From 4be34eae29251f6bef50391ec6950a7e27d935d4 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 20 May 2020 11:00:05 +0200 Subject: [PATCH] Update to 2020-05-20 11:00 --- roles/matrix_ma1sd/defaults/main.yml | 5 ---- roles/matrix_ma1sd/templates/ma1sd.yaml.j2 | 13 ++------- roles/matrix_synapse/defaults/main.yml | 8 +++++- roles/matrix_synapse/templates/homeserver.yaml.j2 | 35 ++++++++++++----------- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/roles/matrix_ma1sd/defaults/main.yml b/roles/matrix_ma1sd/defaults/main.yml index aba05fc..45ec192 100644 --- a/roles/matrix_ma1sd/defaults/main.yml +++ b/roles/matrix_ma1sd/defaults/main.yml @@ -67,11 +67,6 @@ ma1sd_ldap_attr_other: # Outgoing email settings # Will use synapse settings if available -# ma1sd_smtp_server: smtp.domain.com -# ma1sd_smtp_port: 25 -# ma1sd_smtp_tls: True -# ma1sd_smtp_user: -# ma1sd_smtp_pass: # ma1sd_smtp_from: ma1sd@domain.com # Overwrite the DNS name of your Matrix server diff --git a/roles/matrix_ma1sd/templates/ma1sd.yaml.j2 b/roles/matrix_ma1sd/templates/ma1sd.yaml.j2 index 70667c6..843db31 100644 --- a/roles/matrix_ma1sd/templates/ma1sd.yaml.j2 +++ b/roles/matrix_ma1sd/templates/ma1sd.yaml.j2 @@ -78,16 +78,9 @@ threepid: email: connectors: smtp: - host: {{ ma1sd_smtp_server | default(synapse_smtp_server) }} - port: {{ ma1sd_smtp_port | default(synapse_smtp_port) }} - tls: {{ (ma1sd_smtp_tls | default(synapse_smtp_tls)) | ternary('2', '1') }} -{% if ma1sd_smtp_user is defined and ma1sd_smtp_pass is defined %} - login: "{{ ma1sd_smtp_user }}" - password: "{{ ma1sd_smtp_pass }}" -{% elif synapse_smtp_user is defined and synapse_smtp_pass is defined %} - login: "{{ synapse_smtp_user }}" - password: "{{ synapse_smtp_pass }}" -{% endif %} + host: localhost + port: 25 + tls: 1 identity: from: "{{ ma1sd_smtp_from | default('no-reply@' + ansible_domain) }}" storage: diff --git a/roles/matrix_synapse/defaults/main.yml b/roles/matrix_synapse/defaults/main.yml index 9de1c99..d780e44 100644 --- a/roles/matrix_synapse/defaults/main.yml +++ b/roles/matrix_synapse/defaults/main.yml @@ -25,7 +25,7 @@ synapse_pg_db_user: synapse # synapse_public_baseurl: https://matrix.example.com # Should synapse handle TLS -synapse_tls: True +synapse_tls: False # Limit of events for get and sync. -1 for no limit synapse_timeline_limit: -1 @@ -56,6 +56,12 @@ synapse_federation_ip_blacklist: # Limits synapse_upload_max_size: 20M +# Limit number of messages and login +synapse_rc_message_per_sec: 3 +synapse_rc_message_burst: 50 +synapse_rc_login_per_sec: 3 +synapse_rc_login_burst: 10 + # Registration settings synapse_enable_registration: False synapse_allow_guest_access: False diff --git a/roles/matrix_synapse/templates/homeserver.yaml.j2 b/roles/matrix_synapse/templates/homeserver.yaml.j2 index 8d26cf2..02b8676 100644 --- a/roles/matrix_synapse/templates/homeserver.yaml.j2 +++ b/roles/matrix_synapse/templates/homeserver.yaml.j2 @@ -92,6 +92,20 @@ registration_shared_secret: "{{ synapse_registration_shared_secret }}" bcrypt_rounds: 12 allow_guest_access: {{ synapse_allow_guest_access | ternary('True', 'False') }} +rc_message: + per_second: {{ synapse_rc_message_per_sec }} + burst_count: {{ synapse_rc_message_burst }} +rc_login: + address: + per_second: {{ synapse_rc_login_per_sec }} + burst_count: {{ synapse_rc_login_burst }} + account: + per_second: {{ synapse_rc_login_per_sec }} + burst_count: {{ synapse_rc_login_burst }} + failed_attempts: + per_second: {{ synapse_rc_login_per_sec }} + burst_count: {{ synapse_rc_login_burst }} + enable_metrics: False report_stats: False @@ -126,28 +140,17 @@ trusted_key_servers: - server_name: "matrix.org" suppress_key_server_warning: True -{% if synapse_email_notifs %} email: enable_notifs: True - smtp_host: "{{ synapse_smtp_server }}" - smtp_port: {{ synapse_smtp_port }} -{% if synapse_smtp_user is defined and synapse_smtp_pass is defined %} - smtp_user: "{{ synapse_smtp_user }}" - smtp_pass: "{{ synapse_smtp_pass }}" -{% endif %} - require_transport_security: {{ synapse_smtp_tls | ternary('True', 'False') }} + smtp_host: "localhost" + smtp_port: 25 + require_transport_security: False notif_from: "{{ synapse_smtp_from }}" app_name: {{ synapse_app_name }} notif_for_new_users: True - notif_template_html: notif_mail.html - notif_template_text: notif_mail.txt -{% if synapse_riot_url is defined %} - riot_base_url: "{{ synapse_riot_base_url }}" +{% if synapse_client_url is defined %} + client_base_url: "{{ synapse_client_base_url }}" {% endif %} -{% endif %} - -push: - include_content: true {% if synapse_auth == 'ldap' %} password_providers: