Skip to main content
Version: Next

Reference

This page describes all available environment variables, there meaning and there defaults.

note

All variables are prefixed with NAUTHILUS_. For better readability the prefix is left away in this document.

The list of parameters is not following a special order.

There are much more environment variables available, if you look at the configuration file settings. Each of these may also be defined as environment variables by joining the section keywords with an underscore.

Example:

server:
address: "[::]:9443"
haproxy_v2: false

tls:
enabled: true

In env-form:

NAUTHILUS_SERVER_ADDRESS="[::]:9443"
NAUTHILUS_SERVER_HAPROXY_V2=false
NAUTHILUS_SERVER_TLS_ENABLED=true
warning

These configuration parameters are not reloaded, if the main process receives a HUP-signal! You must restart the service if settings have changed!

Nauthilus

NameDEVELOPER_MODE
Defaultfalse
ValueBoolean

This parameter activates the developer mode. In this mode, redis keys are stored in plain text as well as you can see passwords in plain text in the logs! Please really use this mode, if you are testing something and have full control over the system its running on.

NameTRUSTED_PROXIES
Default"127.0.0.1 ::1"
ValueString

If Nauthilus runs behind a reverse proxy or a load balancer, it is necessary to define trusted proxies. This will trust the X-Forwarded-To header in the HTTP protocol and track the real client IP. This especially needed when using the brute force protection!

NameLANGUAGE_RESOURCES
Default"/usr/app/resources"
ValueString

Specify the absolute path to the language resources. This directory contains the localized files need for Nauthilus.

NameLOCAL_CACHE_AUTH_TTL
Default30
ValuePositive integer

Specify how long a page hit in seconds has to be cached locally for each Nauthilus instance.

NameLUA_SCRIPT_TIMEOUT
Default120
ValuePositive integer

This parameter specifies how long in seconds a Lua script is allowed to run, until it is aborted by the interpreter.

NamePROTECT_ENFORCE_REJECT
Defaultfalse
ValueBoolean

Controls enforcement of the Account Protection filter. When false or unset (default), the filter runs in dry‑run mode: applies progressive delay and sets Step‑Up/CAPTCHA hints via headers/Redis but does not reject the request. When true, unauthenticated requests are temporarily rejected while protection is active. Related headers: X-Nauthilus-Protection, X-Nauthilus-Protection-Reason, X-Nauthilus-Protection-Mode (dry‑run).

Global Pattern Monitoring (GPM_*) — since v1.10.2

These variables tune the account-centric distributed pattern detection to reduce false positives (Carrier-NAT, mobile IP churn, TOR). Defaults are conservative.

NameGPM_THRESH_UNIQ_1H
Default12
ValuePositive integer

Minimum unique IPs within 1 hour required as a short-term signal. If this OR the 24h threshold is met, combined with the 7d threshold and other checks, an account is flagged as under distributed attack.

NameGPM_THRESH_UNIQ_24H
Default25
ValuePositive integer

Minimum unique IPs within 24 hours used as an alternative short-/mid-term signal to the 1h threshold.

NameGPM_THRESH_UNIQ_7D
Default60
ValuePositive integer

Minimum unique IPs within 7 days (long-term signal). Must be met together with a short-term signal.

NameGPM_MIN_FAILS_24H
Default8
ValuePositive integer

Minimum number of failed attempts in 24 hours. Prevents flagging cases with many unique IPs but very few failures (typical for benign churn).

NameGPM_THRESH_IP_TO_FAIL_RATIO
Default1.2
ValueFloat

Required ratio of unique IPs to failed attempts in 1h OR 24h. Higher values detect more broadly distributed failures.

NameGPM_ATTACK_TTL_SEC
Default43200 (12h)
ValuePositive integer (sec)

Sliding window horizon for the ZSET that tracks accounts under distributed attack. Lower values reduce the persistence of older spikes.

NameTERM_THEME
Default"light"
ValueString: light or dark

Controls the intensity of ANSI foreground colors used for full-line colorized text logs. dark uses bright/high-intensity colors optimized for dark terminals; light (default) uses standard-intensity colors better suited for light backgrounds. This only affects text logs when color output is enabled (server.log.color: true) and JSON logs remain uncolored.

Nginx

NameNGINX_WAIT_DELAY
Default1
ValuePositive integer (2-255)

