|
|
|
@ -17,14 +17,14 @@ module.exports = {
|
|
|
|
|
app: { |
|
|
|
|
mode: 'default', |
|
|
|
|
autoStart: { |
|
|
|
|
enabled: false |
|
|
|
|
enabled: false, |
|
|
|
|
}, |
|
|
|
|
remoteConfig: { |
|
|
|
|
enabled: true, |
|
|
|
|
// 共享远程配置地址
|
|
|
|
|
url: 'https://gitee.com/wangliang181230/dev-sidecar/raw/docmirror/packages/core/src/config/remote_config.json5', |
|
|
|
|
// 个人远程配置地址
|
|
|
|
|
personalUrl: '' |
|
|
|
|
personalUrl: '', |
|
|
|
|
}, |
|
|
|
|
startShowWindow: true, // 启动时是否打开窗口:true=打开窗口, false=隐藏窗口
|
|
|
|
|
showHideShortcut: 'Alt + S', // 显示/隐藏窗口快捷键
|
|
|
|
@ -33,10 +33,10 @@ module.exports = {
|
|
|
|
|
autoChecked: true, // 是否自动检查更新
|
|
|
|
|
skipPreRelease: true, // 是否忽略预发布版本
|
|
|
|
|
dock: { |
|
|
|
|
hideWhenWinClose: false |
|
|
|
|
hideWhenWinClose: false, |
|
|
|
|
}, |
|
|
|
|
closeStrategy: 0, |
|
|
|
|
showShutdownTip: true |
|
|
|
|
showShutdownTip: true, |
|
|
|
|
}, |
|
|
|
|
server: { |
|
|
|
|
enabled: true, |
|
|
|
@ -47,12 +47,12 @@ module.exports = {
|
|
|
|
|
verifySsl: true, |
|
|
|
|
script: { |
|
|
|
|
enabled: true, |
|
|
|
|
defaultDir: './extra/scripts/' |
|
|
|
|
defaultDir: './extra/scripts/', |
|
|
|
|
}, |
|
|
|
|
userBasePath: getUserBasePath(), |
|
|
|
|
rootCaFile: { |
|
|
|
|
certPath: getRootCaCertPath(), |
|
|
|
|
keyPath: getRootCaKeyPath() |
|
|
|
|
keyPath: getRootCaKeyPath(), |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 默认超时时间配置
|
|
|
|
@ -63,12 +63,12 @@ module.exports = {
|
|
|
|
|
timeoutMapping: { |
|
|
|
|
'github.com': { |
|
|
|
|
timeout: 20000, |
|
|
|
|
keepAliveTimeout: 30000 |
|
|
|
|
} |
|
|
|
|
keepAliveTimeout: 30000, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 慢速IP延迟时间:测速超过该值时,则视为延迟高,显示为橙色
|
|
|
|
|
lowSpeedDelay: 150 |
|
|
|
|
lowSpeedDelay: 150, |
|
|
|
|
}, |
|
|
|
|
compatible: { |
|
|
|
|
// **** 自定义兼容配置 **** //
|
|
|
|
@ -87,15 +87,15 @@ module.exports = {
|
|
|
|
|
// rejectUnauthorized: false
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
intercept: { |
|
|
|
|
enabled: true |
|
|
|
|
enabled: true, |
|
|
|
|
}, |
|
|
|
|
intercepts: { |
|
|
|
|
'github.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
'^(/[\\w-.]+){2,}/?(\\?.*)?$': { |
|
|
|
|
// 篡改猴插件地址,以下是高速镜像地址
|
|
|
|
@ -103,7 +103,7 @@ module.exports = {
|
|
|
|
|
// Github油猴脚本地址,以下是高速镜像地址
|
|
|
|
|
script: 'https://gitee.com/wangliang181230/dev-sidecar/raw/scripts/GithubEnhanced-High-Speed-Download.user.js', |
|
|
|
|
remark: '注:上面所使用的脚本地址,为高速镜像地址。', |
|
|
|
|
desc: '油猴脚本:高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载、添加 git clone 命令' |
|
|
|
|
desc: '油猴脚本:高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件 (公益加速)、项目列表单文件快捷下载、添加 git clone 命令', |
|
|
|
|
}, |
|
|
|
|
// 以下三项暂时先注释掉,因为已经有油猴脚本提供高速下载地址了。
|
|
|
|
|
// '/.*/.*/releases/download/': {
|
|
|
|
@ -119,140 +119,140 @@ module.exports = {
|
|
|
|
|
// },
|
|
|
|
|
'/fluidicon.png': { |
|
|
|
|
cacheDays: 365, |
|
|
|
|
desc: 'Github那只猫的图片,缓存1年' |
|
|
|
|
desc: 'Github那只猫的图片,缓存1年', |
|
|
|
|
}, |
|
|
|
|
'^(/[^/]+){2}/pull/\\d+/open_with_menu.*$': { |
|
|
|
|
cacheDays: 7, |
|
|
|
|
desc: 'PR详情页:标题右边那个Code按钮的HTML代码请求地址,感觉上应该可以缓存。暂时先设置为缓存7天' |
|
|
|
|
desc: 'PR详情页:标题右边那个Code按钮的HTML代码请求地址,感觉上应该可以缓存。暂时先设置为缓存7天', |
|
|
|
|
}, |
|
|
|
|
'^((/[^/]+){2,})/raw((/[^/]+)+\\.(jpg|jpeg|png|gif))(\\?.*)?$': { |
|
|
|
|
// eslint-disable-next-line no-template-curly-in-string
|
|
|
|
|
proxy: 'https://raw.githubusercontent.com${m[1]}${m[3]}', |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
cacheDays: 7, |
|
|
|
|
desc: '仓库内图片,重定向改为代理,并缓存7天。' |
|
|
|
|
desc: '仓库内图片,重定向改为代理,并缓存7天。', |
|
|
|
|
}, |
|
|
|
|
'^((/[^/]+){2,})/raw((/[^/]+)+\\.js)(\\?.*)?$': { |
|
|
|
|
// eslint-disable-next-line no-template-curly-in-string
|
|
|
|
|
proxy: 'https://raw.githubusercontent.com${m[1]}${m[3]}', |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
responseReplace: { headers: { 'content-type': 'application/javascript; charset=utf-8' } }, |
|
|
|
|
desc: '仓库内脚本,重定向改为代理,并设置响应头Content-Type。作用:方便script拦截器直接使用,避免引起跨域问题和脚本内容限制问题。' |
|
|
|
|
} |
|
|
|
|
desc: '仓库内脚本,重定向改为代理,并设置响应头Content-Type。作用:方便script拦截器直接使用,避免引起跨域问题和脚本内容限制问题。', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'github-releases.githubusercontent.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'github.githubassets.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'camo.githubusercontent.com': { |
|
|
|
|
'^[a-zA-Z0-9/]+(\\?.*)?$': { |
|
|
|
|
cacheDays: 365, |
|
|
|
|
desc: '图片,缓存1年' |
|
|
|
|
desc: '图片,缓存1年', |
|
|
|
|
}, |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'collector.github.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'customer-stories-feed.github.com': { |
|
|
|
|
'.*': { proxy: 'customer-stories-feed.fastgit.org' } |
|
|
|
|
'.*': { proxy: 'customer-stories-feed.fastgit.org' }, |
|
|
|
|
}, |
|
|
|
|
'raw.githubusercontent.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'user-images.githubusercontent.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
'^/.*\\.png(\\?.*)?$': { |
|
|
|
|
cacheDays: 365, |
|
|
|
|
desc: '用户在PR或issue等内容中上传的图片,缓存1年。注:每张图片都有唯一的ID,不会重复,可以安心缓存' |
|
|
|
|
} |
|
|
|
|
desc: '用户在PR或issue等内容中上传的图片,缓存1年。注:每张图片都有唯一的ID,不会重复,可以安心缓存', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'private-user-images.githubusercontent.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
'^/.*\\.png(\\?.*)?$': { |
|
|
|
|
cacheHours: 1, |
|
|
|
|
desc: '用户在PR或issue等内容中上传的图片,缓存1小时就够了,因为每次刷新页面都是不一样的链接。' |
|
|
|
|
} |
|
|
|
|
desc: '用户在PR或issue等内容中上传的图片,缓存1小时就够了,因为每次刷新页面都是不一样的链接。', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'avatars.githubusercontent.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
'^/u/\\d+(\\?.*)?$': { |
|
|
|
|
cacheDays: 365, |
|
|
|
|
desc: '用户头像,缓存1年' |
|
|
|
|
} |
|
|
|
|
desc: '用户头像,缓存1年', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'api.github.com': { |
|
|
|
|
'^/_private/browser/stats$': { |
|
|
|
|
success: true, |
|
|
|
|
desc: 'github的访问速度分析上传,没有必要,直接返回成功' |
|
|
|
|
desc: 'github的访问速度分析上传,没有必要,直接返回成功', |
|
|
|
|
}, |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'*.docker.com': { |
|
|
|
|
'.*': { |
|
|
|
|
sni: 'baidu.com' |
|
|
|
|
} |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'login.docker.com': { |
|
|
|
|
'/favicon.ico': { |
|
|
|
|
proxy: 'hub.docker.com', |
|
|
|
|
sni: 'baidu.com', |
|
|
|
|
desc: '登录页面的ico,采用hub.docker.com的' |
|
|
|
|
} |
|
|
|
|
desc: '登录页面的ico,采用hub.docker.com的', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// google cdn
|
|
|
|
|
'www.google.com': { |
|
|
|
|
'/recaptcha/.*': { proxy: 'www.recaptcha.net' } |
|
|
|
|
'/recaptcha/.*': { proxy: 'www.recaptcha.net' }, |
|
|
|
|
// '.*': {
|
|
|
|
|
// proxy: 'gg.docmirror.top/_yxorp',
|
|
|
|
|
// desc: '呀,被你发现了,偷偷的用,别声张'
|
|
|
|
|
// }
|
|
|
|
|
}, |
|
|
|
|
'www.gstatic.com': { |
|
|
|
|
'/recaptcha/.*': { proxy: 'www.recaptcha.net' } |
|
|
|
|
'/recaptcha/.*': { proxy: 'www.recaptcha.net' }, |
|
|
|
|
}, |
|
|
|
|
'ajax.googleapis.com': { |
|
|
|
|
'.*': { |
|
|
|
|
proxy: 'ajax.lug.ustc.edu.cn', |
|
|
|
|
backup: ['gapis.geekzu.org'], |
|
|
|
|
test: 'ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js' |
|
|
|
|
} |
|
|
|
|
test: 'ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'fonts.googleapis.com': { |
|
|
|
|
'.*': { |
|
|
|
|
proxy: 'fonts.geekzu.org', |
|
|
|
|
backup: ['fonts.loli.net'], |
|
|
|
|
test: 'https://fonts.googleapis.com/css?family=Oswald' |
|
|
|
|
} |
|
|
|
|
test: 'https://fonts.googleapis.com/css?family=Oswald', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'themes.googleapis.com': { |
|
|
|
|
'.*': { |
|
|
|
|
proxy: 'themes.loli.net', |
|
|
|
|
backup: ['themes.proxy.ustclug.org'] |
|
|
|
|
} |
|
|
|
|
backup: ['themes.proxy.ustclug.org'], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'themes.googleusercontent.com': { |
|
|
|
|
'.*': { proxy: 'google-themes.proxy.ustclug.org' } |
|
|
|
|
'.*': { proxy: 'google-themes.proxy.ustclug.org' }, |
|
|
|
|
}, |
|
|
|
|
// 'fonts.gstatic.com': {
|
|
|
|
|
// '.*': {
|
|
|
|
@ -266,8 +266,8 @@ module.exports = {
|
|
|
|
|
// mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.0/napi-v3-win32-x64.tar.gz
|
|
|
|
|
'*.s3.1amazonaws1.com': { |
|
|
|
|
'/sqlite3/.*': { |
|
|
|
|
redirect: 'npm.taobao.org/mirrors' |
|
|
|
|
} |
|
|
|
|
redirect: 'npm.taobao.org/mirrors', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// 'packages.elastic.co': { '.*': { proxy: 'elastic.proxy.ustclug.org' } },
|
|
|
|
|
// 'ppa.launchpad.net': { '.*': { proxy: 'launchpad.proxy.ustclug.org' } },
|
|
|
|
@ -278,15 +278,15 @@ module.exports = {
|
|
|
|
|
'*.carbonads.com': { |
|
|
|
|
'/carbon.*': { |
|
|
|
|
abort: true, |
|
|
|
|
desc: '广告拦截' |
|
|
|
|
} |
|
|
|
|
desc: '广告拦截', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
'*.buysellads.com': { |
|
|
|
|
'/ads/.*': { |
|
|
|
|
abort: true, |
|
|
|
|
desc: '广告拦截' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
desc: '广告拦截', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// 预设置IP列表
|
|
|
|
|
preSetIpList: { |
|
|
|
@ -303,7 +303,7 @@ module.exports = {
|
|
|
|
|
'140.82.116.3', |
|
|
|
|
'140.82.116.4', |
|
|
|
|
'140.82.121.3', |
|
|
|
|
'140.82.121.4' |
|
|
|
|
'140.82.121.4', |
|
|
|
|
], |
|
|
|
|
'api.github.com': [ |
|
|
|
|
'20.26.156.210', |
|
|
|
@ -316,7 +316,7 @@ module.exports = {
|
|
|
|
|
'140.82.112.5', |
|
|
|
|
'140.82.113.6', |
|
|
|
|
'140.82.116.6', |
|
|
|
|
'140.82.121.6' |
|
|
|
|
'140.82.121.6', |
|
|
|
|
], |
|
|
|
|
'codeload.github.com': [ |
|
|
|
|
'20.26.156.216', |
|
|
|
@ -329,26 +329,26 @@ module.exports = {
|
|
|
|
|
'140.82.113.9', |
|
|
|
|
'140.82.114.10', |
|
|
|
|
'140.82.116.10', |
|
|
|
|
'140.82.121.9' |
|
|
|
|
'140.82.121.9', |
|
|
|
|
], |
|
|
|
|
'*.githubusercontent.com': [ |
|
|
|
|
'185.199.108.133', |
|
|
|
|
'185.199.109.133', |
|
|
|
|
'185.199.110.133', |
|
|
|
|
'185.199.111.133' |
|
|
|
|
'185.199.111.133', |
|
|
|
|
], |
|
|
|
|
'github.githubassets.com': [ |
|
|
|
|
'185.199.108.154', |
|
|
|
|
'185.199.109.154', |
|
|
|
|
'185.199.110.154', |
|
|
|
|
'185.199.111.154' |
|
|
|
|
'185.199.111.154', |
|
|
|
|
], |
|
|
|
|
'github.io': [ |
|
|
|
|
'185.199.108.153', |
|
|
|
|
'185.199.109.153', |
|
|
|
|
'185.199.110.153', |
|
|
|
|
'185.199.111.153' |
|
|
|
|
] |
|
|
|
|
'185.199.111.153', |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
whiteList: { |
|
|
|
|
'*.cn': true, |
|
|
|
@ -360,35 +360,35 @@ module.exports = {
|
|
|
|
|
'*.alipay.com': true, |
|
|
|
|
'*.qq.com': true, |
|
|
|
|
'*.baidu.com': true, |
|
|
|
|
'192.168.*': true |
|
|
|
|
'192.168.*': true, |
|
|
|
|
}, |
|
|
|
|
dns: { |
|
|
|
|
providers: { |
|
|
|
|
aliyun: { |
|
|
|
|
type: 'https', |
|
|
|
|
server: 'https://dns.alidns.com/dns-query', |
|
|
|
|
cacheSize: 1000 |
|
|
|
|
cacheSize: 1000, |
|
|
|
|
}, |
|
|
|
|
cloudflare: { |
|
|
|
|
type: 'https', |
|
|
|
|
server: 'https://1.1.1.1/dns-query', |
|
|
|
|
cacheSize: 1000 |
|
|
|
|
cacheSize: 1000, |
|
|
|
|
}, |
|
|
|
|
quad9: { |
|
|
|
|
type: 'https', |
|
|
|
|
server: 'https://9.9.9.9/dns-query', |
|
|
|
|
cacheSize: 1000 |
|
|
|
|
cacheSize: 1000, |
|
|
|
|
}, |
|
|
|
|
safe360: { |
|
|
|
|
type: 'https', |
|
|
|
|
server: 'https://doh.360.cn/dns-query', |
|
|
|
|
cacheSize: 1000 |
|
|
|
|
cacheSize: 1000, |
|
|
|
|
}, |
|
|
|
|
rubyfish: { |
|
|
|
|
type: 'https', |
|
|
|
|
server: 'https://rubyfish.cn/dns-query', |
|
|
|
|
cacheSize: 1000 |
|
|
|
|
} |
|
|
|
|
cacheSize: 1000, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mapping: { |
|
|
|
|
'*.github.com': 'quad9', |
|
|
|
@ -407,16 +407,16 @@ module.exports = {
|
|
|
|
|
'*.v2ex.com': 'quad9', |
|
|
|
|
'*.pypi.org': 'quad9', |
|
|
|
|
'*.jetbrains.com': 'quad9', |
|
|
|
|
'*.azureedge.net': 'quad9' |
|
|
|
|
'*.azureedge.net': 'quad9', |
|
|
|
|
}, |
|
|
|
|
speedTest: { |
|
|
|
|
enabled: true, |
|
|
|
|
interval: 300000, |
|
|
|
|
hostnameList: ['github.com'], |
|
|
|
|
dnsProviders: ['cloudflare', 'safe360', 'rubyfish'] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
dnsProviders: ['cloudflare', 'safe360', 'rubyfish'], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
proxy: {}, |
|
|
|
|
plugin: {} |
|
|
|
|
plugin: {}, |
|
|
|
|
} |
|
|
|
|