From d23748567b0b9dc06cb14da54cd3ba2aa49b3cc5 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Wed, 10 Jul 2024 16:39:00 +0800 Subject: [PATCH] massicot: use conduit native well_known handler --- flake.lock | 6 +++--- machines/dolomite/default.nix | 2 +- machines/massicot/services.nix | 17 ++++++----------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 5b6c4a9..1d9d40d 100644 --- a/flake.lock +++ b/flake.lock @@ -158,11 +158,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1716987116, - "narHash": "sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8=", + "lastModified": 1720515935, + "narHash": "sha256-8b+fzR4W2hI5axwB+4nBwoA15awPKkck4ghhCt8v39M=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "8251761f93d6f5b91cee45ac09edb6e382641009", + "rev": "a111ce6b537df12a39874aa9672caa87f8677eda", "type": "github" }, "original": { diff --git a/machines/dolomite/default.nix b/machines/dolomite/default.nix index a6fcfc5..69ac5cc 100644 --- a/machines/dolomite/default.nix +++ b/machines/dolomite/default.nix @@ -80,7 +80,7 @@ in }; nix.settings = { - trusted-users = config.users.groups.wheel.members ++ [ "root" ]; + trusted-users = [ "root" ]; }; services.sing-box = let diff --git a/machines/massicot/services.nix b/machines/massicot/services.nix index a0efd28..a9889f0 100644 --- a/machines/massicot/services.nix +++ b/machines/massicot/services.nix @@ -85,6 +85,11 @@ in log = "info"; database_backend = "rocksdb"; allow_registration = false; + + well_known = { + client = "https://msg.xinyang.life"; + server = "msg.xinyang.life:443"; + }; }; }; @@ -160,17 +165,7 @@ in virtualHosts."xinyang.life:443".extraConfig = '' tls internal encode zstd gzip - handle_path /.well-known/matrix/client { - header Content-Type "application/json" - header Access-Control-Allow-Origin "*" - header Content-Disposition attachment; filename="client" - respond `{"m.homeserver":{"base_url":"https://msg.xinyang.life/"}, "org.matrix.msc3575.proxy":{"url":"https://msg.xinyang.life/"}}` - } - handle_path /.well-known/matrix/server { - header Content-Type "application/json" - header Access-Control-Allow-Origin "*" - respond `{"m.server": "msg.xinyang.life:443"}` - } + reverse_proxy /.well-known/matrix/* localhost:6167 reverse_proxy * http://localhost:8080 { flush_interval -1 }