modules.services.gitea: remove anubis, use simple js

This commit is contained in:
2026-01-06 09:46:37 +08:00
parent 4adc1be9a2
commit c480e681c1
2 changed files with 17 additions and 12 deletions

View File

@@ -57,16 +57,21 @@ inputs:
"cron.gc_lfs" = { ENABLED = true; SCHEDULE = "@monthly"; NUMBER_TO_CHECK_PER_REPO = 0; }; "cron.gc_lfs" = { ENABLED = true; SCHEDULE = "@monthly"; NUMBER_TO_CHECK_PER_REPO = 0; };
}; };
}; };
anubis.instances.gitea.settings = # prevent AI web crawlers
{ # https://her.esy.fun/posts/0031-how-i-protect-my-forgejo-instance-from-ai-web-crawlers/index.html
OG_PASSTHROUGH = true; nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre =
TARGET = "http://127.0.0.1:3002"; ''
BIND_NETWORK = "tcp"; if ($http_user_agent ~* "git/|git-lfs/") {
BIND = "127.0.0.1:3003"; set $bypass_cookie 1;
WEBMASTER_EMAIL = "chn@chn.moe"; }
SERVE_ROBOTS_TXT = true; if ($cookie_Yogsototh_opens_the_door = "1") {
METRICS_BIND = "/run/anubis/anubis-gitea/anubis-metrics.sock"; set $bypass_cookie 1;
}; }
if ($bypass_cookie != 1) {
add_header Content-Type text/html always;
return 418 '<script>document.cookie = "Yogsototh_opens_the_door=1; Path=/;"; window.location.reload();</script>';
}
'';
}; };
nixos = nixos =
{ {
@@ -78,7 +83,7 @@ inputs:
}; };
services = services =
{ {
nginx.https.${gitea.hostname}.location."/".proxy.upstream = "http://127.0.0.1:3003"; nginx.https.${gitea.hostname}.location."/".proxy.upstream = "http://127.0.0.1:3002";
postgresql.instances.gitea = {}; postgresql.instances.gitea = {};
}; };
}; };

Submodule nixpkgs updated: d7f3d87456...d8ca282fc0