minor conduit changes (still broken :PPP)

This commit is contained in:
jacekpoz 2024-01-20 01:26:50 +01:00
parent 7543a9999d
commit 6fe730f997
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -4,15 +4,7 @@
lib,
pkgs,
...
}: with lib; let
caddyConfig = ''
reverse_proxy /_matrix/* localhost:6167
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond /.well-known/matrix/server `{"m.server": "m.jacekpoz.pl:8448"}`
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://m.jacekpoz.pl"}}`
'';
in {
}: with lib; {
environment.systemPackages = with pkgs; [ mautrix-discord ];
services.matrix-conduit = {
@ -20,6 +12,7 @@ in {
package = inputs.conduit.packages.${pkgs.system}.default;
settings.global = {
address = "127.0.0.1";
server_name = "jacekpoz.pl";
database_backend = "rocksdb";
port = 6167;
@ -27,13 +20,34 @@ in {
conduit_cache_capacity_modifier = 4.0;
rocksdb_max_open_files = 20;
allow_check_for_updates = false;
allow_registration = false;
};
};
services.caddy = {
enable = true;
virtualHosts."m.jacekpoz.pl".extraConfig = caddyConfig;
virtualHosts."jacekpoz.pl:8448".extraConfig = caddyConfig;
virtualHosts."m.jacekpoz.pl".extraConfig = ''
reverse_proxy /_matrix/* localhost:6167
'';
virtualHosts."jacekpoz.pl".extraConfig = ''
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
respond /.well-known/matrix/server `{
"m.server": "m.jacekpoz.pl:443"
}`
respond /.well-known/matrix/client `{
"m.homeserver": {
"base_url": "https://m.jacekpoz.pl"
},
"m.identity_server": {
"base_url": "https://matrix.org"
},
"org.matrix.msc3575.proxy": {
"url": "https://m.jacekpoz.pl"
}
}`
'';
};
networking.firewall.allowedTCPPorts = [ 80 443 8448 ];