From 9e986bfde42eb1dad6a42c47e35697079f3bc43a Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Sun, 8 Nov 2026 12:07:30 +0100 Subject: [PATCH 1/2] Rauthy's first start may bootstrap a short-lived key for the clients Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L5fbDmSQSb6u27EiEuwzoM --- .gitea/workflows/deploy.yml | 7 +++++++ README.md | 1 + 2 files changed, 8 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4801a80..541393b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -72,6 +72,11 @@ jobs: RAUTHY_ENC_KEY: ${{ secrets.RAUTHY_ENC_KEY }} RAUTHY_SECRET_RAFT: ${{ secrets.RAUTHY_SECRET_RAFT }} RAUTHY_SECRET_API: ${{ secrets.RAUTHY_SECRET_API }} + # Optional, for Rauthy's very first start only: a short-lived key + # (base64 JSON, README.md "Rauthy") that makes the clients. Rauthy + # reads it into an empty database and never again. + RAUTHY_BOOTSTRAP_API_KEY: ${{ secrets.RAUTHY_BOOTSTRAP_API_KEY }} + RAUTHY_BOOTSTRAP_API_KEY_SECRET: ${{ secrets.RAUTHY_BOOTSTRAP_API_KEY_SECRET }} OIDC_ISSUER: ${{ vars.OIDC_ISSUER }} RAUTHY_API_KEY: ${{ secrets.RAUTHY_API_KEY }} RAUTHY_LANGUAGE: ${{ vars.RAUTHY_LANGUAGE }} @@ -157,6 +162,8 @@ jobs: BOOTSTRAP_ADMIN_EMAIL=$SEED_ADMIN_EMAIL RAUTHY_ADMIN_EMAIL=$SEED_ADMIN_EMAIL EVENT_EMAIL=$SEED_ADMIN_EMAIL + BOOTSTRAP_API_KEY=$RAUTHY_BOOTSTRAP_API_KEY + BOOTSTRAP_API_KEY_SECRET=$RAUTHY_BOOTSTRAP_API_KEY_SECRET EOF fi diff --git a/README.md b/README.md index 168db60..b6071fa 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ Run workflow**. Set them with `gt` (`gt variable set NAME --body ...`, | `RAUTHY_HOST` | variable | repo | optional, Rauthy (see [Rauthy](#rauthy)): `konto.tomtervel.no` | | `RAUTHY_ENC_KEY`, `RAUTHY_SECRET_RAFT`, `RAUTHY_SECRET_API` | secret | repo | optional, Rauthy's own: made once, never changed (the key encrypts its database) | | `OIDC_ISSUER` | variable | repo | optional: `https://konto.tomtervel.no/auth/v1/` moves the site's and the chat's sign-in to Rauthy; unset, Kanidm | +| `RAUTHY_BOOTSTRAP_API_KEY`, `RAUTHY_BOOTSTRAP_API_KEY_SECRET` | secret | repo | optional, Rauthy's first start only: a short-lived key (base64 of `{"name","exp","access"}`, secret 64+ alphanumerics) that makes the OIDC clients through the API; read into an empty database, ignored after | | `RAUTHY_API_KEY`, `RAUTHY_LANGUAGE` | secret, variable | repo | optional: portal makes accounts in Rauthy (`$`, made in Rauthy's admin), in `nb` | A variable is printed wherever a workflow echoes it, and this repo's run From 1ef375a21c9efec6af3e27e4c3b31b0745d15c5d Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Sun, 8 Nov 2026 12:07:53 +0100 Subject: [PATCH 2/2] Write the bootstrap key only when it is set Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L5fbDmSQSb6u27EiEuwzoM --- .gitea/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 541393b..2b7cf17 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -162,9 +162,11 @@ jobs: BOOTSTRAP_ADMIN_EMAIL=$SEED_ADMIN_EMAIL RAUTHY_ADMIN_EMAIL=$SEED_ADMIN_EMAIL EVENT_EMAIL=$SEED_ADMIN_EMAIL - BOOTSTRAP_API_KEY=$RAUTHY_BOOTSTRAP_API_KEY - BOOTSTRAP_API_KEY_SECRET=$RAUTHY_BOOTSTRAP_API_KEY_SECRET EOF + if [ -n "$RAUTHY_BOOTSTRAP_API_KEY" ]; then + printf 'BOOTSTRAP_API_KEY=%s\nBOOTSTRAP_API_KEY_SECRET=%s\n' \ + "$RAUTHY_BOOTSTRAP_API_KEY" "$RAUTHY_BOOTSTRAP_API_KEY_SECRET" >> "$STAGE/rauthy.env" + fi fi - name: Pull and bring the stack up