import Foundation enum AppSettings { private static let baseURLKey = "gitea.baseURL" private static let tokenKey = "gitea.token" static var baseURL: String { get { Keychain.read(baseURLKey) ?? "https://gitea.treytartt.com" } set { Keychain.write(baseURLKey, value: newValue) } } static var token: String { get { Keychain.read(tokenKey) ?? "" } set { Keychain.write(tokenKey, value: newValue) } } static var isConfigured: Bool { !token.isEmpty && URL(string: baseURL) != nil } /// Process-local cache store. Keychain handles cross-process sharing; /// the cached repo list lives in each process's standard defaults. static var localDefaults: UserDefaults { .standard } }