ctucx.git: nixfiles

ctucx' nixfiles

commit f0c823b8bfa9d0731e1495130bf7fe2cfeff4a0e
parent 49673a80c2866d0d062a36b0be3da3a59c4e62bf
Author: Leah (ctucx) <git@ctu.cx>
Date: Sun, 6 Oct 2024 13:30:44 +0200

machines/trabbi/matrix/synapse: patch config for cinny-version 4.2
1 file changed, 21 insertions(+), 7 deletions(-)
M
machines/trabbi/matrix/synapse.nix
|
28
+++++++++++++++++++++-------
diff --git a/machines/trabbi/matrix/synapse.nix b/machines/trabbi/matrix/synapse.nix
@@ -105,13 +105,27 @@
             "/_matrix/client/unstable/org.matrix.msc3575/".proxyPass = "http://[::1]:8009/_matrix/client/unstable/org.matrix.msc3575/";
 #            "/_synapse".proxyPass = "http://[::1]:8008";
 #            "/admin/".alias = "${pkgs.synapse-admin}/";
-            "/".root             = pkgs.cinny.override {
-              conf = {
-                defaultHomeserver = 0;
-                homeserverList    = [
-                  "matrix.ctu.cx"
-                ];
-                allowCustomHomesevrers = false;
+            "/"                  = {
+              extraConfig        = ''
+                rewrite ^/config.json$ /config.json break;
+                rewrite ^/manifest.json$ /manifest.json break;
+
+                rewrite ^.*/olm.wasm$ /olm.wasm break;
+                rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break;
+
+                rewrite ^/public/(.*)$ /public/$1 break;
+                rewrite ^/assets/(.*)$ /assets/$1 break;
+
+                rewrite ^(.+)$ /index.html break;
+              '';
+              root             = pkgs.cinny.override {
+                conf = {
+                  defaultHomeserver = 0;
+                  homeserverList    = [
+                    "matrix.ctu.cx"
+                  ];
+                  allowCustomHomesevrers = false;
+                };
               };
             };
           };