Overview
Anubis uses pluggable storage backends to persist client state, challenge tokens, and bot detection metadata. The storage configuration determines which backend to use and its parameters.Store
Storage backend configuration struct.Type Definition
Fields
Storage backend type. Must be a registered store backend.Built-in backends:
"memory"- In-memory storage (default, not persistent)"bbolt"- BoltDB embedded database"valkey"- Valkey/Redis compatible server"s3api"- S3-compatible object storage
Backend-specific configuration as raw JSON. The structure depends on the selected backend.
Validation Rules
Backendmust be non-emptyBackendmust be a registered store implementationParametersmust be valid according to the backend’s validation rules
Errors
Backend-Specific Parameters
Memory Backend
The memory backend requires no parameters. State is stored in-process and lost on restart.BoltDB Backend
Embedded database stored in a local file.path(string, required): Filesystem path to the database filemode(int, optional): File permissions in octal (default: 0600)
Valkey/Redis Backend
Connect to a Valkey or Redis server.address(string, required): Server address (host:port)password(string, optional): Authentication passworddb(int, optional): Database number (default: 0)poolSize(int, optional): Connection pool sizetls(bool, optional): Enable TLS
S3 Backend
Use S3-compatible object storage (AWS S3, MinIO, etc.).bucket(string, required): S3 bucket nameregion(string, required): AWS regionendpoint(string, optional): Custom S3 endpoint (for S3-compatible services)accessKeyId(string, required): AWS access key IDsecretAccessKey(string, required): AWS secret access keysessionToken(string, optional): AWS session token
Default Configuration
When no store is specified, Anubis defaults to in-memory storage:StatusCodes
HTTP status codes returned for different actions.Type Definition
Fields
HTTP status code to return when presenting a challenge. Valid range: 100-599.Common values:
200- OK (default, challenge rendered in response body)403- Forbidden429- Too Many Requests
HTTP status code to return when denying a request. Valid range: 100-599.Common values:
200- OK (default, denial message in response body)403- Forbidden429- Too Many Requests503- Service Unavailable
Validation Rules
- Both
ChallengeandDenymust be set - Both must be in range 100-599
Errors
Example
DnsTTL
DNS cache TTL settings for reverse DNS lookups.Type Definition
Fields
TTL in seconds for forward DNS lookups (hostname to IP). Must be >= 0.
TTL in seconds for reverse DNS lookups (IP to hostname). Must be >= 0.
Example
Logging
Logging configuration for Anubis.Type Definition
Fields
Logging output sink. Valid values:
"stdio", "file".Log level. If set, overrides the level from command-line flags.Valid levels:
slog.LevelDebug(-4)slog.LevelInfo(0)slog.LevelWarn(4)slog.LevelError(8)
File logging configuration. Required when
Sink is "file".Validation Rules
- If
Sinkis"file",Parametersmust be set Parametersmust pass its own validation
Errors
LoggingFileConfig
File-based logging configuration with log rotation.Type Definition
Fields
Path to the log file.
Maximum number of old log files to retain. Must be >= 0.
Maximum size in bytes before rotating the log file (default: 100 MiB).
Maximum number of days to retain old log files. Must be >= 0.
Compress rotated log files using gzip.
Use local time for log file timestamps instead of UTC.
Validation Rules
Filenamemust be setMaxBackupsmust be >= 0MaxAgemust be >= 0
Errors
Example
OpenGraph
OpenGraph metadata configuration for social media previews.Type Definition
Fields
Enable OpenGraph tag caching and customization.
Include the request hostname when caching OpenGraph tags.
Duration to cache OpenGraph tags (e.g.,
"5m", "1h", "24h").Custom OpenGraph tags to inject. Keys are tag names (e.g.,
"og:title").Required tags when using overrides:"og:title"- Page title