mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: remove envs introduced in v1.7.0 to make Linux TUN work properly (#1283)
This commit is contained in:
parent
67d378f3f3
commit
f61072c309
@ -118,11 +118,7 @@ export async function startCore(detached = false): Promise<Promise<void>[]> {
|
||||
core = 'mihomo',
|
||||
autoSetDNS = true,
|
||||
diffWorkDir = false,
|
||||
mihomoCpuPriority = 'PRIORITY_NORMAL',
|
||||
disableLoopbackDetector = false,
|
||||
disableEmbedCA = false,
|
||||
disableSystemCA = false,
|
||||
skipSafePathCheck = false
|
||||
mihomoCpuPriority = 'PRIORITY_NORMAL'
|
||||
} = await getAppConfig()
|
||||
const { 'log-level': logLevel } = await getControledMihomoConfig()
|
||||
if (existsSync(path.join(dataDir(), 'core.pid'))) {
|
||||
@ -167,19 +163,13 @@ export async function startCore(detached = false): Promise<Promise<void>[]> {
|
||||
// 内核日志输出到独立的 core-日期.log 文件
|
||||
const stdout = createWriteStream(coreLogPath(), { flags: 'a' })
|
||||
const stderr = createWriteStream(coreLogPath(), { flags: 'a' })
|
||||
const env = {
|
||||
DISABLE_LOOPBACK_DETECTOR: String(disableLoopbackDetector),
|
||||
DISABLE_EMBED_CA: String(disableEmbedCA),
|
||||
DISABLE_SYSTEM_CA: String(disableSystemCA),
|
||||
SKIP_SAFE_PATH_CHECK: String(skipSafePathCheck)
|
||||
}
|
||||
|
||||
child = spawn(
|
||||
corePath,
|
||||
['-d', diffWorkDir ? mihomoProfileWorkDir(current) : mihomoWorkDir(), ctlParam, dynamicIpcPath],
|
||||
{
|
||||
detached: detached,
|
||||
stdio: detached ? 'ignore' : undefined,
|
||||
env: env
|
||||
stdio: detached ? 'ignore' : undefined
|
||||
}
|
||||
)
|
||||
if (process.platform === 'win32' && child.pid) {
|
||||
@ -463,15 +453,12 @@ export async function quitWithoutCore(): Promise<void> {
|
||||
async function checkProfile(): Promise<void> {
|
||||
const {
|
||||
core = 'mihomo',
|
||||
diffWorkDir = false,
|
||||
skipSafePathCheck = false
|
||||
diffWorkDir = false
|
||||
} = await getAppConfig()
|
||||
const { current } = await getProfileConfig()
|
||||
const corePath = mihomoCorePath(core)
|
||||
const execFilePromise = promisify(execFile)
|
||||
const env = {
|
||||
SKIP_SAFE_PATH_CHECK: String(skipSafePathCheck)
|
||||
}
|
||||
|
||||
try {
|
||||
await execFilePromise(corePath, [
|
||||
'-t',
|
||||
@ -479,7 +466,7 @@ async function checkProfile(): Promise<void> {
|
||||
diffWorkDir ? mihomoWorkConfigPath(current) : mihomoWorkConfigPath('work'),
|
||||
'-d',
|
||||
mihomoTestDir()
|
||||
], { env })
|
||||
])
|
||||
} catch (error) {
|
||||
await managerLogger.error('Profile check failed', error)
|
||||
|
||||
|
||||
@ -25,11 +25,7 @@ export const defaultConfig: IAppConfig = {
|
||||
controlSniff: true,
|
||||
floatingWindowCompatMode: true,
|
||||
disableHardwareAcceleration: false,
|
||||
disableLoopbackDetector: false,
|
||||
hideConnectionCardWave: false,
|
||||
disableEmbedCA: false,
|
||||
disableSystemCA: false,
|
||||
skipSafePathCheck: false,
|
||||
nameserverPolicy: {},
|
||||
siderOrder: [
|
||||
'sysproxy',
|
||||
|
||||
@ -42,11 +42,8 @@ const Mihomo: React.FC = () => {
|
||||
smartCoreCollectData = false,
|
||||
smartCoreStrategy = 'sticky-sessions',
|
||||
maxLogDays = 7,
|
||||
sysProxy,
|
||||
disableLoopbackDetector,
|
||||
disableEmbedCA,
|
||||
disableSystemCA,
|
||||
skipSafePathCheck } = appConfig || {}
|
||||
sysProxy
|
||||
} = appConfig || {}
|
||||
const { controledMihomoConfig, patchControledMihomoConfig } = useControledMihomoConfig()
|
||||
|
||||
interface WebUIPanel {
|
||||
@ -1130,42 +1127,7 @@ const Mihomo: React.FC = () => {
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('mihomo.disableLoopbackDetector')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={disableLoopbackDetector}
|
||||
onValueChange={(v) => {
|
||||
handleConfigChangeWithRestart('disableLoopbackDetector', v)
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('mihomo.skipSafePathCheck')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={skipSafePathCheck}
|
||||
onValueChange={(v) => {
|
||||
handleConfigChangeWithRestart('skipSafePathCheck', v)
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('mihomo.disableEmbedCA')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={disableEmbedCA}
|
||||
onValueChange={(v) => {
|
||||
handleConfigChangeWithRestart('disableEmbedCA', v)
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
<SettingItem title={t('mihomo.disableSystemCA')} divider>
|
||||
<Switch
|
||||
size="sm"
|
||||
isSelected={disableSystemCA}
|
||||
onValueChange={(v) => {
|
||||
handleConfigChangeWithRestart('disableSystemCA', v)
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
|
||||
<SettingItem title={t('mihomo.logRetentionDays')} divider>
|
||||
<Input
|
||||
size="sm"
|
||||
|
||||
4
src/shared/types.d.ts
vendored
4
src/shared/types.d.ts
vendored
@ -223,10 +223,6 @@ interface IAppConfig {
|
||||
smartCoreUseLightGBM: boolean
|
||||
smartCoreCollectData: boolean
|
||||
smartCoreStrategy: 'sticky-sessions' | 'round-robin'
|
||||
disableLoopbackDetector: boolean
|
||||
disableEmbedCA: boolean
|
||||
disableSystemCA: boolean
|
||||
skipSafePathCheck: boolean
|
||||
proxyDisplayMode: 'simple' | 'full'
|
||||
proxyDisplayOrder: 'default' | 'delay' | 'name'
|
||||
profileDisplayDate?: 'expire' | 'update'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user