server: enable matrix-sliding-sync

This commit is contained in:
chayleaf 2024-08-24 03:01:12 +07:00
parent 45191559c7
commit 5ba73e92a8
Signed by: chayleaf
GPG key ID: 78171AD46227E68E
2 changed files with 22 additions and 2 deletions

View file

@ -281,7 +281,13 @@ in {
job_name = "local_medium_freq"; job_name = "local_medium_freq";
scrape_interval = "15m"; scrape_interval = "15m";
static_configs = [ { static_configs = [ {
targets = [ "127.0.0.1:9548" "127.0.0.1:9198" "127.0.0.1:9173" ]; targets = [
"127.0.0.1:9548"
"127.0.0.1:9198"
(let cfg = config.services.matrix-appservice-discord.settings.metrics;
in "${lib.quoteListenAddr cfg.host}:${toString cfg.port}")
config.services.matrix-sliding-sync.settings.SYNCV3_PROM
];
labels.machine = "server"; labels.machine = "server";
} ]; } ];
} }
@ -363,6 +369,9 @@ in {
host = "127.0.0.1"; host = "127.0.0.1";
port = 9173; port = 9173;
}; };
services.matrix-sliding-sync = {
settings.SYNCV3_PROM = "[::]:8011";
};
services.matrix-synapse.settings = { services.matrix-synapse.settings = {
enable_metrics = true; enable_metrics = true;
federation_metrics_domains = [ "matrix.org" ]; federation_metrics_domains = [ "matrix.org" ];

View file

@ -11,6 +11,7 @@ let
matrixClientJson = { matrixClientJson = {
"m.homeserver".base_url = "https://matrix.${cfg.domainName}"; "m.homeserver".base_url = "https://matrix.${cfg.domainName}";
"m.identity_server".base_url = "https://vector.im"; "m.identity_server".base_url = "https://vector.im";
"org.matrix.msc3575.proxy".url = "https://matrix.${cfg.domainName}";
}; };
matrixServerConfigResponse = '' matrixServerConfigResponse = ''
add_header Content-Type application/json; add_header Content-Type application/json;
@ -41,7 +42,8 @@ in {
locations = { locations = {
"= /.well-known/matrix/server".extraConfig = matrixServerConfigResponse; "= /.well-known/matrix/server".extraConfig = matrixServerConfigResponse;
"= /.well-known/matrix/client".extraConfig = matrixClientConfigResponse; "= /.well-known/matrix/client".extraConfig = matrixClientConfigResponse;
"/".proxyPass = "http://${lib.quoteListenAddr matrixAddr}:${toString matrixPort}"; "~ ^/(_matrix|_synapse/client|$)".proxyPass = "http://${lib.quoteListenAddr matrixAddr}:${toString matrixPort}";
"~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/)".proxyPass = "http://${config.services.matrix-sliding-sync.settings.SYNCV3_BINDADDR}";
}; };
}; };
@ -111,4 +113,13 @@ in {
}]; }];
}; };
}; };
services.matrix-sliding-sync = {
enable = true;
environmentFile = "/secrets/sliding-sync/env";
settings = {
SYNCV3_BINDADDR = "[::]:8010";
SYNCV3_SERVER = "https://matrix.pavluk.org";
};
};
} }