diff --git a/roles/matrix_synapse/defaults/main.yml b/roles/matrix_synapse/defaults/main.yml index ea7b74c..e7685cb 100644 --- a/roles/matrix_synapse/defaults/main.yml +++ b/roles/matrix_synapse/defaults/main.yml @@ -116,5 +116,5 @@ synapse_oidc_server: https://sso.domain.com synapse_oidc_client: matric synapse_oidc_secret: XXXXX # Jinja2 template to for the local part of the MXID. -synapse_oidc_localpart: "{{ '\"{{ user.sub }}\"' }}" -synapse_oidc_display_name: "{{ '\"{{ user.name }}\"' }}" +synapse_oidc_localpart: "{{ '{{ user.sub }}' }}" +synapse_oidc_display_name: "{{ '{{ user.name }}' }}" diff --git a/roles/matrix_synapse/templates/homeserver.yaml.j2 b/roles/matrix_synapse/templates/homeserver.yaml.j2 index c5b4844..6d83501 100644 --- a/roles/matrix_synapse/templates/homeserver.yaml.j2 +++ b/roles/matrix_synapse/templates/homeserver.yaml.j2 @@ -6,8 +6,8 @@ tls_private_key_path: "{{ synapse_root_dir }}/etc/{{ synapse_server_name }}.tls. tls_dh_params_path: "{{ synapse_root_dir }}/etc/{{ synapse_server_name }}.tls.dh" {% endif %} -server_name: "{{ synapse_server_name }}" -public_baseurl: {{ synapse_public_baseurl | default('https://matrix.' + synapse_server_name) }} +server_name: '{{ synapse_server_name }}' +public_baseurl: '{{ synapse_public_baseurl | default('https://matrix.' + synapse_server_name) }}' pid_file: {{ synapse_root_dir }}/tmp/homeserver.pid @@ -39,23 +39,23 @@ listeners: database: name: psycopg2 args: - database: {{ synapse_pg_db_name }} - host: {{ synapse_pg_db_server }} - user: {{ synapse_pg_db_user }} - password: {{ synapse_pg_db_pass }} + database: '{{ synapse_pg_db_name }}' + host: '{{ synapse_pg_db_server }}' + user: '{{ synapse_pg_db_user }}' + password: '{{ synapse_pg_db_pass }}' cp_min: 5 cp_max: 10 -event_cache_size: "10K" +event_cache_size: '10K' verbose: 0 -log_config: "{{ synapse_root_dir }}/etc/logging.conf" +log_config: '{{ synapse_root_dir }}/etc/logging.conf' {% if '*' not in synapse_federation_domain_whitelist %} {% if synapse_federation_domain_whitelist | length > 0 %} federation_domain_whitelist: {% for domain in synapse_federation_domain_whitelist %} - - {{ domain }} + - '{{ domain }}' {% endfor %} {% else %} federation_domain_whitelist: [] @@ -65,29 +65,29 @@ federation_domain_whitelist: [] {% if synapse_federation_ip_blacklist | length > 0 %} federation_ip_range_blacklist: {% for ip in synapse_federation_ip_blacklist %} - - {{ ip }} + - '{{ ip }}' {% endfor %} {% else %} federation_ip_range_blacklist: [] {% endif %} -media_store_path: "{{ synapse_root_dir }}/media_store" -uploads_path: "{{ synapse_root_dir }}/uploads" -max_upload_size: "{{ synapse_upload_max_size }}" +media_store_path: '{{ synapse_root_dir }}/media_store' +uploads_path: '{{ synapse_root_dir }}/uploads' +max_upload_size: '{{ synapse_upload_max_size }}' {% if synapse_turn_uris is defined and synapse_turn_uris | length > 0 %} turn_uris: {% for uri in synapse_turn_uris %} - - {{ uri }} + - '{{ uri }}' {% endfor %} -turn_shared_secret: "{{ synapse_turn_shared_secret | default(turnserver_auth_secret) }}" -turn_user_lifetime: "1h" +turn_shared_secret: '{{ synapse_turn_shared_secret | default(turnserver_auth_secret) }}' +turn_user_lifetime: '1h' turn_allow_guests: {{ synapse_turn_allow_guests | ternary('True', 'False') }} {% endif %} enable_registration: {{ synapse_enable_registration | ternary('True', 'False') }} {% if synapse_registration_shared_secret is defined %} -registration_shared_secret: "{{ synapse_registration_shared_secret }}" +registration_shared_secret: '{{ synapse_registration_shared_secret }}' {% endif %} bcrypt_rounds: 12 allow_guest_access: {{ synapse_allow_guest_access | ternary('True', 'False') }} @@ -109,9 +109,9 @@ rc_login: enable_metrics: False report_stats: False -default_identity_server: {{ synapse_public_baseurl | default('https://matrix.' + synapse_server_name) }} +default_identity_server: '{{ synapse_public_baseurl | default('https://matrix.' + synapse_server_name) }}' -macaroon_secret_key: "{{ synapse_macaroon_key }}" +macaroon_secret_key: '{{ synapse_macaroon_key }}' expire_access_token: False @@ -120,62 +120,62 @@ url_preview_enabled: True {% if synapse_url_preview_ip_range_blacklist is defined and synapse_url_preview_ip_range_blacklist | length > 0 %} url_preview_ip_range_blacklist: {% for ip in synapse_url_preview_ip_range_blacklist %} - - {{ ip }} + - '{{ ip }}' {% endfor %} {% endif %} {% if synapse_url_preview_ip_range_whitelist is defined and synapse_url_preview_ip_range_whitelist | length > 0 %} url_preview_ip_range_whitelist: {% for ip in synapse_url_preview_ip_range_whitelist %} - - {{ ip }} + - '{{ ip }}' {% endfor %} {% endif %} max_spider_size: {{ synapse_max_spider_size }} {% endif %} -form_secret: "{{ synapse_form_secret }}" +form_secret: '{{ synapse_form_secret }}' -signing_key_path: "{{ synapse_root_dir }}/etc/{{ synapse_server_name }}.signing.key" +signing_key_path: '{{ synapse_root_dir }}/etc/{{ synapse_server_name }}.signing.key' trusted_key_servers: - - server_name: "matrix.org" + - server_name: 'matrix.org' suppress_key_server_warning: True email: enable_notifs: True - smtp_host: "localhost" + smtp_host: 'localhost' smtp_port: 25 require_transport_security: False - notif_from: "{{ synapse_smtp_from }}" - app_name: {{ synapse_app_name }} + notif_from: '{{ synapse_smtp_from }}' + app_name: '{{ synapse_app_name }}' notif_for_new_users: True {% if synapse_client_url is defined %} - client_base_url: "{{ synapse_client_base_url }}" + client_base_url: '{{ synapse_client_base_url }}' {% endif %} {% if synapse_auth == 'ldap' %} password_providers: - - module: "ldap_auth_provider.LdapAuthProvider" + - module: 'ldap_auth_provider.LdapAuthProvider' config: enabled: True - uri: "{{ synapse_ldap_uri }}" + uri: '{{ synapse_ldap_uri }}' start_tls: {{ synapse_ldap_start_tls | ternary('True', 'False') }} - base: "{{ synapse_ldap_user_base }}" + base: '{{ synapse_ldap_user_base }}' attributes: - uid: "{{ synapse_ldap_attr_uid }}" - mail: "{{ synapse_ldap_attr_email }}" - name: "{{ synapse_ldap_attr_name }}" + uid: '{{ synapse_ldap_attr_uid }}' + mail: '{{ synapse_ldap_attr_email }}' + name: '{{ synapse_ldap_attr_name }}' {% if synapse_ldap_bind_dn is defined and synapse_ldap_bind_pass is defined %} - bind_dn: {{ synapse_ldap_bind_dn }} - bind_password: {{ synapse_ldap_bind_pass }} + bind_dn: '{{ synapse_ldap_bind_dn }}' + bind_password: '{{ synapse_ldap_bind_pass }}' {% endif %} {% if synapse_ldap_filter is defined %} - filter: "{{ synapse_ldap_filter }}" + filter: '{{ synapse_ldap_filter }}' {% endif %} {% elif synapse_auth == 'rest' %} password_providers: - - module: "rest_auth_provider.RestAuthProvider" + - module: 'rest_auth_provider.RestAuthProvider' config: - endpoint: "{{ synapse_auth_rest_uri }}" + endpoint: '{{ synapse_auth_rest_uri }}' {% elif synapse_auth == 'oidc' %} oidc_config: enabled: True @@ -184,9 +184,9 @@ oidc_config: client_secret: '{{ synapse_oidc_secret }}' user_mapping_provider: config: - localpart_template: {{ synapse_oidc_localpart }} + localpart_template: '{{ synapse_oidc_localpart }}' {% if synapse_oidc_display_name is defined %} - display_name_template: {{ synapse_oidc_display_name }} + display_name_template: '{{ synapse_oidc_display_name }}' {% endif %} sso: @@ -199,8 +199,8 @@ password_config: {% endif %} alias_creation_rules: - - user_id: "*" - alias: "*" + - user_id: '*' + alias: '*' action: allow ...