Find a file
Yulian Kuncheff 6156d3d729
Refactor and split out things into cmd and lib (#77)
* Refactor anubis to split business logic into a lib, and cmd to just be direct usage.

* Post-rebase fixes.

* Update changelog, remove unnecessary one.

* lib: refactor this

This is mostly based on my personal preferences for how Go code should
be laid out. I'm not sold on the package name "lib" (I'd call it anubis
but that would stutter), but people are probably gonna import it as
libanubis so it's likely fine.

Packages have been "flattened" to centralize implementation with area of
concern. This goes against the Java-esque style that many people like,
but I think this helps make things simple.

Most notably: the dnsbl client (which is a hack) is an internal package
until it's made more generic. Then it can be made external.

I also fixed the logic such that `go generate` works and rebased on
main.

* internal/test: run tests iff npx exists and DONT_USE_NETWORK is not set

Signed-off-by: Xe Iaso <me@xeiaso.net>

* internal/test: install deps

Signed-off-by: Xe Iaso <me@xeiaso.net>

* .github/workflows: verbose go tests?

Signed-off-by: Xe Iaso <me@xeiaso.net>

* internal/test: sleep 2

Signed-off-by: Xe Iaso <me@xeiaso.net>

* internal/test: nix this test so CI works

Signed-off-by: Xe Iaso <me@xeiaso.net>

* internal/test: warmup per browser?

Signed-off-by: Xe Iaso <me@xeiaso.net>

* internal/test: disable for now :(

Signed-off-by: Xe Iaso <me@xeiaso.net>

* lib/anubis: do not apply bot rules if address check fails

Closes #83

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-03-22 18:44:49 -04:00
.github Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
cmd Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
data Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
decaymap Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
docs Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
internal Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
lib Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
run initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
var initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
web Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
xess Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
.gitignore initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
.ko.yaml Try using ko to build images 2025-03-19 09:10:29 -04:00
anubis.go Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
Brewfile Try using ko to build images 2025-03-19 09:10:29 -04:00
Dockerfile Explicitely define image sources in Dockerfile (#21) 2025-03-20 17:28:30 -04:00
go.mod internal/test: introduce integration tests using Playwright (#81) 2025-03-22 16:36:27 -04:00
go.sum internal/test: introduce integration tests using Playwright (#81) 2025-03-22 16:36:27 -04:00
LICENSE initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
main Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
PULL_REQUEST_TEMPLATE.md pull request template 2025-03-20 16:01:44 -04:00
README.md add star history chart to README 2025-03-21 08:59:44 -04:00
VERSION cmd/anubis: delete example RSS reader rule (#67) 2025-03-21 17:20:17 -04:00
yeetfile.js initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00

Anubis

A smiling chibi dark-skinned anthro jackal with brown hair and tall ears looking victorious with a thumbs-up

enbyware GitHub Issues or Pull Requests by label GitHub go.mod Go version language count repo size

Anubis weighs the soul of your connection using a sha256 proof-of-work challenge in order to protect upstream resources from scraper bots.

Installing and using this will likely result in your website not being indexed by some search engines. This is considered a feature of Anubis, not a bug.

This is a bit of a nuclear response, but AI scraper bots scraping so aggressively have forced my hand. I hate that I have to do this, but this is what we get for the modern Internet because bots don't conform to standards like robots.txt, even when they claim to.

In most cases, you should not need this and can probably get by using Cloudflare to protect a given origin. However, for circumstances where you can't or won't use Cloudflare, Anubis is there for you.

If you want to try this out, connect to anubis.techaro.lol.

Support

If you run into any issues running Anubis, please open an issue and tag it with the Anubis tag. Please include all the information I would need to diagnose your issue.

For live chat, please join the Patreon and ask in the Patron discord in the channel #anubis.

Star History

Star History Chart