# Configuration
# @see https://docs.gitea.com/next/administration/config-cheat-sheet#repository-repository

USER_UID=1000
USER_GID=1000
DB_TYPE=mysql
DB_HOST={{database_host}}:{{database_port}}
DB_NAME={{database_name}}
DB_USER={{database_username}}
DB_PASSWD={{database_password}}
SSH_PORT={{ports.public.ssh[application_id]}}
SSH_LISTEN_PORT=22
DOMAIN={{domains[application_id]}}
SSH_DOMAIN={{domains[application_id]}}
RUN_MODE="{{run_mode}}"
ROOT_URL="{{ web_protocol }}://{{domains[application_id]}}/"

# Mail Configuration 
# @see https://docs.gitea.com/next/installation/install-with-docker#managing-deployments-with-environment-variables
# @todo test
GITEA__mailer__ENABLED=true
GITEA__mailer__FROM={{ users['no-reply'].email }}
GITEA__mailer__PROTOCOL=smtps
GITEA__mailer__SMTP_ADDR={{ system_email.host }}
GITEA__mailer__SMTP_PORT={{ system_email.port }}
GITEA__mailer__USER={{ users['no-reply'].email }}
GITEA__mailer__PASSWD={{ users['no-reply'].mailu_token }}

# Allow push creation
# @see https://github.com/go-gitea/gitea/issues/17619
GITEA__REPOSITORY__ENABLE_PUSH_CREATE_USER={{ applications[application_id].configuration.repository.enable_push_create_user | lower }}
GITEA__REPOSITORY__DEFAULT_PRIVATE={{ applications[application_id].configuration.repository.default_private | lower }}
GITEA__REPOSITORY__DEFAULT_PUSH_CREATE_PRIVATE={{ applications[application_id].configuration.repository.default_push_create_private | lower }}