From de3850e8244b99c40087d9037599de619f7f3dd1 Mon Sep 17 00:00:00 2001 From: Mira Kuntz Date: Thu, 2 May 2024 15:43:07 +0200 Subject: [PATCH] add mail sending functionality --- group_vars/plausible.yml | 7 ++++++- roles/usegalaxy-eu.plausible/tasks/main.yml | 8 ++++++++ roles/usegalaxy-eu.plausible/templates/plausible-mail.j2 | 4 ++++ roles/usegalaxy-eu.plausible/templates/plausible.j2 | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 roles/usegalaxy-eu.plausible/templates/plausible-mail.j2 diff --git a/group_vars/plausible.yml b/group_vars/plausible.yml index a1bbf465a..4286da40b 100644 --- a/group_vars/plausible.yml +++ b/group_vars/plausible.yml @@ -6,8 +6,13 @@ docker_service_state: started docker_service_enabled: true # Plausible -plausible_lock_register: true +plausible_lock_register: invite_only +plausible_from_mail: galaxy-no-reply@informatik.uni-freiburg.de +plausible_smtp_host: smtp.informatik.uni-freiburg.de +plausible_smtp_username: "{{ smtp_username }}" +plausible_smtp_password: "{{ smtp_password }}" +plausible_smtp_port: 587 # Certbot certbot_auth_method: --webroot certbot_well_known_root: /srv/nginx/_well-known_root diff --git a/roles/usegalaxy-eu.plausible/tasks/main.yml b/roles/usegalaxy-eu.plausible/tasks/main.yml index c9626d439..84c6ac830 100644 --- a/roles/usegalaxy-eu.plausible/tasks/main.yml +++ b/roles/usegalaxy-eu.plausible/tasks/main.yml @@ -15,6 +15,14 @@ group: root mode: '0640' +- name: Template config for mail + template: + src: plausible-mail.j2 + dest: "{{ plausible_dir }}/plausible-mail-conf.env" + owner: root + group: root + mode: '0640' + - name: Create and start services docker_compose: project_src: "{{ plausible_dir }}" diff --git a/roles/usegalaxy-eu.plausible/templates/plausible-mail.j2 b/roles/usegalaxy-eu.plausible/templates/plausible-mail.j2 new file mode 100644 index 000000000..69bb15541 --- /dev/null +++ b/roles/usegalaxy-eu.plausible/templates/plausible-mail.j2 @@ -0,0 +1,4 @@ +RELAY_HOST="{{ plausible_smtp_host }}" +RELAY_PORT="{{ plausible_smtp_port }}" +RELAY_USERNAME="{{ plausible_smtp_username }}" +RELAY_PASSWORD="{{ plausible_smtp_password }}" \ No newline at end of file diff --git a/roles/usegalaxy-eu.plausible/templates/plausible.j2 b/roles/usegalaxy-eu.plausible/templates/plausible.j2 index 0eed7a135..5ca85d0b3 100644 --- a/roles/usegalaxy-eu.plausible/templates/plausible.j2 +++ b/roles/usegalaxy-eu.plausible/templates/plausible.j2 @@ -4,3 +4,4 @@ ADMIN_USER_PWD="{{ plausible_admin_password }}" BASE_URL="https://plausible.galaxyproject.eu" SECRET_KEY_BASE="{{ plausible_secret_key }}" DISABLE_REGISTRATION={{ plausible_lock_register }} +MAILER_EMAIL="{{ plausible_from_mail }}" \ No newline at end of file