From ca15d219b9a63f08667fc45d1a5f2518ce1d5244 Mon Sep 17 00:00:00 2001 From: Daniel Hoffend Date: Thu, 25 Apr 2019 01:05:28 +0200 Subject: [PATCH] make welcome.html customizable --- group_vars/matrix-servers | 2 + roles/matrix-riot-web/defaults/main.yml | 3 + .../matrix-riot-web/tasks/setup_riot_web.yml | 1 + .../systemd/matrix-riot-web.service.j2 | 1 + .../matrix-riot-web/templates/welcome.html.j2 | 194 ++++++++++++++++++ 5 files changed, 201 insertions(+) create mode 100644 roles/matrix-riot-web/templates/welcome.html.j2 diff --git a/group_vars/matrix-servers b/group_vars/matrix-servers index 7ded5ff42..facf1b84e 100755 --- a/group_vars/matrix-servers +++ b/group_vars/matrix-servers @@ -319,6 +319,8 @@ matrix_riot_web_integrations_jitsi_widget_url: "{{ matrix_dimension_integrations matrix_riot_web_self_check_validate_certificates: "{{ false if matrix_ssl_retrieval_method == 'self-signed' else false }}" +matrix_riot_web_registration_enabled: "{{ matrix_synapse_enable_registration }}" + ###################################################################### # # /matrix-riot-web diff --git a/roles/matrix-riot-web/defaults/main.yml b/roles/matrix-riot-web/defaults/main.yml index 4c6424dc3..b1112eeee 100644 --- a/roles/matrix-riot-web/defaults/main.yml +++ b/roles/matrix-riot-web/defaults/main.yml @@ -28,3 +28,6 @@ matrix_riot_web_embedded_pages_home_path: ~ # Controls whether the self-check feature should validate SSL certificates. matrix_riot_web_self_check_validate_certificates: true + +# don't show the registration button on welcome page +matrix_riot_web_registration_enabled: false diff --git a/roles/matrix-riot-web/tasks/setup_riot_web.yml b/roles/matrix-riot-web/tasks/setup_riot_web.yml index a8a314b0e..62eb750b0 100644 --- a/roles/matrix-riot-web/tasks/setup_riot_web.yml +++ b/roles/matrix-riot-web/tasks/setup_riot_web.yml @@ -28,6 +28,7 @@ with_items: - {src: "{{ role_path }}/templates/config.json.j2", name: "config.json"} - {src: "{{ role_path }}/templates/nginx.conf.j2", name: "nginx.conf"} + - {src: "{{ role_path }}/templates/welcome.html.j2", name: "welcome.html"} - {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"} when: "matrix_riot_web_enabled and item.src is not none" diff --git a/roles/matrix-riot-web/templates/systemd/matrix-riot-web.service.j2 b/roles/matrix-riot-web/templates/systemd/matrix-riot-web.service.j2 index 2b57f27c0..06f60cc58 100644 --- a/roles/matrix-riot-web/templates/systemd/matrix-riot-web.service.j2 +++ b/roles/matrix-riot-web/templates/systemd/matrix-riot-web.service.j2 @@ -25,6 +25,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-riot-web \ {% if matrix_riot_web_embedded_pages_home_path is not none %} -v {{ matrix_riot_web_data_path }}/home.html:/etc/riot-web/home.html:ro \ {% endif %} + -v {{ matrix_riot_web_data_path }}/welcome.html:/etc/riot-web/welcome.html:ro \ {{ matrix_riot_web_docker_image }} ExecStop=-/usr/bin/docker kill matrix-riot-web ExecStop=-/usr/bin/docker rm matrix-riot-web diff --git a/roles/matrix-riot-web/templates/welcome.html.j2 b/roles/matrix-riot-web/templates/welcome.html.j2 new file mode 100644 index 000000000..6456e9475 --- /dev/null +++ b/roles/matrix-riot-web/templates/welcome.html.j2 @@ -0,0 +1,194 @@ + + +
+ + + +

_t("Welcome to Riot.im")

+

_t("Decentralised, encrypted chat & collaboration powered by [matrix]")

+
+
+ +
_t("Sign In")
+
+{% if matrix_riot_web_registration_enabled %} + +
_t("Create Account")
+
+{% endif %} +
+{% if matrix_riot_web_disable_guests != true %} + + +
+
+
_t("Need help?")
+ +
_t("Chat with Riot Bot")
+
+
+
+
_t("Explore rooms")
+ +
_t("Room Directory")
+
+
+
+ +{% endif %} +
+