Add Riot v1.0 (v1.0.1) support

This commit is contained in:
Slavi Pantaleev 2019-02-16 11:48:17 +02:00
parent b79db89221
commit 350b25690d
9 changed files with 51 additions and 328 deletions

View File

@ -1,3 +1,14 @@
# 2019-02-16
## Riot v1.0.1 support
You can now use the brand new and redesigned Riot.
The new version no longer has a homepage by default, so we've also removed the custom homepage that we've been installing.
However, we still provide you with hooks to install your own `home.html` file (using the `matrix_riot_web_embedded_pages_home_path` variable).
# 2019-02-14
## Synapse v0.99.1

View File

@ -1,6 +1,6 @@
matrix_riot_web_enabled: true
matrix_riot_web_docker_image: "bubuntux/riot-web:v0.17.9"
matrix_riot_web_docker_image: "bubuntux/riot-web:v1.0.1"
matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web"
@ -22,14 +22,6 @@ matrix_riot_web_integrations_jitsi_widget_url: "https://scalar.vector.im/api/wid
matrix_riot_web_roomdir_servers: ['matrix.org']
matrix_riot_web_welcome_user_id: "@riot-bot:matrix.org"
# Riot home.html customizations
# Default home.html template file
matrix_riot_web_homepage_template: "{{ role_path }}/templates/home.html.j2"
# Show general discussion about Matrix and Riot row
matrix_riot_web_homepage_template_general: true
# Show Matrix technical discussions row
matrix_riot_web_homepage_template_technical: true
# Show building services on Matrix row
matrix_riot_web_homepage_template_building: true
# Show contributing code to Matrix and Riot row
matrix_riot_web_homepage_template_contributing: true
# 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.
matrix_riot_web_embedded_pages_home_path: ~

View File

@ -18,7 +18,7 @@
name: "{{ matrix_riot_web_docker_image }}"
when: matrix_riot_web_enabled
- name: Ensure Matrix riot-web configured
- name: Ensure Matrix riot-web config files installed
template:
src: "{{ item.src }}"
dest: "{{ matrix_riot_web_data_path }}/{{ item.name }}"
@ -28,8 +28,16 @@
with_items:
- {src: "{{ role_path }}/templates/config.json.j2", name: "config.json"}
- {src: "{{ role_path }}/templates/nginx.conf.j2", name: "nginx.conf"}
- {src: "{{ matrix_riot_web_homepage_template }}", name: "home.html"}
when: matrix_riot_web_enabled
- {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
when: "matrix_riot_web_enabled and item.src is not none"
- name: Ensure Matrix riot-web config files removed
file:
path: "{{ matrix_riot_web_data_path }}/{{ item.name }}"
state: absent
with_items:
- {src: "{{ matrix_riot_web_embedded_pages_home_path }}", name: "home.html"}
when: "matrix_riot_web_enabled and item.src is none"
- name: Ensure matrix-riot-web.service installed
template:

View File

@ -7,3 +7,16 @@
when: "vars[item] == ''"
with_items:
- "matrix_riot_web_default_hs_url"
- name: (Deprecation) Catch and report renamed settings
fail:
msg: >
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_riot_web_homepage_template', 'new': 'matrix_riot_web_embedded_pages_home_path'}
- {'old': 'matrix_riot_web_homepage_template_general', 'new': '<removed>'}
- {'old': 'matrix_riot_web_homepage_template_technical', 'new': '<removed>'}
- {'old': 'matrix_riot_web_homepage_template_building', 'new': '<removed>'}
- {'old': 'matrix_riot_web_homepage_template_contributing', 'new': '<removed>'}

View File

@ -13,5 +13,8 @@
"roomDirectory": {
"servers": {{ matrix_riot_web_roomdir_servers|to_json }}
},
"welcomeUserId": {{ matrix_riot_web_welcome_user_id|to_json }}
"welcomeUserId": {{ matrix_riot_web_welcome_user_id|to_json }},
"embeddedPages": {
"homeUrl": {{ matrix_riot_web_embedded_pages_home_url|to_json }}
}
}

View File

