agnes-the-ai-analyst/services/telegram_bot/config.py
Petr f2d3d156e3 Move standalone services from server/ to services/
Extract 4 self-contained services into services/ module:
- server/telegram_bot/ -> services/telegram_bot/
- server/ws_gateway/ -> services/ws_gateway/
- server/corporate_memory/ -> services/corporate_memory/
- server/session_collector.py -> services/session_collector/

Each service now has its own systemd/ directory with .service and .timer files.
deploy.sh updated to auto-discover service units from services/*/systemd/*.

server/ now contains only deployment infrastructure (deploy.sh, setup scripts,
bin/ management tools, sudoers, nginx config).

All imports updated: webapp/app.py, server/bin/ scripts, systemd ExecStart paths.
2026-03-09 12:54:30 +01:00

35 lines
945 B
Python

"""
Configuration for the Telegram notification bot.
All values loaded from environment variables - no hardcoded defaults for secrets.
"""
import os
# Telegram Bot API token (required)
TELEGRAM_BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "")
# Paths
NOTIFICATIONS_DIR = "/data/notifications"
TELEGRAM_USERS_FILE = os.path.join(NOTIFICATIONS_DIR, "telegram_users.json")
PENDING_CODES_FILE = os.path.join(NOTIFICATIONS_DIR, "pending_codes.json")
BOT_LOG_FILE = os.path.join(NOTIFICATIONS_DIR, "bot.log")
# Unix socket for internal send API (in /run/notify-bot/, managed by systemd RuntimeDirectory)
SOCKET_PATH = "/run/notify-bot/bot.sock"
# Verification code settings
CODE_LENGTH = 6
CODE_TTL_SECONDS = 600 # 10 minutes
# Telegram polling
POLL_TIMEOUT_SECONDS = 30
POLL_ERROR_RETRY_SECONDS = 5
# Send API
MAX_MESSAGE_LENGTH = 4096
MAX_CAPTION_LENGTH = 1024
# Script execution (for /status run buttons)
SCRIPT_TIMEOUT_SECONDS = 60