Skip to content

feat: Add support for DB_PASS_FILE #451

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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

luizguilhermesj
Copy link

Fixes #422

I'm not used to go, so I asked https://jules.google/ to follow the issue instructions given by @deitch


This commit introduces support for reading the database password from a file specified by the DB_PASS_FILE environment variable or the --pass-file CLI flag.

  • Added --pass-file flag and DB_PASS_FILE environment variable.
  • Updated logic in cmd/root.go to read the password from the specified file.
  • Ensured that an explicitly set password via DB_PASS or --pass takes precedence.
  • Updated documentation in docs/configuration.md.
  • Added tests in cmd/dump_test.go to cover the new functionality and precedence logic.

This commit introduces support for reading the database password from a file specified by the `DB_PASS_FILE` environment variable or the `--pass-file` CLI flag.

- Added `--pass-file` flag and `DB_PASS_FILE` environment variable.
- Updated logic in `cmd/root.go` to read the password from the specified file.
- Ensured that an explicitly set password via `DB_PASS` or `--pass` takes precedence.
- Updated documentation in `docs/configuration.md`.
- Added tests in `cmd/dump_test.go` to cover the new functionality and precedence logic.
Copy link
Collaborator

@deitch deitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rather nice. Thank you for contributing it.

@deitch
Copy link
Collaborator

deitch commented Jul 2, 2025

And particularly, thank you for adding the tests and the correct documentation.

@deitch deitch merged commit 777a1b0 into databacker:master Jul 3, 2025
3 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.

Add support for DB_PASS_FILE to enable Docker Swarm secrets
2 participants