@ -1,308 +0,0 @@
<style type="text/css">
/* we deliberately inline style here to avoid flash-of-CSS problems, and to avoid
* voodoo where we have to set display: none by default
*/
.mx_HomePage_header h1 {
margin-left: 0px;
margin-bottom: 0px;
margin-top: 20px;
margin-right: 20px;
color: #454545;
}
.mx_HomePage_header h2 {
margin-left: 0px;
margin-top: 5px;
margin-bottom: 20px;
margin-right: 20px;
color: #454545;
}
.mx_HomePage_header h1 a {
color: #454545;
}
.mx_HomePage h3 {
margin-top: 30px;
}
.mx_HomePage_header {
border: 1px solid #76CFA6;
background-color: #eaf5f0;
border-radius: 5px;
align-items: center;
}
.mx_HomePage_col {
display: flex;
flex-direction: row;
}
.mx_HomePage_toprow {
flex-wrap: wrap;
}
.mx_HomePage_row {
flex: 1 1 0;
margin-right: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.mx_HomePage_logo {
margin-top: 20px;
margin-left: 40px;
margin-right: 40px;
margin-bottom: 20px;
display: inline;
height: 100px;
}
.mx_HomePage_room {
cursor: pointer;
float: left;
text-decoration: none;
text-align: center;
padding-left: 10px;
padding-right: 10px;
width: 120px;
}
.mx_HomePage_toprow .mx_HomePage_room {
width: 64px;
}
.mx_HomePage_room .mx_HomePage_icon {
border-radius: 50%;
width: 64px;
height: 64px;
}
.mx_HomePage_room .mx_HomePage_name {
display: block;
}
.mx_HomePage_room .mx_HomePage_desc {
display: block;
font-size: 12px;
margin-top: 8px;
}
.mx_HomePage_comment {
display: flex;
align-items: center;
margin-left: 100px;
min-height: 64px;
}
.mx_HomePage_container h3::after,
.mx_HomePage_container h4::after {
content: ":";
}
.mx_HomePage_container {
display: block ! important;
margin: 20px;
}
.mx_HomePage_container h1,
.mx_HomePage_container h2,
.mx_HomePage_container h3,
.mx_HomePage_container h4 {
font-weight: 600;
}
</style>
<div class="mx_HomePage_container">
<div class="mx_HomePage_col mx_HomePage_header">
<a href="{{ hostname_riot }}"><img src="home/images/logo.svg" class="mx_HomePage_logo"></a>
<div>
<h1>_t("Welcome to {{ hostname_riot }}")</h1>
<h2>_t("Decentralised, encrypted chat &amp; collaboration powered by [matrix]")</h2>
</div>
</div>
<div class="mx_HomePage_col mx_HomePage_toprow">
<div class="mx_HomePage_row">
<div>
<h3>_t("Search the room directory")</h3>
<a class="mx_HomePage_room" href="#/directory">
<img class="mx_HomePage_icon" src="img/icons-directory.svg">
</a>
<span class="mx_HomePage_comment">
_t("Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent. Check out the directory!")
</span>
</div>
</div>
{% if matrix_riot_web_welcome_user_id %}
<div class="mx_HomePage_row">
<div>
<h3>_t("Chat with Riot Bot")</h3>
<a class="mx_HomePage_room" href="#/user/{{ matrix_riot_web_welcome_user_id }}?action=chat">
<img class="mx_HomePage_icon" src="home/rooms/riot-bot.png">
</a>
<span class="mx_HomePage_comment">
_t("Get started with some tips from Riot Bot!")
</span>
</div>
</div>
{% endif %}
</div>
{% if matrix_riot_web_homepage_template_general %}
<h3>_t("General discussion about Matrix and Riot")</h3>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
<a href="#/room/#matrix:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/matrix.png">
<span class="mx_HomePage_name">Matrix HQ</span>
</a>
<span class="mx_HomePage_desc">_t("Discussion of all things Matrix!")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot.png">
<span class="mx_HomePage_name">Riot</span>
</a>
<span class="mx_HomePage_desc">_t("Riot/Web &amp; Desktop chat")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot-ios:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-ios.png">
<span class="mx_HomePage_name">#riot-ios</span>
</a>
<span class="mx_HomePage_desc">_t("Riot/iOS &amp; matrix-ios-sdk chat")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot-android:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-android.png">
<span class="mx_HomePage_name">#riot-android</span>
</a>
<span class="mx_HomePage_desc">_t("Riot/Android &amp; matrix-android-sdk chat")</span>
</div>
</div>
{% endif %}
{% if matrix_riot_web_homepage_template_technical %}
<h3>_t("Matrix technical discussions")</h3>
<h4>_t("Running Matrix services")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
<a href="#/room/#matrix-docker-ansible-deploy:devture.com">
<img class="mx_HomePage_icon" src="home/rooms/matrix.png">
<span class="mx_HomePage_name">Matrix Docker Ansible Deploy</span>
</a>
<span class="mx_HomePage_desc">Support for Matrix Docker Ansible role</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#synapse:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/matrix.png">
<span class="mx_HomePage_name">Synapse Support Community</span>
</a>
<span class="mx_HomePage_desc">_t("Community-run support for Synapse")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#dendrite:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/dendrite.png">
<span class="mx_HomePage_name">#dendrite:matrix.org</span>
</a>
<span class="mx_HomePage_desc">_t("Admin support for Dendrite")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#homeowners:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/homeowners.png">
<span class="mx_HomePage_name">Synapse Homeowners</span>
</a>
<span class="mx_HomePage_desc">_t("Announcements about Synapse releases")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#irc:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/irc.png">
<span class="mx_HomePage_name">IRC Matrix Bridges</span>
</a>
<span class="mx_HomePage_desc">_t("Support for those using and running matrix-appservice-irc")</span>
</div>
</div>
{% endif %}
{% if matrix_riot_web_homepage_template_building %}
<h4>_t("Building services on Matrix")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
<a href="#/room/#matrix-dev:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/matrix-dev.png">
<span class="mx_HomePage_name">#matrix-dev:matrix.org</span>
</a>
<span class="mx_HomePage_desc">_t("Support for those using the Matrix spec")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#e2e:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/e2e.png">
<span class="mx_HomePage_name">End-to-end crypto in Matrix</span>
</a>
<span class="mx_HomePage_desc">_t("Design and implementation of E2E in Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#vr:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/vr.png">
<span class="mx_HomePage_name">#vr:matrix.org</span>
</a>
<span class="mx_HomePage_desc">_t("Implementing VR services with Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#webrtc:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/webrtc.png">
<span class="mx_HomePage_name">#webrtc:matrix.org</span>
</a>
<span class="mx_HomePage_desc">_t("Implementing VoIP services with Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#matrix-identity:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/identity.jpg">
<span class="mx_HomePage_name">Matrix Identity</span>
</a>
<span class="mx_HomePage_desc">_t("Discussion of the Identity Service API")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#bridging:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/bridging.png">
<span class="mx_HomePage_name">Matrix Bridging</span>
</a>
<span class="mx_HomePage_desc">_t("Support for those using, running and writing other bridges")</span>
</div>
</div>
{% endif %}
{% if matrix_riot_web_homepage_template_contributing %}
<h4>_t("Contributing code to Matrix and Riot")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
<a href="#/room/#riot-dev:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-dev.png">
<span class="mx_HomePage_name">#riot-dev</span>
</a>
<span class="mx_HomePage_desc">_t("Dev chat for the Riot/Web dev team")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#dendrite-dev:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/dendrite-dev.png">
<span class="mx_HomePage_name">#dendrite-dev</span>
</a>
<span class="mx_HomePage_desc">_t("Dev chat for the Dendrite dev team")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riotweb-translations:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-translations.png">
<span class="mx_HomePage_name">Riot Translations</span>
</a>
<span class="mx_HomePage_desc">_t("Co-ordination for Riot translators")</span>
</div>
</div>
{% endif %}
</div>

View File

@ -14,14 +14,16 @@ ExecStart=/usr/bin/docker run --rm --name matrix-riot-web \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--read-only \
--network={{ matrix_docker_network }} \
{% if matrix_riot_web_container_expose_port %}
-p 127.0.0.1:8765:8080 \
{% endif %}
--tmpfs=/tmp:rw,noexec,nosuid,size=10m \
-v {{ matrix_riot_web_data_path }}/nginx.conf:/etc/nginx/nginx.conf:ro \
-v /dev/null:/etc/nginx/conf.d/default.conf:ro \
-v {{ matrix_riot_web_data_path }}/config.json:/etc/riot-web/config.json:ro \
{% 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 \
--network={{ matrix_docker_network }} \
{% if matrix_riot_web_container_expose_port %}
-p 127.0.0.1:8765:8080 \
{% endif %}
{{ matrix_riot_web_docker_image }}
ExecStop=-/usr/bin/docker kill matrix-riot-web

View File

@ -0,0 +1,3 @@
---
matrix_riot_web_embedded_pages_home_url: "{{ (none if matrix_riot_web_embedded_pages_home_path is none else 'home.html') }}"

View File

@ -17,4 +17,3 @@
with_items:
- {'old': 'matrix_synapse_container_expose_api_port', 'new': 'matrix_synapse_container_expose_client_api_port'}
- {'old': 'matrix_synapse_no_tls', 'new': '<removed>'}