Overview
Thelib.Options struct contains configuration parameters for initializing an Anubis server instance. These options control middleware behavior, security settings, cookie configuration, and integration with upstream services.
Type Definition
Fields
HTTP handler to call after successful bot protection validation. This is typically your application’s main handler.
Parsed bot policy configuration containing bot rules, thresholds, and challenge settings.
Target URL for reverse proxy mode. When set, Anubis acts as a reverse proxy to this upstream server.
Override the Host header when proxying requests to the target.
SNI (Server Name Indication) value to use when connecting to the target over TLS.
Skip TLS certificate verification when connecting to the target. Only use in development environments.
Enable dynamic cookie domain based on the request hostname.
Domain attribute for authentication cookies. If empty, cookies are scoped to the current domain.
Duration until authentication cookies expire.
Enable partitioned cookies (CHIPS) for improved privacy in third-party contexts.
URL path prefix for all Anubis endpoints. Useful when mounting Anubis under a specific path.
Contact email address displayed to users who are blocked or challenged.
List of allowed domains for redirect validation to prevent open redirect vulnerabilities.
Ed25519 private key for signing JWTs. Auto-generated if both this and HS512Secret are nil.
HMAC-SHA512 secret for signing JWTs. Used instead of ED25519PrivateKey when set.
Remove the BasePrefix from requests before proxying to the target.
OpenGraph tag configuration for customizing social media previews.
Serve a robots.txt file at
/robots.txt and /.well-known/robots.txt.Set the Secure flag on authentication cookies, requiring HTTPS.
SameSite attribute for authentication cookies. Valid values:
http.SameSiteDefaultMode, http.SameSiteLaxMode, http.SameSiteStrictMode, http.SameSiteNoneMode.Structured logger instance. If nil, a default logger is created with subsystem=“anubis”.
Logging level. Valid values:
debug, info, warn, error.Public-facing URL of the Anubis service. Used for generating absolute URLs in responses.
HTTP header name to check for JWT-based restrictions. When set, enables header-based authentication.
Include challenge difficulty in JWT claims for verification.
Related Types
- config.OpenGraph - OpenGraph configuration
- policy.ParsedConfig - Parsed policy configuration