Skip to main content

Configuration Reference

Environment variables for configuring Hook0.

Source of Truth

The authoritative reference for all configuration options is running the executable with --help:

hook0-api --help
hook0-output-worker --help

This documentation may not cover all options or reflect recent changes.

API

Web Server

VariableDescriptionDefaultRequired
CORS_ALLOWED_ORIGINSComma-separated allowed origins for CORS-
ENABLE_HSTS_HEADERIf true, the HSTS header will be enabledfalse
ENABLE_SECURITY_HEADERSIf true, the secured HTTP headers will be enabledtrue
IPIP address on which to start the HTTP server127.0.0.1
PORTPort on which to start the HTTP server8080

Reverse Proxy

VariableDescriptionDefaultRequired
BEHIND_CLOUDFLARESet to true if your instance is served behind Cloudflare's proxies in order to determine the correct user IP for each requestfalse
CC_REVERSE_PROXY_IPSA comma-separated list of trusted IP addresses (e.g. 192.168.1.1) or CIDRs (e.g. 192.168.0.0/16) that are allowed to set "X-Forwarded-For" and "Forwarded" headers-
REVERSE_PROXY_IPSA comma-separated list of trusted IP addresses (e.g. 192.168.1.1) or CIDRs (e.g. 192.168.0.0/16) that are allowed to set "X-Forwarded-For" and "Forwarded" headers-

Database

VariableDescriptionDefaultRequired
DATABASE_URL 🔒Database URL (with credentials)-
DB_STATEMENT_TIMEOUTStatement timeout for database queries; if 0ms (default), no timeout will be set; this is only for API-related queries, housekeeping tasks run without timeout0ms
MAX_DB_CONNECTIONSMaximum number of connections to database5
NO_AUTO_DB_MIGRATIONDisable automatic database migration-

Auth

VariableDescriptionDefaultRequired
BISCUIT_PRIVATE_KEYBiscuit's private key, used for authentication-
DEBUG_AUTHORIZERIf true, a trace log message containing authorizer context is emitted on each request; defaut is false because this feature implies a small overheadfalse
DISABLE_REGISTRATIONSet to true to disable registration endpoint-
MASTER_API_KEY 🔒A global admin API key that have almost all rights. Better left undefined, USE AT YOUR OWN RISKS!-
MAX_AUTHORIZATION_TIME_IN_MSMaximum duration (in millisecond) that can be spent running Biscuit's authorizer10
PASSWORD_MINIMUM_LENGTHMinimum length of user passwords. This is checked when a user registers12

Email

VariableDescriptionDefaultRequired
EMAIL_SENDER_ADDRESSSender email address-
EMAIL_SENDER_NAMESender nameHook0
SMTP_CONNECTION_URL 🔒Connection URL to SMTP server; for example: smtp://localhost:1025, smtps://user:password@provider.com:465 (SMTP over TLS) or smtp://user:password@provider.com:465?tls=required (SMTP with STARTTLS)-
SMTP_TIMEOUT_IN_SDuration (in second) to use as timeout when sending emails to the SMTP server5

Frontend

VariableDescriptionDefaultRequired
APP_URLFrontend application URL (used for building links in emails and pagination)-
CLOUDFLARE_TURNSTILE_SECRET_KEYCloudflare Turnstile secret key (enables Turnstile for user registration)-
CLOUDFLARE_TURNSTILE_SITE_KEYCloudflare Turnstile site key (enables Turnstile for user registration)-
DISABLE_SERVING_WEBAPPSet to true to disable serving the web app and only serve the API-
EMAIL_LOGO_URLURL of the Hook0 logohttps://app.hook0.com/256x256.png
FORMBRICKS_API_HOSTFormbricks API hosthttps://app.formbricks.com
FORMBRICKS_ENVIRONMENT_IDFormbricks API environment ID-
MATOMO_SITE_IDMatomo site ID-
MATOMO_URLMatomo URL-
SUPPORT_EMAIL_ADDRESSSupport email addresssupport@hook0.com
WEBAPP_PATHPath to the directory containing the web app to serve../frontend/dist/
WEBSITE_URLWebsite URLhttps://hook0.com

