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; };
};
};
anubis.instances.gitea.settings =
{
OG_PASSTHROUGH = true;
TARGET = "http://127.0.0.1:3002";
BIND_NETWORK = "tcp";
BIND = "127.0.0.1:3003";
WEBMASTER_EMAIL = "chn@chn.moe";
SERVE_ROBOTS_TXT = true;
METRICS_BIND = "/run/anubis/anubis-gitea/anubis-metrics.sock";
};
# prevent AI web crawlers
# https://her.esy.fun/posts/0031-how-i-protect-my-forgejo-instance-from-ai-web-crawlers/index.html
nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre =
''
if ($http_user_agent ~* "git/|git-lfs/") {
set $bypass_cookie 1;
}
if ($cookie_Yogsototh_opens_the_door = "1") {
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 =
{
@@ -78,7 +83,7 @@ inputs:
};
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 = {};
};
};

Submodule nixpkgs updated: d7f3d87456...d8ca282fc0