惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
博客园 - 司徒正美
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
Jina AI
Jina AI
GbyAI
GbyAI
Y
Y Combinator Blog
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
雷峰网
雷峰网
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
S
Secure Thoughts
博客园 - 三生石上(FineUI控件)
Cyberwarzone
Cyberwarzone
NISL@THU
NISL@THU
J
Java Code Geeks
C
Cisco Blogs
人人都是产品经理
人人都是产品经理
Webroot Blog
Webroot Blog
腾讯CDC
博客园 - 叶小钗
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Troy Hunt's Blog
AI
AI
L
LangChain Blog
Know Your Adversary
Know Your Adversary
T
Tenable Blog
M
MIT News - Artificial intelligence
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 最新话题
Hugging Face - Blog
Hugging Face - Blog
F
Full Disclosure
P
Proofpoint News Feed
AWS News Blog
AWS News Blog
有赞技术团队
有赞技术团队
A
Arctic Wolf
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
W
WeLiveSecurity
The Cloudflare Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(macos): avoid Tailscale hydration config rewrites · openclaw/openclaw@da982a3
BunsDev · 2026-05-02 · via Recent Commits to openclaw:main

@@ -29,6 +29,42 @@ private enum GatewayTailscaleMode: String, CaseIterable, Identifiable {

2929

}

3030

}

313132+

private struct GatewayTailscaleSettingsSnapshot: Equatable {

33+

var mode: GatewayTailscaleMode

34+

var requireCredentialsForServe: Bool

35+

var password: String

36+37+

init(mode: GatewayTailscaleMode, requireCredentialsForServe: Bool, password: String) {

38+

self.mode = mode

39+

self.requireCredentialsForServe = requireCredentialsForServe

40+

self.password = password.trimmingCharacters(in: .whitespacesAndNewlines)

41+

}

42+

}

43+44+

private struct GatewayTailscaleLoadedSettings {

45+

var snapshot: GatewayTailscaleSettingsSnapshot

46+

var displayPassword: String

47+

}

48+49+

private struct GatewayTailscaleApplyResult {

50+

var didApply: Bool

51+

var success: Bool

52+

var errorMessage: String?

53+

var validationMessage: String?

54+

}

55+56+

private struct GatewayTailscaleApplyMessages {

57+

var statusMessage: String?

58+

var validationMessage: String?

59+

var shouldRecordSuccess: Bool

60+

var shouldRestartGateway: Bool

61+

}

62+63+

private typealias GatewayTailscaleSettingsSaver = @MainActor @Sendable (

64+

GatewayTailscaleSettingsSnapshot,

65+

AppState.ConnectionMode,

66+

Bool) async -> (Bool, String?)

67+3268

