development
Horvath Gergely 5 years ago
commit d53d63ab07

1
.gitignore vendored

@ -1,3 +1,4 @@
/inventory/* /inventory/*
!/inventory/.gitkeep !/inventory/.gitkeep
!/inventory/host_vars/.gitkeep !/inventory/host_vars/.gitkeep
/roles/*/files/scratchpad

@ -1,3 +1,29 @@
# 2020-02-26
## Riot-web themes are here
The playbook now makes it easy to install custom riot-web themes.
To learn more, take a look at our [riot-web documentation on Themes](docs/configuring-playbook-riot-web.md#themes).
# 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 # 2020-01-30
## Disabling TLSv1.1 ## Disabling TLSv1.1

@ -28,18 +28,18 @@ matrix_appservice_webhooks_log_level: '<log_level>'
4. If you're using the [Dimension Integration Manager](configuring-playbook-dimension.md), you can configure the Webhooks bridge by opening the Dimension integration manager -> Settings -> Bridges and selecting edit action for "Webhook Bridge". Press "Add self-hosted Bridge" button and populate "Provisioning URL" & "Shared Secret" values from `/matrix/appservice-webhooks/config/config.yaml` file's homeserver URL value and provisioning secret value, respectively. 4. If you're using the [Dimension Integration Manager](configuring-playbook-dimension.md), you can configure the Webhooks bridge by opening the Dimension integration manager -> Settings -> Bridges and selecting edit action for "Webhook Bridge". Press "Add self-hosted Bridge" button and populate "Provisioning URL" & "Shared Secret" values from `/matrix/appservice-webhooks/config/config.yaml` file's homeserver URL value and provisioning secret value, respectively.
4. Invite the bridge bot user to your room: 5. Invite the bridge bot user to your room:
- either with `/invite @_webhook:<domain.name>` (*Note*: Make sure you have administration permissions in your room) - either with `/invite @_webhook:<domain.name>` (*Note*: Make sure you have administration permissions in your room)
- or simply add the bridge bot to a private channel (personal channels imply you being an administrator) - or simply add the bridge bot to a private channel (personal channels imply you being an administrator)
5. Send a message to the bridge bot in order to receive a private message including the webhook link. 6. Send a message to the bridge bot in order to receive a private message including the webhook link.
``` ```
!webhook !webhook
``` ```
6. The JSON body for posting messages will have to look like this: 7. The JSON body for posting messages will have to look like this:
```json ```json
{ {
"text": "Hello world!", "text": "Hello world!",

@ -27,3 +27,14 @@ Alternatively, **if there is no pre-defined variable** for a riot-web setting yo
- or, you can **extend and override the default configuration** ([`config.json.j2`](../roles/matrix-riot-web/templates/config.json.j2)) by making use of the `matrix_riot_web_configuration_extension_json_` variable. You can find information about this in [`roles/matrix-riot-web/defaults/main.yml`](../roles/matrix-riot-web/defaults/main.yml). - or, you can **extend and override the default configuration** ([`config.json.j2`](../roles/matrix-riot-web/templates/config.json.j2)) by making use of the `matrix_riot_web_configuration_extension_json_` variable. You can find information about this in [`roles/matrix-riot-web/defaults/main.yml`](../roles/matrix-riot-web/defaults/main.yml).
- or, if extending the configuration is still not powerful enough for your needs, you can **override the configuration completely** using `matrix_riot_web_configuration_default` (or `matrix_riot_web_configuration`). You can find information about this in [`roles/matrix-riot-web/defaults/main.yml`](../roles/matrix-riot-web/defaults/main.yml). - or, if extending the configuration is still not powerful enough for your needs, you can **override the configuration completely** using `matrix_riot_web_configuration_default` (or `matrix_riot_web_configuration`). You can find information about this in [`roles/matrix-riot-web/defaults/main.yml`](../roles/matrix-riot-web/defaults/main.yml).
## Themes
To change the look of riot-web, you can define your own themes manually by using the `matrix_riot_web_settingDefaults_custom_themes` setting.
Or better yet, you can automatically pull it all themes provided by the [aaronraimist/riot-web-themes](https://github.com/aaronraimist/riot-web-themes) project by simply flipping a flag (`matrix_riot_web_themes_enabled: true`).
If you make your own theme, we encourage you to submit it to the **aaronraimist/riot-web-themes** project, so that the whole community could easily enjoy it.
Note that for a custom theme to work well, all riot-web/riot-desktop instances that you use must have the same theme installed.

@ -72,7 +72,7 @@ matrix_appservice_webhooks_enabled: false
# Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-webhooks over the container network. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-webhooks over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# matrix-appservice-webhooks' client-server port to the local host. # matrix-appservice-webhooks' client-server port to the local host.
matrix_appservice_webhooks_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:{{ matrix_appservice_webhooks_webhooks_port }}' }}" matrix_appservice_webhooks_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:{{ matrix_appservice_webhooks_matrix_port }}' }}"
matrix_appservice_webhooks_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.as.token') | to_uuid }}" matrix_appservice_webhooks_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'webhook.as.token') | to_uuid }}"
@ -106,7 +106,7 @@ matrix_appservice_slack_enabled: false
# Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-slack over the container network. # Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-slack over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose # If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# matrix-appservice-slack's client-server port to the local host. # matrix-appservice-slack's client-server port to the local host.
matrix_appservice_slack_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:{{ matrix_appservice_slack_slack_port }}' }}" matrix_appservice_slack_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else ('127.0.0.1:' ~ matrix_appservice_slack_slack_port) }}"
matrix_appservice_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.as.token') | to_uuid }}" matrix_appservice_slack_appservice_token: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'slack.as.token') | to_uuid }}"

@ -21,9 +21,8 @@ matrix_appservice_webhooks_user_prefix: '_webhook'
# Controls the webhooks_PORT and MATRIX_PORT of the installation # Controls the webhooks_PORT and MATRIX_PORT of the installation
matrix_appservice_webhooks_matrix_port: 6789 matrix_appservice_webhooks_matrix_port: 6789
matrix_appservice_webhooks_webhooks_port: 6788
# Controls whether the appservice-webhooks container exposes its HTTP port (tcp/6788 in the container). # Controls whether the appservice-webhooks container exposes its HTTP port (tcp/6789 in the container).
# #
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose.
matrix_appservice_webhooks_container_http_host_bind_port: '' matrix_appservice_webhooks_container_http_host_bind_port: ''

@ -23,7 +23,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-appservice-webhooks \
--cap-drop=ALL \ --cap-drop=ALL \
--network={{ matrix_docker_network }} \ --network={{ matrix_docker_network }} \
{% if matrix_appservice_webhooks_container_http_host_bind_port %} {% if matrix_appservice_webhooks_container_http_host_bind_port %}
-p {{ matrix_appservice_webhooks_container_http_host_bind_port }}:{{matrix_appservice_webhooks_webhooks_port}} \ -p {{ matrix_appservice_webhooks_container_http_host_bind_port }}:{{matrix_appservice_webhooks_matrix_port}} \
{% endif %} {% endif %}
-v {{ matrix_appservice_webhooks_config_path }}:/config:z \ -v {{ matrix_appservice_webhooks_config_path }}:/config:z \
-v {{ matrix_appservice_webhooks_data_path }}:/data:z \ -v {{ matrix_appservice_webhooks_data_path }}:/data:z \

@ -30,4 +30,4 @@ matrix_postgres_container_extra_arguments: []
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:5432"), or empty string to not expose. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:5432"), or empty string to not expose.
matrix_postgres_container_postgres_bind_port: "" matrix_postgres_container_postgres_bind_port: ""
matrix_postgres_tool_synapse_janitor: "https://raw.githubusercontent.com/xwiki-labs/synapse_scripts/0b3f035951932ceb396631de3fc701043b9723bc/synapse_janitor.sql" matrix_postgres_tool_synapse_janitor: "https://raw.githubusercontent.com/xwiki-labs/synapse_scripts/a9188ff175ae581610f92d58ea6eac9a114d854b/synapse_janitor.sql"

@ -1,6 +1,6 @@
matrix_riot_web_enabled: true matrix_riot_web_enabled: true
matrix_riot_web_docker_image: "vectorim/riot-web:v1.5.10" matrix_riot_web_docker_image: "vectorim/riot-web:v1.5.12"
matrix_riot_web_docker_image_force_pull: "{{ matrix_riot_web_docker_image.endswith(':latest') }}" matrix_riot_web_docker_image_force_pull: "{{ matrix_riot_web_docker_image.endswith(':latest') }}"
matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web" matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web"
@ -17,6 +17,7 @@ matrix_riot_web_container_extra_arguments: []
matrix_riot_web_systemd_required_services_list: ['docker.service'] matrix_riot_web_systemd_required_services_list: ['docker.service']
# Riot config.json customizations # Riot config.json customizations
matrix_riot_web_default_server_name: "{{ matrix_domain }}"
matrix_riot_web_default_hs_url: "" matrix_riot_web_default_hs_url: ""
matrix_riot_web_default_is_url: ~ matrix_riot_web_default_is_url: ~
matrix_riot_web_disable_custom_urls: true matrix_riot_web_disable_custom_urls: true
@ -31,6 +32,25 @@ matrix_riot_web_welcome_user_id: "@riot-bot:matrix.org"
# Branding of riot web # Branding of riot web
matrix_riot_web_brand: "Riot" matrix_riot_web_brand: "Riot"
# URL to Logo on welcome page
matrix_riot_web_welcome_logo: "welcome/images/logo.svg"
# URL of link on welcome image
matrix_riot_web_welcome_logo_link: "https://riot.im"
matrix_riot_web_welcome_headline: "_t('Welcome to Riot.im')"
matrix_riot_web_welcome_text: "_t('Decentralised, encrypted chat &amp; collaboration powered by [matrix]')"
# Links, shown in footer of welcome page:
# [{"text": "Link text", "url": "https://link.target"}, {"text": "Other link"}]
matrix_riot_web_branding_authFooterLinks: ~
# URL to image, shown during Login
matrix_riot_web_branding_authHeaderLogoUrl: "{{ matrix_riot_web_welcome_logo }}"
# URL to Wallpaper, shown in background of welcome page
matrix_riot_web_branding_welcomeBackgroundUrl: ~
# By default, there's no Riot homepage (when logged in). If you wish to have one, # By default, there's no Riot homepage (when logged in). If you wish to have one,
# point this to a `home.html` template file on your local filesystem. # point this to a `home.html` template file on your local filesystem.
matrix_riot_web_embedded_pages_home_path: ~ matrix_riot_web_embedded_pages_home_path: ~
@ -44,6 +64,21 @@ matrix_riot_web_registration_enabled: false
# Controls whether Riot shows the presence features # Controls whether Riot shows the presence features
matrix_riot_web_enable_presence_by_hs_url: ~ matrix_riot_web_enable_presence_by_hs_url: ~
# Controls whether custom riot-web themes will be installed.
# When enabled, all themes found in the `matrix_riot_web_themes_repository_url` repository
# will be installed and enabled automatically.
matrix_riot_web_themes_enabled: false
matrix_riot_web_themes_repository_url: https://github.com/aaronraimist/riot-web-themes
# Controls the `settingsDefault.custom_themes` setting of the riot-web configuration.
# You can use this setting to define custom themes.
#
# Also, look at `matrix_riot_web_themes_enabled` for a way to pull in a bunch of custom themes automatically.
# If you define your own themes here and set `matrix_riot_web_themes_enabled: true`, your themes will be preserved as well.
#
# Note that for a custom theme to work well, all riot-web/riot-desktop instances that you use must have the same theme installed.
matrix_riot_web_settingDefaults_custom_themes: []
# Default riot-web configuration template which covers the generic use case. # Default riot-web configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it. # You can customize it by controlling the various variables inside it.
# #

@ -8,6 +8,12 @@
- setup-all - setup-all
- setup-riot-web - setup-riot-web
- import_tasks: "{{ role_path }}/tasks/prepare_riot_web_themes.yml"
when: run_setup|bool
tags:
- setup-all
- setup-riot-web
- import_tasks: "{{ role_path }}/tasks/setup_riot_web.yml" - import_tasks: "{{ role_path }}/tasks/setup_riot_web.yml"
when: run_setup|bool when: run_setup|bool
tags: tags:

@ -0,0 +1,48 @@
---
#
# Tasks related to setting up riot-web themes
#
- block:
- name: Ensure riot-web themes repository is pulled
git:
repo: "{{ matrix_riot_web_themes_repository_url }}"
dest: "{{ role_path }}/files/scratchpad/riot-web-themes"
- name: Find all riot-web theme files
find:
paths: "{{ role_path }}/files/scratchpad/riot-web-themes"
patterns: "*.json"
recurse: true
register: matrix_riot_web_theme_file_list
- name: Read riot-web theme
slurp:
path: "{{ item.path }}"
register: "matrix_riot_web_theme_file_contents"
with_items: "{{ matrix_riot_web_theme_file_list.files }}"
- name: Load riot-web theme
set_fact:
matrix_riot_web_settingDefaults_custom_themes: "{{ matrix_riot_web_settingDefaults_custom_themes + [item['content'] | b64decode | from_json] }}"
with_items: "{{ matrix_riot_web_theme_file_contents.results }}"
run_once: true
delegate_to: 127.0.0.1
become: false
when: matrix_riot_web_themes_enabled|bool
# #
# # Tasks related to getting rid of riot-web themes (if it was previously enabled)
# #
- name: Ensure riot-web themes repository is removed
file:
path: "{{ role_path }}/files/scratchpad/riot-web-themes"
state: absent
run_once: true
delegate_to: 127.0.0.1
become: false
when: "not matrix_riot_web_themes_enabled|bool"

@ -1,6 +1,16 @@
{ {
"default_hs_url": {{ matrix_riot_web_default_hs_url|string|to_json }}, "default_server_config": {
"default_is_url": {{ matrix_riot_web_default_is_url|string|to_json }}, "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 }}
}
},
"settingDefaults": {
"custom_themes": {{ matrix_riot_web_settingDefaults_custom_themes|to_json }}
},
"disable_custom_urls": {{ matrix_riot_web_disable_custom_urls|to_json }}, "disable_custom_urls": {{ matrix_riot_web_disable_custom_urls|to_json }},
"disable_guests": {{ matrix_riot_web_disable_guests|to_json }}, "disable_guests": {{ matrix_riot_web_disable_guests|to_json }},
"brand": {{ matrix_riot_web_brand|to_json }}, "brand": {{ matrix_riot_web_brand|to_json }},
@ -19,5 +29,10 @@
{% endif %} {% endif %}
"embeddedPages": { "embeddedPages": {
"homeUrl": {{ matrix_riot_web_embedded_pages_home_url|string|to_json }} "homeUrl": {{ matrix_riot_web_embedded_pages_home_url|string|to_json }}
},
"branding": {
"authFooterLinks": {{ matrix_riot_web_branding_authFooterLinks|to_json }},
"authHeaderLogoUrl": {{ matrix_riot_web_branding_authHeaderLogoUrl|to_json }},
"welcomeBackgroundUrl": {{ matrix_riot_web_branding_welcomeBackgroundUrl|to_json }}
} }
} }

