From 27f8a8367a0f951f2dc4568e05b5299c2c2f55b1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 15 Feb 2025 20:13:45 +0300 Subject: [PATCH] fix(ops/www): block ClaudeBot/GPTBot/Amazonbot from cgit These bots are doing unthrottled requests to cgit 24/7, and it's starting to annoy me. Change-Id: I6b7d7a68e9becb8ed4b5c52b376c2a60febc6ec6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/13145 Tested-by: BuildkiteCI Reviewed-by: sterni --- ops/modules/www/code.tvl.fyi.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ops/modules/www/code.tvl.fyi.nix b/ops/modules/www/code.tvl.fyi.nix index ee0211990..b1937770f 100644 --- a/ops/modules/www/code.tvl.fyi.nix +++ b/ops/modules/www/code.tvl.fyi.nix @@ -13,6 +13,10 @@ forceSSL = true; extraConfig = '' + if ($http_user_agent ~ (ClaudeBot|GPTBot|Amazonbot)) { + return 403; + } + location = /go-get/tvix/build-go { alias ${pkgs.writeText "go-import-metadata.html" ''''}; }