Skip to content
Start in Cloud

Configuration Reference

HitKeep follows the 12-factor app methodology. You can configure the application using either command-line flags or environment variables.

Flags take precedence over environment variables.

For citable runtime facts, including binary size, memory use, storage boundaries, exports, and MCP limits, see Facts and Limits.

Flag name compatibility: Several older flag names still work but are deprecated. See each table for details — deprecated flags are marked with an arrow.

These are the most critical settings to get HitKeep running correctly.

FlagEnv VariableDefaultDescription
--public-urlHITKEEP_PUBLIC_URLhttp://localhost:8080Required. The public-facing URL where HitKeep is accessible. May include a path prefix such as https://www.example.net/hitkeep/. Used for dashboard asset URLs, browser ingest routing, CORS, email links, and JWT issuer validation.
--jwt-secretHITKEEP_JWT_SECRET(randomly generated)Required for production. A long random string used to sign authentication tokens. If not provided, sessions will invalidate on restart.
--auth-remember-me-daysHITKEEP_AUTH_REMEMBER_ME_DAYS30Remember-me lifetime in days. The dashboard session API exposes this policy so the frontend can show remembered sign-in status accurately.
--auth-session-minutesHITKEEP_AUTH_SESSION_MINUTES15Dashboard session lifetime in minutes. The frontend reads this policy and shows the remaining time.
--auth-session-warning-secondsHITKEEP_AUTH_SESSION_WARNING_SECONDS120Seconds before session expiry when the dashboard warning appears. Values below 20 seconds are raised to 20.
--db-pathHITKEEP_DB_PATHhitkeep.dbPath to the embedded DuckDB database file. In Docker, this is mapped to /var/lib/hitkeep/data/hitkeep.db. (Old flag: -db)
--data-pathHITKEEP_DATA_PATHdataBase directory for tenant-local analytics databases and other local state. In multiteam installs, this whole tree is part of the backup boundary.
--http-addrHITKEEP_HTTP_ADDR:8080The interface and port for the HTTP server to listen on. (Old flag: -http)
--log-levelHITKEEP_LOG_LEVELinfoLogging verbosity. Options: debug, info, warn, error.
--healthcheckN/AfalseRun the healthcheck client and exit instead of starting the server.

Use a bare origin when HitKeep owns a hostname:

Terminal window
HITKEEP_PUBLIC_URL=https://analytics.example.com

Use a path-prefixed URL when your reverse proxy mounts HitKeep below another site:

Terminal window
HITKEEP_PUBLIC_URL=https://www.example.net/hitkeep/

With a path prefix, HitKeep serves the dashboard shell with <base href="/hitkeep/" />, accepts dashboard API requests below /hitkeep/api/..., and serves tracker files below /hitkeep/hk.js and /hitkeep/hk-vitals.js. The tracker derives /ingest, /ingest/event, and /ingest/web-vitals from the script URL, so a snippet loaded from /hitkeep/hk.js posts back to /hitkeep/ingest. Root /api/..., /hk.js, and dashboard routes are not public fallback routes in this mode. Local /healthz and /readyz remain available for process, container, and Kubernetes checks.

Keep the reverse proxy prefix and HITKEEP_PUBLIC_URL in sync. A mismatch usually appears as a login page that loads but cannot call /api/status, or as a tracker snippet that loads from one path and posts pageviews to another.

FlagEnv VariableDefaultDescription
--archive-pathHITKEEP_ARCHIVE_PATHarchiveDirectory for exports, rollups, and archival artifacts.
--data-retention-daysHITKEEP_DATA_RETENTION_DAYS365Default data retention window (days) for newly created sites. (Old flag: -retention-days)
--import-max-stage-bytesHITKEEP_IMPORT_MAX_STAGE_BYTES107374182400Maximum staged import upload size in bytes. The default is 100 GiB.
--import-stage-retention-daysHITKEEP_IMPORT_STAGE_RETENTION_DAYS7Days to keep stale staged import upload files before automatic cleanup. Set to 0 to disable import staging cleanup.

HitKeep can use a local spam-filter cache for known referrer spam and abuse networks. Automatic refresh is off by default for offline and airgapped installs.

FlagEnv VariableDefaultDescription
--spam-filter-pathHITKEEP_SPAM_FILTER_PATH""Path to the cached spam-filter data. Empty uses <data-path>/spam-filter.json.
--spam-filter-auto-updateHITKEEP_SPAM_FILTER_AUTO_UPDATEfalseAutomatically refresh OSS spam-filter feeds on the leader node.
--spam-filter-update-intervalHITKEEP_SPAM_FILTER_UPDATE_INTERVAL1440Minutes between spam-filter feed refreshes.