Rate Limiting

VariableDescriptionDefaultRequired
API_RATE_LIMITING_GLOBAL_BURST_SIZEGlobal quota of API calls before rate limiting blocks incomming requests (must be ≥ 1)2000
API_RATE_LIMITING_GLOBAL_REPLENISH_PERIOD_IN_MSDuration (in millisecond) after which one global API call is restored in the quota (must be ≥ 1)1
API_RATE_LIMITING_HOUSEKEEPING_PERIODDuration to wait beetween rate limiters housekeeping5m
API_RATE_LIMITING_IP_BURST_SIZEQuota of API calls per IP before rate limiting blocks incomming requests (must be ≥ 1)200
API_RATE_LIMITING_IP_REPLENISH_PERIOD_IN_MSDuration (in millisecond) after which one API call per IP is restored in the quota (must be ≥ 1)10
API_RATE_LIMITING_TOKEN_BURST_SIZEQuota of API calls per token before rate limiting blocks incomming requests (must be ≥ 1)20
API_RATE_LIMITING_TOKEN_REPLENISH_PERIOD_IN_MSDuration (in millisecond) after which one API call per token is restored in the quota (must be ≥ 1)100
DISABLE_API_RATE_LIMITINGSet to true to disable every API rate limiting-
DISABLE_API_RATE_LIMITING_GLOBALSet to true to disable global API rate limiting-
DISABLE_API_RATE_LIMITING_IPSet to true to disable per-IP API rate limiting-
DISABLE_API_RATE_LIMITING_TOKENSet to true to disable per-token API rate limiting-

Quotas

VariableDescriptionDefaultRequired
ENABLE_QUOTA_BASED_EMAIL_NOTIFICATIONSSet to true to enable quota-based email notificationsfalse
ENABLE_QUOTA_ENFORCEMENTSet to true to apply quotas limits (default is not to)-
QUOTA_GLOBAL_APPLICATIONS_PER_ORGANIZATION_LIMITDefault limit of applications per organization (can be overriden by a plan)1
QUOTA_GLOBAL_DAYS_OF_EVENTS_RETENTION_LIMITDefault limit of day of event's retention (can be overriden by a plan)7
QUOTA_GLOBAL_EVENT_TYPES_PER_APPLICATION_LIMITDefault limit of event types per application (can be overriden by a plan)10
QUOTA_GLOBAL_EVENTS_PER_DAY_LIMITDefault limit of events per day (can be overriden by a plan)100
QUOTA_GLOBAL_MEMBERS_PER_ORGANIZATION_LIMITDefault limit of members per organization (can be overriden by a plan)1
QUOTA_GLOBAL_SUBSCRIPTIONS_PER_APPLICATION_LIMITDefault limit of subscriptions per application (can be overriden by a plan)10
QUOTA_NOTIFICATION_EVENTS_PER_DAY_THRESHOLDDefault threshold (in %) of events per day at which to send a warning notification80

Housekeeping

