···11+# Matrix {#module-services-matrix}
22+33+[Matrix](https://matrix.org/) is an open standard for
44+interoperable, decentralised, real-time communication over IP. It can be used
55+to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things
66+communication - or anywhere you need a standard HTTP API for publishing and
77+subscribing to data whilst tracking the conversation history.
88+99+This chapter will show you how to set up your own, self-hosted Matrix
1010+homeserver using the Synapse reference homeserver, and how to serve your own
1111+copy of the Element web client. See the
1212+[Try Matrix Now!](https://matrix.org/docs/projects/try-matrix-now.html)
1313+overview page for links to Element Apps for Android and iOS,
1414+desktop clients, as well as bridges to other networks and other projects
1515+around Matrix.
1616+1717+## Synapse Homeserver {#module-services-matrix-synapse}
1818+1919+[Synapse](https://github.com/matrix-org/synapse) is
2020+the reference homeserver implementation of Matrix from the core development
2121+team at matrix.org. The following configuration example will set up a
2222+synapse server for the `example.org` domain, served from
2323+the host `myhostname.example.org`. For more information,
2424+please refer to the
2525+[installation instructions of Synapse](https://matrix-org.github.io/synapse/latest/setup/installation.html) .
2626+```
2727+{ pkgs, lib, config, ... }:
2828+let
2929+ fqdn = "${config.networking.hostName}.${config.networking.domain}";
3030+ clientConfig = {
3131+ "m.homeserver".base_url = "https://${fqdn}";
3232+ "m.identity_server" = {};
3333+ };
3434+ serverConfig."m.server" = "${config.services.matrix-synapse.settings.server_name}:443";
3535+ mkWellKnown = data: ''
3636+ add_header Content-Type application/json;
3737+ add_header Access-Control-Allow-Origin *;
3838+ return 200 '${builtins.toJSON data}';
3939+ '';
4040+in {
4141+ networking.hostName = "myhostname";
4242+ networking.domain = "example.org";
4343+ networking.firewall.allowedTCPPorts = [ 80 443 ];
4444+4545+ services.postgresql.enable = true;
4646+ services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
4747+ CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
4848+ CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
4949+ TEMPLATE template0
5050+ LC_COLLATE = "C"
5151+ LC_CTYPE = "C";
5252+ '';
5353+5454+ services.nginx = {
5555+ enable = true;
5656+ recommendedTlsSettings = true;
5757+ recommendedOptimisation = true;
5858+ recommendedGzipSettings = true;
5959+ recommendedProxySettings = true;
6060+ virtualHosts = {
6161+ # If the A and AAAA DNS records on example.org do not point on the same host as the
6262+ # records for myhostname.example.org, you can easily move the /.well-known
6363+ # virtualHost section of the code to the host that is serving example.org, while
6464+ # the rest stays on myhostname.example.org with no other changes required.
6565+ # This pattern also allows to seamlessly move the homeserver from
6666+ # myhostname.example.org to myotherhost.example.org by only changing the
6767+ # /.well-known redirection target.
6868+ "${config.networking.domain}" = {
6969+ enableACME = true;
7070+ forceSSL = true;
7171+ # This section is not needed if the server_name of matrix-synapse is equal to
7272+ # the domain (i.e. example.org from @foo:example.org) and the federation port
7373+ # is 8448.
7474+ # Further reference can be found in the docs about delegation under
7575+ # https://matrix-org.github.io/synapse/latest/delegate.html
7676+ locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
7777+ # This is usually needed for homeserver discovery (from e.g. other Matrix clients).
7878+ # Further reference can be found in the upstream docs at
7979+ # https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
8080+ locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
8181+ };
8282+ "${fqdn}" = {
8383+ enableACME = true;
8484+ forceSSL = true;
8585+ # It's also possible to do a redirect here or something else, this vhost is not
8686+ # needed for Matrix. It's recommended though to *not put* element
8787+ # here, see also the section about Element.
8888+ locations."/".extraConfig = ''
8989+ return 404;
9090+ '';
9191+ # Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
9292+ # *must not* be used here.
9393+ locations."/_matrix".proxyPass = "http://[::1]:8008";
9494+ # Forward requests for e.g. SSO and password-resets.
9595+ locations."/_synapse/client".proxyPass = "http://[::1]:8008";
9696+ };
9797+ };
9898+ };
9999+100100+ services.matrix-synapse = {
101101+ enable = true;
102102+ settings.server_name = config.networking.domain;
103103+ settings.listeners = [
104104+ { port = 8008;
105105+ bind_addresses = [ "::1" ];
106106+ type = "http";
107107+ tls = false;
108108+ x_forwarded = true;
109109+ resources = [ {
110110+ names = [ "client" "federation" ];
111111+ compress = true;
112112+ } ];
113113+ }
114114+ ];
115115+ };
116116+}
117117+```
118118+119119+## Registering Matrix users {#module-services-matrix-register-users}
120120+121121+If you want to run a server with public registration by anybody, you can
122122+then enable `services.matrix-synapse.settings.enable_registration = true;`.
123123+Otherwise, or you can generate a registration secret with
124124+{command}`pwgen -s 64 1` and set it with
125125+[](#opt-services.matrix-synapse.settings.registration_shared_secret).
126126+To create a new user or admin, run the following after you have set the secret
127127+and have rebuilt NixOS:
128128+```ShellSession
129129+$ nix-shell -p matrix-synapse
130130+$ register_new_matrix_user -k your-registration-shared-secret http://localhost:8008
131131+New user localpart: your-username
132132+Password:
133133+Confirm password:
134134+Make admin [no]:
135135+Success!
136136+```
137137+In the example, this would create a user with the Matrix Identifier
138138+`@your-username:example.org`.
139139+140140+::: {.warning}
141141+When using [](#opt-services.matrix-synapse.settings.registration_shared_secret), the secret
142142+will end up in the world-readable store. Instead it's recommended to deploy the secret
143143+in an additional file like this:
144144+145145+ - Create a file with the following contents:
146146+147147+ ```
148148+ registration_shared_secret: your-very-secret-secret
149149+ ```
150150+ - Deploy the file with a secret-manager such as
151151+ [{option}`deployment.keys`](https://nixops.readthedocs.io/en/latest/overview.html#managing-keys)
152152+ from {manpage}`nixops(1)` or [sops-nix](https://github.com/Mic92/sops-nix/) to
153153+ e.g. {file}`/run/secrets/matrix-shared-secret` and ensure that it's readable
154154+ by `matrix-synapse`.
155155+ - Include the file like this in your configuration:
156156+157157+ ```
158158+ {
159159+ services.matrix-synapse.extraConfigFiles = [
160160+ "/run/secrets/matrix-shared-secret"
161161+ ];
162162+ }
163163+ ```
164164+:::
165165+166166+::: {.note}
167167+It's also possible to user alternative authentication mechanism such as
168168+[LDAP (via `matrix-synapse-ldap3`)](https://github.com/matrix-org/matrix-synapse-ldap3)
169169+or [OpenID](https://matrix-org.github.io/synapse/latest/openid.html).
170170+:::
171171+172172+## Element (formerly known as Riot) Web Client {#module-services-matrix-element-web}
173173+174174+[Element Web](https://github.com/vector-im/riot-web/) is
175175+the reference web client for Matrix and developed by the core team at
176176+matrix.org. Element was formerly known as Riot.im, see the
177177+[Element introductory blog post](https://element.io/blog/welcome-to-element/)
178178+for more information. The following snippet can be optionally added to the code before
179179+to complete the synapse installation with a web client served at
180180+`https://element.myhostname.example.org` and
181181+`https://element.example.org`. Alternatively, you can use the hosted
182182+copy at <https://app.element.io/>,
183183+or use other web clients or native client applications. Due to the
184184+`/.well-known` urls set up done above, many clients should
185185+fill in the required connection details automatically when you enter your
186186+Matrix Identifier. See
187187+[Try Matrix Now!](https://matrix.org/docs/projects/try-matrix-now.html)
188188+for a list of existing clients and their supported featureset.
189189+```
190190+{
191191+ services.nginx.virtualHosts."element.${fqdn}" = {
192192+ enableACME = true;
193193+ forceSSL = true;
194194+ serverAliases = [
195195+ "element.${config.networking.domain}"
196196+ ];
197197+198198+ root = pkgs.element-web.override {
199199+ conf = {
200200+ default_server_config = clientConfig; # see `clientConfig` from the snippet above.
201201+ };
202202+ };
203203+ };
204204+}
205205+```
206206+207207+::: {.note}
208208+The Element developers do not recommend running Element and your Matrix
209209+homeserver on the same fully-qualified domain name for security reasons. In
210210+the example, this means that you should not reuse the
211211+`myhostname.example.org` virtualHost to also serve Element,
212212+but instead serve it on a different subdomain, like
213213+`element.example.org` in the example. See the
214214+[Element Important Security Notes](https://github.com/vector-im/element-web/tree/v1.10.0#important-security-notes)
215215+for more information on this subject.
216216+:::
+2
nixos/modules/services/matrix/synapse.nix
···801801802802 meta = {
803803 buildDocsInSandbox = false;
804804+ # Don't edit the docbook xml directly, edit the md and generate it:
805805+ # `pandoc synapse.md -t docbook --top-level-division=chapter --extract-media=media -f markdown-smart --lua-filter ../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua --lua-filter ../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua > synapse.xml`
804806 doc = ./synapse.xml;
805807 maintainers = teams.matrix.members;
806808 };
+165-153
nixos/modules/services/matrix/synapse.xml
···11-<chapter xmlns="http://docbook.org/ns/docbook"
22- xmlns:xlink="http://www.w3.org/1999/xlink"
33- xmlns:xi="http://www.w3.org/2001/XInclude"
44- version="5.0"
55- xml:id="module-services-matrix">
66- <title>Matrix</title>
77- <para>
88- <link xlink:href="https://matrix.org/">Matrix</link> is an open standard for
99- interoperable, decentralised, real-time communication over IP. It can be used
1010- to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things
1111- communication - or anywhere you need a standard HTTP API for publishing and
1212- subscribing to data whilst tracking the conversation history.
1313- </para>
1414- <para>
1515- This chapter will show you how to set up your own, self-hosted Matrix
1616- homeserver using the Synapse reference homeserver, and how to serve your own
1717- copy of the Element web client. See the
1818- <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
1919- Matrix Now!</link> overview page for links to Element Apps for Android and iOS,
2020- desktop clients, as well as bridges to other networks and other projects
2121- around Matrix.
2222- </para>
2323- <section xml:id="module-services-matrix-synapse">
2424- <title>Synapse Homeserver</title>
2525-11+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-matrix">
22+ <title>Matrix</title>
263 <para>
2727- <link xlink:href="https://github.com/matrix-org/synapse">Synapse</link> is
2828- the reference homeserver implementation of Matrix from the core development
2929- team at matrix.org. The following configuration example will set up a
3030- synapse server for the <literal>example.org</literal> domain, served from
3131- the host <literal>myhostname.example.org</literal>. For more information,
3232- please refer to the
3333- <link xlink:href="https://matrix-org.github.io/synapse/latest/setup/installation.html">
3434- installation instructions of Synapse </link>.
3535-<programlisting>
44+ <link xlink:href="https://matrix.org/">Matrix</link> is an open
55+ standard for interoperable, decentralised, real-time communication
66+ over IP. It can be used to power Instant Messaging, VoIP/WebRTC
77+ signalling, Internet of Things communication - or anywhere you need
88+ a standard HTTP API for publishing and subscribing to data whilst
99+ tracking the conversation history.
1010+ </para>
1111+ <para>
1212+ This chapter will show you how to set up your own, self-hosted
1313+ Matrix homeserver using the Synapse reference homeserver, and how to
1414+ serve your own copy of the Element web client. See the
1515+ <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
1616+ Matrix Now!</link> overview page for links to Element Apps for
1717+ Android and iOS, desktop clients, as well as bridges to other
1818+ networks and other projects around Matrix.
1919+ </para>
2020+ <section xml:id="module-services-matrix-synapse">
2121+ <title>Synapse Homeserver</title>
2222+ <para>
2323+ <link xlink:href="https://github.com/matrix-org/synapse">Synapse</link>
2424+ is the reference homeserver implementation of Matrix from the core
2525+ development team at matrix.org. The following configuration
2626+ example will set up a synapse server for the
2727+ <literal>example.org</literal> domain, served from the host
2828+ <literal>myhostname.example.org</literal>. For more information,
2929+ please refer to the
3030+ <link xlink:href="https://matrix-org.github.io/synapse/latest/setup/installation.html">installation
3131+ instructions of Synapse</link> .
3232+ </para>
3333+ <programlisting>
3634{ pkgs, lib, config, ... }:
3735let
3838- fqdn = "${config.networking.hostName}.${config.networking.domain}";
3636+ fqdn = "${config.networking.hostName}.${config.networking.domain}";
3937 clientConfig = {
4040- "m.homeserver".base_url = "https://${fqdn}";
4141- "m.identity_server" = {};
3838+ "m.homeserver".base_url = "https://${fqdn}";
3939+ "m.identity_server" = {};
4240 };
4343- serverConfig."m.server" = "${config.services.matrix-synapse.settings.server_name}:443";
4141+ serverConfig."m.server" = "${config.services.matrix-synapse.settings.server_name}:443";
4442 mkWellKnown = data: ''
4543 add_header Content-Type application/json;
4644 add_header Access-Control-Allow-Origin *;
4745 return 200 '${builtins.toJSON data}';
4846 '';
4947in {
5050- networking.hostName = "myhostname";
5151- networking.domain = "example.org";
4848+ networking.hostName = "myhostname";
4949+ networking.domain = "example.org";
5250 networking.firewall.allowedTCPPorts = [ 80 443 ];
53515452 services.postgresql.enable = true;
5555- services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
5656- CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
5757- CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
5353+ services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
5454+ CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
5555+ CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
5856 TEMPLATE template0
5959- LC_COLLATE = "C"
6060- LC_CTYPE = "C";
5757+ LC_COLLATE = "C"
5858+ LC_CTYPE = "C";
6159 '';
62606361 services.nginx = {
···7472 # This pattern also allows to seamlessly move the homeserver from
7573 # myhostname.example.org to myotherhost.example.org by only changing the
7674 # /.well-known redirection target.
7777- "${config.networking.domain}" = {
7575+ "${config.networking.domain}" = {
7876 enableACME = true;
7977 forceSSL = true;
8078 # This section is not needed if the server_name of matrix-synapse is equal to
···8280 # is 8448.
8381 # Further reference can be found in the docs about delegation under
8482 # https://matrix-org.github.io/synapse/latest/delegate.html
8585- locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
8383+ locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
8684 # This is usually needed for homeserver discovery (from e.g. other Matrix clients).
8785 # Further reference can be found in the upstream docs at
8886 # https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
8989- locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
8787+ locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
9088 };
9191- "${fqdn}" = {
8989+ "${fqdn}" = {
9290 enableACME = true;
9391 forceSSL = true;
9492 # It's also possible to do a redirect here or something else, this vhost is not
9593 # needed for Matrix. It's recommended though to *not put* element
9694 # here, see also the section about Element.
9797- locations."/".extraConfig = ''
9595+ locations."/".extraConfig = ''
9896 return 404;
9997 '';
10098 # Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
10199 # *must not* be used here.
102102- locations."/_matrix".proxyPass = "http://[::1]:8008";
100100+ locations."/_matrix".proxyPass = "http://[::1]:8008";
103101 # Forward requests for e.g. SSO and password-resets.
104104- locations."/_synapse/client".proxyPass = "http://[::1]:8008";
102102+ locations."/_synapse/client".proxyPass = "http://[::1]:8008";
105103 };
106104 };
107105 };
···111109 settings.server_name = config.networking.domain;
112110 settings.listeners = [
113111 { port = 8008;
114114- bind_addresses = [ "::1" ];
115115- type = "http";
112112+ bind_addresses = [ "::1" ];
113113+ type = "http";
116114 tls = false;
117115 x_forwarded = true;
118116 resources = [ {
119119- names = [ "client" "federation" ];
117117+ names = [ "client" "federation" ];
120118 compress = true;
121119 } ];
122120 }
···124122 };
125123}
126124</programlisting>
127127- </para>
128128- </section>
129129- <section xml:id="module-services-matrix-register-users">
130130- <title>Registering Matrix users</title>
131131- <para>
132132- If you want to run a server with public registration by anybody, you can
133133- then enable <literal>services.matrix-synapse.settings.enable_registration =
134134- true;</literal>. Otherwise, or you can generate a registration secret with
135135- <command>pwgen -s 64 1</command> and set it with
136136- <option><link linkend="opt-services.matrix-synapse.settings.registration_shared_secret">services.matrix-synapse.settings.registration_shared_secret</link></option>.
137137- To create a new user or admin, run the following after you have set the secret
138138- and have rebuilt NixOS:
139139-<screen>
140140-<prompt>$ </prompt>nix-shell -p matrix-synapse
141141-<prompt>$ </prompt>register_new_matrix_user -k your-registration-shared-secret http://localhost:8008
142142-<prompt>New user localpart: </prompt>your-username
143143-<prompt>Password:</prompt>
144144-<prompt>Confirm password:</prompt>
145145-<prompt>Make admin [no]:</prompt>
125125+ </section>
126126+ <section xml:id="module-services-matrix-register-users">
127127+ <title>Registering Matrix users</title>
128128+ <para>
129129+ If you want to run a server with public registration by anybody,
130130+ you can then enable
131131+ <literal>services.matrix-synapse.settings.enable_registration = true;</literal>.
132132+ Otherwise, or you can generate a registration secret with
133133+ <command>pwgen -s 64 1</command> and set it with
134134+ <xref linkend="opt-services.matrix-synapse.settings.registration_shared_secret"></xref>.
135135+ To create a new user or admin, run the following after you have
136136+ set the secret and have rebuilt NixOS:
137137+ </para>
138138+ <programlisting>
139139+$ nix-shell -p matrix-synapse
140140+$ register_new_matrix_user -k your-registration-shared-secret http://localhost:8008
141141+New user localpart: your-username
142142+Password:
143143+Confirm password:
144144+Make admin [no]:
146145Success!
147147-</screen>
148148- In the example, this would create a user with the Matrix Identifier
149149- <literal>@your-username:example.org</literal>.
150150- <warning>
146146+</programlisting>
151147 <para>
152152- When using <xref linkend="opt-services.matrix-synapse.settings.registration_shared_secret" />, the secret
153153- will end up in the world-readable store. Instead it's recommended to deploy the secret
154154- in an additional file like this:
155155- <itemizedlist>
156156- <listitem>
157157- <para>
158158- Create a file with the following contents:
159159-<programlisting>
148148+ In the example, this would create a user with the Matrix
149149+ Identifier <literal>@your-username:example.org</literal>.
150150+ </para>
151151+ <warning>
152152+ <para>
153153+ When using
154154+ <xref linkend="opt-services.matrix-synapse.settings.registration_shared_secret"></xref>,
155155+ the secret will end up in the world-readable store. Instead it's
156156+ recommended to deploy the secret in an additional file like
157157+ this:
158158+ </para>
159159+ <itemizedlist>
160160+ <listitem>
161161+ <para>
162162+ Create a file with the following contents:
163163+ </para>
164164+ <programlisting>
160165registration_shared_secret: your-very-secret-secret
161166</programlisting>
162162- </para>
163163- </listitem>
164164- <listitem>
165165- <para>
166166- Deploy the file with a secret-manager such as <link xlink:href="https://nixops.readthedocs.io/en/latest/overview.html#managing-keys"><option>deployment.keys</option></link>
167167- from <citerefentry><refentrytitle>nixops</refentrytitle><manvolnum>1</manvolnum></citerefentry>
168168- or <link xlink:href="https://github.com/Mic92/sops-nix/">sops-nix</link> to
169169- e.g. <filename>/run/secrets/matrix-shared-secret</filename> and ensure that it's readable
170170- by <literal>matrix-synapse</literal>.
171171- </para>
172172- </listitem>
173173- <listitem>
174174- <para>
175175- Include the file like this in your configuration:
176176-<programlisting>
167167+ </listitem>
168168+ <listitem>
169169+ <para>
170170+ Deploy the file with a secret-manager such as
171171+ <link xlink:href="https://nixops.readthedocs.io/en/latest/overview.html#managing-keys"><option>deployment.keys</option></link>
172172+ from
173173+ <citerefentry><refentrytitle>nixops</refentrytitle><manvolnum>1</manvolnum></citerefentry>
174174+ or
175175+ <link xlink:href="https://github.com/Mic92/sops-nix/">sops-nix</link>
176176+ to e.g.
177177+ <filename>/run/secrets/matrix-shared-secret</filename> and
178178+ ensure that it's readable by
179179+ <literal>matrix-synapse</literal>.
180180+ </para>
181181+ </listitem>
182182+ <listitem>
183183+ <para>
184184+ Include the file like this in your configuration:
185185+ </para>
186186+ <programlisting>
177187{
178188 services.matrix-synapse.extraConfigFiles = [
179179- "/run/secrets/matrix-shared-secret"
189189+ "/run/secrets/matrix-shared-secret"
180190 ];
181191}
182192</programlisting>
183183- </para>
184184- </listitem>
185185- </itemizedlist>
193193+ </listitem>
194194+ </itemizedlist>
195195+ </warning>
196196+ <note>
197197+ <para>
198198+ It's also possible to user alternative authentication mechanism
199199+ such as
200200+ <link xlink:href="https://github.com/matrix-org/matrix-synapse-ldap3">LDAP
201201+ (via <literal>matrix-synapse-ldap3</literal>)</link> or
202202+ <link xlink:href="https://matrix-org.github.io/synapse/latest/openid.html">OpenID</link>.
203203+ </para>
204204+ </note>
205205+ </section>
206206+ <section xml:id="module-services-matrix-element-web">
207207+ <title>Element (formerly known as Riot) Web Client</title>
208208+ <para>
209209+ <link xlink:href="https://github.com/vector-im/riot-web/">Element
210210+ Web</link> is the reference web client for Matrix and developed by
211211+ the core team at matrix.org. Element was formerly known as
212212+ Riot.im, see the
213213+ <link xlink:href="https://element.io/blog/welcome-to-element/">Element
214214+ introductory blog post</link> for more information. The following
215215+ snippet can be optionally added to the code before to complete the
216216+ synapse installation with a web client served at
217217+ <literal>https://element.myhostname.example.org</literal> and
218218+ <literal>https://element.example.org</literal>. Alternatively, you
219219+ can use the hosted copy at
220220+ <link xlink:href="https://app.element.io/" role="uri">https://app.element.io/</link>,
221221+ or use other web clients or native client applications. Due to the
222222+ <literal>/.well-known</literal> urls set up done above, many
223223+ clients should fill in the required connection details
224224+ automatically when you enter your Matrix Identifier. See
225225+ <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
226226+ Matrix Now!</link> for a list of existing clients and their
227227+ supported featureset.
186228 </para>
187187- </warning>
188188- </para>
189189- <note>
190190- <para>
191191- It's also possible to user alternative authentication mechanism such as
192192- <link xlink:href="https://github.com/matrix-org/matrix-synapse-ldap3">LDAP (via <literal>matrix-synapse-ldap3</literal>)</link>
193193- or <link xlink:href="https://matrix-org.github.io/synapse/latest/openid.html">OpenID</link>.
194194- </para>
195195- </note>
196196- </section>
197197- <section xml:id="module-services-matrix-element-web">
198198- <title>Element (formerly known as Riot) Web Client</title>
199199-200200- <para>
201201- <link xlink:href="https://github.com/vector-im/riot-web/">Element Web</link> is
202202- the reference web client for Matrix and developed by the core team at
203203- matrix.org. Element was formerly known as Riot.im, see the
204204- <link xlink:href="https://element.io/blog/welcome-to-element/">Element introductory blog post</link>
205205- for more information. The following snippet can be optionally added to the code before
206206- to complete the synapse installation with a web client served at
207207- <literal>https://element.myhostname.example.org</literal> and
208208- <literal>https://element.example.org</literal>. Alternatively, you can use the hosted
209209- copy at <link xlink:href="https://app.element.io/">https://app.element.io/</link>,
210210- or use other web clients or native client applications. Due to the
211211- <literal>/.well-known</literal> urls set up done above, many clients should
212212- fill in the required connection details automatically when you enter your
213213- Matrix Identifier. See
214214- <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
215215- Matrix Now!</link> for a list of existing clients and their supported
216216- featureset.
217217-<programlisting>
229229+ <programlisting>
218230{
219219- services.nginx.virtualHosts."element.${fqdn}" = {
231231+ services.nginx.virtualHosts."element.${fqdn}" = {
220232 enableACME = true;
221233 forceSSL = true;
222234 serverAliases = [
223223- "element.${config.networking.domain}"
235235+ "element.${config.networking.domain}"
224236 ];
225237226238 root = pkgs.element-web.override {
···231243 };
232244}
233245</programlisting>
234234- </para>
235235-236236- <note>
237237- <para>
238238- The Element developers do not recommend running Element and your Matrix
239239- homeserver on the same fully-qualified domain name for security reasons. In
240240- the example, this means that you should not reuse the
241241- <literal>myhostname.example.org</literal> virtualHost to also serve Element,
242242- but instead serve it on a different subdomain, like
243243- <literal>element.example.org</literal> in the example. See the
244244- <link xlink:href="https://github.com/vector-im/element-web/tree/v1.10.0#important-security-notes">Element
245245- Important Security Notes</link> for more information on this subject.
246246- </para>
247247- </note>
248248- </section>
246246+ <note>
247247+ <para>
248248+ The Element developers do not recommend running Element and your
249249+ Matrix homeserver on the same fully-qualified domain name for
250250+ security reasons. In the example, this means that you should not
251251+ reuse the <literal>myhostname.example.org</literal> virtualHost
252252+ to also serve Element, but instead serve it on a different
253253+ subdomain, like <literal>element.example.org</literal> in the
254254+ example. See the
255255+ <link xlink:href="https://github.com/vector-im/element-web/tree/v1.10.0#important-security-notes">Element
256256+ Important Security Notes</link> for more information on this
257257+ subject.
258258+ </para>
259259+ </note>
260260+ </section>
249261</chapter>