Skip to content

Commit 6b442b3

Browse files
authored
Merge branch 'master' into copilot/fix-system-proxy-error-macos
2 parents caf9d6c + 93a956b commit 6b442b3

64 files changed

Lines changed: 8288 additions & 11674 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-release.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ jobs:
230230
ren DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-x86_64.exe;
231231
ren DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe;
232232
ren DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe;
233-
ren DevSidecar-${{ steps.package-info.outputs.version }}.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe;
234233
dir;
235234
- name: "Rename artifacts - Linux"
236235
if: ${{ matrix.os == 'ubuntu' }}
@@ -292,13 +291,6 @@ jobs:
292291
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe
293292
name: "DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe"
294293
if-no-files-found: error
295-
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe"
296-
uses: actions/upload-artifact@v4.4.0
297-
if: ${{ matrix.os == 'windows' }}
298-
with:
299-
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe
300-
name: "DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe"
301-
if-no-files-found: error
302294
# endregion Upload artifacts - Windows
303295

304296
# region Upload artifacts - Linux
@@ -474,11 +466,6 @@ jobs:
474466
with:
475467
name: "DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe"
476468
path: release
477-
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe"
478-
uses: actions/download-artifact@v4.1.8
479-
with:
480-
name: "DevSidecar-${{ steps.package-info.outputs.version }}-windows-universal.exe"
481-
path: release
482469
# -------------------------------------------------------------------------------------------------------------------------
483470
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.deb"
484471
uses: actions/download-artifact@v4.1.8
@@ -575,4 +562,4 @@ jobs:
575562
GHR_PATH: release/
576563
GHR_TITLE: ${{ github.ref_name }}
577564
GHR_REPLACE: true
578-
GHR_DRAFT: true
565+
GHR_DRAFT: true

.github/workflows/npm-run-electron.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,9 @@ jobs:
113113
pnpm install;
114114
115115
- name: "npm run electron"
116+
working-directory: packages/gui
116117
run: |
117118
echo "======================================================================";
118-
echo "cd packages/gui";
119-
echo "--------------------";
120-
cd packages/gui;
121119
dir || ls -lah;
122120
123121
echo "======================================================================";

.github/workflows/test-and-upload.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ jobs:
258258
ren DevSidecar-${{ env.BUILD_VERSION }}-x64.exe DevSidecar-${{ env.BUILD_VERSION }}-windows-x86_64.exe;
259259
ren DevSidecar-${{ env.BUILD_VERSION }}-ia32.exe DevSidecar-${{ env.BUILD_VERSION }}-windows-ia32.exe;
260260
ren DevSidecar-${{ env.BUILD_VERSION }}-arm64.exe DevSidecar-${{ env.BUILD_VERSION }}-windows-arm64.exe;
261-
ren DevSidecar-${{ env.BUILD_VERSION }}.exe DevSidecar-${{ env.BUILD_VERSION }}-windows-universal.exe;
262261
dir;
263262
- name: "Rename artifacts - Linux"
264263
if: ${{ matrix.os == 'ubuntu' }}
@@ -320,13 +319,6 @@ jobs:
320319
path: packages/gui/dist_electron/DevSidecar-${{ env.BUILD_VERSION }}-windows-arm64.exe
321320
name: "DevSidecar-${{ env.BUILD_VERSION }}-windows-arm64.exe"
322321
if-no-files-found: error
323-
- name: "Upload DevSidecar-${{ env.BUILD_VERSION }}-windows-universal.exe"
324-
uses: actions/upload-artifact@v4.4.0
325-
if: ${{ matrix.os == 'windows' }}
326-
with:
327-
path: packages/gui/dist_electron/DevSidecar-${{ env.BUILD_VERSION }}-windows-universal.exe
328-
name: "DevSidecar-${{ env.BUILD_VERSION }}-windows-universal.exe"
329-
if-no-files-found: error
330322
# endregion Upload artifacts - Windows
331323

