From 0a6166c557e349d46a685a92b8d6df9eccc43f01 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 13 Nov 2022 23:58:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E9=98=85=E5=A2=9E=E5=8A=A0=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/subscription.ts | 2 ++ back/services/sshKey.ts | 8 +++++++- sample/config.sample.sh | 2 +- src/layouts/index.less | 3 ++- src/pages/subscription/modal.tsx | 13 +++++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/back/api/subscription.ts b/back/api/subscription.ts index 68845e9c..de4cf2b3 100644 --- a/back/api/subscription.ts +++ b/back/api/subscription.ts @@ -49,6 +49,7 @@ export default (app: Router) => { sub_after: Joi.string().optional().allow('').allow(null), schedule_type: Joi.string().required(), alias: Joi.string().required(), + proxy: Joi.string().optional().allow('').allow(null), }), }), async (req: Request, res: Response, next: NextFunction) => { @@ -177,6 +178,7 @@ export default (app: Router) => { sub_before: Joi.string().optional().allow('').allow(null), sub_after: Joi.string().optional().allow('').allow(null), alias: Joi.string().required(), + proxy: Joi.string().optional().allow('').allow(null), id: Joi.number().required(), }), }), diff --git a/back/services/sshKey.ts b/back/services/sshKey.ts index 0550558f..27bb3a22 100644 --- a/back/services/sshKey.ts +++ b/back/services/sshKey.ts @@ -43,7 +43,13 @@ export default class SshKeyService { host: string, proxy?: string, ): string { - return `\nHost ${alias}\n Hostname ${host}\n IdentityFile ${this.sshPath}/${alias}\n StrictHostKeyChecking no\n`; + if (host === 'github.com' && proxy) { + host = 'ssh.github.com'; + } + const proxyStr = proxy + ? ` Port 443\n HostkeyAlgorithms +ssh-rsa\n PubkeyAcceptedAlgorithms +ssh-rsa\n ProxyCommand nc -v -x ${proxy} %h %p\n` + : ''; + return `\nHost ${alias}\n Hostname ${host}\n IdentityFile ${this.sshPath}/${alias}\n StrictHostKeyChecking no\n${proxyStr}`; } private generateSshConfig(configs: string[]) { diff --git a/sample/config.sample.sh b/sample/config.sample.sh index b85d22af..9005c641 100644 --- a/sample/config.sample.sh +++ b/sample/config.sample.sh @@ -16,7 +16,7 @@ DefaultCronRule="" ## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 RepoFileExtensions="js py" -## 代理地址,支持http/https/socks,例如 http://127.0.0.1:7890 +## 代理地址,支持HTTP/SOCK5,例如 http://127.0.0.1:7890 ProxyUrl="" ## 资源告警阙值,默认CPU 80%、内存80%、磁盘90% diff --git a/src/layouts/index.less b/src/layouts/index.less index ad5f6949..cfb596a7 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -253,10 +253,11 @@ textarea:-webkit-autofill:focus, select:-webkit-autofill, select:-webkit-autofill:hover, select:-webkit-autofill:focus { - border: none; box-shadow: none; transition: background-color 5000s ease-in-out 0s; -webkit-text-fill-color: @text-color; + caret-color: @text-color; + color: @text-color; } ::placeholder { diff --git a/src/pages/subscription/modal.tsx b/src/pages/subscription/modal.tsx index f1e28c41..9f893fde 100644 --- a/src/pages/subscription/modal.tsx +++ b/src/pages/subscription/modal.tsx @@ -439,6 +439,19 @@ const SubscriptionModal = ({ )} + + + );