Skip to content

Commit 087b69c

Browse files
committed
fix: 修复了overwall和free-eye不从统一配置中读取的问题,更新了pac.txt与其获取地址
1 parent ca066da commit 087b69c

File tree

16 files changed

+798
-2125
lines changed

16 files changed

+798
-2125
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ npm install -g pnpm --registry=https://registry.npmmirror.com
391391
如果你在 Linux arm64 上为 GUI 安装依赖遇到 Electron `postinstall` 崩溃(`double free or corruption`)或无法下载二进制,可按下面流程处理:
392392

393393
常见错误提示:
394+
394395
- `phantomjs-prebuilt`: Unexpected platform or architecture: linux/arm64,postinstall 失败。
395396
- `electron` postinstall: double free or corruption (out) / Aborted (core dumped)。
396397

@@ -402,13 +403,13 @@ nvm use 18.20.8
402403
corepack enable
403404
```
404405

405-
2. 正常安装 GUI 依赖(脚本需要开启):
406+
1. 正常安装 GUI 依赖(脚本需要开启):
406407

407408
```shell
408409
pnpm install --filter @docmirror/dev-sidecar-gui
409410
```
410411

411-
3. 若依旧在下载阶段崩溃,可手动下载并解压 Electron 二进制:
412+
1. 若依旧在下载阶段崩溃,可手动下载并解压 Electron 二进制:
412413

413414
```shell
414415
electron_dir="$(pwd)/node_modules/.pnpm/[email protected]/node_modules/electron"
@@ -420,7 +421,7 @@ if [ -f "$electron_dir/dist/electron.d.ts" ]; then mv "$electron_dir/dist/electr
420421
printf 'electron' > "$electron_dir/path.txt"
421422
```
422423

423-
4. 首次运行若提示 `chrome-sandbox` 权限问题,可在本地开发时关闭沙箱,或设置 SUID 权限:
424+
1. 首次运行若提示 `chrome-sandbox` 权限问题,可在本地开发时关闭沙箱,或设置 SUID 权限:
424425

425426
```shell
426427
# 开发/调试禁用沙箱(无需 root)
@@ -432,13 +433,14 @@ sudo chmod 4755 "$electron_dir/dist/chrome-sandbox"
432433
```
433434

434435
> `.npmrc` 建议
436+
>
435437
> - `phantomjs_skip_download=true`:避免旧版 `phantomjs-prebuilt` 在 arm64/容器环境拉取二进制导致安装失败,建议保留。
436438
437439
#### 4)Termux/Android ARM64 运行 GUI(无 root)
438440

439441
- 预加载网络接口兜底、强制关闭 Electron 沙箱(无需 root,使用 HOME 路径):
440442

441-
```bash
443+
````bash
442444
cd $HOME/dev-sidecar/packages/gui
443445
NODE_OPTIONS="--require ${HOME:-/data/data/com.termux/files/home}/dev-sidecar/packages/gui/src/utils/os-network-fallback.cjs" \
444446
ELECTRON_FORCE_NO_SANDBOX=1 ELECTRON_NO_SANDBOX=1 ELECTRON_DISABLE_SANDBOX=1 \
@@ -448,14 +450,15 @@ npm run electron
448450

449451
```bash
450452
pnpm run electron:termux
451-
```
453+
````
452454
453455
若需在 Termux 尝试打包(不保证成功,缺少桌面依赖时可能失败):
454456
455457
```bash
456458
pnpm run electron:build:termux
457459
```
458-
```
460+
461+
````
459462

460463
- 说明:
461464
- Termux 缺少 setuid 能力,必须关闭沙箱,否则会提示 chrome-sandbox 权限错误。
@@ -468,7 +471,6 @@ pnpm run electron:build:termux
468471
- 若权限不足,请手动以管理员权限运行相关命令或以管理员身份启动应用;在容器/受限环境中仅能执行当前用户可用的操作。
469472
- 开发者可在代码中统一通过 `DevSidecar.api.shell.sudo`(核心实现见 `packages/core/src/shell/sudo.js`)封装处理。
470473

471-
472474
### 8.2、开发调试模式启动
473475

474476
运行如下命令即可开发模式启动
@@ -486,7 +488,7 @@ pnpm install
486488
cd packages/gui
487489
npm run electron
488490

489-
```
491+
````
490492

