Norwin
7c949d257a
context: https://vivaldi.com/blog/user-agent-changes/ |
1 year ago | |
---|---|---|
.gitignore | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
go.mod | 3 years ago | |
go.sum | 3 years ago | |
handler.go | 3 years ago | |
ips_dynamic.go | 3 years ago | |
ips_static.go | 3 years ago | |
matcher.go | 1 year ago |
README.md
...after the great success of hits like 'don't be evil', 'making the world a better place', and 'the market regulates itself', presenting:
caddy-google-is-broken
Caddy plugin to fuck google over in most ways available to an average ops person.
To that end it provides a request handler fuck-google
, as well as a request matcher google
when more customization is needed.
Yes, it's somewhat ironic I wrote this as a plugin for Caddy, software that was an early adopter of google's
extend-extinguish-protocols like http2. So is life; ironic.
building caddy with this plugin
- set up a tiny go project and import this plugin (follow steps described here), or..
- use
xcaddy
:xcaddy build --with git.nroo.de/norwin/caddy-google-is-broken
handler
The handler automatically applies a couple measures (some of which may deem familiar) to traffic from google servers and/or clients using google's products. There are several degrees of fuckuppery, default is maximum fuckup (just as is googles default).
fuck google... | a teeny tiny bit |
fuck them |
for real |
all the way |
---|---|---|---|---|
451 all reqs from google IPs | n | n | y | y |
451 all reqs from GoogleBot | n | y | y | y |
beg for no FLoC | y | y | y | why even try |
delay reqs of chrome users by | 50ms | 150ms | 700ms | 1400ms |
delay reqs of blink users by | - | - | - | 1400ms |
delay reqs of google search users by | - | 150ms | 700ms | 1400ms |
delay reqs of google service users by | - | - | - | 1400ms |
your idea..? | ? | ? | ? | ? |
usage
- Caddyfile:
Instead of wrapping things in aexample.com { route { fuck-google for real file_server # ..or other handlers serving your content. } }
route
block, you can also specify an order block at the top of your Caddyfile:{ order fuck-google before basicauth }
- JSON:
..., "handle": [{ "handler": "fuck_google", "level": "a teeny tiny bit" }, ...]
matcher
The matcher can be used like any other matcher in Caddy. It doesn't do anything that couldn't be done with Caddy's builtin matchers, but provides much more convenience.
usage
By default all matching options are disabled. Multiple options apply an OR
set.
- Caddyfile
example:google [googlebot] [ip-ranges] [ua-chrome] [ua-chromeish] [referer-google] [referer-other] google { [googlebot] [ip-ranges] [ua-chrome] [ua-chromeish] [referer-google] [referer-other] }
@goog { method GET google ua-chrome referer-google } route @goog { file_server }
- JSON:
{ "handle": ..., "match": [{ "google": { "googlebot": true "ip_ranges": true "useragent_chrome": true "useragent_chromeish": true "referer_google": true "referer_other": true } }] }
For the ip-ranges match method, by default a static list of CIDR netblocks are shipped with the plugin.
If you want to future proof yourself at the cost of caddy startup time (~100ms), build caddy with GOFLAGS=-tags=dyngoogips
.
license
Unlicense