Skip to content

Commit be4a0e6

Browse files
authored
Merge pull request #158605 from mweinelt/synapse-rfc42
nixos/matrix-synapse: migrate to rfc42 settings and formatter
2 parents e408a21 + f799a02 commit be4a0e6

File tree

11 files changed

+1112
-923
lines changed

11 files changed

+1112
-923
lines changed

nixos/doc/manual/from_md/release-notes/rl-2205.section.xml

+110
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,116 @@
388388
its reliance on python2.
389389
</para>
390390
</listitem>
391+
<listitem>
392+
<para>
393+
The <literal>matrix-synapse</literal> service
394+
(<literal>services.matrix-synapse</literal>) has been
395+
converted to use the <literal>settings</literal> option
396+
defined in RFC42. This means that options that are part of
397+
your <literal>homeserver.yaml</literal> configuration, and
398+
that were specified at the top-level of the module
399+
(<literal>services.matrix-synapse</literal>) now need to be
400+
moved into
401+
<literal>services.matrix-synapse.settings</literal>. And while
402+
not all options you may use are defined in there, they are
403+
still supported, because you can set arbitrary values in this
404+
freeform type.
405+
</para>
406+
<para>
407+
An example to make the required migration clearer:
408+
</para>
409+
<para>
410+
Before:
411+
</para>
412+
<programlisting language="bash">
413+
{
414+
services.matrix-synapse = {
415+
enable = true;
416+
417+
server_name = &quot;example.com&quot;;
418+
public_baseurl = &quot;https://example.com:8448&quot;;
419+
420+
enable_registration = false;
421+
registration_shared_secret = &quot;xohshaeyui8jic7uutuDogahkee3aehuaf6ei3Xouz4iicie5thie6nohNahceut&quot;;
422+
macaroon_secret_key = &quot;xoo8eder9seivukaiPh1cheikohquuw8Yooreid0The4aifahth3Ou0aiShaiz4l&quot;;
423+
424+
tls_certificate_path = &quot;/var/lib/acme/example.com/fullchain.pem&quot;;
425+
tls_certificate_path = &quot;/var/lib/acme/example.com/fullchain.pem&quot;;
426+
427+
listeners = [ {
428+
port = 8448;
429+
bind_address = &quot;&quot;;
430+
type = &quot;http&quot;;
431+
tls = true;
432+
resources = [ {
433+
names = [ &quot;client&quot; ];
434+
compress = true;
435+
} {
436+
names = [ &quot;federation&quot; ];
437+
compress = false;
438+
} ];
439+
} ];
440+
441+
};
442+
}
443+
</programlisting>
444+
<para>
445+
After:
446+
</para>
447+
<programlisting language="bash">
448+
{
449+
services.matrix-synapse = {
450+
enable = true;
451+
452+
# this attribute set holds all values that go into your homeserver.yaml configuration
453+
# See https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml for
454+
# possible values.
455+
settings = {
456+
server_name = &quot;example.com&quot;;
457+
public_baseurl = &quot;https://example.com:8448&quot;;
458+
459+
enable_registration = false;
460+
# pass `registration_shared_secret` and `macaroon_secret_key` via `extraConfigFiles` instead
461+
462+
tls_certificate_path = &quot;/var/lib/acme/example.com/fullchain.pem&quot;;
463+
tls_certificate_path = &quot;/var/lib/acme/example.com/fullchain.pem&quot;;
464+
465+
listeners = [ {
466+
port = 8448;
467+
bind_address = [
468+
&quot;::&quot;
469+
&quot;0.0.0.0&quot;
470+
];
471+
type = &quot;http&quot;;
472+
tls = true;
473+
resources = [ {
474+
names = [ &quot;client&quot; ];
475+
compress = true;
476+
} {
477+
names = [ &quot;federation&quot; ];
478+
compress = false;
479+
} ];
480+
} ];
481+
};
482+
483+
extraConfigFiles = [
484+
/run/keys/matrix-synapse/secrets.yaml
485+
];
486+
};
487+
}
488+
</programlisting>
489+
<para>
490+
The secrets in your original config should be migrated into a
491+
YAML file that is included via
492+
<literal>extraConfigFiles</literal>.
493+
</para>
494+
<para>
495+
Additionally a few option defaults have been synced up with
496+
upstream default values, for example the
497+
<literal>max_upload_size</literal> grew from
498+
<literal>10M</literal> to <literal>50M</literal>.
499+
</para>
500+
</listitem>
391501
<listitem>
392502
<para>
393503
The MoinMoin wiki engine

