feat: add native HashiCorp Vault integration for secrets management#491
Open
d0dg3r wants to merge 4 commits intoFinsys:mainfrom
Open
feat: add native HashiCorp Vault integration for secrets management#491d0dg3r wants to merge 4 commits intoFinsys:mainfrom
d0dg3r wants to merge 4 commits intoFinsys:mainfrom
Conversation
- Add Vault client with Token, AppRole, and Kubernetes authentication - Add .secrets.yaml parser for stack-level secret mappings - Add automatic secret sync from Vault to encrypted stack environment variables - Add triggerRedeploy option for automatic redeployment on secret changes - Add granular sync modes (Git-only, Vault-only, All) - Add Vault settings UI with connection testing - Add comprehensive documentation and tutorial - Support self-signed TLS certificates BREAKING CHANGES: None (Vault integration is optional) Co-authored-by: Cursor <cursoragent@cursor.com>
Author
- Update API calls to include Vault configuration retrieval - Introduce vaultEnabled state to manage UI based on Vault status - Modify sync button logic to conditionally display options for Git, Vault, or both based on Vault integration status - Ensure single sync button is shown when Vault is not active This update improves user experience by providing relevant sync options based on the availability of Vault.
feat: enhance Vault integration with dynamic sync buttons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Summary
This PR adds native HashiCorp Vault integration to Dockhand, enabling stacks to fetch secrets directly from Vault and inject them as environment variables during deployment.
Motivation
Note: This is more of a Proof of Concept than a polished PR. I found it easier to demonstrate the feature through working code rather than just describing it in words.
Users using HashiCorp Vault as their secrets management solution currently have no way to integrate it directly with Dockhand. This creates friction and potential security gaps when managing Docker stacks. This feature bridges that gap while maintaining Dockhand's simplicity and security focus.
I'm open to feedback on the approach and happy to refine the implementation based on your guidance.
Changes
New Files:
src/lib/server/vault.ts- Vault client with Token/AppRole/Kubernetes authsrc/lib/server/vault-sync.ts- Secret synchronization logicsrc/lib/server/secrets-file.ts-.secrets.yamlparsersrc/routes/api/vault/*- API endpoints for Vault configurationsrc/routes/settings/vault/VaultTab.svelte- Settings UI componentdocs/VAULT_INTEGRATION.md- Architecture documentationdocs/VAULT_TUTORIAL.md- Step-by-step setup guidedocs/examples/vault-test/- Example stack filesDatabase Migrations:
drizzle/0004_add_vault_config.sql/drizzle-pg/0004_add_vault_config.sqldrizzle/0005_add_vault_tls_skip.sql/drizzle-pg/0005_add_vault_tls_skip.sqlModified Files:
vaultConfigtablesrc/lib/server/git.ts- Vault sync integration in Git stack flowsrc/routes/stacks/+page.svelte- Added Git/Vault/All sync buttonssrc/lib/config/grid-columns.ts- Wider actions column for new buttonsFeatures
.secrets.yamltriggerRedeployflag for automatic redeployment on secret changeHow to Test
docker run -d --name vault-dev -p 8200:8200 \ -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' \ hashicorp/vault:latestConfigure in Dockhand: Settings > Vault > Enter URL and Token > Test Connection
Create Git stack with
.secrets.yaml:Full tutorial available in
docs/VAULT_TUTORIAL.mdDependencies
No new runtime dependencies (uses native
fetchfor Vault API)Breaking Changes
None. Vault integration is fully optional and disabled by default.
Closes #(issue or discussion)
Type of change