fully disable synapse on matrix

This commit is contained in:
Nathan McCarty 2023-06-09 23:10:53 -04:00
parent b09507e910
commit 9a1278a3fc
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
2 changed files with 45 additions and 44 deletions

View File

@ -11,11 +11,11 @@
sopsFile = ../../secrets/matrix/borg.yaml; sopsFile = ../../secrets/matrix/borg.yaml;
format = "yaml"; format = "yaml";
}; };
"matrix-secrets.yaml" = { # "matrix-secrets.yaml" = {
owner = "matrix-synapse"; # owner = "matrix-synapse";
format = "binary"; # format = "binary";
sopsFile = ../../secrets/matrix/recaptcha; # sopsFile = ../../secrets/matrix/recaptcha;
}; # };
}; };
# Setup system configuration # Setup system configuration
nathan = { nathan = {
@ -103,47 +103,47 @@
users.users.nathan = { extraGroups = [ "www-html" ]; }; users.users.nathan = { extraGroups = [ "www-html" ]; };
# Configure matrix registration # Configure matrix registration
services.matrix-synapse = { # services.matrix-synapse = {
settings = { # settings = {
enable_registration_captcha = true; # enable_registration_captcha = true;
allow_guest_access = false; # allow_guest_access = false;
allow_public_rooms_over_federation = true; # allow_public_rooms_over_federation = true;
experimental_features = { spaces_enabled = true; }; # experimental_features = { spaces_enabled = true; };
auto_join_rooms = # auto_join_rooms =
[ "#space:community.rs" "#rules:community.rs" "#info:community.rs" ]; # [ "#space:community.rs" "#rules:community.rs" "#info:community.rs" ];
turn_uris = [ # turn_uris = [
# "turn:turn.community.rs:3478?transport=udp" # # "turn:turn.community.rs:3478?transport=udp"
# "turn:turn.community.rs:3478?transport=tcp" # # "turn:turn.community.rs:3478?transport=tcp"
]; # ];
# turn_user_lifetime = "1h"; # # turn_user_lifetime = "1h";
}; # };
extraConfigFiles = [ config.sops.secrets."matrix-secrets.yaml".path ]; # extraConfigFiles = [ config.sops.secrets."matrix-secrets.yaml".path ];
}; # };
# Install our utilties # # Install our utilties
environment.systemPackages = with pkgs; [ matrix-synapse-tools.synadm ]; # environment.systemPackages = with pkgs; [ matrix-synapse-tools.synadm ];
# Setup a task to cleanup the database # # Setup a task to cleanup the database
systemd.services.synapse-db-cleanup = { # systemd.services.synapse-db-cleanup = {
serviceConfig = { # serviceConfig = {
Type = "oneshot"; # Type = "oneshot";
User = "postgres"; # User = "postgres";
Group = "postgres"; # Group = "postgres";
}; # };
path = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ]; # path = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ];
script = '' # script = ''
synapse_auto_compressor -p "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100 # synapse_auto_compressor -p "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100
''; # '';
}; # };
systemd.timers.synapse-db-cleanup = { # systemd.timers.synapse-db-cleanup = {
wantedBy = [ "timers.target" ]; # wantedBy = [ "timers.target" ];
partOf = [ "synapse-db-cleanup.service" ]; # partOf = [ "synapse-db-cleanup.service" ];
timerConfig = { # timerConfig = {
# Weekly on sunday mornings # # Weekly on sunday mornings
OnCalendar = "Sun, 5:00"; # OnCalendar = "Sun, 5:00";
Unit = "synapse-db-cleanup.service"; # Unit = "synapse-db-cleanup.service";
}; # };
}; # };
# Configure the vhost for the domain # Configure the vhost for the domain
services.nginx.virtualHosts = let services.nginx.virtualHosts = let

View File

@ -53,6 +53,7 @@
synapse_auto_compressor -p "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100 synapse_auto_compressor -p "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100
''; '';
}; };
# Run the compressor
systemd.timers.synapse-db-cleanup = { systemd.timers.synapse-db-cleanup = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
partOf = [ "synapse-db-cleanup.service" ]; partOf = [ "synapse-db-cleanup.service" ];