add metrics

This commit is contained in:
XenGi 2025-11-30 16:09:05 +01:00
parent 79c5c57629
commit 1612f5e511
Signed by: xengi
SSH key fingerprint: SHA256:dM+fLZGsDvyv6kunjE8bGduL24VsCFB4LEOSdmRHdG0
6 changed files with 227 additions and 60 deletions

View file

@ -4,46 +4,78 @@ let
domain = "berlin.ccc.de";
in
{
services.matrix-synapse = {
enable = false;
settings = {
server_name = domain;
public_baseurl = "https://matrix.${domain}:443/";
#signing_key_path = config.age.secrets.signing_key.path; # "/var/lib/matrix-synapse/homeserver.signing.key"
database.name = "psycopg2";
listeners = [
{
path = "/run/matrix-synapse.sock";
x_forwarded = true;
request_id_header = "X-Request-ID";
resources = [
{
services = {
matrix-synapse = {
enable = true;
settings = {
server_name = domain;
public_baseurl = "https://matrix.${domain}:443/";
#signing_key_path = config.age.secrets.signing_key.path; # "/var/lib/matrix-synapse/homeserver.signing.key"
database = {
name = "psycopg2";
args = {
user = "matrix-synapse";
database = "matrix-synapse";
};
};
listeners = [
{
type = "http";
x_forwarded = true;
tls = false;
port = 8008;
bind_addresses = [ "::1" ];
resources = [
{
compress = false;
names = [
"client"
"federation"
];
}
];
}
{
type = "metrics";
port = 9009;
bind_addresses = [ "::1" ];
resources = [{
compress = false;
names = [
"client"
"federation"
];
}
];
names = [ "metrics" ];
}];
}
];
enable_metrics = true;
dynamic_thumbnails = true;
max_upload_size = "128M";
max_image_pixels = "64M";
retention = {
enabled = true;
default_policy = {
min_lifetime = "1d";
max_lifetime = "1y";
};
allowed_lifetime_min = "1d";
allowed_lifetime_max = "1y";
};
};
extraConfigFiles = [
config.age.secrets.matrix-registration-shared-secret.path
];
enableRegistrationScript = true;
};
postgresql = {
ensureUsers = [
{
name = config.services.matrix-synapse.settings.database.args.user;
ensureDBOwnership = true;
}
];
dynamic_thumbnails = true;
max_upload_size = "128M";
max_image_pixels = "64M";
retention = {
enabled = true;
default_policy = {
min_lifetime = "1d";
max_lifetime = "1y";
};
allowed_lifetime_min = "1d";
allowed_lifetime_max = "1y";
};
ensureDatabases = [
config.services.matrix-synapse.settings.database.args.database
];
};
extraConfigFiles = [
config.age.secrets.matrix-registration-shared-secret.path
];
enableRegistrationScript = true;
};
}