Make gitea OAuth2 JWT_SECRET a valid, stable 43-char key

GITEA__OAUTH2__JWT_SECRET must base64url-decode to 32 bytes. The size-32
claim decoded to 24 bytes, so 1.27 rejected it and generated its own key
on each boot; since app.ini lives on an emptyDir that regenerated every
restart and logged out all OAuth2 clients. size 43 decodes to 32 bytes,
so the rotated key is accepted and stays stable across restarts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Erki Aas
2026-09-15 22:38:10 +03:00
co-authored by Claude Opus 4.8
parent 18034b7cd9
commit e17b0e0b41
+6 -1
View File
@@ -49,12 +49,17 @@ spec:
- key: GITEA__SECURITY__INTERNAL_TOKEN - key: GITEA__SECURITY__INTERNAL_TOKEN
value: "%(plaintext)s" value: "%(plaintext)s"
--- ---
# size 43: GITEA__OAUTH2__JWT_SECRET must base64url-decode to exactly 32 bytes.
# A 43-char value decodes to 32 bytes; a 32-char one decodes to 24 and Gitea
# rejects it and generates its own key each boot, which (app.ini is on an
# emptyDir) changes on every restart and logs out all OAuth2 clients. 43 keeps
# the rotated key valid and stable.
apiVersion: codemowers.cloud/v1beta1 apiVersion: codemowers.cloud/v1beta1
kind: SecretClaim kind: SecretClaim
metadata: metadata:
name: gitea-oauth2-jwt name: gitea-oauth2-jwt
spec: spec:
size: 32 size: 43
mapping: mapping:
- key: GITEA__OAUTH2__JWT_SECRET - key: GITEA__OAUTH2__JWT_SECRET
value: "%(plaintext)s" value: "%(plaintext)s"