refactor: fork

reverted from vale981/anubis back to TecharoHQ/anubis. removed unused files. bumped go dependencies. removed Caddyfile, LICENSE, and index.html
This commit is contained in:
z0x 2025-05-08 23:04:58 -04:00
parent 3b703a3fe3
commit 1ec36a9289
7 changed files with 21 additions and 75 deletions

View file

@ -2,35 +2,32 @@
caddy-anubis is a plugin that loads anubis for requests in order to slow down AI and Scraper traffic from destroying infrastucture.
I consider this current implementation more of a Proof-of-Concept. I am not sure how stable or well it works. This is my first Caddy plugin. I do not currently recommend it for production usage.
If you have experience with Caddy plugins, or see obvious issues in my code, feel free to open PRs or reach out to me.
I do not currently recommend it for production usage as the current implementation is more of a Proof-of-Concept then anything and due to it being pinned to anubis v1.15.2 as the main.mjs was no longer served on later versions
## Known Issues
- One major issue is the very first request after a Caddy start or restart, takes like 5 seconds till anubis kicks in. All subsequent requests, even after clearing cookies, are near instant.
- The very first request after a Caddy start or restart takes about 5 seconds before anubis kicks in. All subsequent requests, even after clearing cookies work perfectly and are near instant.
## Current usage
## Usage
Just add an `anubis` to your caddyfile in the block you want the protection. currently I have not seen it work properly inside a `route` or `handler` block. But it works outside of those.
AFIK doesn't work inside a `route` or `handler` block.
There is an optional `target` field you can set if you want to force the redirect elsewhere. It does a 302 redirect.
Example (also check the caddyfile in this repo, it is used for testing):
Example:
```caddy
:80 {
#order anubis after encode
#order redir after anubis
localhost {
request_header +X-Real-IP {remote_host}
request_header +X-Forwarded-For {remote_host}
anubis
# or
anubis {
target https://qwant.com
}
reverse_proxy 127.0.0.1:3000
}
```
## Credits
- [anubis](github.com/TecharoHQ/anubis) - the project that started all of this.
- [TecharoHQ/anubis](https://github.com/TecharoHQ/anubis)
- [daegalus/caddy-anubis](https://github.com/daegalus/caddy-anubis)
- [vale981/caddy-anubis](https://github.com/vale981/caddy-anubis)