fix(gitea): use /data volume path for the non-rootless image

The 1.22 (non-rootless) image expects everything under /data
(/data/gitea/conf/app.ini, /data/git/repositories, etc.). I'd
configured the rootless paths (/var/lib/gitea + /etc/gitea), so
the app.ini that gitea writes on first boot landed in the
container's ephemeral fs instead of the host volume. Result:
'docker exec gitea gitea admin user create' could not find the
config and bailed with 'Unable to load config file for a installed
Gitea instance'.

Also set GITEA__security__INSTALL_LOCK=true so the first boot
bypasses the /install web wizard since every required field is
already provided via GITEA__* env vars.

Migration for an existing broken install:
  make down-gitea
  sudo rm -rf infra/gitea/gitea/data infra/gitea/gitea/config
  make up-gitea
This commit is contained in:
Claude 2026-06-09 00:54:48 +00:00
parent 5a19753013
commit 862dc370f7
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View File

@ -32,7 +32,6 @@ infra/main/pgadmin/data/
infra/main/caddy/data/
infra/main/caddy/config/
infra/gitea/gitea/data/
infra/gitea/gitea/config/
infra/gitea/runner/data/
infra/wedding_photo/backups/

View File

@ -30,6 +30,8 @@ services:
# Service
GITEA__service__DISABLE_REGISTRATION: ${GITEA_DISABLE_REGISTRATION:-true}
GITEA__service__REQUIRE_SIGNIN_VIEW: ${GITEA_REQUIRE_SIGNIN:-false}
# Pula a tela /install no primeiro boot (toda config vem via env).
GITEA__security__INSTALL_LOCK: "true"
# Actions
GITEA__actions__ENABLED: "true"
GITEA__actions__DEFAULT_ACTIONS_URL: github
@ -37,8 +39,7 @@ services:
# SSH pra git push/pull. UI passa pelo Caddy (porta 443).
- "${GITEA_SSH_PORT:-2222}:22"
volumes:
- ./gitea/data:/var/lib/gitea
- ./gitea/config:/etc/gitea
- ./gitea/data:/data
networks:
- infra-net