From d665036d98c77f600ec0b9aa0a04bec5b984d7fa Mon Sep 17 00:00:00 2001 From: WeebDataHoarder Date: Fri, 25 Apr 2025 17:59:16 +0200 Subject: [PATCH] examples: move desired-crawlers before undesired-networks --- examples/forgejo.yml | 20 ++++++++++---------- examples/generic.yml | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/forgejo.yml b/examples/forgejo.yml index 7fb7bed..31f8c1c 100644 --- a/examples/forgejo.yml +++ b/examples/forgejo.yml @@ -92,6 +92,16 @@ rules: - '($is-static-asset)' action: pass + - name: desired-crawlers + conditions: + - *is-bot-googlebot + - *is-bot-bingbot + - *is-bot-duckduckbot + - *is-bot-kagibot + - *is-bot-qwantbot + - *is-bot-yandexbot + action: pass + - name: undesired-networks conditions: - 'remoteAddress.network("huawei-cloud") || remoteAddress.network("alibaba-cloud") || remoteAddress.network("zenlayer-inc")' @@ -221,16 +231,6 @@ rules: - '(path.matches("^/[^/]+/[^/]+/?$") || path.matches("^/[^/]+/[^/]+/badges/") || path.matches("^/[^/]+/[^/]+/(issues|pulls)/[0-9]+$") || (path.matches("^/[^/]+/?$") && size(query) == 0)) && !path.matches("(?i)^/(api|metrics|v2|assets|attachments|avatar|avatars|repo-avatars|captcha|login|org|repo|user|admin|devtest|explore|issues|pulls|milestones|notifications|ghost)(/|$)")' action: pass - - name: desired-crawlers - conditions: - - *is-bot-googlebot - - *is-bot-bingbot - - *is-bot-duckduckbot - - *is-bot-kagibot - - *is-bot-qwantbot - - *is-bot-yandexbot - action: pass - # check a sequence of challenges - name: heavy-operations conditions: ['($is-heavy-resource)'] diff --git a/examples/generic.yml b/examples/generic.yml index b4ee00b..c3eca0b 100644 --- a/examples/generic.yml +++ b/examples/generic.yml @@ -50,6 +50,16 @@ rules: - '($is-static-asset)' action: pass + - name: desired-crawlers + conditions: + - *is-bot-googlebot + - *is-bot-bingbot + - *is-bot-duckduckbot + - *is-bot-kagibot + - *is-bot-qwantbot + - *is-bot-yandexbot + action: pass + - name: undesired-crawlers conditions: - '($is-headless-chromium)' @@ -98,16 +108,6 @@ rules: settings: challenges: [header-refresh] - - name: desired-crawlers - conditions: - - *is-bot-googlebot - - *is-bot-bingbot - - *is-bot-duckduckbot - - *is-bot-kagibot - - *is-bot-qwantbot - - *is-bot-yandexbot - action: pass - - name: homesite conditions: - 'path == "/"'