feat: matrix-conduit: expose /_matrix/ on both ports
parent
7700905647
commit
96d7fb67ae
|
@ -5,27 +5,23 @@
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
homeserver-url = "samsehu.perli.casa";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
# Headscale for access to the network while away from home
|
|
||||||
services.headscale.settings.dns_config.extra_records = [
|
|
||||||
{ name = "matrix.samsehu.perli.casa"; type = "A"; value = "100.64.0.3"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# configure matrix-conduit as a server to host chat communications with end-to-end encryption
|
# configure matrix-conduit as a server to host chat communications with end-to-end encryption
|
||||||
services.matrix-conduit = {
|
services.matrix-conduit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.global = {
|
settings.global = {
|
||||||
server_name = "matrix.samsehu.perli.casa";
|
server_name = "${homeserver-url}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Reverse proxy with Caddy
|
# Reverse proxy with Caddy
|
||||||
services.caddy.virtualHosts."matrix.samsehu.perli.casa".extraConfig = ''
|
services.caddy.virtualHosts."${homeserver-url}, ${homeserver-url}:8448".extraConfig = ''
|
||||||
respond /.well-known/matrix/server `{ "m.server": "matrix.samsehu.perli.casa" }` 200
|
respond /.well-known/matrix/server `{ "m.server": "${homeserver-url}" }` 200
|
||||||
respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://matrix.samsehu.perli.casa" } }` 200
|
respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://${homeserver-url}" } }` 200
|
||||||
'';
|
reverse_proxy /_matrix/* localhost:${toString config.services.matrix-conduit.settings.global.port}
|
||||||
services.caddy.virtualHosts."matrix.samsehu.perli.casa:8448".extraConfig = ''
|
|
||||||
reverse_proxy localhost:${toString config.services.matrix-conduit.settings.global.port}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
|
|
Loading…
Reference in New Issue