From f566c923d860fb3612c99bf1915c9868e67e2109 Mon Sep 17 00:00:00 2001
From: sinanmohd <sinan@sinanmohd.com>
Date: Thu, 6 Mar 2025 20:29:05 +0530
Subject: kay/www: move sliding sync to sliding.sinanmohd.com

---
 os/kay/modules/dns/sinanmohd.com.zone |  3 ++-
 os/kay/modules/www.nix                | 15 +++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

(limited to 'os/kay')

diff --git a/os/kay/modules/dns/sinanmohd.com.zone b/os/kay/modules/dns/sinanmohd.com.zone
index c92dbdd..1b16ac5 100644
--- a/os/kay/modules/dns/sinanmohd.com.zone
+++ b/os/kay/modules/dns/sinanmohd.com.zone
@@ -2,7 +2,7 @@ $ORIGIN sinanmohd.com.
 $TTL 2d
 
 @	IN	SOA	ns1	hostmaster (
-			2025030608 ; serial
+			2025030616 ; serial
 			2h         ; refresh
 			5m         ; retry
 			1d         ; expire
@@ -43,6 +43,7 @@ static	IN	CNAME	@
 home	IN	CNAME	@
 nixbin	IN	CNAME	@
 immich	IN	CNAME	@
+sliding	IN	CNAME	@
 
 lia	IN	A	65.0.3.127
 
diff --git a/os/kay/modules/www.nix b/os/kay/modules/www.nix
index aa989ba..e73b129 100644
--- a/os/kay/modules/www.nix
+++ b/os/kay/modules/www.nix
@@ -57,7 +57,7 @@ in
           "/.well-known/matrix/client".return = ''
             200 '${builtins.toJSON {
                 "m.homeserver".base_url = "https://${domain}";
-                "org.matrix.msc3575.proxy".url = "https://${domain}";
+                "org.matrix.msc3575.proxy".url = "https://sliding.${domain}";
                 "m.identity_server".base_url = "https://vector.im";
             }}'
           '';
@@ -65,8 +65,19 @@ in
           "~ ^(\\/_matrix|\\/_synapse\\/client)".proxyPass = "http://127.0.0.1:${toString
             config.services.dendrite.httpPort
           }";
+        };
+      };
+
+      "sliding.${domain}" = defaultOpts // {
+        extraConfig = ''
+          proxy_buffering off;
+          proxy_request_buffering off;
+          client_max_body_size 0;
+        '';
 
-          "/_matrix/client/unstable/org.matrix.msc3575/sync".proxyPass =
+        locations."/" = {
+          proxyWebsockets = true;
+          proxyPass =
             "http://${config.services.matrix-sliding-sync-dirty.settings.SYNCV3_BINDADDR}";
         };
       };
-- 
cgit v1.2.3