mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-11 10:23:17 +08:00
logFlagValues writes every flag to the log when the server starts, and that included --postgres-connection-string verbatim. The bundled database and Cloud SQL IAM auth use passwordless strings, but an external database DSN can carry a password, and it was written to the log on every restart. Log the parsed, non-secret parts instead: host, port, database, user, whether a password is set and whether TLS is on. pgconn.ParseConfig handles both the URI and the libpq key=value forms, so no string rewriting is needed and nothing is echoed. A string that does not parse is logged as "<unparseable>"; connectStore still reports the real error. Fixes #1832 > It's a good idea to open an issue first for discussion. - [x] Tests pass - [x] Appropriate changes to documentation are included in the PR