Skip to content

Commit c105171

Browse files
authored
Merge pull request #24 from williln/add-cloudflare
Add cloudflare bot fight mode, add pre-commit
2 parents 61a003d + f69d276 commit c105171

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: |-
3939
python3 scripts/build_subdir_toc.py aws
4040
python3 scripts/build_subdir_toc.py celery
41+
python3 scripts/build_subdir_toc.py cloudflare
4142
python3 scripts/build_subdir_toc.py django
4243
python3 scripts/build_subdir_toc.py django-rest-framework
4344
python3 scripts/build_subdir_toc.py drf-yasg

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MD013: false

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
args: ['--markdown-linebreak-ext=md']
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-added-large-files
10+
11+
- repo: https://github.com/psf/black
12+
rev: 25.1.0
13+
hooks:
14+
- id: black
15+
language_version: python3
16+
args: ["--skip-string-normalization"]
17+
18+
19+
- repo: https://github.com/igorshubovych/markdownlint-cli
20+
rev: v0.44.0
21+
hooks:
22+
- id: markdownlint
23+
files: \.md$
24+
args: ["--config", ".markdownlint.yaml"]
25+
26+
default_stages: [commit]

cloudflare/bot-fight-mode.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Bot Fight Mode
2+
3+
If your site is getting hammered by bots and triggering a ton of errors, and you use Cloudflare, one of your options is to use [Bot Fight Mode](https://developers.cloudflare.com/learning-paths/get-started-free/security/bot-fight-mode/?utm_source=chatgpt.com).
4+
5+
This will put that "are you a human?" check in front of your sites.
6+
7+
A note: In the "free" tier of Bot Fight Mode, you can't customize it at all. This may have side effects, like your site blocking webhooks you subscribe to from external sites (like Stripe).
8+
9+
The docs on Bot Fight Mode are pretty light; it's basically an on/off switch.
10+
11+
There is also [Super Bot Fight Mode](https://developers.cloudflare.com/bots/get-started/super-bot-fight-mode/), which costs money (it's part of one of their subscription tiers), which is customizable to a degree. At this level, it seems like you can [set rules](https://developers.cloudflare.com/bots/get-started/super-bot-fight-mode/#conditions) to "Skip action" and specify parts of your site where the Super Bot Fight Mode should not run (like, potentially, your webhook endpoints?)
12+
13+
In my experience, turning on Bot Fight Mode does seem to block legitimate webhook traffic. I haven't tried Super Bot Fight Mode, so I'm not sure about the specifics of the rule-setting capabilities.
14+
15+
There is also [Bot Management for Enterprise](https://developers.cloudflare.com/bots/get-started/bot-management/), but I'm not sure what that gets you beyond Super Bot Fight Mode.

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ default:
55
build-internal-readmes:
66
python3 scripts/build_subdir_toc.py aws
77
python3 scripts/build_subdir_toc.py celery
8+
python3 scripts/build_subdir_toc.py cloudflare
89
python3 scripts/build_subdir_toc.py django
910
python3 scripts/build_subdir_toc.py django-rest-framework
1011
python3 scripts/build_subdir_toc.py drf-yasg

0 commit comments

Comments
 (0)