From 5d92f09978a2e7b5f40becb5215a28f2407f4bb4 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 22 Nov 2026 11:41:01 +0000 Subject: host: path rules match whole path segments A path rule was a plain string prefix of the request's path, so https://api.github.com/search/issues, meant for that API endpoint (with whatever query), also allowed /search/issuesomethingelse, and the only way around it, /search/issues/, didn't allow the endpoint itself. Now a rule's path allows itself and the paths below it, /search/issues/..., but not /search/issuesx; one ending in "/" still allows whatever starts with it. The query was never part of the match, and still isn't. The requests' checks and POST /check share the code now. --- modules/host/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/host/default.nix') diff --git a/modules/host/default.nix b/modules/host/default.nix index 26120b8..6e20219 100644 --- a/modules/host/default.nix +++ b/modules/host/default.nix @@ -325,7 +325,9 @@ ${lib.concatMapStrings (v: " \"${v.user} ${v.vm}\") vip=${v.ip} vip6=${ echo "VM is a running VM's name (run-firecracker-vm --name) or tap;" echo " -v VM means the list it uses" echo "RULE is https://DOMAIN (with subdomains, not decrypted)" - echo " or https://DOMAIN/PATH-PREFIX (decrypted to check the path)" + echo " or https://DOMAIN/PATH (decrypted to check the path: PATH itself," + echo " and below it, PATH/..., with any query; with PATH ending in /," + echo " whatever starts with it)" echo " or tcp://ADDRESS[/PREFIXLEN]:PORT[-PORT] (likewise udp://...)" echo " or tcp://[ADDRESS6[/PREFIXLEN]]:PORT[-PORT] (IPv6, not port 443)" echo " or tcp://NAME:PORT[-PORT] (resolved by the host)" -- cgit v1.3.1