Skip to content

Log actual database config instead of sqlite path#176

Merged
andrew merged 1 commit into
mainfrom
fix-database-log-173
Jun 26, 2026
Merged

Log actual database config instead of sqlite path#176
andrew merged 1 commit into
mainfrom
fix-database-log-173

Conversation

@andrew

@andrew andrew commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The startup log and /stats endpoint always reported Database.Path, which defaults to ./cache/proxy.db even when PROXY_DATABASE_DRIVER=postgres and PROXY_DATABASE_URL are set and postgres is actually in use.

This adds DatabaseConfig.String() which returns the sqlite path for the sqlite driver, or the postgres connection URL with the password redacted (falling back to just postgres if the URL isn't in postgres:// form, to avoid leaking key=value DSN credentials). Both the startup log and /stats now use it.

The /stats JSON field is still named database_path to avoid breaking existing consumers.

Fixes #173

The startup log and /stats endpoint always reported Database.Path,
which is the sqlite default even when PROXY_DATABASE_DRIVER=postgres
is set and a postgres URL is in use. Add DatabaseConfig.String() that
returns the sqlite path or the postgres URL with the password redacted,
and use it in both places.

Fixes #173
@bclermont

Copy link
Copy Markdown
Contributor

plz merge!

@andrew andrew merged commit b2011c0 into main Jun 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database configuration do not reflect reality

2 participants