Skip to content

feat: SSH key rotation guide + .env.app preflight check#18

Merged
heznpc merged 1 commit intomainfrom
feat/ssh-rotation-and-env-preflight
Apr 23, 2026
Merged

feat: SSH key rotation guide + .env.app preflight check#18
heznpc merged 1 commit intomainfrom
feat/ssh-rotation-and-env-preflight

Conversation

@heznpc
Copy link
Copy Markdown
Member

@heznpc heznpc commented Apr 23, 2026

Summary

Two small polish items deferred from the last review pass.

  • SSH key rotation guide (docs/VPS_DEPLOY.md): new section covering quarterly rotation cadence, zero-downtime two-key window, GitHub Secret update, and the recovery path via VPS provider console if you lock yourself out.
  • .env.app preflight (cd.yml): a new SSH step that runs before docker compose up -d --wait. It fails the workflow with a clear doc pointer if ~/.env.app is missing or unreadable, and warns (does not fail) when the file is world-readable.
  • Section 5 update: now explicitly documents that ~/.env.app must pre-exist and that chmod 600 is the recommended permission.

The preflight lives in cd.yml rather than scripts/deploy-with-rollback.sh because the shared script is also used by the CI rollback integration test (which runs without an env file on the runner) — keeping env-file assumptions in the production-only workflow preserves that symmetry.

Test plan

  • CI rollback integration test still passes (unchanged script, env check lives outside).
  • YAML lint / workflow syntax passes.
  • Docs render correctly on GitHub.

- docs: new SSH Key Rotation section in VPS_DEPLOY.md (quarterly cadence, zero-downtime two-key window, recovery via provider console)
- cd.yml: preflight SSH step that fails with a pointer to docs if ~/.env.app is missing or unreadable, warns on world-readable perms (octal-aware bitmask)
- docs: section 5 now states ~/.env.app must pre-exist and documents the 600 permission expectation
@heznpc heznpc merged commit b21c397 into main Apr 23, 2026
4 checks passed
@heznpc heznpc deleted the feat/ssh-rotation-and-env-preflight branch April 23, 2026 19:02
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