Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide credentials when logging database connection issue #4453

Closed
4 tasks done
lazynooblet opened this issue Feb 15, 2024 · 0 comments
Closed
4 tasks done

Hide credentials when logging database connection issue #4453

lazynooblet opened this issue Feb 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lazynooblet
Copy link

Requirements

  • Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

During startup of the lemmy containers, if postgres isn't ready to accept connections yet lemmy will log the failed attempt and include username/password in that log.

Log files may have less stringent permissions, whilst the postgres password itself is part of a docker secret.

Example:
Error connecting to postgres://lemmy:PASSWORDHERE@lemmy-postgres:5432/lemmy: connection to server at "lemmy-postgres" (172.21.2.3), port 5432 failed: FATAL: the database system is not yet accepting connections

Describe the solution you'd like.

Replace the password with a single "x", or some other suitable subtitute.
If required, an additional environment label could be used to re-enable credentials in logs, although I wouldn't recommend it.

Describe alternatives you've considered.

.

Additional context

No response

@lazynooblet lazynooblet added the enhancement New feature or request label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant