From e5f99f76b67887d4d66ef1f90af1bbdea1072470 Mon Sep 17 00:00:00 2001 From: Pyjacpp Date: Sat, 6 Dec 2025 15:46:17 +0100 Subject: [PATCH 1/2] fix: add /public exception for perso pages --- hosts/vm/reverseproxy/reverseproxy.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/hosts/vm/reverseproxy/reverseproxy.nix b/hosts/vm/reverseproxy/reverseproxy.nix index f2ca654..da6ff77 100644 --- a/hosts/vm/reverseproxy/reverseproxy.nix +++ b/hosts/vm/reverseproxy/reverseproxy.nix @@ -111,6 +111,24 @@ let ]; }; + anubisPerso = formatJSON.generate "anubis_perso.json" { + "bots" = [ + { + name = "allow-public"; + path_regex = "^/public/*"; + action = "ALLOW"; + } + { + import = "${antiBot}"; + } + { + name = "challenge-other"; + path_regex = "^*"; + action = "CHALLENGE"; + } + ]; + }; + anubisMirrors = formatJSON.generate "anubis_mirrors.json" { "bots" = [ { @@ -190,7 +208,7 @@ in ]; }; "wiki" = { - anubisConfig = "${anubisChallenge}"; + anubisConfig = "${anubisPerso}"; target = "[fd00::10:0:ff:fe01:6110]"; # l'ipv4 marche pas serverAliases = [ "wikipedia" From 7b29b8679c4579df3c9dead204d0945a3fc9c694 Mon Sep 17 00:00:00 2001 From: Pyjacpp Date: Sat, 6 Dec 2025 16:25:02 +0100 Subject: [PATCH 2/2] fix regex --- hosts/vm/reverseproxy/reverseproxy.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/vm/reverseproxy/reverseproxy.nix b/hosts/vm/reverseproxy/reverseproxy.nix index da6ff77..2d80b89 100644 --- a/hosts/vm/reverseproxy/reverseproxy.nix +++ b/hosts/vm/reverseproxy/reverseproxy.nix @@ -115,7 +115,7 @@ let "bots" = [ { name = "allow-public"; - path_regex = "^/public/*"; + path_regex = "^/[a-zA-Z0-9_-]*/public/.*"; action = "ALLOW"; } { @@ -201,14 +201,14 @@ in target = "172.16.10.104"; }; "perso" = { - anubisConfig = "${anubisChallenge}"; + anubisConfig = "${anubisPerso}"; target = "172.16.10.31"; serverAliases = [ "clubs" ]; }; "wiki" = { - anubisConfig = "${anubisPerso}"; + anubisConfig = "${anubisChallenge}"; target = "[fd00::10:0:ff:fe01:6110]"; # l'ipv4 marche pas serverAliases = [ "wikipedia"