Fix matrix configuration

This commit is contained in:
Nathan McCarty 2022-09-27 00:55:48 -04:00
parent ba403a3a0b
commit 6abfea39fa
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
1 changed files with 24 additions and 11 deletions

View File

@ -106,16 +106,16 @@
};
# Configure matrix registration
services.matrix-synapse.settings = {
enable_registration_captcha = true;
allow_guest_access = false;
extraConfig = ''
allow_public_rooms_over_federation: true
experimental_features: { spaces_enabled: true }
auto_join_rooms: [ "#space:community.rs" , #rules:community.rs" , "#info:community.rs" ]
'';
turn_uris = [ "turn:turn.community.rs:3478?transport=udp" "turn:turn.community.rs:3478?transport=tcp" ];
turn_user_lifetime = "1h";
services.matrix-synapse = {
settings = {
enable_registration_captcha = true;
allow_guest_access = false;
allow_public_rooms_over_federation = true;
experimental_features = { spaces_enabled = true; };
auto_join_rooms = [ "#space:community.rs" "#rules:community.rs" "#info:community.rs" ];
turn_uris = [ "turn:turn.community.rs:3478?transport=udp" "turn:turn.community.rs:3478?transport=tcp" ];
turn_user_lifetime = "1h";
};
extraConfigFiles = [ config.sops.secrets."matrix-secrets.yaml".path ];
};
@ -124,7 +124,20 @@
enable = true;
compression = "none";
backupAll = true;
startAt = "OnCalendar=00/2:00";
startAt = "OnCalendar=00/4:00";
};
# Setup a task to cleanup the database
systemd.services.synapse-db-cleanup = {
serviceConfig = {
Type = "oneshot";
User = "postgres";
Group = "postgres";
};
path = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ];
script = ''
synapse_auto_compressor -p "host=localhost user=postgres" -c 500 -n 100
'';
};
# Configure the vhost for the domain