1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00
ansible_role_gitea/templates/gitea.ini.j2
2021-03-21 17:56:16 +01:00

200 lines
7.8 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; this file is the configuration of your local gitea instance
; {{ ansible_managed }}
;
; This file overwrites the default values from gitea.
; undefined variables will use the default value from gitea.
; Cheat Sheet: https://docs.gitea.io/en-us/config-cheat-sheet/
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default
APP_NAME = {{ gitea_app_name }}
RUN_USER = {{ gitea_user }}
RUN_MODE = {{ gitea_run_mode }}
;
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#repository-repository
[repository]
ROOT = {{ gitea_repository_root }}
FORCE_PRIVATE = {{ gitea_force_private | ternary('true', 'false') }}
MAX_CREATION_LIMIT = {{ gitea_user_repo_limit }}
DISABLE_HTTP_GIT = {{ gitea_disable_http_git | ternary('true', 'false') }}
DEFAULT_BRANCH = {{ gitea_default_branch }}
{{ gitea_repository_extra_config }}
;
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui
[ui]
SHOW_USER_EMAIL = {{ gitea_show_user_email | ternary('true', 'false') }}
DEFAULT_THEME = {{ gitea_theme_default }}
THEMES = {{ gitea_themes }}
{{ gitea_ui_extra_config }}
;
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#server-server
[server]
PROTOCOL = {{ gitea_protocol }}
DOMAIN = {{ gitea_http_domain }}
ROOT_URL = {{ gitea_root_url }}
HTTP_ADDR = {{ gitea_http_listen }}
HTTP_PORT = {{ gitea_http_port }}
{% if gitea_http_port == 443 %}
PORT_TO_REDIRECT = 80
{% endif %}
{% if gitea_http_letsencrypt_mail is defined %}
ENABLE_LETSENCRYPT = true
LETSENCRYPT_ACCEPTTOS = true
LETSENCRYPT_EMAIL = {{ gitea_http_letsencrypt_mail }}
{% endif %}
START_SSH_SERVER = {{ gitea_start_ssh | ternary('true', 'false') }}
SSH_DOMAIN = {{ gitea_ssh_domain }}
SSH_PORT = {{ gitea_ssh_port }}
SSH_LISTEN_HOST = {{ gitea_ssh_listen }}
OFFLINE_MODE = {{ gitea_offline_mode | ternary('true', 'false') }}
APP_DATA_PATH = {{ gitea_home }}/data
{% if gitea_lfs_server_enabled | bool -%}
LFS_START_SERVER = true
LFS_CONTENT_PATH = {{ gitea_lfs_content_path }}
LFS_JWT_SECRET = {{ gitea_lfs_jwt_secret }}
{% endif %}
{{ gitea_server_extra_config }}
;
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#database-database
[database]
DB_TYPE = {{ gitea_db_type }}
HOST = {{ gitea_db_host }}
NAME = {{ gitea_db_name }}
USER = {{ gitea_db_user }}
PASSWD = {{ gitea_db_password }}
SSL_MODE = {{ gitea_db_ssl }}
PATH = {{ gitea_db_path }}
{% if gitea_log_only_warning %}
LOG_SQL = false
{% endif %}
{{ gitea_database_extra_config }}
;
;
; -> https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer
[indexer]
ISSUE_INDEXER_PATH = {{ gitea_home }}/indexers/issues.bleve
ISSUE_INDEXER_QUEUE_DIR = {{ gitea_home }}/indexers/issues.queue
REPO_INDEXER_ENABLED = {{ gitea_repo_indexer_enabled | ternary('true', 'false') }}
REPO_INDEXER_PATH = {{ gitea_home }}/indexers/repos.bleve
REPO_INDEXER_INCLUDE = {{ gitea_repo_indexer_include }}
REPO_INDEXER_EXCLUDE = {{ gitea_repo_indexer_exclude }}
REPO_INDEXER_EXCLUDE_VENDORED = {{ gitea_repo_exclude_vendored }}
MAX_FILE_SIZE = {{ gitea_repo_indexer_max_file_size }}
{{ gitea_indexer_extra_config }}
;
;
;
[security]
; Whether the installer is disabled
INSTALL_LOCK = true
; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
SECRET_KEY = {{ gitea_secret_key }}
INTERNAL_TOKEN = {{ gitea_internal_token }}
; How long to remember that an user is logged in before requiring relogin (in days)
LOGIN_REMEMBER_DAYS = 7
DISABLE_GIT_HOOKS = {{ gitea_disable_git_hooks | ternary('true', 'false') }}
[service]
; Disallow registration, only allow admins to create accounts.
DISABLE_REGISTRATION = {{ gitea_disable_registration }}
REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm }}
; User must sign in to view anything.
REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | ternary('true', 'false') }}
; Enable captcha validation for registration
ENABLE_CAPTCHA = {{ gitea_enable_captcha | ternary('true', 'false') }}
; Type of captcha you want to use. Options: image, recaptcha
CAPTCHA_TYPE = image
; Enable recaptcha to use Google's recaptcha service
; Go to https://www.google.com/recaptcha/admin to sign up for a key
RECAPTCHA_SECRET =
RECAPTCHA_SITEKEY =
; Show Registration button
SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }}
ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }}
ENABLE_NOTIFY_MAIL = {{ gitea_enable_notify_mail | ternary('true', 'false') }}
AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }}
[mailer]
ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }}
; Mail server
; Gmail: smtp.gmail.com:587
; QQ: smtp.qq.com:465
; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
HOST = {{ gitea_mailer_host }}
; Do not verify the certificate of the server. Only use this for self-signed certificates
SKIP_VERIFY = {{ gitea_mailer_skip_verify }}
; Use client certificate
USE_CERTIFICATE = false
CERT_FILE = {{ gitea_home }}/custom/mailer/cert.pem
KEY_FILE = {{ gitea_home }}/custom/mailer/key.pem
; Should SMTP connection use TLS
IS_TLS_ENABLED = {{ gitea_mailer_tls_enabled | ternary('true', 'false') }}
; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format
FROM = {{ gitea_mailer_from }}
; Mailer user name and password
USER = {{ gitea_mailer_user }}
; Use PASSWD = `your password` for quoting if you use special characters in the password.
PASSWD = {{ gitea_mailer_password }}
; Send mails as plain text
SEND_AS_PLAIN_TEXT = false
SUBJECT_PREFIX = {{ gitea_subject_prefix }}
; Set Mailer Type (either SMTP, sendmail or dummy to just send to the log)
MAILER_TYPE = {{ gitea_mailer_type }}
; Specify an alternative sendmail binary
SENDMAIL_PATH = sendmail
[session]
; Either "memory", "file", or "redis", default is "memory"
PROVIDER = file
; Provider config options
; memory: doesn't have any config yet
; file: session file path, e.g. `data/sessions`
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
PROVIDER_CONFIG = {{ gitea_home }}/data/sessions
[picture]
AVATAR_UPLOAD_PATH = {{ gitea_home }}/data/avatars
; This value will always be true in offline mode.
DISABLE_GRAVATAR = {{ gitea_disable_gravatar | ternary('true', 'false') }}
[attachment]
; Whether attachments are enabled. Defaults to `true`
ENABLED = true
; Path for attachments. Defaults to `data/attachments`
PATH = {{ gitea_home }}/data/attachments
[log]
ROOT_PATH = {{ gitea_home }}/log
; Either "console", "file", "conn", "smtp" or "database", default is "console"
; Use comma to separate multiple modes, e.g. "console, file"
{% if gitea_log_systemd %}
MODE = console
MACARON = console
{% else %}
MODE = file
{% endif %}
; Buffer length of the channel, keep it as it is if you don't know what it is.
BUFFER_LEN = 10000
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
{% if gitea_log_only_warning %}
LEVEL = Warn
REDIRECT_MACARON_LOG = true
{% else %}
LEVEL = Info
REDIRECT_MACARON_LOG = false
{% endif %}
[oauth2]
ENABLE = {{ gitea_oauth2_enabled }}
JWT_SECRET = {{ gitea_oauth2_jwt_secret }}
[metrics]
ENABLED = {{ gitea_metrics_enabled }}
TOKEN = {{ gitea_metrics_token }}
{{ gitea_extra_config }}