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;
format = "yaml";
};
"matrix-secrets.yaml" = {
owner = "matrix-synapse";
format = "binary";
sopsFile = ../../secrets/matrix/recaptcha;
};
# "matrix-secrets.yaml" = {
# owner = "matrix-synapse";
# format = "binary";
# sopsFile = ../../secrets/matrix/recaptcha;
# };
};
# Setup system configuration
nathan = {
@ -103,47 +103,47 @@
users.users.nathan = { extraGroups = [ "www-html" ]; };
# Configure matrix registration
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 ];
};
# 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 ];
# };
# Install our utilties
environment.systemPackages = with pkgs; [ matrix-synapse-tools.synadm ];
# # Install our utilties
# environment.systemPackages = with pkgs; [ matrix-synapse-tools.synadm ];
# 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 "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100
'';
};
systemd.timers.synapse-db-cleanup = {
wantedBy = [ "timers.target" ];
partOf = [ "synapse-db-cleanup.service" ];
timerConfig = {
# Weekly on sunday mornings
OnCalendar = "Sun, 5:00";
Unit = "synapse-db-cleanup.service";
};
};
# # 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 "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100
# '';
# };
# systemd.timers.synapse-db-cleanup = {
# wantedBy = [ "timers.target" ];
# partOf = [ "synapse-db-cleanup.service" ];
# timerConfig = {
# # Weekly on sunday mornings
# OnCalendar = "Sun, 5:00";
# Unit = "synapse-db-cleanup.service";
# };
# };
# Configure the vhost for the domain
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
'';
};
# Run the compressor
systemd.timers.synapse-db-cleanup = {
wantedBy = [ "timers.target" ];
partOf = [ "synapse-db-cleanup.service" ];