blob: 0a7b392ffc95221406438e990bfb63897907107e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{ config, ... }:
let
fqdn = "synapse.${config.networking.domain}";
baseUrl = "https://${fqdn}";
in
{
networking.domain = "tdback.net";
networking.firewall.allowedTCPPorts = [
80
443
];
services.caddy = {
enable = true;
virtualHosts = {
${config.networking.domain}.extraConfig = ''
handle /.well-known/matrix/server {
header Content-Type application/json
header Access-Control-Allow-Origin *
respond `{"m.server": "${fqdn}:443"}`
}
handle /.well-known/matrix/client {
header Content-Type application/json
header Access-Control-Allow-Origin *
respond `{"m.homeserver": {"base_url": "${baseUrl}"}}`
}
root * /var/www/tdback.net/
encode zstd gzip
file_server
'';
};
};
}
|