Files
cloud-gitea/templates/opt/gitea/home/app.ini.j2
T
lhahnandClaude Opus 5.5 eefd5c93aa Keep app.ini stable across Gitea restarts
Gitea writes WORK_PATH and a generated [oauth2] JWT_SECRET back into app.ini on start, so every Ansible run rewrote the file and restarted Gitea. Template WORK_PATH and, when gitea_oauth2_jwt_secret is set, the oauth2 JWT secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:23:00 +02:00

93 lines
2.9 KiB
Django/Jinja
Executable File

APP_NAME = gitea@{{ gitea_ssh_domain }}
RUN_USER = {{ gitea_usr }}
RUN_MODE = {{ cloud_stage }}
# set explicitly, otherwise Gitea writes it back and reformats this file on every start
WORK_PATH = {{ gitea_data_location }}
[database]
DB_TYPE = {{ gitea_dbtype_mapping[gitea_db.type] | default('mysql') }}
HOST = {{ gitea_db.host | default('localhost') }}:{{ gitea_db.port | default(5432) }}
NAME = {{ gitea_db.name }}
USER = {{ gitea_db.user }}
PASSWD = """{{ gitea_db.pass }}"""
SCHEMA =
SSL_MODE = disable
CHARSET = utf8mb4
PATH = {{ gitea_data_location }}/data/gitea.db
LOG_SQL = false
[repository]
ROOT = {{ gitea_data_location }}/data/gitea-repositories
[server]
SSH_DOMAIN = {{ gitea_ssh_domain }}
DOMAIN = {{ gitea_domain }}
{% if gitea_http_addr is defined %}
HTTP_ADDR = {{ gitea_http_addr }}
{% endif %}
HTTP_PORT ={{ gitea_port | default(3000) }}
ROOT_URL = {{ gitea_domain_protocol }}://{{ gitea_ssh_domain }}/
DISABLE_SSH = {{ gitea_ssh | default('false') }}
SSH_PORT = {{ gitea_ssh_show_port | default(22) }}
SSH_LISTEN_PORT = {{ gitea_ssh_listen_port | default(ssh_port | default(22)) }}
START_SSH_SERVER = {{ gitea_ssh_builtin | default(false) | bool | lower }}
LFS_START_SERVER = {{ gitea_lfs | default('true') }}
LFS_JWT_SECRET = """{{ gitea_jwt_secret }}"""
OFFLINE_MODE = {{ gitea_is_offline | default('false') }}
LANDING_PAGE = {{ gitea_landing_page | default('explore') }}
[lfs]
PATH = {{ gitea_data_location }}/data/lfs
[mailer]
ENABLED = {{ gitea_mail }}
FROM = {{ gitea_mail_from }}
PROTOCOL = {{ gitea_mail_type }}
SMTP_ADDR = {{ gitea_mail_domain }}
SMTP_PORT = {{ gitea_mail_port }}
USER = {{ gitea_mail_user }}
PASSWD = """{{ gitea_mail_pass }}"""
[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = true
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.{{ gitea_ssh_domain }}
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
{% if gitea_oauth2_jwt_secret is defined %}
[oauth2]
JWT_SECRET = {{ gitea_oauth2_jwt_secret }}
{% endif %}
[oauth2_client]
ENABLE_AUTO_REGISTRATION = true
UPDATE_AVATAR = true
ACCOUNT_LINKING = auto
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = info
ROOT_PATH = {{ gitea_data_location }}/log
logger.router.MODE = file
[security]
INSTALL_LOCK = true
INTERNAL_TOKEN = """{{ gitea_internal_token }}"""
SECRET_KEY = """{{ gitea_secret_key }}"""
PASSWORD_HASH_ALGO = pbkdf2
[ui]
DEFAULT_THEME = {{ gitea_ui_theme | default('gitea-auto') }}