Skip to content

Configuration

Settings come from node-config: defaults in config/default.cjs, overridable by environment variables (mapping in config/custom-environment-variables.js). In Docker, put them into .env. docker-compose.yml builds CONFIG_DB_URL, CONFIG_REDIS_URL and CONFIG_CLI_URL from the other variables for you.

Environment variables

Variable Default Description
NODE_ENV development production enables CLI sign-in and JSON logs. In development/test the CLI skips sign-in.
CONFIG_API_PORT 3000 Port of the REST API (inside tis-worker).
CONFIG_API_PUBLIC_URL – Externally visible base URL (e.g. https://tis.cap-net.cz); pins the GUI's OIDC redirect URI. Derived from the request when unset.
CONFIG_API_TRUST_PROXY loopback, uniquelocal Which proxies may set X-Forwarded-* (Express trust proxy); private networks cover the Docker reverse proxy.
CONFIG_DB_URL postgres://tis:tis@127.0.0.1:5432/tis Postgres connection URL. In Docker built from CONFIG_DB_USER, CONFIG_DB_PASSWORD, CONFIG_DB_NAME.
CONFIG_DB_LOGGING false Log SQL queries (debug level).
CONFIG_DB_MIGRATION_STORAGE_TABLE_NAME sequelize_meta Table recording applied migrations.
CONFIG_REDIS_URL – Redis URL. Without it: no export cache, no persistent CLI sessions, and schedule changes apply only after a worker restart.
CONFIG_REDIS_TTL 3600 Cache lifetime of the public export (GET /export) in seconds.
CONFIG_SCHEDULER_DAYS_RETENTION 14 Indicators not seen for this many days are pruned (except permanent ones and those of manual sources). A source can set its own daysRetention.
CONFIG_SCHEDULER_DAYS_PURGE 30 Indicators soft-deleted (pruned or deleted) longer ago than this are removed for good by the pruning job. 0 keeps them forever. A source can set its own daysPurge.
CONFIG_SCHEDULER_PRUNING_SCHEDULE 0 2 * * * Cron expression of the pruning job (server time).
CONFIG_CLI_PATH /cli URL path of the web CLI.
CONFIG_CLI_PORT 7681 ttyd port in tis-cli.
CONFIG_CLI_URL – Where the worker proxies /cli to (http://tis-cli:<port> in Docker). Unset = no proxy.
CONFIG_CLI_CLEAR_SCREEN true false keeps the output of previous commands in the CLI instead of clearing the screen.
CONFIG_OIDC_ISSUER – Authentik application issuer URL for CLI SSO.
CONFIG_OIDC_CLIENT_ID – Device-flow client ID.
CONFIG_OIDC_CLIENT_SECRET – Only for a confidential client.
CONFIG_OIDC_SCOPES openid profile email Add groups when using allowed groups.
CONFIG_OIDC_ALLOWED_GROUPS admin Comma-separated groups allowed to use the CLI. Empty = any authenticated user.
CONFIG_SESSION_TTL 86400 CLI and GUI session lifetime in seconds.
CONFIG_RATE_LIMIT_FAILED_AUTH 20 Failed token / GUI sign-in attempts per client IP and minute before further attempts get 429 (0 = off).
CONFIG_RATE_LIMIT_EXPORTS 120 Exports per token (or GUI user) and minute (0 = off).
CONFIG_STATS_HOURLY_DAYS 7 Hits are kept per hour this long, then summed up per day by the nightly job.
CONFIG_STATS_RETENTION_DAYS 90 Hits older than this are deleted (0 = keep).
CONFIG_AUDIT_RETENTION_DAYS 365 Audit log entries older than this are deleted by the nightly job (0 = keep).
CONFIG_LOG_LEVEL error fatal, error, warn, info, debug, trace. info shows fetch and pruning results.
CONFIG_GEOIP_LICENSE_KEY, CONFIG_GEOIP_ACCOUNT_ID – MaxMind GeoLite2 license key and account ID: enables the GeoIP country of IP indicators.
CONFIG_GEOIP_SCHEDULE 30 5 * * 3,6 When the worker updates the GeoIP data (cron).
CONFIG_GEOIP_URL – Download the GeoLite2-Country-CSV zip from here instead of MaxMind (a mirror).
CONFIG_SENTRY_DSN – Report errors to Sentry.
CONFIG_FETCH_DROP_WARNING_PERCENT 50 Warn when a feed yields this many percent fewer indicators than last time (0 = only when it yields none). See Sources.
CONFIG_SEED_ADMIN_TOKEN random First start only: secret of the seeded admin token admin (otherwise generated and printed once in the log).
CONFIG_SEED_ABUSEIPDB_KEY, CONFIG_SEED_URLHAUS_KEY, CONFIG_SEED_MALWAREPATROL_RECEIPT – First start only: create the example feeds with these credentials.
TIS_CLI_HOME ~/.tis-cli Where the CLI keeps its local session pointer.
NO_COLOR – Any value disables colours in the CLI.

scripts/gen-env.cjs writes a .env with the current values of the main variables (backing up an existing one).

Retention and pruning

Every fetch refreshes lastObservedAt of the indicators still present in the feed. The pruning job (CONFIG_SCHEDULER_PRUNING_SCHEDULE) soft-deletes indicators whose lastObservedAt is older than CONFIG_SCHEDULER_DAYS_RETENTION days, which removes them from exports. An indicator that reappears in a feed is restored.

Never pruned:

  • permanent indicators – see Indicators
  • indicators of manual sources – see Sources

After pruning, the same job deletes for good the indicators that have been soft-deleted for more than CONFIG_SCHEDULER_DAYS_PURGE days (default 30), so the table doesn't grow forever. A value that shows up again after that is simply created anew (without its old tags).

Indicators of import-only sources (fed by tis-push.sh) are pruned like feed indicators, so pushing a list regularly keeps it alive and stopping the push lets it expire.

Caching

With Redis, the public export (GET /api/v1/export) is cached per query for up to CONFIG_REDIS_TTL seconds. The cache is dropped as soon as data changes (API/GUI/CLI edits, imports, scheduled fetches, pruning). Per-source, multi-source and group exports are not cached.

Every export carries an ETag; a client sending it back in If-None-Match gets 304 Not Modified when the content is unchanged (tis-pull.sh does this automatically).