Major Changes: - Add dual SSH mode system (passthrough default, dedicated fallback) - Refactor domain configuration to use direct specification pattern - Fix critical fail2ban security gap in dedicated mode - Separate HTTP and SSH domains for cleaner Git URLs
70 lines
1.8 KiB
Django/Jinja
70 lines
1.8 KiB
Django/Jinja
# Gitea Configuration - Rick-Infra
|
|
# Generated by Ansible Gitea role
|
|
|
|
[DEFAULT]
|
|
APP_NAME = {{ gitea_app_name }}
|
|
RUN_MODE = {{ gitea_run_mode }}
|
|
|
|
[repository]
|
|
ROOT = {{ gitea_home }}/repositories
|
|
DEFAULT_BRANCH = {{ gitea_default_branch }}
|
|
|
|
[server]
|
|
PROTOCOL = http
|
|
DOMAIN = {{ gitea_http_domain }}
|
|
HTTP_PORT = {{ gitea_http_port }}
|
|
ROOT_URL = https://{{ gitea_http_domain }}/
|
|
DISABLE_SSH = false
|
|
# SSH Mode: {{ gitea_ssh_mode }}
|
|
START_SSH_SERVER = {{ gitea_start_ssh_server | lower }}
|
|
SSH_DOMAIN = {{ gitea_ssh_domain }}
|
|
SSH_PORT = {{ gitea_ssh_port }}
|
|
{% if gitea_ssh_mode == 'dedicated' %}
|
|
SSH_LISTEN_PORT = {{ gitea_ssh_port }}
|
|
{% endif %}
|
|
LOCAL_ROOT_URL = http://127.0.0.1:{{ gitea_http_port }}/
|
|
APP_DATA_PATH = {{ gitea_home }}/data
|
|
|
|
[database]
|
|
DB_TYPE = {{ gitea_db_type }}
|
|
{% if gitea_db_host.startswith('/') %}
|
|
# Unix socket connection
|
|
HOST = {{ gitea_db_host }}
|
|
{% else %}
|
|
# TCP connection
|
|
HOST = {{ gitea_db_host }}:{{ gitea_db_port }}
|
|
{% endif %}
|
|
NAME = {{ gitea_db_name }}
|
|
USER = {{ gitea_db_user }}
|
|
PASSWD = {{ gitea_db_password }}
|
|
SSL_MODE = disable
|
|
CHARSET = utf8
|
|
|
|
[security]
|
|
INSTALL_LOCK = true
|
|
SECRET_KEY = {{ ansible_machine_id }}{{ gitea_db_password | hash('sha256') }}
|
|
INTERNAL_TOKEN = {{ (ansible_machine_id + gitea_db_password) | hash('sha256') }}
|
|
|
|
[service]
|
|
DISABLE_REGISTRATION = {{ gitea_disable_registration | lower }}
|
|
REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | lower }}
|
|
DEFAULT_KEEP_EMAIL_PRIVATE = true
|
|
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
|
|
NO_REPLY_ADDRESS = noreply@{{ gitea_http_domain }}
|
|
|
|
[log]
|
|
MODE = console
|
|
LEVEL = Info
|
|
ROOT_PATH = {{ gitea_home }}/log
|
|
|
|
{% if gitea_enable_lfs %}
|
|
[lfs]
|
|
START_SERVER = true
|
|
CONTENT_PATH = {{ gitea_home }}/data/lfs
|
|
{% endif %}
|
|
|
|
[git]
|
|
PATH = /usr/bin/git
|
|
|
|
# Rick-Infra: Simplified Gitea configuration for self-contained service
|