Project

General

Profile

Common operations on X-as-a-Service » History » Version 12

Timothée Floure, 03/20/2020 03:31 PM
Mention extra parameters for matrix type

1 1 Timothée Floure
h1. Common operations on X-as-a-Service
2
3
h2. Matrix-as-a-Service
4
5 11 Timothée Floure
Ask @fnux for help if needed.
6
7 3 Timothée Floure
h3. Contact customer for setup informations
8
9
Do not forget to replace @$CUSTMER@!
10
11
<pre>
12
Hello $CUSTOMER,
13
14 4 Timothée Floure
I will deploy your Matrix homeserver and need a few configuration details from
15
you. I do not know how familiar you are with Matrix or technical terms:
16 3 Timothée Floure
do not hesitate to tell me if I go to fast or to slow for you.
17
18
First of all, each Matrix homeserver is linked to domain name (you users will look
19
like `@username:domain.tld`) for federation. I can offer you two options here,
20
but remember that the chosen domain name cannot be changed afterward:
21
22
  * Your own domain (e.g. domain.tld).
23
  * One domain controlled by ungleich (e.g. $CUSTOMER.0co2.cloud,
24
    $CUSTOMER.ungleich.cloud).
25
26
Secondly, I will deploy a Riot web matrix client for convenience (you can use
27
the desktop or smartphone clients as well) and need a domain for that as well:
28
29
  * Your own domain (e.g. matrix.domain.tld)
30
  * One domain controlled by ungleich (e.g. matrix.$CUSTOMER.0c02.cloud).
31
32
Lastly, I will configure the Matrix homeserver for you. You can ask us to set
33
any configuration option but we at least need to know your preferences in term
34
of registration:
35
  * Should it be backed by an existing user directory (LDAP)?
36
  * Should registrations be filtered by domain of email address? (e.g. anyone
37
    with a @domain.tld email address can register).
38
  * Should anyone be allowed to register?
39
40
Feel free to ask me any matrix-related question, as I am a heavy matrix user
41
myself.
42
43
Best Regards,
44
45
-- 
46
</pre>
47
48 1 Timothée Floure
h3. Deploy new MaaS instance
49
50 12 Timothée Floure
*Note:* synapse and riot extra parameters are documented in the __matrix_synapse and __matrix_riot types.
51 1 Timothée Floure
52 5 Timothée Floure
* Contact customer to get configuration details (this might take some time => do it first).
53
* Allocate VM in OpenNebula, based on Debian 10 (IPv6Only).
54
* Attach HDD storage to created VM (Help: [[Common operations at DCLIPv6OnlyHosting]]).
55
  - Create EXT4 filesystem: @mkfs.ext4 $DEVICE@
56
  - Add FSTAB entry for /var on $DEVICE.
57
    - Get UUID with @blkid@.
58
    - Should look like: @UUID=$MY_UUID       /var    ext4    errors=remount-ro       1       2@
59
    - Mount data disk on /mnt.
60
    - Move content of /var to /mnt.
61
    - Unmount data disk from /mnt.
62
    - Mount data disk to /var with @mount -a@ (uses configuration in /etc/fstab).
63
    - *Reboot* and make sure that /var is properly mounted.
64 6 Timothée Floure
* Make sure VM is up-to-date (base image might be old).
65
  - @apt update@
66
  - @apt upgrade@
67 1 Timothée Floure
68 6 Timothée Floure
* Once you get details from customer, configure DNS entries:
69
  - Main homeserver address: @$CUSTOMER.matrix.ungleich.cloud@
70
    - @files/dns/matrix.ungleich.cloud@ in dot-cdist.
71
  - Whatever is needed for Riot-web.
72
  - Do not forget to configure the IPv4-to-IPv6 proxy! See [[Common operations on IPv4-to-IPv6-Proxy]].
73
74
* Add server to matrix-as-a-service manifest in dot-cdist. Deploy.
75
  - You can find the detailed parameters of synapse and riot in the @__matrix_synapse@ and @__matrix_riot@.
76
* Create initial admin user:
77 7 Timothée Floure
  - Register new user, either via riot (standard user to be promoted afterwards) or @/usr/bin/register_new_matrix_user@ on server.
78
    - Any user can be promoted by a simple SQL query:
79
      + On server, open postgresql shell: @sudo -u postgres psql matrix-synapse@
80
      + List users: @SELECT * FROM users;@
81
      + Make user admin: @UPDATE users SET admin = 1 WHERE name = '@fnux:matrix-staging.ungleich.ch';@
82
  - Once the initial admin user is created, you can access the web management UI: https://admin.matrix.ungleich.cloud/ (use server FQDN as homeserver).
83 6 Timothée Floure
* Configure federation:
84 8 Timothée Floure
  - Federation defaults to port 8448 and matrix server name. We have to redirect it to $CUSTOMER.matrix.ungleich.cloud on port 443.
85
  - Delegation works with a well-known URL served on matrix server name: @/.well-known/matrix/server@ returning @{"m.server": "$CUSTOMER.matrix.ungleich.cloud:443"}@.
86
  - While we are at it, also configure homeserver discovery for clients: @/.wll-known/matrix/client@ returning @{ "m.homeserver": { "base_url": "https://ungleich.matrix.ungleich.cloud" } }@.
87
  - For a custom domain, either the client do it by himself or redirect the domain to the the matrix server. There are examples in the matrix-as-a-service manifest.
88 1 Timothée Floure
  - *Check that everything looks good with the Federation tester:* https://federationtester.matrix.org/
89 12 Timothée Floure
* Optional: customize hoster riot welcome page (--homepage riot extra parameter)
90 1 Timothée Floure
91
h3. Upgrade a running MaaS instance
92
93 11 Timothée Floure
*Always read "synapse changelog":https://github.com/matrix-org/synapse/releases first!*
94 9 Timothée Floure
*Always work and test on the staging instance first!*
95
96
* @ssh root@staging.matrix.ungleich.cloud@
97
* https://matrix-staging.ungleich.cloud
98
99
Unattended upgrade automatically apply security upgrades to the VM: you only have to update synapse (the matrix homserver) from time to time. It usually boils down to a simple @apt update; apt upgrade@.
100
101
*Note*: the matrix-synapse synapse comes from the "debian (buster) backports repository":https://packages.debian.org/buster-backports/matrix-synapse. APT can be told/forced to use it with the @-t buster-backports@ flag.
102 1 Timothée Floure
103
h3. Deploy Matterbridge application service
104
105 10 Timothée Floure
You can directly use the @__matterbridge@ type:
106
* See deployment on ungleich.matrix.ungleich.cloud for inspirations (matrix-as-a-service dot-cdist manifest)
107
* Matterbridge doc: https://github.com/42wim/matterbridge/wiki