This document describes the runtime configuration accepted by the current code.
Source of truth:
pytmbot.yaml.samplepytmbot/models/settings_model.pypytmbot/settings.py
- The default config path is
pytmbot.yaml. - You can override it with
PYTMBOT_CONFIG_PATH. - The repository includes
pytmbot.yaml.sampleas the canonical example.
- Many fields are modeled as one-item lists. Follow the sample file exactly.
config_versionshould normally match the running app version.- If
config_versionis missing, startup migrates the config to the current version. - Optional sections may be omitted entirely when the related feature is unused.
- Optional, but recommended.
- Current repository sample value:
0.3.0. - Legacy configs without this field are auto-migrated.
Required.
prod_token: required list with at least one bot token.dev_bot_token: optional list for development mode.
Required.
allowed_user_ids: required list of allowed Telegram user IDs.allowed_admins_ids: required list of admin user IDs.auth_salt: required list of secret values used for TOTP.
Validation:
allowed_admins_idsmust be a subset ofallowed_user_ids.
Required.
global_chat_id: required list with at least one target chat ID for notifications.
Required.
host: required list of Docker daemon endpoints.debug_docker_client: optional boolean, defaultfalse.strict_access: optional boolean, defaultfalse.
Behavior:
strict_access: falseallows degraded runtime when Docker is unavailable.strict_access: truemakes Docker access failures fatal for startup or operations that require Docker.
Optional. Required only when running with --webhook true.
url: public host used when registering the Telegram webhook.webhook_port: public HTTPS port used by Telegram.local_port: local listening port for the embedded FastAPI / Uvicorn server.cert: optional certificate path for in-process TLS.cert_key: optional private key path for in-process TLS.trusted_proxy_ips: optional list of trusted reverse-proxy IPs or CIDRs.additional_telegram_ip_ranges: optional list of extra Telegram source ranges.
Validation:
trusted_proxy_ipsandadditional_telegram_ip_rangesmust be valid IPs / CIDRs.
Runtime notes:
local_portmust be non-privileged (>= 1024).- Missing or invalid TLS files disable in-process TLS and keep the listener in HTTP mode.
- Webhook startup failures fall back to polling mode.
Optional.
Used by the built-in monitor plugin.
tracehold: required threshold block. The field name is intentionally spelledtraceholdin the schema and sample.max_notificationscheck_intervalreset_notification_countretry_attemptsretry_intervalmonitor_docker
Notes:
reset_notification_countis a duration in seconds in the shipped sample.- The monitor plugin also requires the
influxdbsection.
Used by the built-in outline plugin.
api_urlcert
Optional. Required when the monitor plugin is enabled.
urltokenorgbucketdebug_mode
config_version: "0.3.0"
bot_token:
prod_token:
- "YOUR_PROD_BOT_TOKEN"
access_control:
allowed_user_ids:
- 123456789
allowed_admins_ids:
- 123456789
auth_salt:
- "YOUR_RANDOM_SALT"
chat_id:
global_chat_id:
- 123456789
docker:
host:
- "unix:///var/run/docker.sock"- Start from
pytmbot.yaml.sampleinstead of writing the file by hand. - Keep secrets out of version control.
- Mount the final config file read-only in container deployments.
- Revisit webhook.md, plugins.md, and security.md for feature-specific settings.