491493
> 如果electron依赖包下载不动,可以开启ds的npm加速
492494

packages/core/src/config/index.js

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,12 +1162,16 @@ const defaultConfig = {
11621162
},
11631163
plugin: {
11641164
overwall: {
1165+
serverDefault: {
1166+
'ow-prod.docmirror.top': {
1167+
port: 443,
1168+
path: 'X2dvX292ZXJfd2FsbF8',
1169+
password: 'dev_sidecar_is_666',
1170+
},
1171+
},
11651172
targets: {
11661173
'*.github.com': true,
11671174
'*github*.com': true,
1168-
'*.gitbook.io': true,
1169-
'*.nodejs.org': true,
1170-
'*.npmjs.com': true,
11711175
'*.wikimedia.org': true,
11721176
'*.v2ex.com': true,
11731177
'*.azureedge.net': true,
@@ -1193,6 +1197,9 @@ const defaultConfig = {
11931197
'*.segment.io': true,
11941198
'*.shields.io': true,
11951199
'*.jsdelivr.net': true,
1200+
'*.gitbook.io': true,
1201+
'*.nodejs.org': true,
1202+
'*.npmjs.com': true,
11961203
'*.z-library.sk': true,
11971204
'*.zlibrary*.se': true,
11981205

@@ -1216,7 +1223,52 @@ const defaultConfig = {
12161223
'*.cn-greasyfork.org': true,
12171224
},
12181225
pac: {
1219-
pacFileUpdateUrl: 'https://ghproxy.net/https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt',
1226+
enabled: true,
1227+
autoUpdate: true,
1228+
// 'https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt'
1229+
pacFileUpdateUrl: 'https://xget.xi-xu.me/gh/gfwlist/gfwlist/raw/master/gfwlist.txt',
1230+
pacFileAbsolutePath: null, // 自定义 pac.txt 文件位置,可以是本地文件路径
1231+
pacFilePath: './extra/pac/pac.txt', // 内置 pac.txt 文件路径
1232+
},
1233+
},
1234+
free_eye: {
1235+
Route: {
1236+
timeout: 0.1,
1237+
addrs: {
1238+
IPv4: '8.8.8.8',
1239+
IPv6: '2001:4860:4860::8888',
1240+
},
1241+
port: 53,
1242+
},
1243+
DNS: {
1244+
timeout: 3,
1245+
allow: ['baidu.cn', 'taobao.com', 'www.gov.cn'],
1246+
block: ['wikipedia.org', 'youtube.com', 'facebook.com'],
1247+
},
1248+
TCP: {
1249+
timeout: 3,
1250+
addrs: {
1251+
IPv4: {
1252+
allow: ['114.114.114.114', '223.6.6.6'],
1253+
block: ['8.8.8.8', '1.1.1.1'],
1254+
},
1255+
IPv6: {
1256+
allow: ['2402:4e00::', '2400:3200:baba::1'],
1257+
block: ['2001:4860:4860::8888', '2606:4700:4700::1111'],
1258+
},
1259+
},
1260+
ports: [80, 443],
1261+
},
1262+
TLS: {
1263+
timeout: 3,
1264+
addrs: {
1265+
IPv4: '172.67.148.147',
1266+
IPv6: '2606:4700:3036::ac43:9493',
1267+
},
1268+
snis: {
1269+
allow: 'baidu.cn',
1270+
block: 'wikipedia.org',
1271+
},
12201272
},
12211273
},
12221274
},

packages/core/src/config/remote_config.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"*.onesignal.com": true, // pixiv站点,会加载该域名下的js脚本
221221
},
222222
pac: {
223-
pacFileUpdateUrl: "https://raw.kkgithub.com/gfwlist/gfwlist/master/gfwlist.txt",
223+
pacFileUpdateUrl: "https://xget.xi-xu.me/gh/gfwlist/gfwlist/raw/master/gfwlist.txt",
224224
},
225225
},
226226
},

0 commit comments

Comments
 (0)