summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/synapse-main.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-03 23:23:11 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commit61c94c0cd250d18114c6c889e55636d94d1475f1 (patch)
tree3131eb3db0ce1404e9641a301f8dd1d06a682628 /host/Rory-nginx/services/matrix/synapse/synapse-main.nix
parentMore senders (diff)
downloadRory-Open-Architecture-61c94c0cd250d18114c6c889e55636d94d1475f1.tar.xz
Synapse main cleanup
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/synapse-main.nix')
-rwxr-xr-xhost/Rory-nginx/services/matrix/synapse/synapse-main.nix81
1 files changed, 3 insertions, 78 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/synapse-main.nix b/host/Rory-nginx/services/matrix/synapse/synapse-main.nix
index e204620..543e782 100755
--- a/host/Rory-nginx/services/matrix/synapse/synapse-main.nix
+++ b/host/Rory-nginx/services/matrix/synapse/synapse-main.nix
@@ -19,7 +19,7 @@ in
     enable = true;
     withJemalloc = true;
 
-    federationSenders = 8;
+    federationSenders = 32;
     pushers = 2;
     enableStreamWriters = false;
     enableAppserviceWorker = true;
@@ -45,8 +45,6 @@ in
         max_long_retry_delay = "30s";
       };
 
-      # Alicia - figure this out later...
-      #registration_shared_secret = builtins.exec ["cat" "/dev/urandom" "|" "tr" "-dc" "a-zA-Z0-9" "|" "fold" "-w" "256" "|" "head" "-n" "1"];
       registration_shared_secret_path = "/var/lib/matrix-synapse/registration_shared_secret.txt";
       
       listeners = [
@@ -77,21 +75,6 @@ in
       };
       url_preview_enabled = true;
       database = (import ./db.nix { workerName = "main"; dbGroup = "medium"; });
-      #database = {
-      #  name = "psycopg2";
-      #  args = {
-      #    user = "matrix-synapse-rory-gay";
-      #    #passwordFile = "/run/secrets/matrix-synapse-password";
-      #    password = "somepassword";
-      #    database = "matrix-synapse-rory-gay";
-      #    #host = "127.0.0.1";
-      #    host = "/run/postgresql";
-      #    application_name = "matrix-synapse (rory.gay)";
-      #    cp_min = 5;
-      #    cp_max = 10;
-      #    #cp_reconnect_interval = "True";
-      #  };
-      #};
       app_service_config_files = [
         #"/etc/matrix-synapse/appservice-registration.yaml"
         "/var/lib/matrix-synapse/modas-registration.yaml"
@@ -117,15 +100,8 @@ in
         prefer_local_users = true;
       };
 
+      # https://github.com/element-hq/synapse/blob/master/synapse/config/experimental.py
       experimental_features = {
-        # These apparently arent valid...
-        #"org.matrix.msc3026.busy_presence" = true;
-        #"fi.mau.msc2815" = true;
-        #"org.matrix.msc3881" = true;
-        #"org.matrix.msc3874" = true;
-        #"org.matrix.msc3912" = true;
-
-        # These should be, looking at synapse's experimental.py
         "msc2815_enabled" = true; # Redacted event content
         "msc3026_enabled" = true; # Busy presence
         "msc3266_enabled" = true; # Room summary API
@@ -141,63 +117,12 @@ in
 
       instance_map = {
         main = { # replication listener
-          #host = "127.0.0.1";
-          #port = 8009;
           path = "/run/matrix-synapse/replication-listener.sock";
         };
-      } ;
-      ### // builtins.listToAttrs (map (port: {
-      ###   name = "federation_sender-${toString port}";
-      ###   value = {
-      ###     path = "/run/matrix-synapse/federation_sender-${toString port}.sock";
-      ###   };
-      ### }) federationSenders);
-
-      #} // builtins.listToAttrs (map (port: {
-      #  name = "federation_receiver-${toString port}";
-      #  value = {
-      #    path = "/run/matrix-synapse/federation_receiver-${toString port}.sock";
-      #  };
-      #}) federationReceivers);
-
-      # by type:
-      
-      #federation_sender_instances = map (port: "federation_sender-${toString port}") federationSenders;
+      };
     }
     // import ./ratelimits.nix
     // import ./caches.nix;
-
-    ## TODO: INVESTIGATE
-    # worker_listeners:
-    # - type: metrics
-    #   bind_address: ''
-    #   port: 9101
-
-    #workers = 
-    #builtins.listToAttrs (map (port: {
-    #  name = "federation_receiver-${toString port}";
-    #  value = {
-    #    worker_app = "synapse.app.generic_worker";
-    #    worker_listeners = [
-    #      { 
-    #        port = port;
-    #        type = "http";
-    #        resources = [ {
-    #          names = [ "federation" ];
-    #          compress = false;
-    #        } ];
-    #      }
-    #    ];
-    #  };
-    #}) federationReceivers)
-    ### builtins.listToAttrs (map (port: {
-    ###   name = "federation_sender-${toString port}";
-    ###   value = {
-    ###     worker_app = "synapse.app.generic_worker";
-    ###     worker_listeners = [ ];
-    ###     database = (import ./db.nix { workerName = "federation sender ${toString port}"; dbGroup = "small"; });
-    ###   };
-    ### }) federationSenders);
   };
 
   systemd.services.matrix-synapse-reg-token = {