Explain the SSL failure instead of just reporting it

A Postgres URL without an sslmode made lib/pq ask for TLS and die with
"SSL is not enabled on the server", which reads like a server fault when
it is really a connection-string default. The error now says what to
append, and the server retries briefly so a deploy is not marked
unhealthy just because Postgres was still starting.

The sync server URL also defaults to the hosted instance now, so a fresh
install needs no setup.
This commit is contained in:
2026-10-08 10:38:54 +08:00
parent c0dd211ee5
commit 1bd346ce20
5 changed files with 76 additions and 14 deletions
+4 -1
View File
@@ -39,6 +39,9 @@ final class SyncService: ObservableObject {
private static let urlKey = "sync.serverURL"
private static let versionKey = "sync.version"
/// Where sync points unless the user overrides it in the sync panel.
static let defaultServerURL = "https://prompt.tzgyn.dev"
private var lastVersion: Int64 {
get { Int64(defaults.integer(forKey: Self.versionKey)) }
set { defaults.set(newValue, forKey: Self.versionKey) }
@@ -54,7 +57,7 @@ final class SyncService: ObservableObject {
private init() {
code = defaults.string(forKey: Self.codeKey)
serverURL = defaults.string(forKey: Self.urlKey) ?? "http://localhost:8080"
serverURL = defaults.string(forKey: Self.urlKey) ?? Self.defaultServerURL
}
func start() {