If a login failed, this value is returned to Nginx to let a client wait. It is a setting for brute force prevention.

NameNGINX_MAX_LOGIN_ATTEMPTS
Default15
ValuePositive integer (1-255)

Replay with Auth-Wait header as long as the maximum login attemtps does not raise the limit of this parameter.

NameSMTP_BACKEND_ADDRESS
Default"127.0.0.1"
ValueString

Specify the backend IP address for an SMTP server. This setting is used, if backend monitoring is turned off.

NameSMTP_BACKEND_PORT
Default5871
ValuePositive integer (a valid port number)

This is the port of an SMTP server. This setting is used, if backend monitoring is turned off.

NameIMAP_BACKEND_ADDRESS
Default"127.0.0.1"
ValueString

Specify the backend IP address for a IMAP server. This setting is used, if backend monitoring is turned off.

NameIMAP_BACKEND_PORT
Default9931
ValuePositive integer (a valid port number)

This is the port of a IMAP server. This setting is used, if backend monitoring is turned off.

OAuth2 / Ory Hydra settings

NameHTTP_STATIC_CONTENT_PATH
Default"/usr/app/static"
ValueString

Define the path where Nauthilus will find OAuth2 pages and content. The default is perfect if using Docker.

NameDEFAULT_LOGO_IMAGE
Default"/static/img/logo.png"
ValueString

Path to the company logo. The path is the location part of an HTTP url.

NameHYDRA_ADMIN_URI
Default"http://127.0.0.1:4445"
ValueString

This is the protected URI to the Ory Hydra admin endpoint. You must change this if you plan on using OAuth2!

NameHTTP_CLIENT_SKIP_TLS_VERIFY
Defaultfalse
ValueBoolean

Nauthilus does communicate to Ory Hydra using HTTP. If the server certificate can not be validated, you may turn of verification

NameHOMEPAGE
Default"https://nauthilus.org"
ValueString

After a user has logged out, there may exist a user defined post URL. If none was defined, Nauthilus will redirect the user to this page.

Login page (including 2FA page)

NameLOGIN_PAGE
Default"/login"
ValueString

This is the URI path for the login page. If you change this, you also must modify the page template! Leave it unchanged if possible!

NameLOGIN_PAGE_LOGO_IMAGE_ALT
Default"Logo (c) by Roessner-Network-Solutions"
ValueString

The HTML image alt text for the company logo.

NameLOGIN_REMEMBER_FOR
Default10800
ValueInteger

This is the number of seconds a user will not be asked to log in again, if the checkbox to remember the user was checked. This has nothing to do with the calling application, which may keep a user logged in differently. Setting this to 0 ( zero), will keep the user logged in forever. This is not recommended! If you want to disable this feature, you may consider modifying the page template and removing the checkbox entirely.

NameLOGIN_PAGE_WELCOME
Default-
ValueString

If you define this string, a headline will appear on top of the company logo

Device page

NameDEVICE_PAGE
Default"/device"
ValueString

See LOGIN_PAGE

NameCONSENT_PAGE
Default"/consent"
ValueString

See LOGIN_PAGE

NameCONSENT_PAGE_LOGO_IMAGE_ALT
Default"Logo (c) by Roessner-Network-Solutions"
ValueString

See LOGIN_PAGE_LOGO_IMAGE_ALT

NameCONSENT_REMEMBER_FOR
Default3600
ValueInteger

See LOGIN_REMEMBER_FOR

NameCONSENT_PAGE_WELCOME
Default-
ValueString

See LOGIN_PAGE_WELCOME

Logout page

NameLOGOUT_PAGE
Default"/logout"
ValueString

See LOGIN_PAGE

NameLOGOUT_PAGE_WELCOME
Default-
ValueString

See LOGIN_PAGE_WELCOME

2FA specific settings

If you provide two-factor authentication, the following settings are available:

NameTOTP_ISSUER
Default"nauthilus.me"
ValueString

This field is used in the otpauth:// URL parameter, when restoring a secret key. It should match the issuer that was used when creating the key (and read from database afterward).

warning

The current implementation uses hard-coded settings for TOTP-secrets. These are:

  • algorithm: SHA1
  • Digits: 6
NameLOGIN_2FA_PAGE
Default"/register"
ValueString

This is the URL path where a user can register a second factor for authentication.

warning

