Anubis module for Caddy

Compare changes

Choose any two refs to compare.

+35 -3
README.md
···
-
# `caddy_anubis`
+
# `caddy-anubis`
You can add caddy-anubis to your server using xcaddy:
```
xcaddy build \
-
--with github.com/kotx/caddy-anubis \
-
--replace github.com/TecharoHQ/anubis=github.com/kotx/anubis-static@v1.21.0
+
--with tangled.sh/kot.pink/caddy-anubis \
+
--replace github.com/TecharoHQ/anubis=github.com/kotx/anubis-static@v1.23.1
# ...any other plugins
```
+
+
## Example config
+
+
```Caddyfile
+
localhost {
+
@anubis {
+
# This matcher allows you to select specific paths for Anubis to handle.
+
# If you want to handle all paths, remove this block and use `anubis {...}` instead!
+
path / # don't let AI scrapers browse the file index
+
path /.within.website/* # required for anubis to work
+
+
not path /api/* # exclude api routes from anubis
+
}
+
+
log http.handlers.anubis {
+
level DEBUG # optionally set log level
+
}
+
+
anubis @anubis {
+
# This setting gets overridden a lot by the default bot policy.
+
difficulty 4
+
+
# Custom bot policy file
+
policy_fname botPolicies.yaml
+
+
private_key {$ED25519_PRIVATE_KEY} # for challenge persistence across restarts
+
# or if you're running multiple anubis instances
+
}
+
+
file_server browse
+
}
+
```
+1
caddy_anubis.go
···
return err
}
r.Header.Set("X-Real-Ip", remoteHost)
+
r.Header.Set("X-Http-Version", r.Proto)
m.next = next
m.err = nil
+1 -1
example/Caddyfile
···
difficulty 4
# Custom bot policy.
-
policy_fname example/botPolicy.yaml
+
policy_fname botPolicy.yaml
private_key "a183a07283e86b669e30e153ad4f0c7a9e2bbc3218fc8fa9d6b858b29e97d22b"
+3 -2
example/Dockerfile
···
FROM caddy:builder AS builder
RUN xcaddy build \
-
--with pkg.kot.pink/caddy-anubis
+
--with tangled.sh/kot.pink/caddy-anubis \
+
--replace github.com/TecharoHQ/anubis=github.com/kotx/anubis-static@v1.23.1
FROM caddy:latest
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile /etc/caddy/Caddyfile
-
COPY botPolicy.json .
+
COPY botPolicy.yaml .
+1 -1
go.mod
···
-
module git.teto.zip/kot/caddy-anubis
+
module tangled.sh/kot.pink/caddy-anubis
go 1.25