See Bot and Spam Filtering for update commands and operator guidance.

HitKeep can periodically export all live databases (shared + per-tenant) to Parquet snapshots. Set HITKEEP_BACKUP_PATH to enable.

FlagEnv VariableDefaultDescription
--backup-pathHITKEEP_BACKUP_PATH"" (disabled)Backup destination: local directory or s3:// URL. Empty disables backups.
--backup-intervalHITKEEP_BACKUP_INTERVAL60Minutes between backup runs.
--backup-retentionHITKEEP_BACKUP_RETENTION24Number of snapshots to keep before pruning older ones.

When HITKEEP_BACKUP_PATH is an s3:// URL, the same S3 credentials configured below are used. For local paths, old snapshots beyond the retention count are automatically deleted. For S3, configure lifecycle policies on your bucket.

See Backups and Restore and S3 Backups for concrete layouts and restore examples.

When HITKEEP_ARCHIVE_PATH is set to an s3:// URL, HitKeep writes Parquet archives directly to S3-compatible storage via DuckDB’s httpfs extension.

Authentication mode is auto-detected:

  • If HITKEEP_S3_ACCESS_KEY_ID and HITKEEP_S3_SECRET_ACCESS_KEY are both set, HitKeep uses static credentials.
  • If neither is set, HitKeep uses the AWS credential chain (environment variables, shared config, instance profiles, STS, SSO).
FlagEnv VariableDefaultDescription
--s3-access-key-idHITKEEP_S3_ACCESS_KEY_ID""AWS access key ID for static credential authentication.
--s3-secret-access-keyHITKEEP_S3_SECRET_ACCESS_KEY""AWS secret access key for static credential authentication.
--s3-session-tokenHITKEEP_S3_SESSION_TOKEN""STS temporary session token (used with static credentials).
--s3-regionHITKEEP_S3_REGIONus-east-1S3 region for the archive bucket.
--s3-endpointHITKEEP_S3_ENDPOINT""Custom S3-compatible endpoint (e.g., MinIO, Cloudflare R2, DigitalOcean Spaces).
--s3-url-styleHITKEEP_S3_URL_STYLE""URL addressing style: path or vhost. Empty uses the DuckDB default.
--s3-use-sslHITKEEP_S3_USE_SSLtrueSet to false for local S3-compatible endpoints over HTTP (e.g., MinIO dev).

See S3 Backups for end-to-end examples with AWS S3, MinIO, and Cloudflare R2.

Settings for binding ports and clustering nodes.

FlagEnv VariableDefaultDescription
--node-nameHITKEEP_NODE_NAMEhostname-timestampUnique identifier for this node in a cluster. (Old flag: -name)
--bind-addrHITKEEP_BIND_ADDR0.0.0.0:7946The address used for cluster communication (Memberlist/Gossip). (Old flag: -bind)
--join-addrHITKEEP_JOIN_ADDR""The address of an existing peer node to join when starting in clustered mode. (Old flag: -join)

MCP is disabled by default. When enabled, it is mounted on the leader’s main HTTP server and serves read-only aggregate analytics plus official documentation tools over MCP Streamable HTTP.

FlagEnv VariableDefaultDescription
--mcp-enabledHITKEEP_MCP_ENABLEDfalseEnable the optional leader-only MCP server.
--mcp-pathHITKEEP_MCP_PATH/mcpStreamable HTTP path mounted on the main HitKeep HTTP server. Empty values and / normalize to /mcp.
--mcp-max-range-daysHITKEEP_MCP_MAX_RANGE_DAYS366Maximum analytics and comparison date range accepted by MCP tools.
--mcp-docs-enabledHITKEEP_MCP_DOCS_ENABLEDtrueEnable MCP tools and resources that fetch official HitKeep docs.
--mcp-docs-urlHITKEEP_MCP_DOCS_URLhttps://hitkeep.comOfficial docs base URL used by MCP docs tools.
--mcp-docs-cache-minutesHITKEEP_MCP_DOCS_CACHE_MINUTES60In-memory cache TTL for llms.txt and up to 128 markdown docs pages.

See Official MCP Server for setup and tool details.

AI-powered product features are disabled by default. When enabled, HitKeep uses the configured provider/model route and stores only audit metadata plus the validated customer-visible output.

