Update serve.go

Support multiple postgres connection URL formats
This commit is contained in:
BradStaton
2026-03-15 16:22:22 -04:00
committed by GitHub
parent 888850d8bc
commit ce24594c32

View File

@@ -284,8 +284,8 @@ func execServe(c *cli.Context) error {
}
// Check values
if databaseURL != "" && !strings.HasPrefix(databaseURL, "postgres://") {
return errors.New("if database-url is set, it must start with postgres://")
if databaseURL != "" && (!strings.HasPrefix(databaseURL, "postgres://") || !strings.HasPrefix(databaseURL, "postgresql://") {
return errors.New("if database-url is set, it must start with postgres:// or postgresql://")
} else if databaseURL != "" && (authFile != "" || cacheFile != "" || webPushFile != "") {
return errors.New("if database-url is set, auth-file, cache-file, and web-push-file must not be set")
} else if len(databaseReplicaURLs) > 0 && databaseURL == "" {