nixos/doc/manual/release-notes/rl-2205.section.md

+89
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,95 @@ In addition to numerous new and upgraded packages, this release has the followin
128128

129129
- The `mailpile` email webclient (`services.mailpile`) has been removed due to its reliance on python2.
130130

131+
- The `matrix-synapse` service (`services.matrix-synapse`) has been converted to use the `settings` option defined in RFC42.
132+
This means that options that are part of your `homeserver.yaml` configuration, and that were specified at the top-level of the
133+
module (`services.matrix-synapse`) now need to be moved into `services.matrix-synapse.settings`. And while not all options you
134+
may use are defined in there, they are still supported, because you can set arbitrary values in this freeform type.
135+
136+
An example to make the required migration clearer:
137+
138+
Before:
139+
```nix
140+
{
141+
services.matrix-synapse = {
142+
enable = true;
143+
144+
server_name = "example.com";
145+
public_baseurl = "https://example.com:8448";
146+
147+
enable_registration = false;
148+
registration_shared_secret = "xohshaeyui8jic7uutuDogahkee3aehuaf6ei3Xouz4iicie5thie6nohNahceut";
149+
macaroon_secret_key = "xoo8eder9seivukaiPh1cheikohquuw8Yooreid0The4aifahth3Ou0aiShaiz4l";
150+
151+
tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem";
152+
tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem";
153+
154+
listeners = [ {
155+
port = 8448;
156+
bind_address = "";
157+
type = "http";
158+
tls = true;
159+
resources = [ {
160+
names = [ "client" ];
161+
compress = true;
162+
} {
163+
names = [ "federation" ];
164+
compress = false;
165+
} ];
166+
} ];
167+
168+
};
169+
}
170+
```
171+
172+
After:
173+
```nix
174+
{
175+
services.matrix-synapse = {
176+
enable = true;
177+
178+
# this attribute set holds all values that go into your homeserver.yaml configuration
179+
# See https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml for
180+
# possible values.
181+
settings = {
182+
server_name = "example.com";
183+
public_baseurl = "https://example.com:8448";
184+
185+
enable_registration = false;
186+
# pass `registration_shared_secret` and `macaroon_secret_key` via `extraConfigFiles` instead
187+
188+
tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem";
189+
tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem";
190+
191+
listeners = [ {
192+
port = 8448;
193+
bind_address = [
194+
"::"
195+
"0.0.0.0"
196+
];
197+
type = "http";
198+
tls = true;
199+
resources = [ {
200+
names = [ "client" ];
201+
compress = true;
202+
} {
203+
names = [ "federation" ];
204+
compress = false;
205+
} ];
206+
} ];
207+
};
208+
209+
extraConfigFiles = [
210+
/run/keys/matrix-synapse/secrets.yaml
211+
];
212+
};
213+
}
214+
```
215+
216+
The secrets in your original config should be migrated into a YAML file that is included via `extraConfigFiles`.
217+
218+
Additionally a few option defaults have been synced up with upstream default values, for example the `max_upload_size` grew from `10M` to `50M`.
219+
131220
- The MoinMoin wiki engine (`services.moinmoin`) has been removed, because Python 2 is being retired from nixpkgs.
132221

133222
- The `wafHook` hook now honors `NIX_BUILD_CORES` when `enableParallelBuilding` is not set explicitly. Packages can restore the old behaviour by setting `enableParallelBuilding=false`.

nixos/modules/module-list.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@
499499
./services/mail/roundcube.nix
500500
./services/mail/sympa.nix
501501
./services/mail/nullmailer.nix
502+
./services/matrix/matrix-synapse.nix
502503
./services/matrix/mjolnir.nix
503504
./services/matrix/pantalaimon.nix
504505
./services/misc/ananicy.nix
@@ -565,7 +566,6 @@
565566
./services/misc/matrix-appservice-discord.nix
566567
./services/misc/matrix-appservice-irc.nix
567568
./services/misc/matrix-conduit.nix
568-
./services/misc/matrix-synapse.nix
569569
./services/misc/mautrix-facebook.nix
570570
./services/misc/mautrix-telegram.nix
571571
./services/misc/mbpfan.nix

0 commit comments

Comments
 (0)