From 46db88127849a2455d20d79dbad9fc36fd926d2f Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 17 Dec 2024 19:25:28 +0800 Subject: [PATCH 1/9] feat: respect system proxy settings on Windows platform --- package-lock.json | 64 ++++++++++++-------------- package.json | 4 ++ src/main/helpers/proxy.helpers.ts | 68 ++++++++++++++++++++++++++++ src/main/services/request.service.ts | 5 +- 4 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 src/main/helpers/proxy.helpers.ts diff --git a/package-lock.json b/package-lock.json index dd60eacf..c78f0605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "format-duration": "^3.0.2", "framer-motion": "^11.2.6", "fs-extra": "^11.2.0", + "global-agent": "^3.0.0", "got": "^14.4.4", "history": "^5.3.0", "is-elevated": "^4.0.0", @@ -60,6 +61,7 @@ "to-ico": "^1.1.5", "use-double-click": "^1.0.5", "use-fit-text": "^2.4.0", + "winreg": "^1.2.5", "yauzl": "^3.2.0" }, "devDependencies": { @@ -74,6 +76,7 @@ "@types/color": "^3.0.3", "@types/crypto-js": "^4.2.1", "@types/dateformat": "^5.0.0", + "@types/global-agent": "^2.1.3", "@types/got": "^9.6.12", "@types/jest": "^29.5.11", "@types/node": "22.8.6", @@ -92,6 +95,7 @@ "@types/use-double-click": "^1.0.4", "@types/webpack-bundle-analyzer": "^4.4.2", "@types/webpack-env": "^1.18.0", + "@types/winreg": "^1.2.36", "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.17", @@ -6158,6 +6162,13 @@ "@types/node": "*" } }, + "node_modules/@types/global-agent": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@types/global-agent/-/global-agent-2.1.3.tgz", + "integrity": "sha512-rGtZZcgZcKWuKNTkGBGsqyOQ7Nn2MjXh4+xeZbf+5b5KMUx8H1rTqLRackxos7pUlreszbYjQcop5JvqCnZlLw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/got": { "version": "9.6.12", "resolved": "https://registry.npmjs.org/@types/got/-/got-9.6.12.tgz", @@ -6553,6 +6564,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/winreg": { + "version": "1.2.36", + "resolved": "https://registry.npmjs.org/@types/winreg/-/winreg-1.2.36.tgz", + "integrity": "sha512-DtafHy5A8hbaosXrbr7YdjQZaqVewXmiasRS5J4tYMzt3s1gkh40ixpxgVFfKiQ0JIYetTJABat47v9cpr/sQg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.5.10", "dev": true, @@ -8437,9 +8455,7 @@ }, "node_modules/boolean": { "version": "3.2.0", - "dev": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -10345,7 +10361,6 @@ }, "node_modules/define-data-property": { "version": "1.1.1", - "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.1", @@ -10366,7 +10381,6 @@ }, "node_modules/define-properties": { "version": "1.2.1", - "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -10435,7 +10449,6 @@ }, "node_modules/detect-node": { "version": "2.1.0", - "dev": true, "license": "MIT" }, "node_modules/detect-node-es": { @@ -11364,9 +11377,7 @@ }, "node_modules/es6-error": { "version": "4.1.1", - "dev": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/es6-promise": { "version": "3.3.1", @@ -13131,7 +13142,6 @@ }, "node_modules/get-intrinsic": { "version": "1.2.2", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2", @@ -13250,9 +13260,9 @@ }, "node_modules/global-agent": { "version": "3.0.0", - "dev": true, + "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", + "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", "license": "BSD-3-Clause", - "optional": true, "dependencies": { "boolean": "^3.0.1", "es6-error": "^4.1.1", @@ -13267,9 +13277,7 @@ }, "node_modules/global-agent/node_modules/serialize-error": { "version": "7.0.1", - "dev": true, "license": "MIT", - "optional": true, "dependencies": { "type-fest": "^0.13.1" }, @@ -13282,9 +13290,7 @@ }, "node_modules/global-agent/node_modules/type-fest": { "version": "0.13.1", - "dev": true, "license": "(MIT OR CC0-1.0)", - "optional": true, "engines": { "node": ">=10" }, @@ -13319,7 +13325,6 @@ }, "node_modules/globalthis": { "version": "1.0.3", - "dev": true, "license": "MIT", "dependencies": { "define-properties": "^1.1.3" @@ -13352,7 +13357,6 @@ }, "node_modules/gopd": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" @@ -13478,7 +13482,6 @@ }, "node_modules/has-property-descriptors": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.2" @@ -13489,7 +13492,6 @@ }, "node_modules/has-proto": { "version": "1.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -13500,7 +13502,6 @@ }, "node_modules/has-symbols": { "version": "1.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -16703,9 +16704,7 @@ }, "node_modules/matcher": { "version": "3.0.0", - "dev": true, "license": "MIT", - "optional": true, "dependencies": { "escape-string-regexp": "^4.0.0" }, @@ -16715,9 +16714,7 @@ }, "node_modules/matcher/node_modules/escape-string-regexp": { "version": "4.0.0", - "dev": true, "license": "MIT", - "optional": true, "engines": { "node": ">=10" }, @@ -17355,7 +17352,6 @@ }, "node_modules/object-keys": { "version": "1.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -19620,9 +19616,7 @@ }, "node_modules/roarr": { "version": "2.15.4", - "dev": true, "license": "BSD-3-Clause", - "optional": true, "dependencies": { "boolean": "^3.0.1", "detect-node": "^2.0.4", @@ -19842,9 +19836,7 @@ }, "node_modules/semver-compare": { "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/send": { "version": "0.18.0", @@ -20304,9 +20296,7 @@ }, "node_modules/sprintf-js": { "version": "1.1.2", - "dev": true, - "license": "BSD-3-Clause", - "optional": true + "license": "BSD-3-Clause" }, "node_modules/sshpk": { "version": "1.17.0", @@ -22501,6 +22491,12 @@ "dev": true, "license": "MIT" }, + "node_modules/winreg": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.5.tgz", + "integrity": "sha512-uf7tHf+tw0B1y+x+mKTLHkykBgK2KMs3g+KlzmyMbLvICSHQyB/xOFjTT8qZ3oeTFyU7Bbj4FzXitGG6jvKhYw==", + "license": "BSD-2-Clause" + }, "node_modules/wrap-ansi": { "version": "7.0.0", "dev": true, diff --git a/package.json b/package.json index 2a7df7b0..8f561eb8 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "@types/color": "^3.0.3", "@types/crypto-js": "^4.2.1", "@types/dateformat": "^5.0.0", + "@types/global-agent": "^2.1.3", "@types/got": "^9.6.12", "@types/jest": "^29.5.11", "@types/node": "22.8.6", @@ -95,6 +96,7 @@ "@types/use-double-click": "^1.0.4", "@types/webpack-bundle-analyzer": "^4.4.2", "@types/webpack-env": "^1.18.0", + "@types/winreg": "^1.2.36", "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.17", @@ -170,6 +172,7 @@ "format-duration": "^3.0.2", "framer-motion": "^11.2.6", "fs-extra": "^11.2.0", + "global-agent": "^3.0.0", "got": "^14.4.4", "history": "^5.3.0", "is-elevated": "^4.0.0", @@ -201,6 +204,7 @@ "to-ico": "^1.1.5", "use-double-click": "^1.0.5", "use-fit-text": "^2.4.0", + "winreg": "^1.2.5", "yauzl": "^3.2.0" }, "engines": { diff --git a/src/main/helpers/proxy.helpers.ts b/src/main/helpers/proxy.helpers.ts new file mode 100644 index 00000000..6ce1d227 --- /dev/null +++ b/src/main/helpers/proxy.helpers.ts @@ -0,0 +1,68 @@ +import log from 'electron-log'; +import Winreg from 'winreg'; +import { bootstrap } from 'global-agent'; + +export function configureProxy() { + if (process.platform === "win32") { + configureWindowsProxy(); + } else { + log.info('configureProxy: Unsupported platform'); + } +} + +async function configureWindowsProxy() { + if (await getWindowsProxy()){ + bootstrap(); + log.info(`Using system proxy: ${process.env.GLOBAL_AGENT_HTTP_PROXY}`); + } +} + +function getWindowsProxy() { + return new Promise((resolve, reject) => { + const regKey = new Winreg({ + hive: Winreg.HKCU, + key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings' + }); + + regKey.get('ProxyEnable', (err, result) => { + if (err) { + log.error('Error accessing registry for ProxyEnable: ', err); + resolve(false); + } + + // ProxyEnable = 1 means proxy is enabled, 0 means it's disabled + if (parseInt(result.value) !== 1) { + log.info('Proxy Enabled: false'); + resolve(false); + } else { + log.info('Proxy Enabled: true'); + + regKey.get('ProxyServer', (err, result) => { + if (err) { + log.error('Error accessing registry for ProxyServer: ', err); + resolve(false); + } + + const httpProxyUrl = `http://${result.value}` + process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxyUrl; + process.env.GLOBAL_AGENT_HTTPS_PROXY = httpProxyUrl; + + log.info('Proxy Server: ', httpProxyUrl); + + regKey.get('ProxyOverride', (err, result) => { + if (err) { + log.error('Error accessing registry for ProxyOverride: ', err); + resolve(false); + } + + process.env.GLOBAL_AGENT_NO_PROXY = result.value; + + log.info('Proxy Override: ', result.value); + + resolve(true); + }); + }); + } + }); + }); +} diff --git a/src/main/services/request.service.ts b/src/main/services/request.service.ts index 8961ca8c..b34e3129 100644 --- a/src/main/services/request.service.ts +++ b/src/main/services/request.service.ts @@ -11,6 +11,7 @@ import path from 'path'; import { pipeline } from 'stream/promises'; import sanitize from 'sanitize-filename'; import internal from 'stream'; +import { configureProxy } from 'main/helpers/proxy.helpers'; export class RequestService { private static instance: RequestService; @@ -23,7 +24,9 @@ export class RequestService { return RequestService.instance; } - private constructor() {} + private constructor() { + configureProxy(); + } public async getJSON(url: string): Promise<{ data: T; headers: IncomingHttpHeaders }> { From 2c0b33f2e650504b94b6867bb0a5c86aa19e7d7f Mon Sep 17 00:00:00 2001 From: Gold John King Date: Mon, 23 Dec 2024 17:02:45 +0800 Subject: [PATCH 2/9] refactor: using regedit-rs instead of winreg --- src/main/helpers/proxy.helpers.ts | 100 ++++++++++++++---------------- 1 file changed, 45 insertions(+), 55 deletions(-) diff --git a/src/main/helpers/proxy.helpers.ts b/src/main/helpers/proxy.helpers.ts index 6ce1d227..e870fee4 100644 --- a/src/main/helpers/proxy.helpers.ts +++ b/src/main/helpers/proxy.helpers.ts @@ -1,68 +1,58 @@ import log from 'electron-log'; -import Winreg from 'winreg'; +import { RegDwordValue, RegSzValue } from "regedit-rs" +import { execOnOs } from "../helpers/env.helpers"; import { bootstrap } from 'global-agent'; -export function configureProxy() { - if (process.platform === "win32") { - configureWindowsProxy(); - } else { - log.info('configureProxy: Unsupported platform'); - } -} +const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs"); -async function configureWindowsProxy() { - if (await getWindowsProxy()){ - bootstrap(); - log.info(`Using system proxy: ${process.env.GLOBAL_AGENT_HTTP_PROXY}`); - } +async function isProxyEnabled(): Promise{ + const res = await list("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"); + const key = res["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"]; + if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" not exist"); } + const registryValue = key.values.ProxyEnable as RegDwordValue; + if(!registryValue){ throw new Error("Value \"ProxyEnable\" not exist"); } + return (1 === registryValue.value) ? true : false; } -function getWindowsProxy() { - return new Promise((resolve, reject) => { - const regKey = new Winreg({ - hive: Winreg.HKCU, - key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings' - }); - - regKey.get('ProxyEnable', (err, result) => { - if (err) { - log.error('Error accessing registry for ProxyEnable: ', err); - resolve(false); - } - - // ProxyEnable = 1 means proxy is enabled, 0 means it's disabled - if (parseInt(result.value) !== 1) { - log.info('Proxy Enabled: false'); - resolve(false); - } else { - log.info('Proxy Enabled: true'); - - regKey.get('ProxyServer', (err, result) => { - if (err) { - log.error('Error accessing registry for ProxyServer: ', err); - resolve(false); - } +async function getProxyServer(): Promise{ + const res = await list("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"); + const key = res["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"]; + if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" not exist"); } + const registryValue = key.values.ProxyServer as RegSzValue; + if(!registryValue){ throw new Error("Value \"ProxyServer\" not exist"); } + return registryValue.value; +} - const httpProxyUrl = `http://${result.value}` - process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxyUrl; - process.env.GLOBAL_AGENT_HTTPS_PROXY = httpProxyUrl; +async function getProxyOverride(): Promise{ + const res = await list("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"); + const key = res["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"]; + if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" not exist"); } + const registryValue = key.values.ProxyOverride as RegSzValue; + if(!registryValue){ throw new Error("Value \"ProxyOverride\" not exist"); } + return registryValue.value; +} - log.info('Proxy Server: ', httpProxyUrl); +async function configureWindowsProxy() : Promise { + if (await isProxyEnabled().catch(err => log.error(err))) { + const httpProxyUrl = `http://${await getProxyServer().catch(err => log.error(err))}` + process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxyUrl; + process.env.GLOBAL_AGENT_HTTPS_PROXY = httpProxyUrl; - regKey.get('ProxyOverride', (err, result) => { - if (err) { - log.error('Error accessing registry for ProxyOverride: ', err); - resolve(false); - } + process.env.GLOBAL_AGENT_NO_PROXY = `${await getProxyOverride().catch(err => log.error(err))}`; - process.env.GLOBAL_AGENT_NO_PROXY = result.value; + log.info(`configureWindowsProxy: Using system proxy: ${process.env.GLOBAL_AGENT_HTTP_PROXY}`); - log.info('Proxy Override: ', result.value); + bootstrap(); + } + else { + log.info(`configureWindowsProxy: System proxy not detected`); + } +} - resolve(true); - }); - }); - } - }); - }); +export function configureProxy() { + if (process.platform === "win32") { + configureWindowsProxy(); + } else { + log.info('configureProxy: Unsupported platform'); + } } From 57b7ee00a17945809b07c98817d625f251f6bd96 Mon Sep 17 00:00:00 2001 From: Gold John King Date: Mon, 23 Dec 2024 17:40:57 +0800 Subject: [PATCH 3/9] Remove winreg package, clean up package-lock.json --- package-lock.json | 55 +++++++++++++++++++++++++++++------------------ package.json | 2 -- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index c78f0605..3738ce5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,6 @@ "to-ico": "^1.1.5", "use-double-click": "^1.0.5", "use-fit-text": "^2.4.0", - "winreg": "^1.2.5", "yauzl": "^3.2.0" }, "devDependencies": { @@ -95,7 +94,6 @@ "@types/use-double-click": "^1.0.4", "@types/webpack-bundle-analyzer": "^4.4.2", "@types/webpack-env": "^1.18.0", - "@types/winreg": "^1.2.36", "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.17", @@ -6564,13 +6562,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/winreg": { - "version": "1.2.36", - "resolved": "https://registry.npmjs.org/@types/winreg/-/winreg-1.2.36.tgz", - "integrity": "sha512-DtafHy5A8hbaosXrbr7YdjQZaqVewXmiasRS5J4tYMzt3s1gkh40ixpxgVFfKiQ0JIYetTJABat47v9cpr/sQg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/ws": { "version": "8.5.10", "dev": true, @@ -8455,7 +8446,9 @@ }, "node_modules/boolean": { "version": "3.2.0", - "license": "MIT" + "dev": true, + "license": "MIT", + "optional": true }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -10361,6 +10354,7 @@ }, "node_modules/define-data-property": { "version": "1.1.1", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.1", @@ -10381,6 +10375,7 @@ }, "node_modules/define-properties": { "version": "1.2.1", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -10449,6 +10444,7 @@ }, "node_modules/detect-node": { "version": "2.1.0", + "dev": true, "license": "MIT" }, "node_modules/detect-node-es": { @@ -11377,7 +11373,9 @@ }, "node_modules/es6-error": { "version": "4.1.1", - "license": "MIT" + "dev": true, + "license": "MIT", + "optional": true }, "node_modules/es6-promise": { "version": "3.3.1", @@ -13142,6 +13140,7 @@ }, "node_modules/get-intrinsic": { "version": "1.2.2", + "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2", @@ -13260,9 +13259,9 @@ }, "node_modules/global-agent": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", - "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", + "dev": true, "license": "BSD-3-Clause", + "optional": true, "dependencies": { "boolean": "^3.0.1", "es6-error": "^4.1.1", @@ -13277,7 +13276,9 @@ }, "node_modules/global-agent/node_modules/serialize-error": { "version": "7.0.1", + "dev": true, "license": "MIT", + "optional": true, "dependencies": { "type-fest": "^0.13.1" }, @@ -13290,7 +13291,9 @@ }, "node_modules/global-agent/node_modules/type-fest": { "version": "0.13.1", + "dev": true, "license": "(MIT OR CC0-1.0)", + "optional": true, "engines": { "node": ">=10" }, @@ -13325,6 +13328,7 @@ }, "node_modules/globalthis": { "version": "1.0.3", + "dev": true, "license": "MIT", "dependencies": { "define-properties": "^1.1.3" @@ -13357,6 +13361,7 @@ }, "node_modules/gopd": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" @@ -13482,6 +13487,7 @@ }, "node_modules/has-property-descriptors": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.2" @@ -13492,6 +13498,7 @@ }, "node_modules/has-proto": { "version": "1.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -13502,6 +13509,7 @@ }, "node_modules/has-symbols": { "version": "1.0.3", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -16704,7 +16712,9 @@ }, "node_modules/matcher": { "version": "3.0.0", + "dev": true, "license": "MIT", + "optional": true, "dependencies": { "escape-string-regexp": "^4.0.0" }, @@ -16714,7 +16724,9 @@ }, "node_modules/matcher/node_modules/escape-string-regexp": { "version": "4.0.0", + "dev": true, "license": "MIT", + "optional": true, "engines": { "node": ">=10" }, @@ -17352,6 +17364,7 @@ }, "node_modules/object-keys": { "version": "1.1.1", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -19616,7 +19629,9 @@ }, "node_modules/roarr": { "version": "2.15.4", + "dev": true, "license": "BSD-3-Clause", + "optional": true, "dependencies": { "boolean": "^3.0.1", "detect-node": "^2.0.4", @@ -19836,7 +19851,9 @@ }, "node_modules/semver-compare": { "version": "1.0.0", - "license": "MIT" + "dev": true, + "license": "MIT", + "optional": true }, "node_modules/send": { "version": "0.18.0", @@ -20296,7 +20313,9 @@ }, "node_modules/sprintf-js": { "version": "1.1.2", - "license": "BSD-3-Clause" + "dev": true, + "license": "BSD-3-Clause", + "optional": true }, "node_modules/sshpk": { "version": "1.17.0", @@ -22491,12 +22510,6 @@ "dev": true, "license": "MIT" }, - "node_modules/winreg": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.5.tgz", - "integrity": "sha512-uf7tHf+tw0B1y+x+mKTLHkykBgK2KMs3g+KlzmyMbLvICSHQyB/xOFjTT8qZ3oeTFyU7Bbj4FzXitGG6jvKhYw==", - "license": "BSD-2-Clause" - }, "node_modules/wrap-ansi": { "version": "7.0.0", "dev": true, diff --git a/package.json b/package.json index 8f561eb8..35b8da3d 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "@types/use-double-click": "^1.0.4", "@types/webpack-bundle-analyzer": "^4.4.2", "@types/webpack-env": "^1.18.0", - "@types/winreg": "^1.2.36", "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.17", @@ -204,7 +203,6 @@ "to-ico": "^1.1.5", "use-double-click": "^1.0.5", "use-fit-text": "^2.4.0", - "winreg": "^1.2.5", "yauzl": "^3.2.0" }, "engines": { From 9e9fc14e2bf71f13e659f1d4e066c7f5a4c3ce60 Mon Sep 17 00:00:00 2001 From: Gold John King Date: Mon, 23 Dec 2024 18:24:00 +0800 Subject: [PATCH 4/9] optimize as suggested --- src/main/helpers/proxy.helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/helpers/proxy.helpers.ts b/src/main/helpers/proxy.helpers.ts index e870fee4..ea2810b2 100644 --- a/src/main/helpers/proxy.helpers.ts +++ b/src/main/helpers/proxy.helpers.ts @@ -11,7 +11,7 @@ async function isProxyEnabled(): Promise{ if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" not exist"); } const registryValue = key.values.ProxyEnable as RegDwordValue; if(!registryValue){ throw new Error("Value \"ProxyEnable\" not exist"); } - return (1 === registryValue.value) ? true : false; + return (1 === registryValue.value); } async function getProxyServer(): Promise{ From 68c174c29be94ffe89d3216e71d9dc24f874e1d6 Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 24 Dec 2024 19:52:22 +0800 Subject: [PATCH 5/9] Add toggle-able system proxy setting --- assets/jsons/translations/en.json | 12 +++++ assets/jsons/translations/zh.json | 12 +++++ src/main/helpers/proxy.helpers.ts | 19 +++++++- .../services/static-configuration.service.ts | 1 + .../pages/settings-page.component.tsx | 47 +++++++++++++++++++ 5 files changed, 90 insertions(+), 1 deletion(-) diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 1ef9eab9..8e0be61b 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -277,6 +277,18 @@ "error-notification": { "message": "An error occured, unable to change symlinks settings." } + }, + "use-system-proxy": { + "title": "Use system proxy", + "description": "BSMansger will make network requests through system proxy.", + "modal": { + "title": "Restart Needed", + "body": "Turning off system proxy will quit and re-launch BSManager. Are you sure you want to do this?", + "confirm-btn": "Yes I'm sure" + }, + "error-notification": { + "message": "An error occured, unable to use system proxy." + } } } } diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index a84ec492..7ef94df1 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -277,6 +277,18 @@ "error-notification": { "message": "发生错误,无法更改符号链接设置。" } + }, + "use-system-proxy": { + "title": "使用系统代理", + "description": "BSMansger将通过系统代理发起网络请求。", + "modal": { + "title": "需要重启", + "body": "关闭系统代理需要退出并重新启动BSManager。您确定要这样做吗?", + "confirm-btn": "是的,我确定" + }, + "error-notification": { + "message": "发生错误,无法启用系统代理。" + } } } } diff --git a/src/main/helpers/proxy.helpers.ts b/src/main/helpers/proxy.helpers.ts index ea2810b2..ba4ec320 100644 --- a/src/main/helpers/proxy.helpers.ts +++ b/src/main/helpers/proxy.helpers.ts @@ -2,6 +2,9 @@ import log from 'electron-log'; import { RegDwordValue, RegSzValue } from "regedit-rs" import { execOnOs } from "../helpers/env.helpers"; import { bootstrap } from 'global-agent'; +import { StaticConfigurationService } from "../services/static-configuration.service"; + +const staticConfig = StaticConfigurationService.getInstance(); const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs"); @@ -51,7 +54,21 @@ async function configureWindowsProxy() : Promise { export function configureProxy() { if (process.platform === "win32") { - configureWindowsProxy(); + const useSystemProxy = staticConfig.get("use-system-proxy"); + + if (useSystemProxy === true) { + configureWindowsProxy(); + } + + log.info(`configureProxy: UseSystemProxy is set to ${useSystemProxy}`); + + staticConfig.$watch("use-system-proxy").subscribe((useSystemProxy) => { + if (useSystemProxy === true) { + configureWindowsProxy(); + } + + log.info(`configureProxy: UseSystemProxy is set to ${useSystemProxy}`); + }); } else { log.info('configureProxy: Unsupported platform'); } diff --git a/src/main/services/static-configuration.service.ts b/src/main/services/static-configuration.service.ts index 1748b42d..0a90c607 100644 --- a/src/main/services/static-configuration.service.ts +++ b/src/main/services/static-configuration.service.ts @@ -88,6 +88,7 @@ export interface StaticConfigKeyValues { "song-details-cache-etag": string; "disable-hadware-acceleration": boolean; "use-symlinks": boolean; + "use-system-proxy": boolean; // Linux Specific static configs "proton-folder": string; diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index 991c4ece..cd26de6d 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -541,10 +541,12 @@ function AdvancedSettings() { const [hardwareAccelerationEnabled, setHardwareAccelerationEnabled] = useState(true); const [useSymlink, setUseSymlink] = useState(false); + const [useSystemProxy, setUseSystemProxy] = useState(false); useEffect(() => { staticConfig.get("disable-hadware-acceleration").then(disabled =>setHardwareAccelerationEnabled(() => disabled !== true)); staticConfig.get("use-symlinks").then(useSymlinks => setUseSymlink(() => useSymlinks)); + staticConfig.get("use-system-proxy").then(useSystemProxy => setUseSystemProxy(() => useSystemProxy)); }, []); const onChangeHardwareAcceleration = async (newHardwareAccelerationEnabled: boolean) => { @@ -609,6 +611,45 @@ function AdvancedSettings() { setUseSymlink(() => newUseSymlink); } + const onChangeUseSystemProxy = async (newUseSystemProxy: boolean) => { + + if (window.electron.platform !== "win32" || newUseSystemProxy === useSystemProxy) { + return; + } + + if(!newUseSystemProxy){ + const res = await modal.openModal(BasicModal, { data: { + title: "pages.settings.advanced.use-system-proxy.modal.title", + body: "pages.settings.advanced.use-system-proxy.modal.body", + image: BeatConflict, + buttons: [ + { id: "cancel", text: "misc.cancel", type: "cancel" }, + { id: "confirm", text: "pages.settings.advanced.use-system-proxy.modal.confirm-btn", type: "error", onClick: () => true } + ] + }}); + + if(res.exitCode !== ModalExitCode.COMPLETED || res.data !== "confirm"){ return; } + } + + const { error } = await tryit(() => staticConfig.set("use-system-proxy", newUseSystemProxy)); + + if(error){ + notification.notifyError({ title: "notifications.types.error", desc: "pages.settings.advanced.use-system-proxy.error-notification.message" }); + return; + } + + setUseSystemProxy(() => newUseSystemProxy); + + if(!progressBar.require()){ + return; + } + + if (!newUseSystemProxy) { + await lastValueFrom(ipc.sendV2("restart-app")); + } + + } + const advancedItems: Item[] = [{ checked: hardwareAccelerationEnabled, text: t.text("pages.settings.advanced.hardware-acceleration.title"), @@ -622,6 +663,12 @@ function AdvancedSettings() { desc: t.text("pages.settings.advanced.use-symlinks.description"), onChange: onChangeUseSymlinks }); + advancedItems.push({ + checked: useSystemProxy, + text: t.text("pages.settings.advanced.use-system-proxy.title"), + desc: t.text("pages.settings.advanced.use-system-proxy.description"), + onChange: onChangeUseSystemProxy + }); } return From 4eb8c067066e63d1778e0c93f155116f87cb5b05 Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 24 Dec 2024 22:43:04 +0800 Subject: [PATCH 6/9] add multilingual translation for system proxy, fix mis-spelled words --- assets/jsons/translations/de.json | 12 ++++++++++++ assets/jsons/translations/en.json | 10 +++++----- assets/jsons/translations/es.json | 12 ++++++++++++ assets/jsons/translations/fr.json | 12 ++++++++++++ assets/jsons/translations/ja.json | 12 ++++++++++++ assets/jsons/translations/ko.json | 12 ++++++++++++ assets/jsons/translations/ru.json | 12 ++++++++++++ assets/jsons/translations/zh-tw.json | 12 ++++++++++++ 8 files changed, 89 insertions(+), 5 deletions(-) diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index d3f1c4dc..bbe4dd46 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -279,6 +279,18 @@ "error-notification": { "message": "Ein Fehler ist aufgetreten, die Einstellungen für symbolische Links können nicht geändert werden." } + }, + "use-system-proxy": { + "title": "System-Proxy verwenden", + "description": "BSManager wird Netzwerkrequests über Ihren Systemproxy durchführen.", + "modal": { + "title": "Neustart erforderlich", + "body": "Das Deaktivieren des Systemproxys beendet BSManager und startet ihn neu. Sind Sie sicher, dass Sie dies tun möchten?", + "confirm-btn": "Ja, ich bin sicher" + }, + "error-notification": { + "message": "Es ist ein Fehler aufgetreten, die Systemproxyeinstellungen können nicht geändert werden." + } } } } diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 26a7543b..9e54af84 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -265,7 +265,7 @@ "confirm-btn": "Yes I'm sure" }, "error-notification": { - "message": "An error occured, unable to disable hardware acceleration." + "message": "An error occurred, unable to disable hardware acceleration." } }, "use-symlinks": { @@ -277,19 +277,19 @@ "confirm-btn": "Yes I'm sure" }, "error-notification": { - "message": "An error occured, unable to change symlinks settings." + "message": "An error occurred, unable to change symlinks settings." } }, "use-system-proxy": { "title": "Use system proxy", - "description": "BSMansger will make network requests through system proxy.", + "description": "BSManager will make network requests through your system proxy.", "modal": { "title": "Restart Needed", "body": "Turning off system proxy will quit and re-launch BSManager. Are you sure you want to do this?", "confirm-btn": "Yes I'm sure" }, "error-notification": { - "message": "An error occured, unable to use system proxy." + "message": "An error occurred, unable to change system proxy settings." } } } @@ -1057,7 +1057,7 @@ }, "no-models": "No models found.", "no-internet": "No internet connection.", - "error-occured": "An error occurred, try again later." + "error-occurred": "An error occurred, try again later." } }, "notifications": { diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index c78d2959..61f7fff2 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -279,6 +279,18 @@ "error-notification": { "message": "Ocurrió un error, no se pueden cambiar los ajustes de los enlaces simbólicos." } + }, + "use-system-proxy": { + "title": "Usar proxy del sistema", + "description": "BSManager realizará solicitudes de red a través de su proxy del sistema.", + "modal": { + "title": "Se necesita reiniciar", + "body": "Desactivar el proxy del sistema cerrará y reiniciará BSManager. ¿Está seguro de que desea hacer esto?", + "confirm-btn": "Sí, estoy seguro" + }, + "error-notification": { + "message": "Ocurrió un error, no se pueden cambiar los ajustes del proxy del sistema." + } } } } diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 02852a84..96bed9be 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -279,6 +279,18 @@ "error-notification": { "message": "Une erreur s'est produite, impossible de changer les paramètres des liens symboliques." } + }, + "use-system-proxy": { + "title": "Utiliser le proxy du système", + "description": "BSManager effectuera des requêtes réseau via votre proxy système.", + "modal": { + "title": "Redémarrage nécessaire", + "body": "Désactiver le proxy système fermera et relancera BSManager. Êtes-vous sûr de vouloir faire cela ?", + "confirm-btn": "Oui, je suis sûr" + }, + "error-notification": { + "message": "Une erreur est survenue, impossible de modifier les paramètres du proxy système." + } } } } diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index d87c5772..76224a15 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -279,6 +279,18 @@ "error-notification": { "message": "エラーが発生しました。シンボリックリンク設定を変更できません。" } + }, + "use-system-proxy": { + "title": "システムプロキシを使用", + "description": "BSManagerはシステムプロキシを通じてネットワークリクエストを行います。", + "modal": { + "title": "再起動が必要", + "body": "システムプロキシをオフにすると、BSManagerが終了して再起動します。本当にこれを実行しますか?", + "confirm-btn": "はい、確かです" + }, + "error-notification": { + "message": "エラーが発生しました。システムプロキシ設定を変更できません。" + } } } } diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json index 99b3d2b9..f4096a68 100644 --- a/assets/jsons/translations/ko.json +++ b/assets/jsons/translations/ko.json @@ -279,6 +279,18 @@ "error-notification": { "message": "오류가 발생했습니다. 심볼릭 링크 설정을 변경할 수 없습니다." } + }, + "use-system-proxy": { + "title": "시스템 프록시 사용", + "description": "BSManager는 시스템 프록시를 통해 네트워크 요청을 수행합니다.", + "modal": { + "title": "재시작이 필요합니다", + "body": "시스템 프록시를 끄면 BSManager가 종료되고 재시작됩니다. 정말로 이렇게 하시겠습니까?", + "confirm-btn": "네, 확실합니다" + }, + "error-notification": { + "message": "오류가 발생했습니다. 시스템 프록시 설정을 변경할 수 없습니다." + } } } } diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index ab6a3895..48a2ff46 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -279,6 +279,18 @@ "error-notification": { "message": "Произошла ошибка, невозможно изменить настройки символических ссылок." } + }, + "use-system-proxy": { + "title": "Использовать системный прокси", + "description": "BSManager будет делать сетевые запросы через ваш системный прокси.", + "modal": { + "title": "Необходим перезапуск", + "body": "Отключение системного прокси приведет к закрытию и перезапуску BSManager. Вы уверены, что хотите это сделать?", + "confirm-btn": "Да, я уверен" + }, + "error-notification": { + "message": "Произошла ошибка, не удалось изменить настройки системного прокси." + } } } } diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index c2881a3d..19ea523e 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -279,6 +279,18 @@ "error-notification": { "message": "發生錯誤,無法更改符號鏈接設置。" } + }, + "use-system-proxy": { + "title": "使用系統代理", + "description": "BSManager將通過您的系統代理發送網絡請求。", + "modal": { + "title": "需要重新啟動", + "body": "關閉系統代理會退出並重新啟動BSManager。您確定要這麼做嗎?", + "confirm-btn": "是的,我確定" + }, + "error-notification": { + "message": "發生錯誤,無法更改系統代理設置。" + } } } } From ce89532f3ddeba9e238b0ab41d35c74af7bf8b43 Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 24 Dec 2024 22:46:30 +0800 Subject: [PATCH 7/9] move proxy-helper init entry to main.ts for earlier init so it can make earlier connections go through proxy as well --- src/main/main.ts | 2 ++ src/main/services/request.service.ts | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index 6d6fbf80..0c8ab1c8 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -25,6 +25,7 @@ import { FileAssociationService } from "./services/file-association.service"; import { SongDetailsCacheService } from "./services/additional-content/maps/song-details-cache.service"; import { readdirSync, statSync, unlinkSync } from "fs-extra"; import { StaticConfigurationService } from "./services/static-configuration.service"; +import { configureProxy } from './helpers/proxy.helpers'; const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true"; const staticConfig = StaticConfigurationService.getInstance(); @@ -46,6 +47,7 @@ staticConfig.take("disable-hadware-acceleration", disabled => { } }); +configureProxy(); if (process.env.NODE_ENV === "production") { const sourceMapSupport = require("source-map-support"); diff --git a/src/main/services/request.service.ts b/src/main/services/request.service.ts index b34e3129..8961ca8c 100644 --- a/src/main/services/request.service.ts +++ b/src/main/services/request.service.ts @@ -11,7 +11,6 @@ import path from 'path'; import { pipeline } from 'stream/promises'; import sanitize from 'sanitize-filename'; import internal from 'stream'; -import { configureProxy } from 'main/helpers/proxy.helpers'; export class RequestService { private static instance: RequestService; @@ -24,9 +23,7 @@ export class RequestService { return RequestService.instance; } - private constructor() { - configureProxy(); - } + private constructor() {} public async getJSON(url: string): Promise<{ data: T; headers: IncomingHttpHeaders }> { From 3c1faf825937a381512a2469ba648dc0d6a58ecc Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 24 Dec 2024 23:12:21 +0800 Subject: [PATCH 8/9] switching proxy enable/disable does not require app restart anymore --- src/main/helpers/proxy.helpers.ts | 50 +++++++++++-------- .../pages/settings-page.component.tsx | 23 --------- 2 files changed, 28 insertions(+), 45 deletions(-) diff --git a/src/main/helpers/proxy.helpers.ts b/src/main/helpers/proxy.helpers.ts index ba4ec320..71f9a366 100644 --- a/src/main/helpers/proxy.helpers.ts +++ b/src/main/helpers/proxy.helpers.ts @@ -35,41 +35,47 @@ async function getProxyOverride(): Promise{ return registryValue.value; } -async function configureWindowsProxy() : Promise { - if (await isProxyEnabled().catch(err => log.error(err))) { - const httpProxyUrl = `http://${await getProxyServer().catch(err => log.error(err))}` - process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxyUrl; - process.env.GLOBAL_AGENT_HTTPS_PROXY = httpProxyUrl; +async function enableWindowsProxy(enable: boolean): Promise { + if (!(await isProxyEnabled().catch(err => log.error(err)))) { + log.info("enableWindowsProxy: System proxy not detected"); + return; + } + + let { GLOBAL_AGENT: globalProxyAgent } = global as any; + if (!globalProxyAgent) { // If this is undefined, call bootstrap to set it up + if (!bootstrap()) { + log.error("enableWindowsProxy: Could not setup proxy stuff"); + return; + } + globalProxyAgent = (global as any).GLOBAL_AGENT; + } - process.env.GLOBAL_AGENT_NO_PROXY = `${await getProxyOverride().catch(err => log.error(err))}`; + if (enable) { + const httpProxyUrl = `http://${await getProxyServer().catch(err => log.error(err))}` + globalProxyAgent.HTTP_PROXY = httpProxyUrl; + globalProxyAgent.HTTPS_PROXY = httpProxyUrl; + globalProxyAgent.NO_PROXY = `${await getProxyOverride().catch(err => log.error(err))}`; - log.info(`configureWindowsProxy: Using system proxy: ${process.env.GLOBAL_AGENT_HTTP_PROXY}`); + log.info(`enableWindowsProxy: Using system proxy: ${httpProxyUrl}`); + } else { + delete globalProxyAgent.HTTP_PROXY; + delete globalProxyAgent.HTTPS_PROXY; + delete globalProxyAgent.NO_PROXY; - bootstrap(); - } - else { - log.info(`configureWindowsProxy: System proxy not detected`); + log.info("enableWindowsProxy: proxy disabled"); } } export function configureProxy() { if (process.platform === "win32") { - const useSystemProxy = staticConfig.get("use-system-proxy"); - - if (useSystemProxy === true) { - configureWindowsProxy(); - } - - log.info(`configureProxy: UseSystemProxy is set to ${useSystemProxy}`); + enableWindowsProxy(staticConfig.get("use-system-proxy")); staticConfig.$watch("use-system-proxy").subscribe((useSystemProxy) => { - if (useSystemProxy === true) { - configureWindowsProxy(); - } + enableWindowsProxy(useSystemProxy); log.info(`configureProxy: UseSystemProxy is set to ${useSystemProxy}`); }); } else { - log.info('configureProxy: Unsupported platform'); + log.info("configureProxy: Unsupported platform"); } } diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index cd26de6d..19530fb4 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -617,20 +617,6 @@ function AdvancedSettings() { return; } - if(!newUseSystemProxy){ - const res = await modal.openModal(BasicModal, { data: { - title: "pages.settings.advanced.use-system-proxy.modal.title", - body: "pages.settings.advanced.use-system-proxy.modal.body", - image: BeatConflict, - buttons: [ - { id: "cancel", text: "misc.cancel", type: "cancel" }, - { id: "confirm", text: "pages.settings.advanced.use-system-proxy.modal.confirm-btn", type: "error", onClick: () => true } - ] - }}); - - if(res.exitCode !== ModalExitCode.COMPLETED || res.data !== "confirm"){ return; } - } - const { error } = await tryit(() => staticConfig.set("use-system-proxy", newUseSystemProxy)); if(error){ @@ -639,15 +625,6 @@ function AdvancedSettings() { } setUseSystemProxy(() => newUseSystemProxy); - - if(!progressBar.require()){ - return; - } - - if (!newUseSystemProxy) { - await lastValueFrom(ipc.sendV2("restart-app")); - } - } const advancedItems: Item[] = [{ From d09fbb090c3fb2f80d3990259768261f8ebeb1fb Mon Sep 17 00:00:00 2001 From: Gold John King Date: Tue, 24 Dec 2024 23:13:18 +0800 Subject: [PATCH 9/9] remove redundant strings entries of system proxy module --- assets/jsons/translations/de.json | 5 ----- assets/jsons/translations/en.json | 5 ----- assets/jsons/translations/es.json | 5 ----- assets/jsons/translations/fr.json | 5 ----- assets/jsons/translations/ja.json | 5 ----- assets/jsons/translations/ko.json | 5 ----- assets/jsons/translations/ru.json | 5 ----- assets/jsons/translations/zh-tw.json | 5 ----- assets/jsons/translations/zh.json | 5 ----- 9 files changed, 45 deletions(-) diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index bbe4dd46..50be05d4 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "System-Proxy verwenden", "description": "BSManager wird Netzwerkrequests über Ihren Systemproxy durchführen.", - "modal": { - "title": "Neustart erforderlich", - "body": "Das Deaktivieren des Systemproxys beendet BSManager und startet ihn neu. Sind Sie sicher, dass Sie dies tun möchten?", - "confirm-btn": "Ja, ich bin sicher" - }, "error-notification": { "message": "Es ist ein Fehler aufgetreten, die Systemproxyeinstellungen können nicht geändert werden." } diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 9e54af84..063a5f0e 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "Use system proxy", "description": "BSManager will make network requests through your system proxy.", - "modal": { - "title": "Restart Needed", - "body": "Turning off system proxy will quit and re-launch BSManager. Are you sure you want to do this?", - "confirm-btn": "Yes I'm sure" - }, "error-notification": { "message": "An error occurred, unable to change system proxy settings." } diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index 61f7fff2..af62103f 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "Usar proxy del sistema", "description": "BSManager realizará solicitudes de red a través de su proxy del sistema.", - "modal": { - "title": "Se necesita reiniciar", - "body": "Desactivar el proxy del sistema cerrará y reiniciará BSManager. ¿Está seguro de que desea hacer esto?", - "confirm-btn": "Sí, estoy seguro" - }, "error-notification": { "message": "Ocurrió un error, no se pueden cambiar los ajustes del proxy del sistema." } diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 96bed9be..ff2a856c 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "Utiliser le proxy du système", "description": "BSManager effectuera des requêtes réseau via votre proxy système.", - "modal": { - "title": "Redémarrage nécessaire", - "body": "Désactiver le proxy système fermera et relancera BSManager. Êtes-vous sûr de vouloir faire cela ?", - "confirm-btn": "Oui, je suis sûr" - }, "error-notification": { "message": "Une erreur est survenue, impossible de modifier les paramètres du proxy système." } diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index 76224a15..1e4220ad 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "システムプロキシを使用", "description": "BSManagerはシステムプロキシを通じてネットワークリクエストを行います。", - "modal": { - "title": "再起動が必要", - "body": "システムプロキシをオフにすると、BSManagerが終了して再起動します。本当にこれを実行しますか?", - "confirm-btn": "はい、確かです" - }, "error-notification": { "message": "エラーが発生しました。システムプロキシ設定を変更できません。" } diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json index f4096a68..abc2ab9a 100644 --- a/assets/jsons/translations/ko.json +++ b/assets/jsons/translations/ko.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "시스템 프록시 사용", "description": "BSManager는 시스템 프록시를 통해 네트워크 요청을 수행합니다.", - "modal": { - "title": "재시작이 필요합니다", - "body": "시스템 프록시를 끄면 BSManager가 종료되고 재시작됩니다. 정말로 이렇게 하시겠습니까?", - "confirm-btn": "네, 확실합니다" - }, "error-notification": { "message": "오류가 발생했습니다. 시스템 프록시 설정을 변경할 수 없습니다." } diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index 48a2ff46..ed64c100 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "Использовать системный прокси", "description": "BSManager будет делать сетевые запросы через ваш системный прокси.", - "modal": { - "title": "Необходим перезапуск", - "body": "Отключение системного прокси приведет к закрытию и перезапуску BSManager. Вы уверены, что хотите это сделать?", - "confirm-btn": "Да, я уверен" - }, "error-notification": { "message": "Произошла ошибка, не удалось изменить настройки системного прокси." } diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index 19ea523e..1c838f97 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "使用系統代理", "description": "BSManager將通過您的系統代理發送網絡請求。", - "modal": { - "title": "需要重新啟動", - "body": "關閉系統代理會退出並重新啟動BSManager。您確定要這麼做嗎?", - "confirm-btn": "是的,我確定" - }, "error-notification": { "message": "發生錯誤,無法更改系統代理設置。" } diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index c52e84e7..00d6edf8 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -283,11 +283,6 @@ "use-system-proxy": { "title": "使用系统代理", "description": "BSMansger将通过系统代理发起网络请求。", - "modal": { - "title": "需要重启", - "body": "关闭系统代理需要退出并重新启动BSManager。您确定要这样做吗?", - "confirm-btn": "是的,我确定" - }, "error-notification": { "message": "发生错误,无法启用系统代理。" }