The path is relative to /2fa/v1, which is a hardcoded default!

NameLOGIN_2FA_PAGE_WELCOME
Default-
ValueString

See LOGIN_PAGE_WELCOME

NameLOGIN_2FA_POST_PAGE
Default"/totp"
ValueString

This is the URL path where a user gets redirected to after logging in at the registration endpoint. This may change in future releases, when webauthn is supported.

Note:

The path is relative to /2fa/v1, which is a hardcoded default!

NameTOTP_PAGE
Default"/totp"
ValueString

This is the URL where a user can fetch a QR code of a newly created TOTP code. After the code has been verified by the user, the code will finally be stored in the user backend database.

Note:

The path is relative to /2fa/v1, which is a hardcoded default!

NameTOTP_WELCOME
Default-
ValueString

See LOGIN_PAGE_WELCOME

NameTOTP_PAGE_LOGO_IMAGE_ALT
Default"Logo (c) by Roessner-Network-Solutions"
ValueString

See LOGIN_PAGE_LOGO_IMAGE_ALT

NameTOTP_SKEW
Default1
ValuePositive integer

When using TOTP secrets, this variable is used to allow the server adding TOTP_SKEW times 30 seconds periods before and after the current time slot. Disable this by setting the variable to 0. Values larger than 1 are sketchy.

NameNOTIFY_PAGE
Default"/notify"
ValueString

This is an endpoint for user information returned by Nauthilus.

NameNOTIFY_WELCOME
Default-
ValueString

See LOGIN_PAGE_WELCOME

NameNOTIFY_PAGE_LOGO_IMAGE_ALT
Default"Logo (c) by Roessner-Network-Solutions"
ValueString

See LOGIN_PAGE_LOGO_IMAGE_ALT

WebAuthn

This is work in progress and under active development.

Lua Plugins (Features, Filters, Actions, Hooks)

The following environment variables are read directly by bundled Lua scripts. They complement the main configuration and can be used to tune behavior without changing Lua code. Unless stated otherwise, variables are optional.

Common (used by many Lua scripts)

NameDefaultTypeUsed byDescription
CUSTOM_REDIS_POOL_NAME— (unset)Stringfeatures, filters, actions, hooksName of a non-default Redis connection pool to use for this Lua execution. When unset, the default pool is used.

Account Protection filter (filters/account_protection_mode.lua)

NameDefaultTypeDescription
PROTECT_THRESH_UNIQ2412IntegerMinimum unique scoped IPs in 24h window to consider an account under protection.
PROTECT_THRESH_UNIQ7D30IntegerMinimum unique scoped IPs in 7d window to consider an account under protection.
PROTECT_THRESH_FAIL247IntegerMinimum failed attempts in 24h window to consider an account under protection.
PROTECT_THRESH_FAIL7D15IntegerMinimum failed attempts in 7d window to consider an account under protection.
PROTECT_BACKOFF_MIN_MS150Integer (ms)Minimum backoff delay applied when protection is active.
PROTECT_BACKOFF_MAX_MS1000Integer (ms)Upper bound for applied backoff delay.
PROTECT_BACKOFF_MAX_LEVEL5IntegerMaximum backoff escalation level.
PROTECT_MODE_TTL_SEC3600Integer (seconds)TTL for the protection state and step-up requirement hints.
PROTECT_ENFORCE_REJECTfalseBooleanEnforcement switch. When false or unset (default), the filter runs in dry‑run mode (no blocking, only delay + step-up hints). When true, unauthenticated requests are rejected while protection is active. See also the dedicated entry above.
CUSTOM_REDIS_POOL_NAMEStringRedis pool override for this filter’s Redis operations.

Emits headers for HTTP/OIDC frontends: X-Nauthilus-Protection, X-Nauthilus-Protection-Reason; and in dry‑run mode: X-Nauthilus-Protection-Mode: dry-run.

Security metrics feature (features/security_metrics.lua)

NameDefaultTypeDescription
SECURITY_METRICS_PER_USER_ENABLEDfalseBooleanWhen true, emits per‑user security_* metrics (guarded by sampling). When false, per‑user emission is disabled except for protected users.
SECURITY_METRICS_SAMPLE_RATE1.0 (effective when enabled)Float (0.0–1.0)Sampling rate for per‑user metrics; users currently in protection mode are always emitted. Unset is treated as 1.0 when per‑user metrics are enabled.
CUSTOM_REDIS_POOL_NAMEStringRedis pool override for metrics reads.

