From b80dfe1723123c9f5bce594d97e5cf3ca3fe956c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 27 Jun 2024 18:09:31 +0300 Subject: [PATCH] Add variable for controlling `service.ENABLE_NOTIFY_MAIL` and wire it to `mailer.ENABLED` by default Without `service.ENABLE_NOTIFY_MAIL` being enabled, the mailer (if enabled) is only used for important transactional emails, but not for sending notifications to people about stuff they're watching. This is not very useful, so we're changing the defaults. If a mailer is configured, it shall be used for notification emails by default. --- defaults/main.yml | 6 ++++++ templates/env.j2 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 1dde117..4d7fb49 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -39,6 +39,12 @@ gitea_config_database_name: gitea gitea_config_database_username: '' gitea_config_database_password: '' +# Enable this to send e-mail to watchers of a repository when something happens, like creating issues. Requires Mailer to be enabled. +# See: https://docs.gitea.com/administration/config-cheat-sheet#service-service +# +# We enable this by default if the mailer is enabled, because it makes sense use it for more than just transactional emails. +gitea_config_service_enable_notify_email: "{{ gitea_config_mailer_enabled }}" + gitea_config_mailer_enabled: false gitea_config_mailer_from: '' gitea_config_mailer_protocol: '' diff --git a/templates/env.j2 b/templates/env.j2 index 485bbd4..f5e2018 100644 --- a/templates/env.j2 +++ b/templates/env.j2 @@ -10,6 +10,8 @@ GITEA__database__PASSWD={{ gitea_config_database_password }} GITEA____RUN_USER={{ gitea_config_run_user }} +GITEA__service__ENABLE_NOTIFY_MAIL={{ gitea_config_service_enable_notify_email }} + {% if gitea_config_mailer_enabled %} GITEA__mailer__ENABLED={{ gitea_config_mailer_enabled }} GITEA__mailer__FROM={{ gitea_config_mailer_from }}