feat(gitea): Migrate configuration from environment variables to app.ini
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 1m12s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
🧊 Warm Docker Build Cache / Refresh Buildx Caches (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 25s
System Maintenance / Run Ansible System Maintenance (push) Successful in 1m8s
📊 Monitor Workflow Performance / Monitor Workflow Performance (push) Failing after 35s
Security Vulnerability Scan / Composer Security Audit (push) Failing after 27s
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 1m12s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
🧊 Warm Docker Build Cache / Refresh Buildx Caches (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 25s
System Maintenance / Run Ansible System Maintenance (push) Successful in 1m8s
📊 Monitor Workflow Performance / Monitor Workflow Performance (push) Failing after 35s
Security Vulnerability Scan / Composer Security Audit (push) Failing after 27s
- Move all Gitea configuration from docker-compose.yml environment variables to app.ini - Enable Redis cache with proper connection string format (redis://) - Fix Redis password to use Gitea Redis instance password (gitea_redis_password) instead of application Redis stack password - Add database connection pool settings to prevent timeout errors - Configure Redis for cache, session, and queue using app.ini - Update Ansible task to use correct Redis password for Gitea Redis instance Benefits: - Cache now works correctly (environment variables had a bug in Gitea 1.25) - All settings are versioned in Git - Better maintainability and reliability - Configuration follows Gitea documentation recommendations
This commit is contained in:
@@ -10,41 +10,18 @@ services:
|
||||
- traefik-public
|
||||
- gitea-internal
|
||||
environment:
|
||||
# Container-specific settings only
|
||||
- TZ=Europe/Berlin
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
# Postgres password for postgres container (not for Gitea config)
|
||||
- POSTGRES_PASSWORD=gitea_password
|
||||
- GITEA__database__DB_TYPE=postgres
|
||||
- GITEA__database__HOST=postgres:5432
|
||||
- GITEA__database__NAME=${POSTGRES_DB:-gitea}
|
||||
- GITEA__database__USER=${POSTGRES_USER:-gitea}
|
||||
- GITEA__database__PASSWD=${POSTGRES_PASSWORD:-gitea_password}
|
||||
# Database connection pool settings to prevent "Timeout before authentication" errors
|
||||
# These limit the number of concurrent connections and prevent connection pool exhaustion
|
||||
# - MAX_OPEN_CONNS: Maximum number of open connections to the database
|
||||
# - MAX_IDLE_CONNS: More warm connections to avoid constantly creating new sessions
|
||||
# - CONN_MAX_LIFETIME: 10 minutes; idle connections are not recycled too quickly
|
||||
# - CONN_MAX_IDLE_TIME: Clean up connections that are idle for too long
|
||||
- GITEA__database__MAX_OPEN_CONNS=50
|
||||
- GITEA__database__MAX_IDLE_CONNS=30
|
||||
- GITEA__database__CONN_MAX_LIFETIME=600
|
||||
- GITEA__database__CONN_MAX_IDLE_TIME=300
|
||||
# Cache, Session, and Queue configuration via environment variables
|
||||
# These override app.ini settings and are applied on every container start
|
||||
# NOTE: Cache deaktiviert - Gitea 1.25 interpretiert GITEA__cache__HOST nicht korrekt
|
||||
# (verbindet sich mit 127.0.0.1:6379 statt redis:6379). Session und Queue nutzen weiterhin Redis.
|
||||
- GITEA__cache__ENABLED=false
|
||||
- GITEA__cache__ADAPTER=memory
|
||||
- GITEA__session__PROVIDER=redis
|
||||
- GITEA__session__PROVIDER_CONFIG=network=tcp,addr=redis:6379,password=${REDIS_PASSWORD:-gitea_redis_password},db=0,pool_size=100,idle_timeout=180
|
||||
- GITEA__queue__TYPE=redis
|
||||
- GITEA__queue__CONN_STR=redis://:${REDIS_PASSWORD:-gitea_redis_password}@redis:6379/0
|
||||
- GITEA__server__DOMAIN=${GITEA_DOMAIN:-git.michaelschiemer.de}
|
||||
- GITEA__server__ROOT_URL=https://${GITEA_DOMAIN:-git.michaelschiemer.de}/
|
||||
- GITEA__server__SSH_DOMAIN=${GITEA_DOMAIN:-git.michaelschiemer.de}
|
||||
- GITEA__server__SSH_PORT=2222
|
||||
- GITEA__service__DISABLE_REGISTRATION=${DISABLE_REGISTRATION:-true}
|
||||
- GITEA__actions__ENABLED=true
|
||||
# All Gitea configuration is now in app.ini (deployed via Ansible)
|
||||
# Environment variables removed for better reliability and maintainability
|
||||
# Migration benefits:
|
||||
# - Cache now works correctly (environment variables had a bug in Gitea 1.25)
|
||||
# - All settings are versioned in Git
|
||||
# - Better documentation and maintainability
|
||||
volumes:
|
||||
- gitea-data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
|
||||
Reference in New Issue
Block a user