Self-hosted operators configure the HitKeep route and budget fields through environment variables or flags. Provider credentials are resolved by the wrapped goAI provider, so set the selected provider’s own environment variables such as OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, or AWS credentials. Use the goAI supported providers documentation for provider-specific auth and endpoint variables. HitKeep Cloud can run the same route fields as cloud-managed configuration, with provider secrets managed outside the customer dashboard.

Use this reference for exact field names and defaults. For model selection, setup examples, and budget sizing, see AI Model Configuration.

FlagEnv VariableDefaultDescription
--ai-enabledHITKEEP_AI_ENABLEDfalseEnable optional AI-powered product features.
--ai-providerHITKEEP_AI_PROVIDER""Provider key supported by the HitKeep goAI wrapper. Supported values include openai, openai-compatible, compat, gateway, bifrost, litellm, bedrock, anthropic, google, gemini, mistral, ollama, openrouter, deepseek, groq, xai, cerebras, cohere, perplexity, together, and fireworks.
--ai-modelHITKEEP_AI_MODEL""Model identifier for the configured provider.
--ai-base-urlHITKEEP_AI_BASE_URL""Optional explicit base URL passed to providers that support it. Required for OpenAI-compatible gateways such as LiteLLM or Bifrost. Direct providers can also use their goAI-native base URL variables, such as OPENAI_BASE_URL.
--ai-regionHITKEEP_AI_REGION""Optional explicit region passed to providers that support it. Providers such as Bedrock also read their native environment, such as AWS_REGION.
--ai-api-keyHITKEEP_AI_API_KEY""Optional static token passed to providers that support static API keys or bearer tokens. Prefer the selected goAI provider’s native environment variable. This value is redacted in logs and status responses.
--ai-timeout-secondsHITKEEP_AI_TIMEOUT_SECONDS30Provider request timeout in seconds.
--ai-request-limitHITKEEP_AI_REQUEST_LIMIT100Maximum AI requests per local budget window. Set to 0 to disable the local request cap.
--ai-token-limitHITKEEP_AI_TOKEN_LIMIT100000Maximum AI tokens per local budget window. Set to 0 to disable the local token cap.
--ai-budget-windowHITKEEP_AI_BUDGET_WINDOW1440Local AI budget window in minutes.

The token limit is a local usage budget, not the model context window. The current Opportunities enrichment path asks the provider for a small validated JSON object and caps provider output at 900 tokens. Provider model limits still apply upstream.

The admin AI status endpoint reports whether AI is enabled and configured, the provider/model label, the configuration mode (self_hosted or cloud_managed), the current request/token budget state, and a safe last-error category. It never returns provider secrets, raw prompts, raw provider responses, or raw external error bodies.

Opportunities use deterministic detectors for opportunity type, evidence, impact, confidence, and status. AI may summarize or explain only cited evidence. The saved API output uses translation keys plus interpolation params so dashboard copy can be localized without changing stored records.

For a direct provider route, configure the HitKeep route and the provider’s goAI credential environment:

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=openai
HITKEEP_AI_MODEL=your-json-capable-model
OPENAI_API_KEY=provider_key_from_your_secret_store

For an OpenAI-compatible gateway, configure a HitKeep base URL. Set HITKEEP_AI_API_KEY only when the gateway expects a bearer token:

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=openai-compatible
HITKEEP_AI_MODEL=opportunities-json
HITKEEP_AI_BASE_URL=https://ai-gateway.example.com/v1

See AI Model Configuration for setup examples and Opportunity Recommendations for the product behavior, permissions, API contract, and export boundary.

Self-hosted installs must configure a Google OAuth web client before teams can connect Search Console, map properties, and import Search Analytics rows.

FlagEnv VariableDefaultDescription
--google-search-console-client-idHITKEEP_GOOGLE_SEARCH_CONSOLE_CLIENT_ID""Google OAuth web client ID used for Search Console connection and property access.
--google-search-console-client-secretHITKEEP_GOOGLE_SEARCH_CONSOLE_CLIENT_SECRET""Google OAuth web client secret. Keep this out of logs, screenshots, seed data, and support bundles.
--google-search-console-redirect-urlHITKEEP_GOOGLE_SEARCH_CONSOLE_REDIRECT_URL""Optional callback URL override. Empty derives /api/integrations/google-search-console/oauth/callback from HITKEEP_PUBLIC_URL.

Enable the Google Search Console API in the same Google Cloud project that owns the OAuth client. See Google Search Console Integration for the Google Cloud setup and sync behavior.

Required for “Forgot Password” functionality.

