add draupnir

This commit is contained in:
XenGi 2025-11-24 22:56:05 +01:00
parent 9dd5d2ef2e
commit 79c5c57629
Signed by: xengi
SSH key fingerprint: SHA256:dM+fLZGsDvyv6kunjE8bGduL24VsCFB4LEOSdmRHdG0
5 changed files with 45 additions and 2 deletions

View file

@ -33,3 +33,16 @@ register_new_matrix_user \
--password <YOUR_PASSWORD> --password <YOUR_PASSWORD>
``` ```
# Draupnir
Remove rate limit for account:
```bash
curl -X DELETE https://matrix.berlin.ccc.de/_synapse/admin/v1/users/@admin:berlin.ccc.de/override_ratelimit
```
Set rate limit for account:
```bash
curl -X POST -d '{"messages_per_second":0,"burst_count":0}' https://matrix.berlin.ccc.de/_synapse/admin/v1/users/@admin:berlin.ccc.de/override_ratelimit
```

View file

@ -57,6 +57,7 @@
./services/nginx.nix ./services/nginx.nix
./services/postgres.nix ./services/postgres.nix
./services/synapse.nix ./services/synapse.nix
./services/draupnir.nix
]; ];
}; };
}; };

17
services/draupnir.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, ... }:
{
services.draupnir = {
enable = false;
settings = {
homeserverUrl = "https://matrix.berlin.ccc.de";
managementRoom = "#moderators:berlin.ccc.de";
autojoinOnlyIfManager = true;
recordIgnoredInvites = true;
roomStateBackingStore.enabled = true;
displayReports = true;
};
secrets.accessToken = config.age.secrets.draupnir_access_token.path;
};
}

View file

@ -20,6 +20,7 @@ in
kTLS = true; kTLS = true;
forceSSL = true; forceSSL = true;
useACMEHost = fqdn; useACMEHost = fqdn;
#enableACME = true;
locations = { locations = {
"/.well-known/matrix/client" = { "/.well-known/matrix/client" = {
return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.berlin.ccc.de\"}}'"; return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.berlin.ccc.de\"}}'";
@ -28,13 +29,23 @@ in
add_header Access-Control-Allow-Origin "*"; add_header Access-Control-Allow-Origin "*";
''; '';
}; };
"/" = { "~ ^(/_matrix|/_synapse/client)" {
recommendedProxySettings = true; recommendedProxySettings = true;
proxyPass = "unix:/run/matrix-synapse.sock"; proxyPass = "unix:/run/matrix-synapse.sock";
extraConfig = ''
proxy_set_header X-Request-ID $request_id;
'';
}; };
"/" = {
return = "418 \"I'm a Teapot!\"";
};
extraConfig = ''
client_max_body_size 64M;
'';
}; };
extraConfig = '' extraConfig = ''
''; proxy_http_version 1.1;
'';
}; };
}; };

View file

@ -15,6 +15,7 @@ in
{ {
path = "/run/matrix-synapse.sock"; path = "/run/matrix-synapse.sock";
x_forwarded = true; x_forwarded = true;
request_id_header = "X-Request-ID";
resources = [ resources = [
{ {
compress = false; compress = false;