diff --git a/hosts/git/forgejo.nix b/hosts/git/forgejo.nix index 11490d6..7938e52 100644 --- a/hosts/git/forgejo.nix +++ b/hosts/git/forgejo.nix @@ -53,12 +53,13 @@ in SENDMAIL_PATH = "${pkgs.msmtp}/bin/msmtp"; SENDMAIL_ARGS = "--"; }; - cors = { - ENABLED = false; - ALLOW_DOMAIN = "https://git.berlin.ccc.de"; - ALLOW_CREDENTIALS = true; - }; metrics.ENABLED = true; + "cron.archive_cleanup" = { + ENABLED = true; + RUN_AT_START = true; + SCHEDULE = "@every 4h"; + OLDER_THAN = "4h"; + }; }; lfs.enable = true; database = { @@ -98,12 +99,13 @@ in deny all; ''; }; - "= /robots.txt" = { - extraConfig = '' - default_type text/plain; - return 200 "User-agent: *\nDisallow: /*/*/archive/\n"; - ''; - }; + "~ ^/[^/]+/[^/]+/archive/".extraConfig = '' + limit_req zone=forgejo_archive burst=10 nodelay; + ''; + "= /robots.txt".extraConfig = '' + default_type text/plain; + return 200 "User-agent: *\nDisallow: /*/*/archive/\n"; + ''; }; }; };