From 7a45c651d2cb8775b56e9df839f64a31e8d39b1d Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Mon, 24 Feb 2020 13:55:00 +0000 Subject: [PATCH 1/3] Use new syntax for default HS/IS in Riot config. This change makes no difference in itself, but is a pre-requisite for adding the 'server name' config, and the old syntax is deprecated. --- roles/matrix-riot-web/templates/config.json.j2 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/matrix-riot-web/templates/config.json.j2 b/roles/matrix-riot-web/templates/config.json.j2 index 69fb1393..6fc79077 100644 --- a/roles/matrix-riot-web/templates/config.json.j2 +++ b/roles/matrix-riot-web/templates/config.json.j2 @@ -1,6 +1,12 @@ { - "default_hs_url": {{ matrix_riot_web_default_hs_url|string|to_json }}, - "default_is_url": {{ matrix_riot_web_default_is_url|string|to_json }}, + "default_server_config": { + "m.homeserver": { + "base_url": {{ matrix_riot_web_default_hs_url|string|to_json }}, + }, + "m.identity_server": { + "base_url": {{ matrix_riot_web_default_is_url|string|to_json }} + } + }, "disable_custom_urls": {{ matrix_riot_web_disable_custom_urls|to_json }}, "disable_guests": {{ matrix_riot_web_disable_guests|to_json }}, "brand": {{ matrix_riot_web_brand|to_json }}, From 3228cfd229b74c05e3bab520c0ec45f5bb8f015e Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Mon, 24 Feb 2020 14:00:43 +0000 Subject: [PATCH 2/3] Add custom server name string in Riot config. This adds into the Riot config.json the field 'default_server_config.m.homeserver.server_name' with, by default, the value of the playbook's 'matrix_domain' variable. Riot displays this string in its login page and will now say 'Sign in to your Matrix account on example.org' (the server name) instead of 'Sign in ... on matrix.example.org' (the server domain-name). This string can be configured by setting the playbook variable 'matrix_riot_web_default_server_name' to any string, so we can make Riot say for example 'Sign in ... on Our Server'. --- roles/matrix-riot-web/defaults/main.yml | 1 + roles/matrix-riot-web/templates/config.json.j2 | 1 + 2 files changed, 2 insertions(+) diff --git a/roles/matrix-riot-web/defaults/main.yml b/roles/matrix-riot-web/defaults/main.yml index 05f6b796..cec6c8ea 100644 --- a/roles/matrix-riot-web/defaults/main.yml +++ b/roles/matrix-riot-web/defaults/main.yml @@ -17,6 +17,7 @@ matrix_riot_web_container_extra_arguments: [] matrix_riot_web_systemd_required_services_list: ['docker.service'] # Riot config.json customizations +matrix_riot_web_default_server_name: "{{ matrix_domain }}" matrix_riot_web_default_hs_url: "" matrix_riot_web_default_is_url: ~ matrix_riot_web_disable_custom_urls: true diff --git a/roles/matrix-riot-web/templates/config.json.j2 b/roles/matrix-riot-web/templates/config.json.j2 index 6fc79077..16a0cf4c 100644 --- a/roles/matrix-riot-web/templates/config.json.j2 +++ b/roles/matrix-riot-web/templates/config.json.j2 @@ -2,6 +2,7 @@ "default_server_config": { "m.homeserver": { "base_url": {{ matrix_riot_web_default_hs_url|string|to_json }}, + "server_name": {{ matrix_riot_web_default_server_name|string|to_json }} }, "m.identity_server": { "base_url": {{ matrix_riot_web_default_is_url|string|to_json }} From 0703c31e11ed813632c692e8e2fa42e123ea5754 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Mon, 24 Feb 2020 14:55:08 +0000 Subject: [PATCH 3/3] Document the new Riot server name setting. --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f5f62f4..53ee3295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 2020-02-24 + +## Customize the server name in Riot's login page + +You can now customize the server name string that Riot-web displays in its login page. + +These playbook variables, with these default values, have been added: + +``` +matrix_riot_web_default_server_name: "{{ matrix_domain }}" +``` + +The login page previously said "Sign in to your Matrix account on matrix.example.org" (the homeserver's domain name). It will now say "Sign in ... on example.org" (the server name) by default, or "Sign in ... on Our Server" if you set the variable to "Our Server". + +To support this, the config.json template is changed to use the configuration key `default_server_config` for setting the default HS/IS, and the new configuration key `server_name` is added in there. + + # 2020-01-30 ## Disabling TLSv1.1