From e118d2f7cb45df2fdd108887566b8f9a9839af98 Mon Sep 17 00:00:00 2001 From: Lyn Matten Date: Tue, 29 Aug 2023 08:52:06 +0200 Subject: [PATCH 1/3] added several config options for service section --- defaults/main.yml | 13 +++++++++++++ templates/gitea.ini.j2 | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index bb04b91..ef25d10 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -164,6 +164,19 @@ gitea_only_allow_external_registration: false gitea_enable_notify_mail: false gitea_auto_watch_new_repos: true gitea_service_extra_config: '' +gitea_autowatch_new_repo: false +gitea_autowatch_on_change: true +# make sure, that register_email_confirm is false when register_manual_confirm is set to true +gitea_register_email_confirm: false +gitea_register_manual_confirm: true +gitea_default_allow_create_organization: false +gitea_default_user_is_restricted: true +gitea_email_domain_allowlist: "" +gitea_auto_watch_new_repos: false +gitea_default_user_visibility: limited +gitea_default_org_visibility: limited +gitea_allow_only_internal_registration: true +# gitea_email_domain_allowlist: "" # Mailer [mailer] # -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index cbe7cb2..c25365d 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -174,6 +174,21 @@ DEFAULT_KEEP_EMAIL_PRIVATE = {{ gitea_default_keep_mail_private | ternary SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }} AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }} ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }} +; new +AUTO_WATCH_NEW_REPOS = {{ gitea_autowatch_new_repo }} +AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} +SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_mailstones_dashboard }} +REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm }} +REGISTER_MANUAL_CONFIRM = {{ gitea_register_manual_confirm }} +DEFAULT_ALLOW_CREATE_ORGANIZATION = {{ gitea_default_allow_create_organization }} +DEFAULT_USER_IS_RESTRICTED = {{ gitea_default_user_is_restricted }} +{% if gitea_email_domain_allowlist is defined and gitea_email_domain_allowlist|length %} +EMAIL_DOMAIN_ALLOWLIST = {{ gitea_email_domain_allowlist }} +{% endif %} +AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos }} +DEFAULT_USER_VISIBILITY = {{ gitea_default_user_visibility }} +DEFAULT_ORG_VISIBILITY = {{ gitea_default_org_visibility }} +ALLOW_ONLY_INTERNAL_REGISTRATION = {{ gitea_allow_only_internal_registration }} {{ gitea_service_extra_config }} ; ; From d08647ef84be66a7f9da1701aa4bbee06c3e3e96 Mon Sep 17 00:00:00 2001 From: Lyn Matten Date: Tue, 29 Aug 2023 09:01:20 +0200 Subject: [PATCH 2/3] removed with spaces to avoid unneccesary redeplyoment of variables --- templates/gitea.ini.j2 | 236 ++++++++++++++++++++--------------------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index c25365d..9009e5d 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -13,39 +13,39 @@ 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') }} -DEFAULT_PRIVATE = {{ gitea_default_private }} -MAX_CREATION_LIMIT = {{ gitea_user_repo_limit }} -DISABLE_HTTP_GIT = {{ gitea_disable_http_git | ternary('true', 'false') }} +ROOT = {{ gitea_repository_root }} +FORCE_PRIVATE = {{ gitea_force_private | ternary('true', 'false') }} +DEFAULT_PRIVATE = {{ gitea_default_private }} +MAX_CREATION_LIMIT = {{ gitea_user_repo_limit }} +DISABLE_HTTP_GIT = {{ gitea_disable_http_git | ternary('true', 'false') }} ENABLE_PUSH_CREATE_USER = {{ gitea_enable_push_create_user | ternary('true', 'false') }} -ENABLE_PUSH_CREATE_ORG = {{ gitea_enable_push_create_org | ternary('true', 'false') }} -DISABLED_REPO_UNITS = {{ gitea_disabled_repo_units }} -DEFAULT_REPO_UNITS = {{ gitea_default_repo_units }} -DISABLE_STARS = {{ gitea_disable_stars | ternary('true', 'false') }} -DEFAULT_BRANCH = {{ gitea_default_branch }} +ENABLE_PUSH_CREATE_ORG = {{ gitea_enable_push_create_org | ternary('true', 'false') }} +DISABLED_REPO_UNITS = {{ gitea_disabled_repo_units }} +DEFAULT_REPO_UNITS = {{ gitea_default_repo_units }} +DISABLE_STARS = {{ gitea_disable_stars | ternary('true', 'false') }} +DEFAULT_BRANCH = {{ gitea_default_branch }} {{ gitea_repository_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload [repository.upload] -ENABLED = {{ gitea_repository_upload_enabled | ternary('true', 'false') }} -TEMP_PATH = {{ gitea_home }}/data/tmp/uploads -FILE_MAX_SIZE = {{ gitea_repository_upload_max_size }} +ENABLED = {{ gitea_repository_upload_enabled | ternary('true', 'false') }} +TEMP_PATH = {{ gitea_home }}/data/tmp/uploads +FILE_MAX_SIZE = {{ gitea_repository_upload_max_size }} {{ gitea_repository_upload_extra_config }} ; ; {% if gitea_enable_repo_signing_options | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#repository---signing-repositorysigning [repository.signing] -SIGNING_KEY = {{ gitea_repo_signing_key }} -SIGNING_NAME = {{ gitea_repo_signing_name }} -SIGNING_EMAIL = {{ gitea_repo_signing_email }} -INITIAL_COMMIT = {{ gitea_repo_initial_commit }} +SIGNING_KEY = {{ gitea_repo_signing_key }} +SIGNING_NAME = {{ gitea_repo_signing_name }} +SIGNING_EMAIL = {{ gitea_repo_signing_email }} +INITIAL_COMMIT = {{ gitea_repo_initial_commit }} DEFAULT_TRUST_MODEL = {{ gitea_repo_default_trust_model }} -WIKI = {{ gitea_repo_wiki }} -CRUD_ACTIONS = {{ gitea_repo_crud_actions }} -MERGES = {{ gitea_repo_merges }} +WIKI = {{ gitea_repo_wiki }} +CRUD_ACTIONS = {{ gitea_repo_crud_actions }} +MERGES = {{ gitea_repo_merges }} {{ gitea_enable_repo_signing_extra }} ; {% endif %} @@ -54,94 +54,94 @@ MERGES = {{ gitea_repo_merges }} ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#cors-cors [cors] -ENABLED = {{ gitea_enable_cors | ternary('true', 'false') }} -SCHEME = {{ gitea_cors_scheme }} -ALLOW_DOMAIN = {{ gitea_cors_allow_domain }} -ALLOW_SUBDOMAIN = {{ gitea_cors_allow_subdomain | ternary('true', 'false') }} -METHODS = {{ gitea_cors_methods }} -MAX_AGE = {{ gitea_cors_max_age }} +ENABLED = {{ gitea_enable_cors | ternary('true', 'false') }} +SCHEME = {{ gitea_cors_scheme }} +ALLOW_DOMAIN = {{ gitea_cors_allow_domain }} +ALLOW_SUBDOMAIN = {{ gitea_cors_allow_subdomain | ternary('true', 'false') }} +METHODS = {{ gitea_cors_methods }} +MAX_AGE = {{ gitea_cors_max_age }} ALLOW_CREDENTIALS = {{ gitea_cors_allow_credentials | ternary('true', 'false') }} -HEADERS = {{ gitea_cors_headers }} -X_FRAME_OPTIONS = {{ gitea_cors_x_frame_options }} +HEADERS = {{ gitea_cors_headers }} +X_FRAME_OPTIONS = {{ gitea_cors_x_frame_options }} {{ gitea_cors_extra }} ; {% endif %} ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui [ui] -THEMES = {{ gitea_themes }} -DEFAULT_THEME = {{ gitea_theme_default }} -SHOW_USER_EMAIL = {{ gitea_show_user_email | ternary('true', 'false') }} +THEMES = {{ gitea_themes }} +DEFAULT_THEME = {{ gitea_theme_default }} +SHOW_USER_EMAIL= {{ gitea_show_user_email | ternary('true', 'false') }} {{ gitea_ui_extra_config }} ; ; ; [ui.meta] -AUTHOR = {{ gitea_ui_author }} +AUTHOR = {{ gitea_ui_author }} DESCRIPTION = {{ gitea_ui_description }} -KEYWORDS = {{ gitea_ui_keywords }} +KEYWORDS = {{ gitea_ui_keywords }} {{ gitea_ui_meta_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#server-server [server] -APP_DATA_PATH = {{ gitea_home }}/data -PROTOCOL = {{ gitea_protocol }} -DOMAIN = {{ gitea_http_domain }} -ROOT_URL = {{ gitea_root_url }} -HTTP_ADDR = {{ gitea_http_listen }} -HTTP_PORT = {{ gitea_http_port }} -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 +PROTOCOL = {{ gitea_protocol }} +DOMAIN = {{ gitea_http_domain }} +ROOT_URL = {{ gitea_root_url }} +HTTP_ADDR = {{ gitea_http_listen }} +HTTP_PORT = {{ gitea_http_port }} +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') }} {% if gitea_enable_tls_certs | bool %} -CERT_FILE = {{ gitea_tls_cert_file }} -KEY_FILE = {{ gitea_tls_key_file }} +CERT_FILE = {{ gitea_tls_cert_file }} +KEY_FILE = {{ gitea_tls_key_file }} {% endif %} -LANDING_PAGE = {{ gitea_landing_page }} +LANDING_PAGE = {{ gitea_landing_page }} {% if gitea_lfs_server_enabled | bool -%} -LFS_START_SERVER = true -LFS_JWT_SECRET = {{ gitea_lfs_jwt_secret }} +LFS_START_SERVER = true +LFS_JWT_SECRET = {{ gitea_lfs_jwt_secret }} {% endif %} -REDIRECT_OTHER_PORT = {{ gitea_redirect_other_port | ternary('true', 'false') }} -PORT_TO_REDIRECT = {{ gitea_port_to_redirect }} -ENABLE_ACME = {{ gitea_enable_acme | ternary('true', 'false') }} +REDIRECT_OTHER_PORT = {{ gitea_redirect_other_port | ternary('true', 'false') }} +PORT_TO_REDIRECT = {{ gitea_port_to_redirect }} +ENABLE_ACME = {{ gitea_enable_acme | ternary('true', 'false') }} {% if gitea_enable_acme | bool %} {% if gitea_acme_url != '' %} -ACME_URL = {{ gitea_acme_url }} +ACME_URL = {{ gitea_acme_url }} {% endif %} -ACME_ACCEPTTOS = {{ gitea_acme_accepttos | ternary('true', 'false') }} -ACME_DIRECTORY = {{ gitea_acme_directory }} -ACME_EMAIL = {{ gitea_acme_email }} -ACME_CA_ROOT = {{ gitea_acme_ca_root }} +ACME_ACCEPTTOS = {{ gitea_acme_accepttos | ternary('true', 'false') }} +ACME_DIRECTORY = {{ gitea_acme_directory }} +ACME_EMAIL = {{ gitea_acme_email }} +ACME_CA_ROOT = {{ gitea_acme_ca_root }} {% 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 }} +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 }} -LOG_SQL = {{ gitea_db_log_sql | ternary('true', 'false') }} +PATH = {{ gitea_db_path }} +LOG_SQL = {{ gitea_db_log_sql | ternary('true', 'false') }} {{ gitea_database_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer [indexer] -ISSUE_INDEXER_PATH = {{ gitea_home }}/indexers/issues.bleve -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 }} +ISSUE_INDEXER_PATH = {{ gitea_home }}/indexers/issues.bleve +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 | ternary('true', 'false') }} -MAX_FILE_SIZE = {{ gitea_repo_indexer_max_file_size }} +MAX_FILE_SIZE = {{ gitea_repo_indexer_max_file_size }} {{ gitea_indexer_extra_config }} ; ; @@ -154,26 +154,26 @@ DATADIR = {{ gitea_home }}/indexers/issues.queue ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#security-security [security] -INSTALL_LOCK = true -SECRET_KEY = {{ gitea_secret_key }} -DISABLE_GIT_HOOKS = {{ gitea_disable_git_hooks | ternary('true', 'false') }} -DISABLE_WEBHOOKS = {{ gitea_disable_webhooks | ternary('true', 'false') }} -INTERNAL_TOKEN = {{ gitea_internal_token }} -PASSWORD_CHECK_PWN = {{ gitea_password_check_pwn | ternary('true', 'false') }} +INSTALL_LOCK = true +SECRET_KEY = {{ gitea_secret_key }} +DISABLE_GIT_HOOKS = {{ gitea_disable_git_hooks | ternary('true', 'false') }} +DISABLE_WEBHOOKS = {{ gitea_disable_webhooks | ternary('true', 'false') }} +INTERNAL_TOKEN = {{ gitea_internal_token }} +PASSWORD_CHECK_PWN = {{ gitea_password_check_pwn | ternary('true', 'false') }} {{ gitea_security_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service [service] -REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm | ternary('true', 'false') }} -DISABLE_REGISTRATION = {{ gitea_disable_registration | ternary('true', 'false') }} -REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | ternary('true', 'false') }} -ENABLE_NOTIFY_MAIL = {{ gitea_enable_notify_mail | ternary('true', 'false') }} -ENABLE_CAPTCHA = {{ gitea_enable_captcha | ternary('true', 'false') }} -DEFAULT_KEEP_EMAIL_PRIVATE = {{ gitea_default_keep_mail_private | ternary('true', 'false') }} -SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }} -AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }} -ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }} +REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm | ternary('true', 'false') }} +DISABLE_REGISTRATION = {{ gitea_disable_registration | ternary('true', 'false') }} +REQUIRE_SIGNIN_VIEW = {{ gitea_require_signin | ternary('true', 'false') }} +ENABLE_NOTIFY_MAIL = {{ gitea_enable_notify_mail | ternary('true', 'false') }} +ENABLE_CAPTCHA = {{ gitea_enable_captcha | ternary('true', 'false') }} +DEFAULT_KEEP_EMAIL_PRIVATE = {{ gitea_default_keep_mail_private | ternary('true', 'false') }} +SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }} +AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }} +ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }} ; new AUTO_WATCH_NEW_REPOS = {{ gitea_autowatch_new_repo }} AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} @@ -194,23 +194,23 @@ ALLOW_ONLY_INTERNAL_REGISTRATION = {{ gitea_allow_only_internal_registration }} ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer [mailer] -ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} +ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} {% if gitea_mailer_enabled | bool %} -PROTOCOL = {{ gitea_mailer_protocol }} -SMTP_ADDR = {{ gitea_mailer_smtp_addr }} -SMTP_PORT = {{ gitea_mailer_smtp_port }} -USE_CLIENT_CERT = {{ gitea_mailer_use_client_cert | ternary('true', 'false') }} +PROTOCOL = {{ gitea_mailer_protocol }} +SMTP_ADDR = {{ gitea_mailer_smtp_addr }} +SMTP_PORT = {{ gitea_mailer_smtp_port }} +USE_CLIENT_CERT = {{ gitea_mailer_use_client_cert | ternary('true', 'false') }} {% if gitea_mailer_use_client_cert | bool %} -CLIENT_CERT_FILE = {{ gitea_mailer_client_cert_file }} -CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }} +CLIENT_CERT_FILE = {{ gitea_mailer_client_cert_file }} +CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }} {% endif %} FORCE_TRUST_SERVER_CERT = {{ gitea_mailer_force_trust_server_cert | ternary('true', 'false') }} -USER = {{ gitea_mailer_user }} -PASSWD = `{{ gitea_mailer_password }}` -ENABLE_HELO = {{ gitea_mailer_enable_helo | ternary('true', 'false') }} -FROM = {{ gitea_mailer_from }} -SUBJECT_PREFIX = {{ gitea_subject_prefix }} -SEND_AS_PLAIN_TEXT = {{ gitea_mailer_send_as_plaintext | ternary('true', 'false') }} +USER = {{ gitea_mailer_user }} +PASSWD = `{{ gitea_mailer_password }}` +ENABLE_HELO = {{ gitea_mailer_enable_helo | ternary('true', 'false') }} +FROM = {{ gitea_mailer_from }} +SUBJECT_PREFIX = {{ gitea_subject_prefix }} +SEND_AS_PLAIN_TEXT = {{ gitea_mailer_send_as_plaintext | ternary('true', 'false') }} {{ gitea_mailer_extra_config }} ; {% endif %} @@ -218,7 +218,7 @@ SEND_AS_PLAIN_TEXT = {{ gitea_mailer_send_as_plaintext | ternary('true', 'f ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#session-session [session] -PROVIDER = {{ gitea_session_provider }} +PROVIDER = {{ gitea_session_provider }} PROVIDER_CONFIG = {{ gitea_home }}/data/sessions {{ gitea_session_extra_config }} ; @@ -231,42 +231,42 @@ AVATAR_UPLOAD_PATH = {{ gitea_home }}/data/avatars ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment [attachment] -ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }} -ALLOWED_TYPES = {{ gitea_attachment_types }} -MAX_SIZE = {{ gitea_attachment_max_size }} -PATH = {{ gitea_home }}/data/attachments +ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }} +ALLOWED_TYPES = {{ gitea_attachment_types }} +MAX_SIZE = {{ gitea_attachment_max_size }} +PATH = {{ gitea_home }}/data/attachments {{ gitea_attachment_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#log-log [log] -ROOT_PATH = {{ gitea_home }}/log +ROOT_PATH = {{ gitea_home }}/log {% if gitea_log_systemd %} -MODE = console +MODE = console {% else %} -MODE = file +MODE = file {% endif %} -LEVEL = {{ gitea_log_level }} +LEVEL = {{ gitea_log_level }} {{ gitea_log_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#metrics-metrics [metrics] ENABLED = {{ gitea_metrics_enabled | ternary('true', 'false') }} -TOKEN = {{ gitea_metrics_token }} +TOKEN = {{ gitea_metrics_token }} {{ gitea_metrics_extra }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2 [oauth2] -ENABLE = {{ gitea_oauth2_enabled | ternary('true', 'false') }} +ENABLE = {{ gitea_oauth2_enabled | ternary('true', 'false') }} JWT_SECRET = {{ gitea_oauth2_jwt_secret }} {{ gitea_oauth2_extra_config }} ; ; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#federation-federation [federation] -ENABLED = {{ gitea_federation_enabled | ternary('true', 'false') }} +ENABLED = {{ gitea_federation_enabled | ternary('true', 'false') }} SHARE_USER_STATISTICS = {{ gitea_federation_share_user_stats | ternary('true', 'false') }} {{ gitea_federation_extra }} ; @@ -274,7 +274,7 @@ SHARE_USER_STATISTICS = {{ gitea_federation_share_user_stats | ternary('true', ' ; Packages (packages) ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#packages-packages [packages] -ENABLED = {{ gitea_packages_enabled | ternary('true', 'false') }} +ENABLED = {{ gitea_packages_enabled | ternary('true', 'false') }} {% if gitea_packages_enabled | bool %} CHUNKED_UPLOAD_PATH = {{ gitea_home }}/data/tmp/package-upload {{ gitea_packages_extra }} @@ -284,9 +284,9 @@ CHUNKED_UPLOAD_PATH = {{ gitea_home }}/data/tmp/package-upload {% if gitea_lfs_server_enabled | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#lfs-lfs [lfs] -STORAGE_TYPE = {{ gitea_lfs_storage_type }} -SERVE_DIRECT = {{ gitea_lfs_serve_direct | ternary('true', 'false') }} -PATH = {{ gitea_lfs_content_path }} +STORAGE_TYPE = {{ gitea_lfs_storage_type }} +SERVE_DIRECT = {{ gitea_lfs_serve_direct | ternary('true', 'false') }} +PATH = {{ gitea_lfs_content_path }} {{ gitea_lfs_extra }} {% endif %} ; @@ -294,7 +294,7 @@ PATH = {{ gitea_lfs_content_path }} {% if gitea_actions_enabled | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#actions-actions [actions] -ENABLED = {{ gitea_actions_enabled }} +ENABLED = {{ gitea_actions_enabled }} DEFAULT_ACTIONS_URL = {{ gitea_actions_default_actions_url }} {{ gitea_actions_extra }} {% endif %} @@ -303,10 +303,10 @@ DEFAULT_ACTIONS_URL = {{ gitea_actions_default_actions_url }} ; Other (other) ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#other-other [other] -SHOW_FOOTER_VERSION = {{ gitea_other_show_footer_version | ternary('true', 'false') }} +SHOW_FOOTER_VERSION = {{ gitea_other_show_footer_version | ternary('true', 'false') }} SHOW_FOOTER_TEMPLATE_LOAD_TIME = {{ gitea_other_show_footer_template_load_time | ternary('true', 'false') }} -ENABLE_SITEMAP = {{ gitea_other_enable_sitemap | ternary('true', 'false') }} -ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }} +ENABLE_SITEMAP = {{ gitea_other_enable_sitemap | ternary('true', 'false') }} +ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }} ; ; ; From 2912ec874fcd1ad2f2853cd5e6819efe214e8abe Mon Sep 17 00:00:00 2001 From: Lyn Matten Date: Tue, 29 Aug 2023 09:35:35 +0200 Subject: [PATCH 3/3] removed double parameter entries; added missing variable gitea_show_milestones_dashboard; fixed ini layout to only show valid changed when using -D --- defaults/main.yml | 6 +- templates/gitea.ini.j2 | 127 ++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 69 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ef25d10..16a01dd 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -162,20 +162,18 @@ gitea_enable_captcha: true gitea_show_registration_button: true gitea_only_allow_external_registration: false gitea_enable_notify_mail: false -gitea_auto_watch_new_repos: true gitea_service_extra_config: '' -gitea_autowatch_new_repo: false +gitea_auto_watch_new_repos: false gitea_autowatch_on_change: true # make sure, that register_email_confirm is false when register_manual_confirm is set to true -gitea_register_email_confirm: false gitea_register_manual_confirm: true gitea_default_allow_create_organization: false gitea_default_user_is_restricted: true gitea_email_domain_allowlist: "" -gitea_auto_watch_new_repos: false gitea_default_user_visibility: limited gitea_default_org_visibility: limited gitea_allow_only_internal_registration: true +gitea_show_mailstones_dashboard: true # gitea_email_domain_allowlist: "" # Mailer [mailer] diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index 9009e5d..6409b7f 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -1,16 +1,17 @@ ; 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 }} -; -; +WORK_PATH = {{ gitea_home }} +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#repository-repository [repository] ROOT = {{ gitea_repository_root }} @@ -25,16 +26,16 @@ DEFAULT_REPO_UNITS = {{ gitea_default_repo_units }} DISABLE_STARS = {{ gitea_disable_stars | ternary('true', 'false') }} DEFAULT_BRANCH = {{ gitea_default_branch }} {{ gitea_repository_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/administration/config-cheat-sheet/#repository---upload-repositoryupload [repository.upload] ENABLED = {{ gitea_repository_upload_enabled | ternary('true', 'false') }} TEMP_PATH = {{ gitea_home }}/data/tmp/uploads FILE_MAX_SIZE = {{ gitea_repository_upload_max_size }} {{ gitea_repository_upload_extra_config }} -; -; +; +; {% if gitea_enable_repo_signing_options | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#repository---signing-repositorysigning [repository.signing] @@ -47,11 +48,11 @@ WIKI = {{ gitea_repo_wiki }} CRUD_ACTIONS = {{ gitea_repo_crud_actions }} MERGES = {{ gitea_repo_merges }} {{ gitea_enable_repo_signing_extra }} -; +; {% endif %} -; +; {% if gitea_enable_cors | bool %} -; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#cors-cors [cors] ENABLED = {{ gitea_enable_cors | ternary('true', 'false') }} @@ -64,25 +65,25 @@ ALLOW_CREDENTIALS = {{ gitea_cors_allow_credentials | ternary('true', 'false') } HEADERS = {{ gitea_cors_headers }} X_FRAME_OPTIONS = {{ gitea_cors_x_frame_options }} {{ gitea_cors_extra }} -; +; {% endif %} -; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui [ui] THEMES = {{ gitea_themes }} DEFAULT_THEME = {{ gitea_theme_default }} -SHOW_USER_EMAIL= {{ gitea_show_user_email | ternary('true', 'false') }} +SHOW_USER_EMAIL = {{ gitea_show_user_email | ternary('true', 'false') }} {{ gitea_ui_extra_config }} -; -; -; +; +; +; [ui.meta] AUTHOR = {{ gitea_ui_author }} DESCRIPTION = {{ gitea_ui_description }} KEYWORDS = {{ gitea_ui_keywords }} {{ gitea_ui_meta_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#server-server [server] APP_DATA_PATH = {{ gitea_home }}/data @@ -118,8 +119,8 @@ ACME_EMAIL = {{ gitea_acme_email }} ACME_CA_ROOT = {{ gitea_acme_ca_root }} {% endif %} {{ gitea_server_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#database-database [database] DB_TYPE = {{ gitea_db_type }} @@ -131,8 +132,8 @@ SSL_MODE = {{ gitea_db_ssl }} PATH = {{ gitea_db_path }} LOG_SQL = {{ gitea_db_log_sql | ternary('true', 'false') }} {{ gitea_database_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#indexer-indexer [indexer] ISSUE_INDEXER_PATH = {{ gitea_home }}/indexers/issues.bleve @@ -143,15 +144,15 @@ REPO_INDEXER_EXCLUDE = {{ gitea_repo_indexer_exclude }} REPO_INDEXER_EXCLUDE_VENDORED = {{ gitea_repo_exclude_vendored | ternary('true', 'false') }} MAX_FILE_SIZE = {{ gitea_repo_indexer_max_file_size }} {{ gitea_indexer_extra_config }} -; -; +; +; ; Queue (queue and queue.*) ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#queue-queue-and-queue [queue.issue_indexer] DATADIR = {{ gitea_home }}/indexers/issues.queue {{ gitea_queue_issue_indexer_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#security-security [security] INSTALL_LOCK = true @@ -161,8 +162,8 @@ DISABLE_WEBHOOKS = {{ gitea_disable_webhooks | ternary('true', 'false') }} INTERNAL_TOKEN = {{ gitea_internal_token }} PASSWORD_CHECK_PWN = {{ gitea_password_check_pwn | ternary('true', 'false') }} {{ gitea_security_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service [service] REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm | ternary('true', 'false') }} @@ -174,24 +175,20 @@ DEFAULT_KEEP_EMAIL_PRIVATE = {{ gitea_default_keep_mail_private | ternary('true' SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }} AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }} ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }} -; new -AUTO_WATCH_NEW_REPOS = {{ gitea_autowatch_new_repo }} -AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} +AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }} SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_mailstones_dashboard }} -REGISTER_EMAIL_CONFIRM = {{ gitea_register_email_confirm }} REGISTER_MANUAL_CONFIRM = {{ gitea_register_manual_confirm }} DEFAULT_ALLOW_CREATE_ORGANIZATION = {{ gitea_default_allow_create_organization }} DEFAULT_USER_IS_RESTRICTED = {{ gitea_default_user_is_restricted }} {% if gitea_email_domain_allowlist is defined and gitea_email_domain_allowlist|length %} EMAIL_DOMAIN_ALLOWLIST = {{ gitea_email_domain_allowlist }} {% endif %} -AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos }} DEFAULT_USER_VISIBILITY = {{ gitea_default_user_visibility }} DEFAULT_ORG_VISIBILITY = {{ gitea_default_org_visibility }} ALLOW_ONLY_INTERNAL_REGISTRATION = {{ gitea_allow_only_internal_registration }} {{ gitea_service_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer [mailer] ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }} @@ -206,29 +203,29 @@ CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }} {% endif %} FORCE_TRUST_SERVER_CERT = {{ gitea_mailer_force_trust_server_cert | ternary('true', 'false') }} USER = {{ gitea_mailer_user }} -PASSWD = `{{ gitea_mailer_password }}` +PASSWD = {{ gitea_mailer_password }} ENABLE_HELO = {{ gitea_mailer_enable_helo | ternary('true', 'false') }} -FROM = {{ gitea_mailer_from }} +FROM = {{ gitea_mailer_from }} SUBJECT_PREFIX = {{ gitea_subject_prefix }} SEND_AS_PLAIN_TEXT = {{ gitea_mailer_send_as_plaintext | ternary('true', 'false') }} {{ gitea_mailer_extra_config }} -; +; {% endif %} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#session-session [session] PROVIDER = {{ gitea_session_provider }} PROVIDER_CONFIG = {{ gitea_home }}/data/sessions {{ gitea_session_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#picture-picture [picture] AVATAR_UPLOAD_PATH = {{ gitea_home }}/data/avatars {{ gitea_picture_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#issue-and-pull-request-attachments-attachment [attachment] ENABLED = {{ gitea_attachment_enabled | ternary('true', 'false') }} @@ -236,8 +233,8 @@ ALLOWED_TYPES = {{ gitea_attachment_types }} MAX_SIZE = {{ gitea_attachment_max_size }} PATH = {{ gitea_home }}/data/attachments {{ gitea_attachment_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#log-log [log] ROOT_PATH = {{ gitea_home }}/log @@ -248,29 +245,29 @@ MODE = file {% endif %} LEVEL = {{ gitea_log_level }} {{ gitea_log_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#metrics-metrics [metrics] ENABLED = {{ gitea_metrics_enabled | ternary('true', 'false') }} TOKEN = {{ gitea_metrics_token }} {{ gitea_metrics_extra }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2 [oauth2] ENABLE = {{ gitea_oauth2_enabled | ternary('true', 'false') }} JWT_SECRET = {{ gitea_oauth2_jwt_secret }} {{ gitea_oauth2_extra_config }} -; -; +; +; ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#federation-federation [federation] ENABLED = {{ gitea_federation_enabled | ternary('true', 'false') }} SHARE_USER_STATISTICS = {{ gitea_federation_share_user_stats | ternary('true', 'false') }} {{ gitea_federation_extra }} -; -; +; +; ; Packages (packages) ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#packages-packages [packages] @@ -279,8 +276,8 @@ ENABLED = {{ gitea_packages_enabled | ternary('true', 'false') }} CHUNKED_UPLOAD_PATH = {{ gitea_home }}/data/tmp/package-upload {{ gitea_packages_extra }} {% endif %} -; -; +; +; {% if gitea_lfs_server_enabled | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#lfs-lfs [lfs] @@ -289,8 +286,8 @@ SERVE_DIRECT = {{ gitea_lfs_serve_direct | ternary('true', 'false') }} PATH = {{ gitea_lfs_content_path }} {{ gitea_lfs_extra }} {% endif %} -; -; +; +; {% if gitea_actions_enabled | bool %} ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#actions-actions [actions] @@ -298,8 +295,8 @@ ENABLED = {{ gitea_actions_enabled }} DEFAULT_ACTIONS_URL = {{ gitea_actions_default_actions_url }} {{ gitea_actions_extra }} {% endif %} -; -; +; +; ; Other (other) ; -> https://docs.gitea.io/en-us/config-cheat-sheet/#other-other [other] @@ -307,8 +304,8 @@ SHOW_FOOTER_VERSION = {{ gitea_other_show_footer_version | ternary('true', 'fals SHOW_FOOTER_TEMPLATE_LOAD_TIME = {{ gitea_other_show_footer_template_load_time | ternary('true', 'false') }} ENABLE_SITEMAP = {{ gitea_other_enable_sitemap | ternary('true', 'false') }} ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }} -; -; -; +; +; +; ; Optional additional config -{{ gitea_extra_config }} +{{ gitea_extra_config }} \ No newline at end of file