summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-02-20 00:15:42 +0100
committerRory& <root@rory.gay>2025-02-20 00:15:42 +0100
commit0507bf5c6b1139747cc819b67aa396b140753252 (patch)
tree49b7e3620fdd84c5228a42aacd0ad09de78d713a
parentAdd cgit to nginx (diff)
downloadRory-Open-Architecture-0507bf5c6b1139747cc819b67aa396b140753252.tar.xz
Reintroduce synapse
-rwxr-xr-xhost/Rory-ovh/configuration.nix1
-rwxr-xr-xhost/Rory-ovh/services/matrix/synapse/synapse-main.nix56
2 files changed, 29 insertions, 28 deletions
diff --git a/host/Rory-ovh/configuration.nix b/host/Rory-ovh/configuration.nix

index 101d691..691f4e3 100755 --- a/host/Rory-ovh/configuration.nix +++ b/host/Rory-ovh/configuration.nix
@@ -22,6 +22,7 @@ ./services/nginx/nginx.nix ./services/cgit.nix ./services/postgres.nix + ./services/matrix/synapse/synapse-main.nix ]; users.groups.ocp = { }; diff --git a/host/Rory-ovh/services/matrix/synapse/synapse-main.nix b/host/Rory-ovh/services/matrix/synapse/synapse-main.nix
index 0b75412..d90ef26 100755 --- a/host/Rory-ovh/services/matrix/synapse/synapse-main.nix +++ b/host/Rory-ovh/services/matrix/synapse/synapse-main.nix
@@ -78,7 +78,7 @@ destination_retry_multiplier = 1.2; # default=2 }; - registration_shared_secret_path = "/var/lib/matrix-synapse/registration_shared_secret.txt"; + registration_shared_secret_path = "/data/secrets/synapse-shared-secret"; listeners = [ { @@ -120,7 +120,7 @@ ); app_service_config_files = [ #"/etc/matrix-synapse/appservice-registration.yaml" - "/var/lib/matrix-synapse/modas-registration.yaml" + #"/var/lib/matrix-synapse/modas-registration.yaml" ]; #region Media @@ -186,32 +186,32 @@ // import ./caches.nix; }; - systemd.services.matrix-synapse-reg-token = { - description = "Random registration token for Synapse."; - before = [ "matrix-synapse.service" ]; # So the registration can be used by Synapse - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - - script = '' - set -e -x -o pipefail - echo "Starting key generation" - if [ ! -f "registration_shared_secret.txt" ] - then - echo "Generating new key" - strace cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt - echo "Key generation complete" - else - echo "Not generating key, key exists" - fi - echo "Script complete" - ''; - serviceConfig = { - User = "matrix-synapse"; - Group = "matrix-synapse"; - WorkingDirectory = "/var/lib/matrix-synapse"; - RemainAfterExit = true; - }; - }; + #systemd.services.matrix-synapse-reg-token = { + # description = "Random registration token for Synapse."; + # before = [ "matrix-synapse.service" ]; # So the registration can be used by Synapse + # wantedBy = [ "multi-user.target" ]; + # after = [ "network.target" ]; +# + # script = '' + # set -e -x -o pipefail + # echo "Starting key generation" + # if [ ! -f "registration_shared_secret.txt" ] + # then + # echo "Generating new key" + # strace cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt + # echo "Key generation complete" + # else + # echo "Not generating key, key exists" + # fi + # echo "Script complete" + # ''; + # serviceConfig = { + # User = "matrix-synapse"; + # Group = "matrix-synapse"; + # WorkingDirectory = "/var/lib/matrix-synapse"; + # RemainAfterExit = true; + # }; + #}; services.redis = { package = pkgs.keydb;