mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix: default tun device name doesn't work
This commit is contained in:
parent
d6b88d407c
commit
4325c77b4c
@ -38,10 +38,6 @@ export async function patchControledMihomoConfig(patch: Partial<IMihomoConfig>):
|
|||||||
controledMihomoConfig.sniffer = defaultControledMihomoConfig.sniffer
|
controledMihomoConfig.sniffer = defaultControledMihomoConfig.sniffer
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
delete controledMihomoConfig?.tun?.device
|
|
||||||
}
|
|
||||||
|
|
||||||
await generateProfile()
|
await generateProfile()
|
||||||
await writeFile(controledMihomoConfigPath(), yaml.stringify(controledMihomoConfig), 'utf-8')
|
await writeFile(controledMihomoConfigPath(), yaml.stringify(controledMihomoConfig), 'utf-8')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,7 +250,8 @@ async function migration(): Promise<void> {
|
|||||||
authentication,
|
authentication,
|
||||||
'bind-address': bindAddress,
|
'bind-address': bindAddress,
|
||||||
'lan-allowed-ips': lanAllowedIps,
|
'lan-allowed-ips': lanAllowedIps,
|
||||||
'lan-disallowed-ips': lanDisallowedIps
|
'lan-disallowed-ips': lanDisallowedIps,
|
||||||
|
tun
|
||||||
} = await getControledMihomoConfig()
|
} = await getControledMihomoConfig()
|
||||||
// add substore sider card
|
// add substore sider card
|
||||||
if (useSubStore && !siderOrder.includes('substore')) {
|
if (useSubStore && !siderOrder.includes('substore')) {
|
||||||
@ -276,6 +277,16 @@ async function migration(): Promise<void> {
|
|||||||
if (!lanDisallowedIps) {
|
if (!lanDisallowedIps) {
|
||||||
await patchControledMihomoConfig({ 'lan-disallowed-ips': [] })
|
await patchControledMihomoConfig({ 'lan-disallowed-ips': [] })
|
||||||
}
|
}
|
||||||
|
// default tun device
|
||||||
|
if (!tun?.device || (process.platform === 'darwin' && tun.device === 'Mihomo')) {
|
||||||
|
const defaultDevice = process.platform === 'darwin' ? 'utun1500' : 'Mihomo'
|
||||||
|
await patchControledMihomoConfig({
|
||||||
|
tun: {
|
||||||
|
...tun,
|
||||||
|
device: defaultDevice
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// remove custom app theme
|
// remove custom app theme
|
||||||
if (!['system', 'light', 'dark'].includes(appTheme)) {
|
if (!['system', 'light', 'dark'].includes(appTheme)) {
|
||||||
await patchAppConfig({ appTheme: 'system' })
|
await patchAppConfig({ appTheme: 'system' })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user