From 9b39c4aaad41b0eb750e2cb1ba6ee116ece7029c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 18:18:52 -0500 Subject: [PATCH] I5: names-only credentials doc; bump gitea role for separate passwords - docs/ci-cd/credentials.md: no Actions secrets exist yet, rules for adding them, which role variable serves which purpose, and how to give each its own value safely. - Bump the gitea role: gitea_mailer_password and gitea_postgresql_password, defaulting to the current value. Refs #47 Co-Authored-By: Claude Opus 5.5 --- docs/ci-cd/credentials.md | 77 +++++++++++++++++++++++++++++++++++++++ roles/ericomeehan.gitea | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 docs/ci-cd/credentials.md diff --git a/docs/ci-cd/credentials.md b/docs/ci-cd/credentials.md new file mode 100644 index 0000000..7f5b743 --- /dev/null +++ b/docs/ci-cd/credentials.md @@ -0,0 +1,77 @@ +# Credentials used by CI/CD and Gitea (I5) + +Names only. Values live in the Ansible vault and in Kubernetes Secrets, never +in this repo. Refs: #47. + +## Gitea Actions secrets + +None, as of 2026-11-12: no repository, organisation or user Actions secrets +are configured (confirmed by Eric on #47). + +Rules for adding one: + +- One purpose per secret, with the least access that purpose needs. +- Prefer repo-level over org-level, so a secret reaches only the workflows that + use it. +- No deployment credentials (SSH keys, vault password, kubeconfig) on the shared + runner. Deploys get their own path in D4 (#72). +- Record the name and purpose in the table below when it's created. + +| Secret | Scope | Purpose | Added | +|---|---|---|---| +| (none) | | | | + +`deployLibvirt.yaml` refers to `SSH_PRIVATE_KEY` and `VAULT_PASSWORD`. Neither +exists, and that workflow is being reworked in D7 (#75) to use the D4 path +instead. + +## Gitea's service credentials (role `ericomeehan.gitea`) + +Each purpose has its own variable. All default to `gitea_admin_password`, so a +role run with no new vault variables changes nothing. + +| Variable | Used for | +|---|---| +| `gitea_admin_password` | the `gitea_admin` account | +| `gitea_mailer_password` | `[mailer] PASSWD`, the `gitea` mailbox on the mail server | +| `gitea_postgresql_password` | the `gitea` database user | +| (runner token Secret) | runner registration, see `runner.md` | + +## Rotating a service credential + +Give it its own value one at a time, and check Gitea after each. + +### Mailer + +1. Set a new password for the `gitea` mailbox on the mail server. +2. Add `gitea_mailer_password` to the vault with the same value. +3. `ansible-playbook -i inventories/eom.dev.yml gitea.yaml` (not `--tags actions`: this is `app.ini`, so + Gitea restarts for about a minute). +4. Check: Site Administration → Configuration → send a test email. + +Rollback: remove the vault variable and rerun; the mailbox then needs the old +password back. + +### PostgreSQL + +The PostgreSQL chart sets the user's password only when the database is first +created, so changing the variable alone would lock Gitea out of its database. + +1. Take a backup first (D1, #69). +2. Change the password inside the database: + `kubectl -n gitea exec -it gitea-postgresql-0 -- psql -U gitea -d gitea -c '\password gitea'` + (`psql` may ask for the current password to connect, then `\password` asks + for the new one twice, so nothing lands in shell history). +3. Add `gitea_postgresql_password` to the vault with the new value. +4. `ansible-playbook -i inventories/eom.dev.yml gitea.yaml`. Gitea restarts with the new value. +5. Check: Gitea loads and you can sign in. + +Rollback: run step 2 again with the old password, remove the vault variable, +and rerun. + +### Admin account + +`gitea_admin_password` stays the admin account's password. The chart uses +`passwordMode: keepUpdated`, so changing it in the vault and rerunning the +role updates the account. Do this after the two above, so the old value no +longer has other uses. diff --git a/roles/ericomeehan.gitea b/roles/ericomeehan.gitea index a4a75d8..b5764c7 160000 --- a/roles/ericomeehan.gitea +++ b/roles/ericomeehan.gitea @@ -1 +1 @@ -Subproject commit a4a75d8c8c2aa0f914be9572b29ecfd54ed73eda +Subproject commit b5764c732a1ee3481f17fa51d7376d608de2bfb9