From cc69cbd7e589ec4b065ce74d8c5e7714a040cfc5 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 26 Apr 2026 00:22:01 -0500 Subject: DomainDig v4.2.0: Add a local-only HTTP API layer for DomainDig Expose DomainDig as a programmable local domain intelligence engine over localhost with explicit user opt-in and token-based authentication. Highlights: - add a localhost-only API server with safe start/stop lifecycle - require a local token for every request and store it in Keychain - add read endpoints for portfolio, domains, history, events, and monitoring - add inspection endpoints that reuse the existing inspection engine - add monitoring enable/disable control endpoints - add structured JSON response envelopes with API versioning - add lightweight capped request logging with clear/reset support - add a Settings UI for Local API enablement, token management, status, and logs - start the server on launch only when enabled - include Local API secrets in local data reset cleanup This is the first programmability release for DomainDig and establishes the foundation for Shortcuts, scripts, and other local automation workflows. --- DomainDig/DomainDigApp.swift | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'DomainDig/DomainDigApp.swift') diff --git a/DomainDig/DomainDigApp.swift b/DomainDig/DomainDigApp.swift index 2071213..ff40caf 100644 --- a/DomainDig/DomainDigApp.swift +++ b/DomainDig/DomainDigApp.swift @@ -15,6 +15,7 @@ struct DomainDigApp: App { @State private var viewModel = DomainViewModel() @State private var purchaseService = PurchaseService.shared @State private var cloudSyncService = CloudSyncService.shared + @State private var localAPIService = LocalAPIService.shared init() { LocalNotificationService.shared.configureForegroundPresentation() @@ -28,11 +29,13 @@ struct DomainDigApp: App { .task { let _ = purchaseService.currentTier let _ = cloudSyncService.status + let _ = localAPIService.isRunning let _ = IntegrationService.shared.targets.count await purchaseService.refreshEntitlements() viewModel.refreshMonitoringState() await viewModel.refreshMonitoringAuthorizationStatus() await cloudSyncService.refreshAvailability() + localAPIService.refresh() cloudSyncService.scheduleSyncIfNeeded(trigger: .launch) viewModel.monitoringStatusMessage = DomainMonitoringScheduler.shared.syncSchedule() IntegrationService.shared.processQueueNow() @@ -50,6 +53,7 @@ struct DomainDigApp: App { await viewModel.refreshMonitoringAuthorizationStatus() await cloudSyncService.refreshAvailability() } + localAPIService.refresh() cloudSyncService.scheduleSyncIfNeeded(trigger: .launch) viewModel.monitoringStatusMessage = DomainMonitoringScheduler.shared.syncSchedule() IntegrationService.shared.processQueueNow() -- cgit v1.2.3