Skip to content

feat: configurable vault location via --vault-dir flag and BDSTORAGE_VAULT env var#61

Merged
Rakshat28 merged 3 commits into
Rakshat28:mainfrom
diksha78dev:fix/issue-45
May 19, 2026
Merged

feat: configurable vault location via --vault-dir flag and BDSTORAGE_VAULT env var#61
Rakshat28 merged 3 commits into
Rakshat28:mainfrom
diksha78dev:fix/issue-45

Conversation

@diksha78dev

Copy link
Copy Markdown
Contributor

Closes #45

Problem

The vault and state DB were hardcoded to $HOME/.imprint/, making it
impossible to use a separate drive, run multiple vaults, or use bdstorage
in CI where $HOME is ephemeral.

Solution

  • Added --vault-dir <PATH> global CLI flag (parsed before subcommand dispatch)
  • Added BDSTORAGE_VAULT env var as fallback (handled via clap's env attribute)
  • $HOME/.imprint/ remains the default when neither override is set
  • Threaded the resolved vault dir through vault.rs and state.rs as a &Path parameter
  • Updated the Data Locations & Storage section of README.md
  • Added integration tests for both the CLI flag and env var

Priority Order

--vault-dir flag → BDSTORAGE_VAULT env var → $HOME/.imprint/ (default)

@Rakshat28

Copy link
Copy Markdown
Owner

@diksha78dev resolve merge conflicts and ensure your PR passes the CI checks. (Please see the project’s contribution guidelines before submitting a PR.)

@diksha78dev

Copy link
Copy Markdown
Contributor Author

@Rakshat28 I have resolved merge conflicts
Kindly review my pr and let me know if there any changes required.
Thanks.

@Rakshat28

Copy link
Copy Markdown
Owner

Please fix the failing CI tests @diksha78dev

@Rakshat28

Copy link
Copy Markdown
Owner

still failing CI tests, please read contribution guidelines of the project before submitting PR

@Rakshat28

Copy link
Copy Markdown
Owner

Hey @diksha78dev, thanks for the PR!

Before we merge this, can you please record a short video showing the new --vault-dir flag and the BDSTORAGE_VAULT env var working as expected and upload it? Just a quick run-through of the order of priority will do.

Please add it and let me know when you do so I can review and merge.

@diksha78dev

Copy link
Copy Markdown
Contributor Author

@Rakshat28 Here is the requested video demonstrating the --vault-dir flag and BDSTORAGE_VAULT environment variable priority order. Let me know if everything looks good to merge

Screen.Recording.2026-05-18.162140.mp4

@Rakshat28 Rakshat28 merged commit aeed332 into Rakshat28:main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: configurable vault location via --vault-dir flag and BDSTORAGE_VAULT env var

2 participants