Skip to content

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