;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Gitea Configuration File ;; Generated by Ansible - DO NOT EDIT MANUALLY ;; ;; All Gitea configuration is now managed via app.ini instead of ;; environment variables for better reliability and maintainability. ;; ;; Migration from environment variables to app.ini: ;; - Cache now works correctly (environment variables had a bug in Gitea 1.25) ;; - All settings are versioned in Git ;; - Better documentation and maintainability ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; APP_NAME = Gitea: Git with a cup of tea RUN_MODE = prod ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Server Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [server] PROTOCOL = http DOMAIN = {{ gitea_domain }} HTTP_ADDR = 0.0.0.0 HTTP_PORT = 3000 ROOT_URL = https://{{ gitea_domain }}/ DISABLE_SSH = false START_SSH_SERVER = false SSH_DOMAIN = {{ gitea_domain }} SSH_PORT = {{ ssh_port | default(2222) }} SSH_LISTEN_PORT = {{ ssh_listen_port | default(2222) }} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Database Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [database] DB_TYPE = postgres HOST = postgres:5432 NAME = {{ postgres_db | default('gitea') }} USER = {{ postgres_user | default('gitea') }} PASSWD = {{ postgres_password | default('gitea_password') }} SSL_MODE = disable # 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 MAX_OPEN_CONNS = 50 MAX_IDLE_CONNS = 30 CONN_MAX_LIFETIME = 600 CONN_MAX_IDLE_TIME = 300 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Cache Configuration (Redis) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [cache] ENABLED = true ADAPTER = redis # HOST must be a Redis connection string (as per Gitea documentation) # Format: redis://:password@host:port/db?pool_size=100&idle_timeout=180s # Using same format as queue CONN_STR for consistency HOST = redis://:{{ redis_password }}@redis:6379/0?pool_size=100&idle_timeout=180s # Cache configuration now works correctly in app.ini # (Environment variables had a bug in Gitea 1.25 that connected to 127.0.0.1:6379 instead of redis:6379) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Session Configuration (Redis) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [session] PROVIDER = redis PROVIDER_CONFIG = network=tcp,addr=redis:6379,password={{ redis_password }},db=0,pool_size=100,idle_timeout=180 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Queue Configuration (Redis) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [queue] TYPE = redis CONN_STR = redis://:{{ redis_password }}@redis:6379/0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Security Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [security] INSTALL_LOCK = true ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Service Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [service] DISABLE_REGISTRATION = {{ disable_registration | default(true) | lower }} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Actions Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [actions] ENABLED = true