diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-03-27 15:24:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-27 15:24:03 -0400 |
| commit | 7d4be0dcecdbe8deca8d055c0e2f10a369dc86e6 (patch) | |
| tree | e5cd61b82bfe97c9cae132d9104763ab3be4d237 /cmd | |
| parent | d1d63d9c1878b4567fec6a1d2bb86364de2b513e (diff) | |
| download | anubis-7d4be0dcecdbe8deca8d055c0e2f10a369dc86e6.tar.xz anubis-7d4be0dcecdbe8deca8d055c0e2f10a369dc86e6.zip | |
Apply bits of the cookie settings PR one by one (#140)
Enables uses to change the cookie domain and partitioned flags.
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/anubis/main.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 551ed61..7f98e7b 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -34,6 +34,8 @@ var ( bind = flag.String("bind", ":8923", "network address to bind HTTP to") bindNetwork = flag.String("bind-network", "tcp", "network family to bind HTTP to, e.g. unix, tcp") challengeDifficulty = flag.Int("difficulty", anubis.DefaultDifficulty, "difficulty of the challenge") + cookieDomain = flag.String("cookie-domain", "", "if set, the top-level domain that the Anubis cookie will be valid for") + cookiePartitioned = flag.Bool("cookie-partitioned", false, "if true, sets the partitioned flag on Anubis cookies, enabling CHIPS support") ed25519PrivateKeyHex = flag.String("ed25519-private-key-hex", "", "private key used to sign JWTs, if not set a random one will be assigned") metricsBind = flag.String("metrics-bind", ":9090", "network address to bind metrics to") metricsBindNetwork = flag.String("metrics-bind-network", "tcp", "network family for the metrics server to bind to") @@ -189,10 +191,12 @@ func main() { } s, err := libanubis.New(libanubis.Options{ - Next: rp, - Policy: policy, - ServeRobotsTXT: *robotsTxt, - PrivateKey: priv, + Next: rp, + Policy: policy, + ServeRobotsTXT: *robotsTxt, + PrivateKey: priv, + CookieDomain: *cookieDomain, + CookiePartitioned: *cookiePartitioned, }) if err != nil { log.Fatalf("can't construct libanubis.Server: %v", err) |