332324
# region Upload artifacts - Linux
@@ -465,4 +457,4 @@ jobs:
465457
path: packages/gui/dist_electron/DevSidecar-${{ env.BUILD_VERSION }}-macos-universal.dmg
466458
name: "DevSidecar-${{ env.BUILD_VERSION }}-macos-universal.dmg"
467459
if-no-files-found: error
468-
# endregion Upload artifacts - macOS
460+
# endregion Upload artifacts - macOS

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
shamefully-hoist=true
2+
phantomjs_cdnurl=https://npmmirror.com/mirrors/phantomjs
23
# Native modules (e.g. @parcel/watcher) require C++17.
34
# In CI, CXXFLAGS=-std=c++17 (Linux/macOS) and CL=/std:c++17 (Windows) are
45
# set before `pnpm install` so node-gyp compiles with the correct standard.

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
> 1. ~~[hub.fastgit.org](https://hub.fastgit.org/) (2024/11/18:这个好像失效了?)~~
183183
> 2. ~~[github.com.cnpmjs.org](https://github.com.cnpmjs.org/) 这个很容易超限(2024/11/18:这个好像失效了?)~~
184184
> 3. [bgithub.xyz](https://bgithub.xyz/)(edge浏览器可能报毒)
185+
> 4. [kkgithub.com](https://kkgithub.com/)(目前正在维护中)
185186
186187
## 五、api
187188

@@ -375,10 +376,24 @@ npm config delete https-proxy
375376

376377
### 8.1、准备环境
377378

378-
#### 1)安装 `nodejs`
379+
#### 1)安装 `nodejs` 及其他环境
379380

380381
推荐安装 nodejs `22.x.x` 的版本,其他版本未做测试
381382

383+
Windows上需要msvc,推荐使用VS 2022(node-gyp对VS 2026支持可能存在问题),安装时选择C++桌面开发工作负载即可。
384+
385+
另外还需要带distutils的python,推荐安装自带setuptools的python 3.11版本。如果本地有uv,则可以简单的运行以下命令
386+
387+
```shell
388+
uv init .
389+
uv sync
390+
.venv/Scripts/activate.ps1 # for windows pwsh
391+
.venv/Scripts/activate.bat # for windows cmd
392+
source .venv/bin/activate # for linux/mac
393+
```
394+
395+
这会根据.python-version文件自动安装python 3.11版本。如不想使用python 3.11,也可删除.python-version文件,pyproject.toml已经指定了所需依赖。
396+
382397
#### 2)安装 `pnpm`
383398

384399
运行如下命令即可安装所需依赖:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@antfu/eslint-config": "^3.16.0",
14-
"eslint": "^9.39.4",
14+
"eslint": "^10.2.1",
1515
"eslint-plugin-format": "^0.1.3"
1616
},
1717
"pnpm": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@docmirror/dev-sidecar-cli",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"private": false,
55
"description": "给开发者的加速代理工具",
66
"author": "docmirror.cn",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@docmirror/dev-sidecar",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"private": false,
55
"description": "给开发者的加速代理工具",
66
"author": "docmirror.cn",

packages/core/src/config/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,15 @@ const defaultConfig = {
228228
},
229229
'fonts.googleapis.com': {
230230
'.*': {
231-
proxy: 'fonts.loli.net',
231+
proxy: 'fonts.googleapis.cn',
232+
backup: ['fonts.loli.net'],
233+
test: 'https://fonts.googleapis.com/css?family=Oswald',
234+
},
235+
},
236+
'fonts.gstatic.com': {
237+
'.*': {
238+
proxy: 'fonts-gstatic.proxy.ustclug.org',
239+
backup: ['gstatic.loli.net'],
232240
test: 'https://fonts.googleapis.com/css?family=Oswald',
233241
},
234242
},
@@ -241,12 +249,6 @@ const defaultConfig = {
241249
'themes.googleusercontent.com': {
242250
'.*': { proxy: 'google-themes.proxy.ustclug.org' },
243251
},
244-
// 'fonts.gstatic.com': {
245-
// '.*': {
246-
// proxy: 'gstatic.loli.net',
247-
// backup: ['fonts-gstatic.proxy.ustclug.org']
248-
// }
249-
// },
250252
'clients*.google.com': { '.*': { abort: false, desc: '设置abort:true可以快速失败,节省时间' } },
251253
'www.googleapis.com': { '.*': { abort: false, desc: '设置abort:true可以快速失败,节省时间' } },
252254
'lh*.googleusercontent.com': { '.*': { abort: false, desc: '设置abort:true可以快速失败,节省时间' } },
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# 网络审查检测器
2+
3+
FreeEye 是一个用 JavaScript 编写的网络审查检测器,自动化检测网络环境并推荐可能的规避方法。
4+
5+
为中国大陆用户设计,但也可用于其他地区。
6+
7+
希望使得用户能够使用本工具回答以下问题:
8+
9+
1. 我的网络是被审查了,还是只是出现了异常故障?
10+
2. 使用了哪些审查手段?
11+
3. 有哪些规避方法可以绕过这些审查?
12+
13+
## 使用方法
14+
15+
前提条件是你需要在设备上安装 `node.js`
16+
17+
启动向导的方法:
18+
19+
```bash
20+
git clone https://github.com/cute-omega/free-eye.git
21+
cd free-eye
22+
npm install
23+
npm start
24+
```
25+
26+
(如果你不准备进行开发,可以跳过 `npm install`并直接运行 `npm start`;中国大陆用户可能需要设置npm镜像)
27+
28+
不同测试的代码位于 `checkpoints/` 目录中。每个测试都有唯一的 `tag` 标识。单个测试的参数在 `config.json` 文件中设置,使用测试的 tag 作为键:
29+
30+
```json
31+
{
32+
"tag": {
33+
// 测试特定的参数
34+
}
35+
// ...
36+
}
37+
```
38+
39+
## 测试
40+
41+
### Route(路由)
42+
43+
通过尝试创建一个套接字并连接到一个非本地地址,检测设备是否具有互联网连通性。
44+
45+
### DNS
46+
47+
使用系统的 DNS 解析器尝试解析允许和被封锁的主机名。测试被封锁主机名是否存在 DNS 缓存投毒。
48+
49+
### TCP
50+
51+
尝试与已知允许和已知被封锁的 IP 地址建立 TCP 连接。
52+
53+
### TLS
54+
55+
尝试与已知允许但可能遭受审查的 IP 地址(例如对中国用户来说的“干净”的外国 IP)完成 TLS 握手。测试内容包括:
56+
57+
- 不带任何 SNI 的握手
58+
- 带已知允许的 SNI 的握手
59+
- 带已知被封锁的 SNI 的握手
60+
61+
还测试将 TLS 记录分片作为一种规避方法,通过尝试对被封锁的 SNI 进行握手但分片 ClientHello 来实现。
62+
63+
## 编写你自己的测试
64+
65+
如果你想编写自定义测试,只需实现 `template.js` 中描述的接口,将测试模块保存到 `checkpoints/` 目录,并在 `config.json` 中添加该测试的参数。
66+
67+
## 相关项目
68+
69+
本项目受到来自 [wallpunch/wizard](https://github.com/wallpunch/wizard) 的启发;
70+
用作 [docmirror/dev-sidecar](https://github.com/docmirror/dev-sidecar) 中的网络检测插件。
71+
72+
---
73+
74+
不论在哪里,人们的目光都应该是自由的。

0 commit comments

Comments
 (0)