ctucx.git: nixfiles

ctucx' nixfiles

commit 31a04779a92b8108d3c712235ab1678fbac0f7d5
parent 9040291dfc3718b12db7a803cdd8531147ff4da7
Author: Leah (ctucx) <git@ctu.cx>
Date: Mon, 7 Aug 2023 13:34:37 +0200

machines/{briefkasten,trabbi}/gotosocial: block `mnemo.social`
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/machines/briefkasten/gotosocial.nix b/machines/briefkasten/gotosocial.nix
@@ -69,6 +69,11 @@ in {
     enableACME = lib.mkIf config.networking.usePBBUplink true;
     forceSSL   = lib.mkIf config.networking.usePBBUplink true;
     kTLS       = lib.mkIf config.networking.usePBBUplink true;
+    extraConfig = ''
+      if ($http_user_agent ~* (mnemo.social)) {
+        return 403;
+      }
+    '';
     locations  = {
       "= /".return = "307 /@leah";
 
diff --git a/machines/trabbi/gotosocial.nix b/machines/trabbi/gotosocial.nix
@@ -76,6 +76,11 @@ in {
     enableACME = true;
     forceSSL   = true;
     kTLS       = true;
+    extraConfig = ''
+      if ($http_user_agent ~* (mnemo.social)) {
+        return 403;
+      }
+    '';
     locations  = {
       "= /".return = "307 /@leah";