From d36d8354a2b99f79c8ddd1ee8955ebcd94804e9d Mon Sep 17 00:00:00 2001 From: WeebDataHoarder Date: Sun, 27 Apr 2025 20:53:30 +0200 Subject: [PATCH] examples: clarify rules order, default action and standard-tools rule --- examples/forgejo.yml | 4 ++++ examples/generic.yml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/forgejo.yml b/examples/forgejo.yml index 31f8c1c..5a9dec7 100644 --- a/examples/forgejo.yml +++ b/examples/forgejo.yml @@ -81,6 +81,7 @@ conditions: - 'path.matches("^/[^/]+$") && "tab" in query && query.tab == "activity"' +# Rules are checked sequentially in order, from top to bottom rules: - name: allow-well-known-resources conditions: @@ -293,6 +294,7 @@ rules: conditions: - 'userAgent.startsWith("Lynx/")' + # Comment this rule out to not challenge tool-like user agents - name: standard-tools action: challenge settings: @@ -307,3 +309,5 @@ rules: challenges: [http-cookie-check, preload-link, meta-refresh, resource-load, js-pow-sha256] conditions: - '($is-generic-browser)' + +# If end of rules is reached, default is PASS diff --git a/examples/generic.yml b/examples/generic.yml index c3eca0b..6aa7426 100644 --- a/examples/generic.yml +++ b/examples/generic.yml @@ -38,7 +38,7 @@ conditions: - 'userAgent.matches("^Mozilla/[1-4]")' - +# Rules are checked sequentially in order, from top to bottom rules: - name: allow-well-known-resources conditions: @@ -144,6 +144,7 @@ rules: conditions: - 'userAgent.startsWith("Lynx/")' + # Comment this rule out to not challenge tool-like user agents - name: standard-tools action: challenge settings: @@ -159,3 +160,5 @@ rules: challenges: [preload-link, meta-refresh, resource-load, js-pow-sha256] conditions: - '($is-generic-browser)' + +# If end of rules is reached, default is PASS