docs: self-hosted prod/test/dev Azure VM guide with key rotation, Azure Key Vault workflows, and rsync data migration pattern#4545
Conversation
This commit introduces a comprehensive guide on JWT signing key rotation for self-hosted SpacetimeDB environments. The document covers assumptions, operational risks, setup instructions, quickstart scaffolding, deployment modes, and recommended operational sequences to ensure smooth key rotation without disrupting service.
3e09feb to
ee6f681
Compare
|
Hi team - I just wrapped up getting this setup working on my first SpacetimeDB build. I am able to successfully add data to production, rsync to dev, and query and see that data on docker container restart. Pretty cool! Key rotation works too. I wanted to get some of these basic workflows before building a real app for users in our production environment. Thanks @cloutiertyler for showing interest on X; this is all very new tech (and awesome) and I am willing to "bleed" a bit to learn and adopt. Hopefully other people that prefer self-hosting will find this guide useful when pointing their AI at it to help them get going with their setups. Also we will try your paid service for sure! I just like to always know how to run stuff myself and have that option available. Thank you for the hard work you and the team did to make this possible. |
… completeness This commit enhances the self-hosted key rotation documentation for SpacetimeDB by refining operational instructions, clarifying deployment modes, and providing detailed command examples. Key changes include updated commands for key rotation, clearer explanations of deployment modes, and a streamlined process for generating compatible keys. These improvements aim to facilitate a smoother key rotation process for users.
bfops
left a comment
There was a problem hiding this comment.
Thank you for opening this PR & explaining everything so thoroughly!
Summary
This PR creates a comprehensive self-hosted JWT key rotation how-to for SpacetimeDB with reproducible defaults, identity-preserving rotation guidance, and host-scoped data migration runbooks. It is written for both operators and automation workflows, with explicit guardrails for production-like VM environments.
Key Changes
prod,test,dev, optionallocal) including backup prerequisites before rotation or sync../.generated/spacetimedb-keys/etc/spacetimedb/etc/spacetimedb/id_ecdsaand/etc/spacetimedb/id_ecdsa.pubspacetimedb-tooling.tsfor:--dry-run,--yes)--verify-only)--resign-token-only)--publisher-cli-toml-path,--private-key-path)prod -> test -> dev) with destination-side token re-signing semantics (run on destination host context, including SSH examples).rsync --deleteis destructiveInvalidSignatureand ownership mismatch errorsWhy This Matters
The most common failure mode in self-hosted fleets is identity drift: signatures validate, but
spacetime publishstill fails with403 Forbiddenbecause destination ownership no longer matches the publishing identity after key rotation or data movement.The updated how-to makes these operator requirements explicit:
rsyncin destination host contextFollowing this runbook prevents regressions where key material is correct but publish still fails due to stale signatures or owner mismatch state.
Why JWT Key Rotation Is Essential for Self-Hosters
In self-hosted deployments, operators are the signing authority. Rotation is both a security control and an operational correctness requirement.
Security value
Operational value
401/403failures in routine release workflowsScope
PUBLISH_SUCCESS,PUBLISH_FAILED)rsync+ destination re-sign + restart/redeploy + publish checks)