block certain paths unauthed

This commit is contained in:
Henry Hiles 2026-08-18 17:24:44 -04:00
commit e10bdbca0b
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -48,15 +48,16 @@
};
};
# We may want to include regular commits, e.g. https://git.federated.nexus/Henry-Hiles/nixos/commit/21373eed250ba70ff195258d3b5a4fe039f72779, but currently this doesn't seem needed
caddy.virtualHosts."${domain}".extraConfig = ''
respond /robots.txt <<EOF
User-agent: *
Disallow: /*/*/*/commit
Disallow: /*/*/*/commit*
EOF 200
@commitAnonymous {
path /*/*/src/commit*
not header_regexp Cookie "(^|;\s*)session=[^;]+(?:;|$)"
path_regexp commit ^/[^/]+/[^/]+/[^/]+/commit(?:/.*)?$
not header_regexp Cookie "(^|;[[:space:]]*)session=[^;]+(;|$)"
}
redir @commitAnonymous /user/login?redirect_to={uri} 302