Anubis module for Caddy
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip

Kot 12b9a00b ffab8119

+14 -6
+1 -1
README.md
··· 4 4 5 5 ``` 6 6 xcaddy build \ 7 - --with gl.kot.pink/kot/caddy-anubis \ 7 + --with github.com/kotx/caddy-anubis \ 8 8 --replace github.com/TecharoHQ/anubis=github.com/kotx/anubis-static@v1.21.0 9 9 # ...any other plugins 10 10 ```
+8
caddy_anubis.go
··· 2 2 3 3 import ( 4 4 "fmt" 5 + "log/slog" 5 6 "net" 6 7 "net/http" 7 8 ··· 47 48 func (m *AnubisMiddleware) Provision(ctx caddy.Context) error { 48 49 m.log = ctx.Logger(m) 49 50 51 + slog.SetLogLoggerLevel(slog.LevelDebug) // TODO: customizable log level 52 + 50 53 m.log.Debug("loading anubis policies", zap.String("policy_file", m.PolicyFname), zap.Int("default_difficulty", m.DefaultDifficulty)) 51 54 policy, err := libanubis.LoadPoliciesOrDefault(ctx, m.PolicyFname, m.DefaultDifficulty) 52 55 if err != nil { ··· 85 88 d.Next() 86 89 87 90 m.DefaultDifficulty = anubis.DefaultDifficulty 91 + m.Options.CookieExpiration = anubis.CookieDefaultExpirationTime 92 + m.Options.CookieSecure = true // TODO: temporary 88 93 89 94 for nesting := d.Nesting(); d.NextBlock(nesting); { 90 95 switch d.Val() { 91 96 case "target": 97 + case "opengraph": 98 + m.Options.OpenGraph.Enabled = true 99 + 92 100 } 93 101 } // anubis options 94 102
+4 -4
example/Caddyfile
··· 1 - eri.elf-bramble.ts.net { 1 + localhost { 2 2 @anubis { 3 - path / 3 + path / # don't let AI scrapers list files! 4 4 path /.within.website/* # required 5 5 } 6 6 7 7 anubis @anubis { 8 - # required for OpenGraph passthrough! 8 + # FIXME: required for OpenGraph passthrough! 9 9 ## TODO: access backend directly somehow? 10 10 ## otherwise anubis may trigger itself 11 - ## additionally, https://github.com/TecharoHQ/anubis/issues/319 11 + ## additionally, https://github.com/TecharoHQ/anubis/issues/329 12 12 # target http://localhost:8080 13 13 } 14 14
+1 -1
go.mod
··· 1 - module gl.kot.pink/kot/caddy-anubis 1 + module gl.kot.pink/kot/caddy-anubis // TODO: change to github 2 2 3 3 go 1.24.2 4 4