diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2024-01-04 22:38:36 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2024-01-04 22:38:36 +0100 |
commit | 95d696a55a43f38f8aa4bd8a38d448bcc593da76 (patch) | |
tree | cc7059b4e0184eaf0838ff4968bc032cbcd7af8a /roles/gitea/templates/app.ini.j2 | |
parent | cb5707c4bf3face21731cfa88cf7998e26d3c6c2 (diff) | |
download | ansible_collection-95d696a55a43f38f8aa4bd8a38d448bcc593da76.tar.gz |
refactor gitea
Diffstat (limited to 'roles/gitea/templates/app.ini.j2')
-rw-r--r-- | roles/gitea/templates/app.ini.j2 | 105 |
1 files changed, 18 insertions, 87 deletions
diff --git a/roles/gitea/templates/app.ini.j2 b/roles/gitea/templates/app.ini.j2 index bfb7e08..4ab2fcc 100644 --- a/roles/gitea/templates/app.ini.j2 +++ b/roles/gitea/templates/app.ini.j2 @@ -1,88 +1,19 @@ ; vi: ft=dosini - -APP_NAME = {{ gitea.name }} -RUN_USER = git -RUN_MODE = prod - -[repository] -ROOT = /home/git/gitea-repositories - -[server] -APP_DATA_PATH = /var/lib/gitea/data -PROTOCOL = https -DOMAIN = {{ ansible_facts.fqdn }} -ROOT_URL = {{ gitea.root_url }} -STATIC_URL_PREFIX = -HTTP_ADDR = 0.0.0.0 -HTTP_PORT = 8443 -LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/ -DISABLE_SSH = false -SSH_DOMAIN = %(DOMAIN)s -SSH_PORT = 22 -SSH_CREATE_AUTHORIZED_KEYS_FILE = true -SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE = true - -CERT_FILE = {{ gitea.ssl.cert }} -KEY_FILE = {{ gitea.ssl.key }} - -LANDING_PAGE = login - -[database] -DB_TYPE = mysql -HOST = {{ gitea.mysql.host }} -NAME = {{ gitea.mysql.db }} -USER = {{ gitea.mysql.user }} -PASSWD = `{{ gitea.mysql.passwd }}` -SSL_MODE = true -CHARSET = utf8mb4 - -[security] -INSTALL_LOCK = true -SECRET_KEY = {{ sec_key.content }} -DISABLE_GIT_HOOKS = true -INTERNAL_TOKEN = {{ int_tok.content }} - -[service] -DISABLE_REGISTRATION = true - -REQUIRE_SIGNIN_VIEW = {{ gitea.require_signing_view }} -ENABLE_NOTIFY_MAIL = {{ gitea.mail.enable }} - - -[webhook] -ALLOWED_HOST_LIST = {{ gitea.webhook_allowed_hosts }} - -[mailer] -ENABLED = {{ gitea.mail.enable }} -{% if gitea.mail.enable %} -SUBJECT_PREFIX = {{ gitea.mail.subject_prefix }} -HOST = {{ gitea.mail.smtp_host }} -SKIP_VERIFY = {{ gitea.mail.skip_verify }} -IS_TLS_ENABLED = {{ gitea.mail.tls }} -FROM = {{ gitea.mail.from }} -USER = {{ gitea.mail.user }} -PASSWD = `{{ gitea.mail.pass }}` -SEND_AS_PLAIN_TEXT = {{ gitea.mail.plain_text }} -MAILER_TYPE = smtp -SENDMAIL_PATH = sendmail -SENDMAIL_ARGS = -SENDMAIL_TIMEOUT = 5m - -[queue.mailer] -SEND_BUFFER_LEN = 100 -{% endif %} - -[log] -MODE = console -ROUTER_LOG_LEVEL = Info -ROUTER = console - -[git] -PATH = - -[oauth2] -ENABLE = false - -[actions] -ENABLED = {{ gitea.actions }} - +; This file is managed by Ansible. Manual changes will be overridden. +; DO NOT CHANGE! + +{% macro procval(key, val) -%} +{% if val is mapping %} +[{{ key }}] +{% for k, v in val.items() %}{{ procval(k,v) }} +{% endfor -%} +{%- elif val is sameas true or val is sameas false -%} +{{ key }} = {{ val | string | lower }} +{%- else -%} +{{ key }} = {{ val }} +{%- endif -%} +{% endmacro %} + +{% for key in gitea.config -%} +{{ procval(key, gitea.config[key]) }} +{% endfor %} |