FlagEnv VariableDefaultDescription
--mail-driverHITKEEP_MAIL_DRIVERsmtpCurrently only smtp is supported.
--mail-hostHITKEEP_MAIL_HOST""SMTP Server Hostname (e.g., smtp.postmarkapp.com).
--mail-portHITKEEP_MAIL_PORT587SMTP Server Port.
--mail-usernameHITKEEP_MAIL_USERNAME""SMTP Username.
--mail-passwordHITKEEP_MAIL_PASSWORD""SMTP Password.
--mail-encryptionHITKEEP_MAIL_ENCRYPTIONtlsEncryption mode: tls (STARTTLS), ssl (Implicit TLS), or none.
--mail-from-addressHITKEEP_MAIL_FROM_ADDRESShitkeep@localhostThe email address messages are sent from.
--mail-from-nameHITKEEP_MAIL_FROM_NAMEHitKeepThe sender name displayed in inboxes.
--mail-insecure-skip-verifyHITKEEP_MAIL_INSECURE_SKIP_VERIFYfalseSet to true to accept self-signed certificates (not recommended for production).

HitKeep includes a built-in rate limiter to protect against abuse. Limits are defined per IP address.

Ingestion (/ingest, /ingest/event, /api/ingest/server/*)

Section titled “Ingestion (/ingest, /ingest/event, /api/ingest/server/*)”

High-throughput endpoints for the browser tracker and trusted server-side pageview or event ingest. Server-side ingest still requires an API client token and can be called by non-browser clients without Origin or Referer headers, but it uses this ingest limiter because log forwarders and edge workers often send bursts from one IP.

FlagEnv VariableDefaultDescription
--ingest-rate-limitHITKEEP_INGEST_RATE_LIMIT20.0Requests per second allowed per IP. (Old flag: -ingest-rate)
--ingest-burstHITKEEP_INGEST_BURST40Maximum burst size allowed per IP.

General data retrieval endpoints.

FlagEnv VariableDefaultDescription
--api-rate-limitHITKEEP_API_RATE_LIMIT10.0Requests per second allowed per IP. (Old flag: -api-rate)
--api-burstHITKEEP_API_BURST20Maximum burst size allowed per IP.

Import lifecycle and chunk upload requests use the normal API limiter above. The staged upload size is controlled by HITKEEP_IMPORT_MAX_STAGE_BYTES. Stale staged import files are cleaned after HITKEEP_IMPORT_STAGE_RETENTION_DAYS; set the value to 0 to disable cleanup.

Strict limits to prevent brute-force attacks.

FlagEnv VariableDefaultDescription
--auth-rate-limitHITKEEP_AUTH_RATE_LIMIT2.0Requests per second allowed per IP. (Old flag: -auth-rate)
--auth-burstHITKEEP_AUTH_BURST5Maximum burst size allowed per IP.

Public webhook endpoints use a separate limiter.

FlagEnv VariableDefaultDescription
--webhook-rate-limitHITKEEP_WEBHOOK_RATE_LIMIT30.0Requests per second allowed per IP for webhook endpoints. (Old flag: -webhook-rate)
--webhook-burstHITKEEP_WEBHOOK_BURST60Maximum webhook burst size allowed per IP.

Use this when HitKeep is behind a reverse proxy or load balancer and you want to trust forwarded headers. This affects both rate limiting and GeoIP resolution.

FlagEnvironment VariableDefaultDescription
--trusted-proxiesHITKEEP_TRUSTED_PROXIES*Comma-separated list of trusted proxy CIDRs, or * to trust forwarded headers from any direct peer.

Behavior:

  • The default * expands to all IPv4 and IPv6 networks.
  • With *, HitKeep uses the first valid IP in X-Forwarded-For when that header is present.
  • If set to CIDRs, HitKeep only trusts forwarded headers when the direct connection IP is in the trusted list.
  • If set to an empty value, HitKeep ignores forwarded headers and uses the direct connection IP.

Configuration for embedded components. You generally do not need to change these unless you are developing HitKeep or have port conflicts on the host network.

FlagEnv VariableDefaultDescription
--nsq-tcp-addressHITKEEP_NSQ_TCP_ADDRESS127.0.0.1:4150Bind address for the embedded NSQ TCP interface.
--nsq-http-addressHITKEEP_NSQ_HTTP_ADDRESS127.0.0.1:4151Bind address for the embedded NSQ HTTP API.

Cloud-hosted builds have additional internal HITKEEP_CLOUD_* and HITKEEP_STRIPE_* variables used by managed HitKeep Cloud. They are not needed for self-hosted installs.