webchat: move serving to relay loopback and tunnel from mac app

This commit is contained in:
Peter Steinberger
2025-12-08 11:54:30 +01:00
parent dc69d20ec9
commit dc22661744
7 changed files with 387 additions and 331 deletions

View File

@@ -328,14 +328,14 @@ enum CommandResolver {
return ["/usr/bin/ssh"] + args
}
private struct RemoteSettings {
struct RemoteSettings {
let mode: AppState.ConnectionMode
let target: String
let identity: String
let projectRoot: String
}
private static func connectionSettings() -> RemoteSettings {
static func connectionSettings() -> RemoteSettings {
let modeRaw = UserDefaults.standard.string(forKey: connectionModeKey) ?? "local"
let mode = AppState.ConnectionMode(rawValue: modeRaw) ?? .local
let target = UserDefaults.standard.string(forKey: remoteTargetKey) ?? ""
@@ -348,6 +348,10 @@ enum CommandResolver {
projectRoot: projectRoot)
}
static func connectionModeIsRemote() -> Bool {
self.connectionSettings().mode == .remote
}
private static func sanitizedTarget(_ raw: String) -> String {
VoiceWakeForwarder.sanitizedTarget(raw)
}