From 3cb3f17a90026d493737cefa85c518daa028d767 Mon Sep 17 00:00:00 2001 From: anadahz Date: Sun, 18 Nov 2018 02:00:08 +0000 Subject: [PATCH] Add more configured options for riot-web and homeserver. --- examples/host-vars.yml | 12 ++++++++++++ .../templates/riot-web/config.json.j2 | 14 ++++++++++++++ .../templates/synapse/homeserver.yaml.j2 | 11 +++++++++++ 3 files changed, 37 insertions(+) diff --git a/examples/host-vars.yml b/examples/host-vars.yml index d0d1a41e..14f4b9a1 100644 --- a/examples/host-vars.yml +++ b/examples/host-vars.yml @@ -26,3 +26,15 @@ matrix_coturn_turn_static_auth_secret: "" # You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`). matrix_synapse_macaroon_secret_key: "" +# Set autojoin room(s) +# Users who register on this homeserver will automatically be joined to these rooms +matrix_autojoin_rooms: ['#room:server.tld'] + +# Enable registrations, disabled by default. +matrix_enable_reg: true + +# Disable Riot welcome bot, default enabled +riot_welcome_bot: false + +# Riot public room directory server +riot_roomdir_servers: ['server.tld'] diff --git a/roles/matrix-server/templates/riot-web/config.json.j2 b/roles/matrix-server/templates/riot-web/config.json.j2 index 98939986..52004cbc 100644 --- a/roles/matrix-server/templates/riot-web/config.json.j2 +++ b/roles/matrix-server/templates/riot-web/config.json.j2 @@ -10,10 +10,24 @@ "integrations_jitsi_widget_url": "{{ matrix_riot_web_integrations_jitsi_widget_url }}", "bug_report_endpoint_url": "https://riot.im/bugreports/submit", "enableLabs": true, +{% if riot_roomdir_servers is defined %} +{% for server in riot_roomdir_servers %} + "roomDirectory": { + "servers": [ + "{{ server }}" + ] + }, +{% endfor %} +{% else %} "roomDirectory": { "servers": [ "matrix.org" ] +{% endif %} +{% if riot_welcome_bot|default(true)|bool %} }, "welcomeUserId": "@riot-bot:matrix.org" +{% else %} + } +{% endif %} } diff --git a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 index 90bd2120..ceefad03 100644 --- a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 @@ -432,7 +432,11 @@ turn_allow_guests: False ## Registration ## # Enable registration for new users. +{% if matrix_enable_reg|default(false)|bool %} +enable_registration: True +{% else %} enable_registration: False +{% endif %} # The user must provide all of the below types of 3PID when registering. # @@ -476,9 +480,16 @@ trusted_third_party_id_servers: # Users who register on this homeserver will automatically be joined # to these rooms +{% if matrix_autojoin_rooms is defined %} +{% for room in matrix_autojoin_rooms %} +auto_join_rooms: + - "{{ room }}" +{% endfor %} +{% else %} #auto_join_rooms: # - "#example:example.com" +{% endif %} ## Metrics ###