Skip to content

feat(sentinel): wire INTERNAL_BOOTSTRAP_SECRET + Discord login env#86

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/sentinel-s2s-auth-env
Jun 17, 2026
Merged

feat(sentinel): wire INTERNAL_BOOTSTRAP_SECRET + Discord login env#86
BK1031 merged 1 commit into
mainfrom
bk1031/sentinel-s2s-auth-env

Conversation

@BK1031

@BK1031 BK1031 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Catches the prod env-var config up to two recent Sentinel changes that the image-bump deploy workflow didn't carry across (it only handles image tags).

  1. `INTERNAL_BOOTSTRAP_SECRET` for s2s auth (Sentinel PR fix(clickhouse-ec2): disable text_log and lower log level in provisioning #79). Each non-core service exchanges this shared secret at startup for its pre-seeded bearer JWT, then carries the JWT on every outbound sentinel-client call. Wired to core, discord, oauth, saml.
  2. Discord OAuth client config (Sentinel PR foreman: swap to standalone image (v2.0.0) #76). The "Continue with Discord" login button shipped but the oauth deployment never got `DISCORD_CLIENT_ID` / `DISCORD_CLIENT_SECRET` / `DISCORD_REDIRECT_URI`. Adding now — same model as the other Discord secrets (read from `sentinel-secrets`).

Operator todo before rolling

Three new keys need to land in `sentinel-secrets`:

```bash

Pick a strong shared secret for s2s bootstrap

openssl rand -hex 32

→ use the same value across every service

kubectl -n sentinel edit secret sentinel-secrets

Add base64-encoded:

INTERNAL_BOOTSTRAP_SECRET

DISCORD_CLIENT_ID

DISCORD_CLIENT_SECRET

```

Also register `https://sentinel-v5.gauchoracing.com/auth/login/discord\` as an authorized redirect URI on the Discord application at discord.com/developers (if not already).

Failure mode if secrets aren't populated when this rolls

The new bootstrap call at non-core service startup fails closed — each service retries with linear backoff (~10s), then pod restarts (compose/k8s `restart: always`). You'll see CrashLoopBackOff on discord/oauth/saml until the secret is in place. No silent data corruption.

Test plan (post-deploy)

  • All four pods come up healthy
  • `kubectl -n sentinel logs deploy/core | grep 'bootstrap: issued'` shows three lines (one per non-core service)
  • `kubectl -n sentinel logs deploy/oauth | grep 'bootstrap'` shows no failures
  • Click "Continue with Discord" on https://sentinel-v5.gauchoracing.com/auth/login — should redirect to Discord and back successfully
  • An internal action that crosses a gate (e.g. a Discord role binding change) succeeds in the discord pod logs

Two related additions from recent Sentinel PRs:

1. INTERNAL_BOOTSTRAP_SECRET (PR #79: s2s auth)
   Each non-core service now exchanges this shared secret at startup
   for its pre-seeded bearer JWT, then uses the JWT on every outbound
   sentinel-client call. Wired to core/discord/oauth/saml from a new
   key on sentinel-secrets.

2. Discord OAuth client config (PR #76: Login with Discord)
   The "Continue with Discord" button was merged + deployed via image
   bumps, but the env vars to make it actually work were never added
   to the oauth deployment. Adds DISCORD_CLIENT_ID + DISCORD_CLIENT_SECRET
   from sentinel-secrets and a prod-URL DISCORD_REDIRECT_URI inline.

Operator todo before this rolls:

  Add three new keys to the sentinel-secrets Secret. Same value across
  every service for INTERNAL_BOOTSTRAP_SECRET — generate with
  `openssl rand -hex 32`. Discord client id/secret come from the
  registered application at discord.com/developers.

    kubectl -n sentinel edit secret sentinel-secrets

    # Add (base64-encoded values):
    #   INTERNAL_BOOTSTRAP_SECRET
    #   DISCORD_CLIENT_ID
    #   DISCORD_CLIENT_SECRET

  Then make sure the Discord application has
  https://sentinel-v5.gauchoracing.com/auth/login/discord registered
  as an authorized redirect URI.

  After the secret is populated, the auto-image-bump PR for the next
  Sentinel release will roll this into prod cleanly. If the secret
  isn't populated when this lands, the new bootstrap call from
  non-core services will fail closed (each retries with backoff, then
  the pod restarts) — no silent data corruption, just CrashLoopBackOff
  until the operator catches up.
@BK1031 BK1031 merged commit 5b85b6d into main Jun 17, 2026
@BK1031 BK1031 deleted the bk1031/sentinel-s2s-auth-env branch June 17, 2026 09:01
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