Account long‑window metrics feature (features/account_longwindow_metrics.lua)

NameDefaultTypeDescription
CUSTOM_REDIS_POOL_NAMEStringRedis pool override. Used for HLL (PFADD/PFCOUNT) and failure ZSET updates.

This feature already uses scoped IPs when computing uniq_ips_24h and uniq_ips_7d (see Lua Backend config ip_scoping_v6_cidr / ip_scoping_v4_cidr).

Failed login hotspot feature (features/failed_login_hotspot.lua)

NameDefaultTypeDescription
FAILED_LOGIN_HOT_THRESHOLD10IntegerZSET score threshold for a username to be considered “hot”.
FAILED_LOGIN_TOP_K20IntegerConsider users within Top‑K by rank as potential hotspots.
FAILED_LOGIN_SNAPSHOT_SEC30Integer (seconds)Rate‑limit for emitting a small Top‑N snapshot as Prometheus gauges.
FAILED_LOGIN_SNAPSHOT_TOPN10IntegerSize of the Top‑N snapshot to expose as gauges.
CUSTOM_REDIS_POOL_NAMEStringRedis pool override for ZSET reads.

Dynamic response action (actions/dynamic_response.lua)

Administration alerting controls and warm‑up parameters for dynamic threat response.

NameDefaultTypeDescription
ADMIN_ALERTS_ENABLEDtrueBooleanMaster toggle for sending administrator alert emails.
ADMIN_ALERT_MIN_UNIQUE_IPS100IntegerBaseline: minimum global unique IPs before alerts are considered.
ADMIN_ALERT_MIN_IPS_PER_USER2.5FloatBaseline: minimum IPs per user before alerts are considered.
ADMIN_ALERT_REQUIRE_EVIDENCEfalseBooleanIf true, require additional evidence (e.g., suspicious regions/IPs) besides baselines.
ADMIN_ALERT_COOLDOWN_SECONDS900Integer (seconds)Per‑subject cooldown to avoid alert storms.
DYNAMIC_RESPONSE_WARMUP_SECONDS604800Integer (seconds)Warm‑up period length before full automated responses are enabled.
DYNAMIC_RESPONSE_WARMUP_MIN_ATTEMPTS1000IntegerMinimum number of attempts observed before warm‑up can end.
DYNAMIC_RESPONSE_WARMUP_MIN_USERS10IntegerMinimum number of distinct users observed before warm‑up can end.
CUSTOM_REDIS_POOL_NAMEStringRedis pool override for dynamic response data access and rate‑limits.

ClickHouse post‑action (actions/clickhouse.lua)

NameDefaultTypeDescription
CLICKHOUSE_INSERT_URLString (URL)Full HTTP endpoint including SQL, e.g. http://host:8123/?query=INSERT%20INTO%20nauthilus.logins%20FORMAT%20JSONEachRow.
CLICKHOUSE_USERStringOptional basic auth user (also sent via X‑ClickHouse-User).
CLICKHOUSE_PASSWORDStringOptional basic auth password (also sent via X‑ClickHouse-Key).
CLICKHOUSE_BATCH_SIZE100IntegerBatch size for buffered inserts.
CLICKHOUSE_CACHE_KEY"clickhouse:batch:logins"StringCache key used for the in‑process batching queue.

ClickHouse query hook (hooks/clickhouse-query.lua)

NameDefaultTypeDescription
CLICKHOUSE_SELECT_BASEString (URL)Base URL of ClickHouse HTTP endpoint, e.g. http://host:8123.
CLICKHOUSE_TABLEnauthilus.loginsStringTable to query for read‑only operations.
CLICKHOUSE_USERStringOptional basic auth user (also sent via headers).
CLICKHOUSE_PASSWORDStringOptional basic auth password (also sent via headers).

Blocklist feature (features/blocklist.lua)

NameDefaultTypeDescription
BLOCKLIST_URLString (URL)Endpoint for retrieving external blocklist data.

See also:

  • Release Notes → 1.10.x (Security and protection)
  • Configuration → Database Backends → Lua Backend (ip_scoping_v6_cidr, ip_scoping_v4_cidr)
  • Lua API → HTTP response (headers used by filters)
  • Filters → Account protection