@ -153,11 +153,11 @@ h1::after {
</style> </style>
<div class="mx_Parent"> <div class="mx_Parent">
<a href="https://riot.im" target="_blank" rel="noopener"> <a href="{{ matrix_riot_web_welcome_logo_link }}" target="_blank" rel="noopener">
<img src="welcome/images/logo.svg" alt="" class="mx_Logo"/> <img src="{{ matrix_riot_web_welcome_logo }}" alt="" class="mx_Logo"/>
</a> </a>
<h1 class="mx_Header_title">_t("Welcome to Riot.im")</h1> <h1 class="mx_Header_title">{{ matrix_riot_web_welcome_headline }}</h1>
<h4 class="mx_Header_subtitle">_t("Decentralised, encrypted chat &amp; collaboration powered by [matrix]")</h4> <h4 class="mx_Header_subtitle">{{ matrix_riot_web_welcome_text }}</h4>
<div class="mx_ButtonGroup"> <div class="mx_ButtonGroup">
<div class="mx_ButtonRow"> <div class="mx_ButtonRow">
<a href="#/login" class="mx_ButtonParent mx_ButtonSignIn mx_Button_iconSignIn"> <a href="#/login" class="mx_ButtonParent mx_ButtonSignIn mx_Button_iconSignIn">

@ -3,7 +3,7 @@
matrix_synapse_enabled: true matrix_synapse_enabled: true
matrix_synapse_docker_image: "matrixdotorg/synapse:v1.11.0" matrix_synapse_docker_image: "matrixdotorg/synapse:v1.11.1"
matrix_synapse_docker_image_force_pull: "{{ matrix_synapse_docker_image.endswith(':latest') }}" matrix_synapse_docker_image_force_pull: "{{ matrix_synapse_docker_image.endswith(':latest') }}"
matrix_synapse_base_path: "{{ matrix_base_data_path }}/synapse" matrix_synapse_base_path: "{{ matrix_base_data_path }}/synapse"

Loading…
Cancel
Save