mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
feat: add launch guard and secure multi-user service ownership (#7569)
* feat(service): isolate macOS launch and owner runtime * ci(windows): run owner security tests * chore(deps): use kode-bridge v0.4.1 tag * fix(macos): classify installed service state * fix(macos): classify marked unavailable service * fix(macos): gate core startup on service migration * fix(macos): scope service init to supported platforms * feat(macos): prompt before migrating installed service * fix(macos): shorten sidecar IPC path * build(service): pin helper protocol and artifacts * fix(core): require confirmed service and sidecar readiness * fix(macos): harden launch roots and singleton state * fix(ui): refresh migration state before restart * fix(macos): linearize service migration lifecycle * fix(ui): keep service migration state fresh * feat(service): track authenticated owner sessions * fix(service): preserve newer owner sessions * feat(macos): route service proxy changes through helper * fix(macos): serialize service proxy guard * fix(macos): close service proxy owner lifecycle * fix(macos): close remaining proxy stop races * fix(app): do not cancel controlled service stop * fix(lifecycle): keep controlled updates cancellation-safe * fix(macos): stage dev core for service * test(macos): exercise staged core cleanup * fix(dev): await controlled macOS exit * chore: update changelog * fix(macos): recover sidecar after service install failure Allow the existing sidecar to continue when service installation leaves the manager in InstallRequired, then settle the session state as SidecarAllowed. Show neutral status text while the migration dialog waits for its final state. * fix(macos): stage dev service tools before elevation * fix(macos): localize launch guard prompts * fix(service): address cross-platform integration issues * feat: support seamless service migration * fix: pass Windows service installer path safely * fix(prebuild): derive service release from Cargo dependency * fix(dev): preserve service installation state * fix: resolve clippy warnings in service lifecycle
This commit is contained in:
+33
-7
@@ -190,12 +190,12 @@ export async function getAutotemProxy() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function changeClashCore(clashCore: string) {
|
||||
return invoke<string | null>('change_clash_core', { clashCore })
|
||||
export async function getEmbeddedServerPort() {
|
||||
return invoke<number>('get_embedded_server_port')
|
||||
}
|
||||
|
||||
export async function stopCore() {
|
||||
return invoke<void>('stop_core')
|
||||
export async function changeClashCore(clashCore: string) {
|
||||
return invoke<string | null>('change_clash_core', { clashCore })
|
||||
}
|
||||
|
||||
export async function restartCore() {
|
||||
@@ -358,8 +358,10 @@ export async function listLocalBackup() {
|
||||
}
|
||||
|
||||
// 获取当前运行模式
|
||||
export type RunningMode = 'Service' | 'Sidecar' | 'NotRunning'
|
||||
|
||||
export const getRunningMode = async () => {
|
||||
return invoke<string>('get_running_mode')
|
||||
return invoke<RunningMode>('get_running_mode')
|
||||
}
|
||||
|
||||
// 获取应用运行时间
|
||||
@@ -377,12 +379,36 @@ export const uninstallService = async () => {
|
||||
return invoke<void>('uninstall_service')
|
||||
}
|
||||
|
||||
export type ServiceInstallState =
|
||||
| 'checking'
|
||||
| 'notInstalled'
|
||||
| 'installRequired'
|
||||
| 'ready'
|
||||
| 'needsReinstall'
|
||||
| 'sidecarAllowed'
|
||||
| 'unavailable'
|
||||
|
||||
export const getServiceInstallState = async () => {
|
||||
return invoke<ServiceInstallState>('get_service_install_state')
|
||||
}
|
||||
|
||||
export const reinstallService = async () => {
|
||||
return invoke<void>('reinstall_service')
|
||||
}
|
||||
|
||||
export const repairService = async () => {
|
||||
return invoke<void>('repair_service')
|
||||
}
|
||||
|
||||
export const continueWithSidecar = async () => {
|
||||
return invoke<void>('continue_with_sidecar')
|
||||
}
|
||||
|
||||
// 系统服务是否可用
|
||||
export const isServiceAvailable = async () => {
|
||||
try {
|
||||
return await invoke<boolean>('is_service_available')
|
||||
} catch (error) {
|
||||
console.error('Service check failed:', error)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user