VariableDescriptionDefaultRequired
ENABLE_SOFT_DELETED_APPLICATIONS_CLEANUPIf true, soft-deleted applications will be removed from database after a while; otherwise they will be kept in database foreverfalse
ENABLE_UNVERIFIED_USERS_CLEANUPIf true, unverified users will be remove from database after a whilefalse
EXPIRED_TOKENS_CLEANUP_GRACE_PERIODDuration to wait before actually deleting expired tokens (expired tokens cannot be used anyway, even if kept for some time)7d
EXPIRED_TOKENS_CLEANUP_PERIODDuration to wait between expired tokens cleanups1h
EXPIRED_TOKENS_CLEANUP_REPORT_AND_DELETEIf true, expired tokens will be reported and cleaned up; if false (default), they will only be reportedfalse
MATERIALIZED_VIEWS_REFRESH_PERIOD_IN_SDuration (in second) to wait between materialized views refreshes60
OBJECT_STORAGE_CLEANUP_PERIODDuration to wait between object storage cleanups1d
OBJECT_STORAGE_CLEANUP_REPORT_AND_DELETEIf true, allow to delete outdated objects from object storage; if false (default), they will only be reportedfalse
OLD_EVENTS_CLEANUP_GRACE_PERIOD_IN_DAYDuration (in day) to wait before actually deleting events that are passed retention period30
OLD_EVENTS_CLEANUP_PERIOD_IN_SDuration (in second) to wait between old events cleanups3600
OLD_EVENTS_CLEANUP_REPORT_AND_DELETEIf true, old events will be reported and cleaned up; if false (default), they will only be reportedfalse
SOFT_DELETED_APPLICATIONS_CLEANUP_GRACE_PERIODDuration to wait before removing a soft-deleted application30d
SOFT_DELETED_APPLICATIONS_CLEANUP_PERIODDuration to wait between soft-deleted applications cleanups1d
UNVERIFIED_USERS_CLEANUP_GRACE_PERIOD_IN_DAYSDuration (in day) to wait before removing a unverified user7
UNVERIFIED_USERS_CLEANUP_PERIOD_IN_SDuration (in second) to wait between unverified users cleanups3600
UNVERIFIED_USERS_CLEANUP_REPORT_AND_DELETEIf true, unverified users will be reported and cleaned up; if false (default), they will only be reportedfalse

Monitoring

VariableDescriptionDefaultRequired
HEALTH_CHECK_KEY 🔒Key for the health check endpoint; if not specified, endpoint is disabled; if empty, endpoint is public-
HEALTH_CHECK_TIMEOUTMax timeout duration for health check: if subsystems take longer to respond they will be considered unhealthy5s
OTLP_AUTHORIZATION 🔒Optional value for OTLP Authorization header (for example: Bearer mytoken)-
OTLP_METRICS_ENDPOINTOptional OTLP endpoint that will receive metrics-
OTLP_TRACES_ENDPOINTOptional OTLP endpoint that will receive traces-
SENTRY_DSNOptional Sentry DSN for error reporting-
SENTRY_TRACES_SAMPLE_RATEOptional sample rate for tracing transactions with Sentry (between 0.0 and 1.0)-

Hook0 Client

VariableDescriptionDefaultRequired
HOOK0_CLIENT_API_URLBase API URL of a Hook0 instance that will receive events from this Hook0 instance-
HOOK0_CLIENT_APPLICATION_IDUUID of a Hook0 application that will receive events from this Hook0 instance-
HOOK0_CLIENT_TOKENAuthentifcation token valid for a Hook0 application that will receive events from this Hook0 instance-
HOOK0_CLIENT_UPSERTS_RETRIESNumber of allowed retries when upserting event types to the linked Hook0 application fails10

Object Storage