struct TailscaleIntegrationSection: View {

3369

let connectionMode: AppState.ConnectionMode

3470

let isPaused: Bool

@@ -45,6 +81,7 @@ struct TailscaleIntegrationSection: View {

4581

@State private var statusMessage: String?

4682

@State private var validationMessage: String?

4783

@State private var statusTimer: Timer?

84+

@State private var lastAppliedSettings: GatewayTailscaleSettingsSnapshot?

48854986

init(connectionMode: AppState.ConnectionMode, isPaused: Bool) {

5087

self.connectionMode = connectionMode

@@ -246,60 +283,34 @@ struct TailscaleIntegrationSection: View {

246283247284

private func loadConfig() async {

248285

let root = await ConfigStore.load()

249-

let gateway = root["gateway"] as? [String: Any] ?? [:]

250-

let tailscale = gateway["tailscale"] as? [String: Any] ?? [:]

251-

let modeRaw = (tailscale["mode"] as? String) ?? "serve"

252-

self.tailscaleMode = GatewayTailscaleMode(rawValue: modeRaw) ?? .off

253-254-

let auth = gateway["auth"] as? [String: Any] ?? [:]

255-

let authModeRaw = auth["mode"] as? String

256-

let allowTailscale = auth["allowTailscale"] as? Bool

257-258-

self.password = auth["password"] as? String ?? ""

259-260-

if self.tailscaleMode == .serve {

261-

let usesExplicitAuth = authModeRaw == "password"

262-

if let allowTailscale, allowTailscale == false {

263-

self.requireCredentialsForServe = true

264-

} else {

265-

self.requireCredentialsForServe = usesExplicitAuth

266-

}

267-

} else {

268-

self.requireCredentialsForServe = false

269-

}

286+

let loaded = TailscaleIntegrationSection.loadedSettings(from: root)

287+

self.tailscaleMode = loaded.snapshot.mode

288+

self.requireCredentialsForServe = loaded.snapshot.requireCredentialsForServe

289+

self.password = loaded.displayPassword

290+

self.lastAppliedSettings = loaded.snapshot

270291

}

271292272293

private func applySettings() async {

273294

guard self.hasLoaded else { return }

274-

self.validationMessage = nil

275-

self.statusMessage = nil

276-277-

let trimmedPassword = self.password.trimmingCharacters(in: .whitespacesAndNewlines)

278-

let requiresPassword = self.tailscaleMode == .funnel

279-

|| (self.tailscaleMode == .serve && self.requireCredentialsForServe)

280-

if requiresPassword, trimmedPassword.isEmpty {

281-

self.validationMessage = "Password required for this mode."

282-

return

283-

}

284-285-

let (success, errorMessage) = await TailscaleIntegrationSection.buildAndSaveTailscaleConfig(

286-

tailscaleMode: self.tailscaleMode,

287-

requireCredentialsForServe: self.requireCredentialsForServe,

288-

password: trimmedPassword,

295+

let currentSettings = self.currentSettingsSnapshot()

296+

let result = await TailscaleIntegrationSection.applySettingsIfChanged(

297+

currentSettings: currentSettings,

298+

lastAppliedSettings: self.lastAppliedSettings,

299+

connectionMode: self.connectionMode,

300+

isPaused: self.isPaused,

301+

saveSettings: TailscaleIntegrationSection.saveTailscaleSettings)

302+

let messages = TailscaleIntegrationSection.messages(

303+

for: result,

289304

connectionMode: self.connectionMode,

290305

isPaused: self.isPaused)

306+

self.validationMessage = messages.validationMessage

307+

self.statusMessage = messages.statusMessage

308+

guard messages.shouldRecordSuccess else { return }

291309292-

if !success, let errorMessage {

293-

self.statusMessage = errorMessage

294-

return

310+

self.lastAppliedSettings = currentSettings

311+

if messages.shouldRestartGateway {

312+

self.restartGatewayIfNeeded()

295313

}

296-297-

if self.connectionMode == .local, !self.isPaused {

298-

self.statusMessage = "Saved to ~/.openclaw/openclaw.json. Restarting gateway…"

299-

} else {

300-

self.statusMessage = "Saved to ~/.openclaw/openclaw.json. Restart the gateway to apply."

301-

}

302-

self.restartGatewayIfNeeded()

303314

}

304315305316

@MainActor

@@ -310,28 +321,46 @@ struct TailscaleIntegrationSection: View {

310321

connectionMode: AppState.ConnectionMode,

311322

isPaused: Bool) async -> (Bool, String?)

312323

{

313-

var root = await ConfigStore.load()

324+

let settings = GatewayTailscaleSettingsSnapshot(

325+

mode: tailscaleMode,

326+

requireCredentialsForServe: requireCredentialsForServe,

327+

password: password)

328+

let root = await self.buildTailscaleConfigRoot(root: ConfigStore.load(), settings: settings)

329+330+

do {

331+

try await ConfigStore.save(root, allowGatewayAuthMutation: true)

332+

return (true, nil)

333+

} catch {

334+

return (false, error.localizedDescription)

335+

}

336+

}

337+338+

private static func buildTailscaleConfigRoot(

339+

root originalRoot: [String: Any],

340+

settings: GatewayTailscaleSettingsSnapshot) -> [String: Any]

341+

{

342+

var root = originalRoot

314343

var gateway = root["gateway"] as? [String: Any] ?? [:]

315344

var tailscale = gateway["tailscale"] as? [String: Any] ?? [:]

316-

tailscale["mode"] = tailscaleMode.rawValue

345+

tailscale["mode"] = settings.mode.rawValue

317346

gateway["tailscale"] = tailscale

318347319-

if tailscaleMode != .off {

348+

if settings.mode != .off {

320349

gateway["bind"] = "loopback"

321350

}

322351323-

if tailscaleMode == .off {

352+

if settings.mode == .off {

324353

gateway.removeValue(forKey: "auth")

325354

} else {

326355

var auth = gateway["auth"] as? [String: Any] ?? [:]

327-

if tailscaleMode == .serve, !requireCredentialsForServe {

356+

if settings.mode == .serve, !settings.requireCredentialsForServe {

328357

auth["allowTailscale"] = true

329358

auth.removeValue(forKey: "mode")

330359

auth.removeValue(forKey: "password")

331360

} else {

332361

auth["allowTailscale"] = false

333362

auth["mode"] = "password"

334-

auth["password"] = password

363+

auth["password"] = settings.password

335364

}

336365337366

if auth.isEmpty {

@@ -347,19 +376,140 @@ struct TailscaleIntegrationSection: View {

347376

root["gateway"] = gateway

348377

}

349378350-

do {

351-

try await ConfigStore.save(root, allowGatewayAuthMutation: true)

352-

return (true, nil)

353-

} catch {

354-

return (false, error.localizedDescription)

355-

}

379+

return root

356380

}

357381358382

private func restartGatewayIfNeeded() {

359383

guard self.connectionMode == .local, !self.isPaused else { return }

360384

Task { await GatewayLaunchAgentManager.kickstart() }

361385

}

362386387+

private func currentSettingsSnapshot() -> GatewayTailscaleSettingsSnapshot {

388+

GatewayTailscaleSettingsSnapshot(

389+

mode: self.tailscaleMode,

390+

requireCredentialsForServe: self.requireCredentialsForServe,

391+

password: self.password.trimmingCharacters(in: .whitespacesAndNewlines))

392+

}

393+394+

private static func loadedSettings(from root: [String: Any]) -> GatewayTailscaleLoadedSettings {

395+

let gateway = root["gateway"] as? [String: Any] ?? [:]

396+

let tailscale = gateway["tailscale"] as? [String: Any] ?? [:]

397+

let modeRaw = (tailscale["mode"] as? String) ?? "serve"

398+

let mode = GatewayTailscaleMode(rawValue: modeRaw) ?? .off

399+400+

let auth = gateway["auth"] as? [String: Any] ?? [:]

401+

let authModeRaw = auth["mode"] as? String

402+

let allowTailscale = auth["allowTailscale"] as? Bool

403+

let password = auth["password"] as? String ?? ""

404+

let requireCredentialsForServe: Bool

405+406+

if mode == .serve {

407+

let usesExplicitAuth = authModeRaw == "password"

408+

if let allowTailscale, allowTailscale == false {

409+

requireCredentialsForServe = true

410+

} else {

411+

requireCredentialsForServe = usesExplicitAuth

412+

}

413+

} else {

414+

requireCredentialsForServe = false

415+

}

416+417+

return GatewayTailscaleLoadedSettings(

418+

snapshot: GatewayTailscaleSettingsSnapshot(

419+

mode: mode,

420+

requireCredentialsForServe: requireCredentialsForServe,

421+

password: password),

422+

displayPassword: password)

423+

}

424+425+

private static func applySettingsIfChanged(

426+

currentSettings: GatewayTailscaleSettingsSnapshot,

427+

lastAppliedSettings: GatewayTailscaleSettingsSnapshot?,

428+

connectionMode: AppState.ConnectionMode,

429+

isPaused: Bool,

430+

saveSettings: GatewayTailscaleSettingsSaver) async -> GatewayTailscaleApplyResult

431+

{

432+

guard currentSettings != lastAppliedSettings else {

433+

return GatewayTailscaleApplyResult(

434+

didApply: false,

435+

success: true,

436+

errorMessage: nil,

437+

validationMessage: nil)

438+

}

439+440+

let requiresPassword = currentSettings.mode == .funnel

441+

|| (currentSettings.mode == .serve && currentSettings.requireCredentialsForServe)

442+

if requiresPassword, currentSettings.password.isEmpty {

443+

return GatewayTailscaleApplyResult(

444+

didApply: true,

445+

success: false,

446+

errorMessage: nil,

447+

validationMessage: "Password required for this mode.")

448+

}

449+450+

let (success, errorMessage) = await saveSettings(currentSettings, connectionMode, isPaused)

451+

return GatewayTailscaleApplyResult(

452+

didApply: true,

453+

success: success,

454+

errorMessage: errorMessage,

455+

validationMessage: nil)

456+

}

457+458+

private static func messages(

459+

for result: GatewayTailscaleApplyResult,

460+

connectionMode: AppState.ConnectionMode,

461+

isPaused: Bool) -> GatewayTailscaleApplyMessages

462+

{

463+

guard result.didApply else {

464+

return GatewayTailscaleApplyMessages(

465+

statusMessage: nil,

466+

validationMessage: nil,

467+

shouldRecordSuccess: false,

468+

shouldRestartGateway: false)

469+

}

470+471+

if let validationMessage = result.validationMessage {

472+

return GatewayTailscaleApplyMessages(

473+

statusMessage: nil,

474+

validationMessage: validationMessage,

475+

shouldRecordSuccess: false,

476+

shouldRestartGateway: false)

477+

}

478+479+

if !result.success, let errorMessage = result.errorMessage {

480+

return GatewayTailscaleApplyMessages(

481+

statusMessage: errorMessage,

482+

validationMessage: nil,

483+

shouldRecordSuccess: false,

484+

shouldRestartGateway: false)

485+

}

486+487+

let statusMessage = if connectionMode == .local, !isPaused {

488+

"Saved to ~/.openclaw/openclaw.json. Restarting gateway…"

489+

} else {

490+

"Saved to ~/.openclaw/openclaw.json. Restart the gateway to apply."

491+

}

492+

return GatewayTailscaleApplyMessages(

493+

statusMessage: statusMessage,

494+

validationMessage: nil,

495+

shouldRecordSuccess: true,

496+

shouldRestartGateway: true)

497+

}

498+499+

@MainActor

500+

private static func saveTailscaleSettings(

501+

settings: GatewayTailscaleSettingsSnapshot,

502+

connectionMode: AppState.ConnectionMode,

503+

isPaused: Bool) async -> (Bool, String?)

504+

{

505+

await self.buildAndSaveTailscaleConfig(

506+

tailscaleMode: settings.mode,

507+

requireCredentialsForServe: settings.requireCredentialsForServe,

508+

password: settings.password,

509+

connectionMode: connectionMode,

510+

isPaused: isPaused)

511+

}

512+363513

private func startStatusTimer() {

364514

self.stopStatusTimer()

365515

if ProcessInfo.processInfo.isRunningTests {

@@ -397,5 +547,51 @@ extension TailscaleIntegrationSection {

397547

mutating func setTestingService(_ service: TailscaleService?) {

398548

self.testingService = service

399549

}

550+551+

static func simulateHydrationApplyForTesting(

552+

root: [String: Any],

553+

connectionMode: AppState.ConnectionMode,

554+

isPaused: Bool,

555+

saveRoot: @MainActor @Sendable @escaping ([String: Any]) -> Void) async

556+

{

557+

let loaded = self.loadedSettings(from: root)

558+

_ = await self.applySettingsIfChanged(

559+

currentSettings: loaded.snapshot,

560+

lastAppliedSettings: loaded.snapshot,

561+

connectionMode: connectionMode,

562+

isPaused: isPaused,

563+

saveSettings: { settings, _, _ in

564+

let nextRoot = self.buildTailscaleConfigRoot(root: root, settings: settings)

565+

saveRoot(nextRoot)

566+

return (true, nil)

567+

})

568+

}

569+570+

static func messagesForTesting(

571+

didApply: Bool,

572+

success: Bool,

573+

errorMessage: String? = nil,

574+

validationMessage: String? = nil,

575+

connectionMode: AppState.ConnectionMode,

576+

isPaused: Bool) -> (

577+

statusMessage: String?,

578+

validationMessage: String?,

579+

shouldRecordSuccess: Bool,

580+

shouldRestartGateway: Bool)

581+

{

582+

let messages = self.messages(

583+

for: GatewayTailscaleApplyResult(

584+

didApply: didApply,

585+

success: success,

586+

errorMessage: errorMessage,

587+

validationMessage: validationMessage),

588+

connectionMode: connectionMode,

589+

isPaused: isPaused)

590+

return (

591+

statusMessage: messages.statusMessage,

592+

validationMessage: messages.validationMessage,

593+

shouldRecordSuccess: messages.shouldRecordSuccess,

594+

shouldRestartGateway: messages.shouldRestartGateway)

595+

}

400596

}

401597

#endif