From d1bec257814bdebe3a2d84e4bc955a6582922d50 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 15 Jan 2025 22:15:44 +0100 Subject: [PATCH] Optimized friendica und refactored mail configuration --- roles/docker-baserow/templates/env.j2 | 2 +- roles/docker-bigbluebutton/templates/env.j2 | 6 +++--- .../templates/discourse_application.yml.j2 | 4 ++-- roles/docker-friendica/README.md | 4 +++- .../templates/docker-compose.yml.j2 | 18 +++++++++++------- .../templates/.env.production.j2 | 4 ++-- .../templates/synapse/homeserver.yaml.j2 | 4 ++-- roles/docker-peertube/templates/env.j2 | 6 +++--- roles/docker-pixelfed/templates/env.j2 | 4 ++-- roles/docker-taiga/templates/.env.j2 | 4 ++-- .../templates/msmtprc.conf.j2 | 4 ++-- .../templates/systemd-notifier-email.sh.j2 | 2 +- 12 files changed, 34 insertions(+), 28 deletions(-) diff --git a/roles/docker-baserow/templates/env.j2 b/roles/docker-baserow/templates/env.j2 index 1887ec2f..183facc4 100644 --- a/roles/docker-baserow/templates/env.j2 +++ b/roles/docker-baserow/templates/env.j2 @@ -5,7 +5,7 @@ BASEROW_PUBLIC_URL=https://{{ domain }} EMAIL_SMTP={{ system_email_smtp | upper }} EMAIL_SMTP_HOST={{ system_email_host }} EMAIL_SMTP_PORT={{ system_email_smtp_port }} -EMAIL_SMTP_USER={{ system_email_username }} +EMAIL_SMTP_USER={{ system_email_address }} EMAIL_SMTP_PASSWORD={{ system_email_password }} EMAIL_SMTP_USE_TLS={{ system_email_tls | upper }} diff --git a/roles/docker-bigbluebutton/templates/env.j2 b/roles/docker-bigbluebutton/templates/env.j2 index 18d01f54..f47e56ef 100644 --- a/roles/docker-bigbluebutton/templates/env.j2 +++ b/roles/docker-bigbluebutton/templates/env.j2 @@ -198,13 +198,13 @@ ALLOW_GREENLIGHT_ACCOUNTS=true SMTP_SERVER={{system_email_host}} SMTP_DOMAIN={{domain}} SMTP_PORT={{system_email_smtp_port}} -SMTP_USERNAME={{system_email_username}} +SMTP_USERNAME={{system_email_address}} SMTP_PASSWORD={{system_email_password}} SMTP_AUTH=plain SMTP_OPENSSL_VERIFY_MODE=none SMTP_STARTTLS_AUTO={{system_email_start_tls}} -SMTP_SENDER={{system_email_username}} -SMTP_SENDER_EMAIL={{system_email_username}} +SMTP_SENDER={{system_email_address}} +SMTP_SENDER_EMAIL={{system_email_address}} # Prefix for the applications root URL. # Useful for deploying the application to a subdirectory, which is highly recommended diff --git a/roles/docker-discourse/templates/discourse_application.yml.j2 b/roles/docker-discourse/templates/discourse_application.yml.j2 index b9e9e3bc..b1962e9a 100644 --- a/roles/docker-discourse/templates/discourse_application.yml.j2 +++ b/roles/docker-discourse/templates/discourse_application.yml.j2 @@ -57,11 +57,11 @@ env: # WARNING the char '#' in SMTP password can cause problems! DISCOURSE_SMTP_ADDRESS: {{ system_email_host }} DISCOURSE_SMTP_PORT: {{ system_email_smtp_port }} - DISCOURSE_SMTP_USER_NAME: {{ system_email }} + DISCOURSE_SMTP_USER_NAME: {{system_email_address}} DISCOURSE_SMTP_PASSWORD: {{ system_email_password }} DISCOURSE_SMTP_ENABLE_START_TLS: {{ system_email_start_tls | upper }} DISCOURSE_SMTP_DOMAIN: {{ system_email_domain }} - DISCOURSE_NOTIFICATION_EMAIL: {{ system_email }} + DISCOURSE_NOTIFICATION_EMAIL: {{system_email_address}} # Database Configuration DISCOURSE_DB_USERNAME: {{ database_username }} diff --git a/roles/docker-friendica/README.md b/roles/docker-friendica/README.md index 26967631..dfa99e5b 100644 --- a/roles/docker-friendica/README.md +++ b/roles/docker-friendica/README.md @@ -31,6 +31,7 @@ docker compose exec --user www-data -it application bin/console autoinstall ## reinitialisation ### docker +docker-compose up -d --force-recreate ### full docker-compose up -d --force-recreate && sleep 2; docker compose exec --user www-data -it application bin/console autoinstall; @@ -58,4 +59,5 @@ VALUES ( ## More information - https://hub.docker.com/_/friendica -- https://wiki.friendi.ca/docs/install \ No newline at end of file +- https://wiki.friendi.ca/docs/install +- https://github.com/friendica/docker \ No newline at end of file diff --git a/roles/docker-friendica/templates/docker-compose.yml.j2 b/roles/docker-friendica/templates/docker-compose.yml.j2 index e1227a71..fc98c01b 100644 --- a/roles/docker-friendica/templates/docker-compose.yml.j2 +++ b/roles/docker-friendica/templates/docker-compose.yml.j2 @@ -3,7 +3,7 @@ services: {% include 'templates/docker/services/' + database_type + '.yml.j2' %} application: - image: friendica/server + image: friendica restart: {{docker_restart_policy}} volumes: - data:/var/www/html @@ -21,20 +21,24 @@ services: # Debugging FRIENDICA_DEBUGGING: false + FRIENDICA_LOGLEVEL: 5 + FRIENDICA_LOGGER: stream + FRIENDICA_LOGFILE: php://stdout + # Database Configuration MYSQL_HOST: {{database_host}}:3306 MYSQL_DATABASE: {{database_name}} MYSQL_USER: {{database_username}} MYSQL_PASSWORD: {{database_password}} - SMTP: {{system_email_host}} - + # Email Configuration - SMTP_DOMAIN: {{ system_email_host }} - SMTP_PORT: {{system_email_smtp_port}} + SMTP: {{system_email_host}} + SMTP_DOMAIN: {{system_email_domain}} + SMTP_PORT: {{system_email_smtp_port}} SMTP_AUTH_USER: {{system_email_username}} SMTP_AUTH_PASS: {{system_email_password}} - SMTP_STARTTLS: {{system_email_start_tls}} - SMTP_FROM: {{system_email_username}} + SMTP_STARTTLS: "{{ 'On' if system_email_start_tls else 'Off' }}" + SMTP_FROM: {{system_email_address}} # Administrator Credentials FRIENDICA_ADMIN_MAIL: {{administrator_email}} diff --git a/roles/docker-mastodon/templates/.env.production.j2 b/roles/docker-mastodon/templates/.env.production.j2 index 93dfcaa0..07606a99 100644 --- a/roles/docker-mastodon/templates/.env.production.j2 +++ b/roles/docker-mastodon/templates/.env.production.j2 @@ -18,12 +18,12 @@ REDIS_PASSWORD= SMTP_SERVER={{system_email_host}} SMTP_PORT={{system_email_smtp_port}} -SMTP_LOGIN={{system_email_username}} +SMTP_LOGIN={{system_email_address}} SMTP_PASSWORD={{system_email_password}} SMTP_AUTH_METHOD=plain SMTP_OPENSSL_VERIFY_MODE=none SMTP_ENABLE_STARTTLS=auto -SMTP_FROM_ADDRESS=Mastodon <{{system_email_username}}> +SMTP_FROM_ADDRESS=Mastodon <{{system_email_address}}> ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= {{mastodon_active_record_encryption_deterministic_key}} ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT={{mastodon_active_record_encryption_key_derivation_salt}} diff --git a/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 b/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 index 40286e19..2cfc18b2 100644 --- a/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 +++ b/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 @@ -33,12 +33,12 @@ admin_contact: 'mailto:{{administrator_email}}' email: smtp_host: "{{system_email_host}}" smtp_port: "{{system_email_smtp_port}}" - smtp_user: "{{system_email_username}}" + smtp_user: "{{system_email_address}}" smtp_pass: "{{system_email_password}}" #force_tls: true #require_transport_security: true enable_tls: "{{ system_email_tls | upper }}" - notif_from: "Your Friendly %(app)s homeserver <{{system_email}}>" + notif_from: "Your Friendly %(app)s homeserver <{{system_email_address}}>" app_name: "Matrix on {{synapse_domain}}" enable_notifs: true notif_for_new_users: false diff --git a/roles/docker-peertube/templates/env.j2 b/roles/docker-peertube/templates/env.j2 index 52608ac5..f9b94e74 100644 --- a/roles/docker-peertube/templates/env.j2 +++ b/roles/docker-peertube/templates/env.j2 @@ -14,11 +14,11 @@ PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback"] PEERTUBE_SECRET={{peertube_secret}} # E-mail configuration -PEERTUBE_SMTP_USERNAME={{system_email_username}} +PEERTUBE_SMTP_USERNAME={{system_email_address}} PEERTUBE_SMTP_PASSWORD={{system_email_password}} PEERTUBE_SMTP_HOSTNAME={{system_email_host}} PEERTUBE_SMTP_PORT={{system_email_smtp_port}} -PEERTUBE_SMTP_FROM={{system_email}} +PEERTUBE_SMTP_FROM={{system_email_address}} PEERTUBE_SMTP_TLS={{ system_email_tls | lower }} PEERTUBE_SMTP_DISABLE_STARTTLS={{ 'false' if system_email_start_tls else 'true' }} -PEERTUBE_ADMIN_EMAIL={{system_email}} \ No newline at end of file +PEERTUBE_ADMIN_EMAIL={{system_email_address}} \ No newline at end of file diff --git a/roles/docker-pixelfed/templates/env.j2 b/roles/docker-pixelfed/templates/env.j2 index 8d981862..cd2d2faf 100644 --- a/roles/docker-pixelfed/templates/env.j2 +++ b/roles/docker-pixelfed/templates/env.j2 @@ -48,9 +48,9 @@ RESTRICTED_INSTANCE=false MAIL_DRIVER=log MAIL_HOST={{system_email_host}} MAIL_PORT={{system_email_smtp_port}} -MAIL_FROM_ADDRESS="{{system_email_username}}" +MAIL_FROM_ADDRESS="{{system_email_address}}" MAIL_FROM_NAME="Pixelfed" -MAIL_USERNAME={{system_email_username}} +MAIL_USERNAME={{system_email_address}} MAIL_PASSWORD={{system_email_password}} MAIL_ENCRYPTION=tls diff --git a/roles/docker-taiga/templates/.env.j2 b/roles/docker-taiga/templates/.env.j2 index ec9dd0e8..187be69b 100644 --- a/roles/docker-taiga/templates/.env.j2 +++ b/roles/docker-taiga/templates/.env.j2 @@ -15,9 +15,9 @@ POSTGRES_PASSWORD={{database_password}} # database user's password EMAIL_BACKEND = console # use an SMTP server or display the emails in the console (either "smtp" or "console") EMAIL_HOST = {{system_email_host}} # SMTP server address EMAIL_PORT = {{system_email_smtp_port}} # default SMTP port -EMAIL_HOST_USER = {{system_email_username}} # user to connect the SMTP server +EMAIL_HOST_USER = {{system_email_address}} # user to connect the SMTP server EMAIL_HOST_PASSWORD = {{system_email_password}} # SMTP user's password -EMAIL_DEFAULT_FROM = {{system_email}} # default email address for the automated emails +EMAIL_DEFAULT_FROM = {{system_email_address}} # default email address for the automated emails # EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive (only set one of those to True) EMAIL_USE_TLS={{ system_email_tls | lower | capitalize }} # use TLS (secure) connection with the SMTP server EMAIL_USE_SSL={{ 'False' if system_email_start_tls else 'True' }} # use implicit TLS (secure) connection with the SMTP server diff --git a/roles/systemd-notifier-email/templates/msmtprc.conf.j2 b/roles/systemd-notifier-email/templates/msmtprc.conf.j2 index 4f7ed0f2..e6fb5aca 100644 --- a/roles/systemd-notifier-email/templates/msmtprc.conf.j2 +++ b/roles/systemd-notifier-email/templates/msmtprc.conf.j2 @@ -12,8 +12,8 @@ tls off account system_email host {{system_email_host}} port {{system_email_smtp_port}} -from {{system_email}} -user {{system_email_username}} +from {{system_email_address}} +user {{system_email_address}} password {{system_email_password}} account default : system_email diff --git a/roles/systemd-notifier-email/templates/systemd-notifier-email.sh.j2 b/roles/systemd-notifier-email/templates/systemd-notifier-email.sh.j2 index b99811be..8d68e552 100644 --- a/roles/systemd-notifier-email/templates/systemd-notifier-email.sh.j2 +++ b/roles/systemd-notifier-email/templates/systemd-notifier-email.sh.j2 @@ -2,7 +2,7 @@ /usr/bin/sendmail -t < +From: systemd <{{system_email_address}}> Subject: $1 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8