Skip to content

Commit

Permalink
Add variable for controlling service.ENABLE_NOTIFY_MAIL and wire it…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
spantaleev committed Jun 27, 2024
1 parent f2b2fcf commit b80dfe1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down
2 changes: 2 additions & 0 deletions templates/env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit b80dfe1

Please sign in to comment.