VariableDescriptionDefaultRequired
OBJECT_STORAGE_BUCKET_NAMEBucket name of the S3-like object storage-
OBJECT_STORAGE_FORCE_HTTP_SCHEMEForce endpoint scheme to be HTTP (by default it is HTTPS)false
OBJECT_STORAGE_HOSTHost of the S3-like object storage (without https://)-
OBJECT_STORAGE_KEY_IDKey ID of the S3-like object storage-
OBJECT_STORAGE_KEY_SECRET 🔒Key secret of the S3-like object storage-
OBJECT_STORAGE_MAX_ATTEMPTSMaximum number of attempts for object storage operations3
STORE_EVENT_PAYLOADS_IN_OBJECT_STORAGEIf true, new event payloads will be stored in object storage instead of databasefalse
STORE_EVENT_PAYLOADS_IN_OBJECT_STORAGE_ONLY_FORA comma-separated list of applications ID whose event payloads should be stored in object storage; if empty (default), all event payloads will be stored in object storage regardless of application ID-

Pulsar

VariableDescriptionDefaultRequired
PULSAR_BINARY_URLPulsar binary URL-
PULSAR_NAMESPACEPulsar namespace-
PULSAR_TENANTPulsar tenant-
PULSAR_TOKEN 🔒Pulsar token-

Deprecated

VariableDescriptionDefaultRequired
ENABLE_APPLICATION_SECRET_COMPATIBILITYEnable application secret compatibility modetrue

Output Worker

The output-worker is a separate binary with its own configuration. Run hook0-output-worker --help for the authoritative reference.

VariableDescriptionDefaultRequired
SENTRY_DSNOptional Sentry DSN for error reporting-
OTLP_METRICS_ENDPOINTOptional OTLP endpoint that will receive metrics-
OTLP_TRACES_ENDPOINTOptional OTLP endpoint that will receive traces-
OTLP_AUTHORIZATION 🔒Optional value for OTLP Authorization header (for example: Bearer mytoken)-
DATABASE_URL 🔒Database URL (with credentials)-
MAX_DB_CONNECTIONSMaximum number of connections to database (for a worker with pg queue type, it should be equal to CONCURRENT)5
PULSAR_BINARY_URLPulsar binary URL-
PULSAR_TOKEN 🔒Pulsar token-
PULSAR_TENANTPulsar tenant-
PULSAR_NAMESPACEPulsar namespace-
OBJECT_STORAGE_HOSTHost of the S3-like object storage (without https://)-
OBJECT_STORAGE_FORCE_HTTP_SCHEMEForce endpoint scheme to be HTTP (by default it is HTTPS)false
OBJECT_STORAGE_KEY_IDKey ID of the S3-like object storage-
OBJECT_STORAGE_KEY_SECRET 🔒Key secret of the S3-like object storage-
OBJECT_STORAGE_MAX_ATTEMPTSMaximum number of attempts for object storage operations3
OBJECT_STORAGE_BUCKET_NAMEBucket name of the S3-like object storage-
STORE_RESPONSE_BODY_AND_HEADERS_IN_OBJECT_STORAGEIf true, new response bodies and headers will be stored in object storage instead of databasefalse
STORE_RESPONSE_BODY_AND_HEADERS_IN_OBJECT_STORAGE_ONLY_FORA comma-separated list of applications ID whose response bodies and headers should be stored in object storage-
WORKER_NAMEWorker name (as defined in the infrastructure.worker table)-
WORKER_VERSIONWorker version (if empty, will use version from Cargo.toml)-
CONCURRENTNumber of request attempts to handle concurrently1
MAX_FAST_RETRIESMaximum number of fast retries (before doing slow retries)30
MAX_SLOW_RETRIESMaximum number of slow retries (before giving up)30
MONITORING_HEARTBEAT_URLHeartbeat URL that should be called regularly-
MONITORING_HEARTBEAT_MIN_PERIOD_IN_SMinimal duration (in second) to wait between sending two heartbeats60
DISABLE_TARGET_IP_CHECKIf set to false (default), webhooks targeting non-globally-reachable IPs will failfalse
CONNECT_TIMEOUTTimeout for establishing a connection to the target5s
TIMEOUTTimeout for obtaining a HTTP response from the target, including connect phase15s
SIGNATURE_HEADER_NAMEName of the header containing webhook's signatureX-Hook0-Signature
ENABLED_SIGNATURE_VERSIONSA comma-separated list of enabled signature versionsv1
LOAD_WAITING_REQUEST_ATTEMPT_INTO_PULSARIf true, will load waiting request attempts from DB into Pulsar before startingfalse

Notes

  • 🔒 indicates sensitive values (hidden in logs)
  • Boolean values: true, false (case-insensitive)
  • Durations: Use humantime format (1h, 30m, 7d) where supported, otherwise seconds
  • Lists: Comma-separated
  • URLs: Must be valid URLs with scheme