Skip to main content

Module config

Module config 

Source
Expand description

Runtime configuration, read from environment variables.

Every variable can alternatively be provided as a file by appending _FILE to its name (e.g. TEAMCRAFT_DB_PASSWORD_FILE=/run/secrets/db_password), which is how container secrets are consumed. Reference: docs/src/admin/configuration.md.

Files that are read on start (variables already set take precedence): TEAMCRAFT_ENV_FILE if set, the local development file LOCAL_ENV_FILE (secrets/.env, git-ignored) and – only in package builds – the system file SYSTEM_ENV_FILE.

Structs§

AssistantConfig
BootstrapAdmin
Config
MattermostBot
MattermostConfig
OidcConfig
SmtpConfig
WebhookConfig
Target rules of outgoing event webhooks (the SSRF guard in crate::webhooks).

Enums§

AssistantProvider
Which wire format the assistant speaks.
LocalAgents
TEAMCRAFT_LOCAL_AGENTS: may users connect their own local AI agents (the desktop app’s Agent view, an ACP client for Claude Code, Gemini CLI …) to TeamCraft’s tools?
LogFormat

Constants§

DEFAULT_ASSISTANT_MAX_CONCURRENT
Default number of runs at the same time.
DEFAULT_ASSISTANT_MAX_STEPS
Default for the most model calls of one assistant run.
DEFAULT_ASSISTANT_MAX_TOKENS
Default output tokens per model call.
DEFAULT_ASSISTANT_MODEL
Default model of the anthropic provider.
DEFAULT_ASSISTANT_REQUEST_TIMEOUT
Default time limit of one HTTP call to the AI service, in seconds.
DEFAULT_ASSISTANT_RETENTION_DAYS
Default for how long an idle assistant conversation is kept (days).
DEFAULT_ASSISTANT_RUN_TIMEOUT
Default time limit of a whole run, in seconds.
DEFAULT_WEBHOOK_RETENTION_DAYS
Default for how long finished webhook deliveries are kept.
KNOWN_VARIABLES
Every variable the configuration (and the command line) reads, also as <NAME>_FILE. Sorted; guarded by tests against the string literals of this file and against docs/src/admin/configuration.md.
LOCAL_AGENT_HEADER
Header the desktop app adds to the MCP connection it hands to a local agent (value LOCAL_AGENT_HEADER_VALUE).
LOCAL_AGENT_HEADER_VALUE
Value of LOCAL_AGENT_HEADER on a local agent’s MCP calls.
LOCAL_ENV_FILE
Local configuration file, relative to the working directory (the repository root).
MIN_AUDIT_RETENTION_DAYS
Shortest audit log retention (TEAMCRAFT_AUDIT_RETENTION_DAYS): a typo must not empty the audit trail.
SYSTEM_ENV_FILE
Configuration file of a system installation. Set at build time by the distribution packages (TEAMCRAFT_SYSTEM_CONFIG=/etc/teamcraft/teamcraft.env), so development builds never read a system file.
TOOLING_VARIABLES
Variables of the build and the test tooling: documented and never warned about, but not part of the server configuration.

Functions§

load_env_files
Loads every configuration file (see the module documentation). Errors are returned with the path; the remaining files are still loaded.
load_local_env_file
Loads LOCAL_ENV_FILE into the process environment if it exists. Variables that are already set take precedence. Returns whether a file was loaded.
unknown_variables
TEAMCRAFT_* (and MATTERMOST_*) names that TeamCraft does not know, each with the nearest known name. <NAME>_FILE is checked as NAME.
url_is_under
Whether base_url is listed or below it: same scheme, host and port, and the path of listed is a prefix at a segment boundary.
warn_unknown_variables
Logs a warning for every unknown TEAMCRAFT_* variable of the process environment (a typo would otherwise silently leave the default in place). Call after the tracing subscriber is installed.