From d24b6c3bac52915216caf418e5632468c4812cec Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 27 Nov 2026 13:19:18 -0700 Subject: [PATCH] gitea: trust only Caddy as proxy, argon2 hashes, private emails by default, no password Basic auth Co-Authored-By: Claude Opus 5.5 --- roles/docker/templates/gitea-compose.yml.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/docker/templates/gitea-compose.yml.j2 b/roles/docker/templates/gitea-compose.yml.j2 index 6c59838..acde1f9 100644 --- a/roles/docker/templates/gitea-compose.yml.j2 +++ b/roles/docker/templates/gitea-compose.yml.j2 @@ -20,6 +20,15 @@ services: - GITEA__openid__ENABLE_OPENID_SIGNUP=false # v28 deletes Actions runs older than 400 days by default; keep them all - GITEA__actions__RUN_RETENTION_DAYS=0 + # Only Caddy may set X-Forwarded-For (was "*") + - GITEA__security__REVERSE_PROXY_TRUSTED_PROXIES={{ docker.hairpin_ip }}/32 + # Rehashed to argon2 at each user's next password login + - GITEA__security__PASSWORD_HASH_ALGO=argon2 + # New accounts hide their email address + - GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE=true + # No HTTP Basic auth with account passwords. Tokens (PATs, OAuth, + # Actions job tokens) sent via Basic auth still work. + - GITEA__service__ENABLE_BASIC_AUTHENTICATION=false restart: unless-stopped labels: mag37.dockcheck.update: true