Skip to content
/ cerberus Public

A Caddy module that blocks unwanted requests using a sha256 PoW challenge

License

Notifications You must be signed in to change notification settings

sjtug/cerberus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5c73261 · Mar 27, 2025

History

11 Commits
Mar 27, 2025
Mar 22, 2025
Mar 22, 2025
Mar 22, 2025
Mar 22, 2025
Mar 22, 2025
Mar 22, 2025
Mar 27, 2025
Mar 22, 2025
Mar 22, 2025
Mar 27, 2025
Mar 27, 2025
Mar 27, 2025
Mar 22, 2025
Mar 27, 2025
Mar 22, 2025
Mar 27, 2025
Mar 27, 2025
Mar 27, 2025
Mar 27, 2025
Mar 27, 2025
Mar 22, 2025
Mar 22, 2025

Repository files navigation

Cerberus

Caddy plugin version of Anubis.

This plugin provides a Caddy handler that blocks unwanted requests using a sha256 PoW challenge. It's not a full replacement for Anubis, but most of the features are there.

Usage

  1. Install Caddy with the plugin:
    caddy add-package github.com/sjtug/cerberus
  2. Add the handler directive to your Caddyfile. Refer to the Caddyfile for an example configuration.

Comparison with Anubis

  • Anubis is a standalone server that can be used with any web server, while Cerberus is a Caddy plugin.
  • No support for custom rules: use caddy matchers instead.
  • No custom UI or anime girls.
  • Scripts and parameters are inlined in HTML.
  • No separate endpoint for challenge response: any query with ?cerberus will be treated as a challenge response.

Configuration

Check Caddyfile for an example configuration.

WARNING: Each cerberus directive will create a new instance of the handler. This means that if you have multiple cerberus directives, each one will have its own internal state and consume memory. Please use the cerberus directive only once per site.

Development

If you modified the js file, you need to run the following command to rebundle the js file:

$ devenv tasks js:bundle

Also, you need to run the following command to recompile the template if modified:

$ devenv tasks go:codegen

Please run tests and lints before submitting a PR:

$ direnv test # or go test
$ golangci-lint run