fix: matrix to allow federation and use synapse

This commit is contained in:
Jet Pham 2026-02-23 19:22:36 -08:00
parent 6c805737f1
commit 75a49c7516
No known key found for this signature in database
3 changed files with 36 additions and 12 deletions

View file

@ -12,8 +12,18 @@
root * /var/lib/acme/acme-challenge root * /var/lib/acme/acme-challenge
file_server file_server
} }
handle /.well-known/matrix/server {
header Access-Control-Allow-Origin "*"
header Content-Type "application/json"
respond `{"m.server": "matrix.extremist.software:443"}`
}
handle /.well-known/matrix/client {
header Access-Control-Allow-Origin "*"
header Content-Type "application/json"
respond `{"m.homeserver": {"base_url": "https://matrix.extremist.software"}}`
}
handle { handle {
respond "Hi" redir https://jetpham.com{uri}
} }
''; '';
}; };
@ -51,8 +61,9 @@
"matrix.extremist.software" = { "matrix.extremist.software" = {
extraConfig = '' extraConfig = ''
reverse_proxy /_matrix/* localhost:6167 reverse_proxy /_matrix/* 127.0.0.1:8008
reverse_proxy /_synapse/client/* localhost:6167 reverse_proxy /_synapse/client/* 127.0.0.1:8008
reverse_proxy /.well-known/matrix/* 127.0.0.1:8008
''; '';
}; };
}; };

View file

@ -1,16 +1,29 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.matrix-conduit = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
global = { server_name = "extremist.software";
server_name = "matrix.extremist.software"; public_baseurl = "https://matrix.extremist.software";
allow_registration = true; # Disable after creating first user
port = 6167;
};
};
};
networking.firewall.allowedTCPPorts = [ 6167 8448 ]; listeners = [
{
port = 8008;
bind_addresses = [ "127.0.0.1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [ "client" "federation" ];
compress = false;
}
];
}
];
enable_registration = true;
};
};
} }