Skip to content

Migrate Kamal secrets from 1Password to Bitwarden (consumer)#34

Merged
fleveque merged 3 commits into
mainfrom
chore/bws-migration
May 24, 2026
Merged

Migrate Kamal secrets from 1Password to Bitwarden (consumer)#34
fleveque merged 3 commits into
mainfrom
chore/bws-migration

Conversation

@fleveque

@fleveque fleveque commented May 24, 2026

Copy link
Copy Markdown
Owner

Third of three coordinated PRs migrating deploy secrets from 1Password to consumer Bitwarden Password Manager (free tier). Sister PRs:

Earlier revision targeted Bitwarden Secrets Manager (BWS), but BWS Free caps at 3 projects per org — too tight as more services land. Switched to consumer Bitwarden (no item cap).

Three commits

  1. Snapshot current 1P-driven .kamal/secrets + .kamal/secrets.beta as .1password.example — verbatim, no behaviour change.
  2. Switch the active secrets files to the bitwarden adapter. Prod fetches from a Bitwarden item quantic-prod (custom fields); beta from quantic-beta.
  3. Workflow + docs: deploy workflow installs the bw CLI via npm on each run; env block swapped from OP_* to BW_*; env.sample and README updated.

Before merging — operator prereqs

See dividend-portfolio#168 for the full setup (same Bitwarden vault covers all three services). Pulse-specific keys: SECRET_KEY_BASE (both envs), LOGO_SERVICE_API_KEY (prod only).

Test plan

  • Locally: bundle exec kamal secrets fetch --adapter bitwarden --from quantic-prod KAMAL_REGISTRY_PASSWORD returns the value
  • Merge main → auto-deploy to prod runs green; verify by hitting any session-cookie-protected route (uses SECRET_KEY_BASE)
  • Push to beta → auto-deploy to beta runs green

Rollback

cp .kamal/secrets.1password.example .kamal/secrets
cp .kamal/secrets.beta.1password.example .kamal/secrets.beta
# Then revert the workflow change manually.

1P vault was never touched.

🤖 Generated with Claude Code

fleveque and others added 2 commits May 24, 2026 10:51
Preserve the working 1Password setup so future-you can swap back with a
single cp. The two new files are verbatim copies of .kamal/secrets and
.kamal/secrets.beta as of the last 1P-driven deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same set of secret keys; only the storage backend changes. Prod fetches
from a Bitwarden item `quantic-prod`; beta from `quantic-beta`. Each
item holds the relevant secrets as custom fields.

Why consumer Bitwarden over Bitwarden Secrets Manager (BWS): BWS Free
caps at 3 projects per org, which would bite us as more services land.
Consumer has no item cap on the free tier.

LOGO_SERVICE_API_KEY stays prod-only (matching the prior 1P setup —
beta-pulse doesn't call logo-service).

This commit alone breaks deploy until the workflow change in the next
commit, so don't deploy from this state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fleveque fleveque force-pushed the chore/bws-migration branch from d8b867d to f152501 Compare May 24, 2026 20:06
@fleveque fleveque changed the title Migrate Kamal secrets from 1Password to Bitwarden Secrets Manager Migrate Kamal secrets from 1Password to Bitwarden (consumer) May 24, 2026
@fleveque fleveque force-pushed the chore/bws-migration branch from f152501 to 2161863 Compare May 24, 2026 20:28
Replaces the 1Password CLI install step with `npm install -g @bitwarden/cli`,
and the `OP_*` env block with `BW_CLIENTID` + `BW_CLIENTSECRET` +
`BW_PASSWORD` pulled from repo-level GitHub Actions secrets.

env.sample and README updated to reflect the new bootstrap flow.
README also documents how to roll back to 1Password using the
preserved `.kamal/secrets.*.1password.example` snapshots.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fleveque fleveque force-pushed the chore/bws-migration branch from 2161863 to 3af106d Compare May 24, 2026 20:51
@fleveque fleveque merged commit 7b75015 into main May 24, 2026
1 check passed
@fleveque fleveque deleted the chore/bws-migration branch May 24, 2026 21:28
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.

1 participant