From d6c594775f095358dfce7260223cb6b604484d79 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Mon, 30 Sep 2024 23:18:55 +0800 Subject: [PATCH] disable external-controller by default --- src/main/utils/init.ts | 4 ++++ src/main/utils/template.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main/utils/init.ts b/src/main/utils/init.ts index a39a801..8151f0a 100644 --- a/src/main/utils/init.ts +++ b/src/main/utils/init.ts @@ -153,6 +153,7 @@ async function migration(): Promise { const { 'external-controller-pipe': externalControllerPipe, 'external-controller-unix': externalControllerUnix, + 'external-controller': externalController, 'skip-auth-prefixes': skipAuthPrefixes, authentication, 'bind-address': bindAddress, @@ -204,6 +205,9 @@ async function migration(): Promise { 'external-controller-pipe': '\\\\.\\pipe\\MihomoParty\\mihomo' }) } + if (externalController === undefined) { + await patchControledMihomoConfig({ 'external-controller': '' }) + } } function initDeeplink(): void { diff --git a/src/main/utils/template.ts b/src/main/utils/template.ts index dcf0c4b..a5097fb 100644 --- a/src/main/utils/template.ts +++ b/src/main/utils/template.ts @@ -38,6 +38,7 @@ export const defaultConfig: IAppConfig = { export const defaultControledMihomoConfig: Partial = { 'external-controller-pipe': '\\\\.pipe\\MihomoParty\\mihomo', 'external-controller-unix': '/tmp/mihomo-party.sock', + 'external-controller': '', ipv6: true, mode: 'rule', 'mixed-port': 7890,