Files
digikedai-bot/.env.example
T

50 lines
2.5 KiB
Bash

# ===== Digi Kedai Bot — environment template =====
# Copy to .env and fill in real values. NEVER commit .env.
# All secrets live in the repo's SECRETS.md (private repo), not in source code.
# --- App ---
APP_ENV=development # development | production
LOG_LEVEL=info # trace|debug|info|warn|error
# --- Telegram ---
BOT_TOKEN= # from @BotFather
BOT_USERNAME=DigiKedaiBot # public @username, for docs/references
TELEGRAM_WEBHOOK_URL= # e.g. https://bot.example.com/<secret>/webhook
TELEGRAM_WEBHOOK_SECRET= # random token in the URL path, guards the endpoint
TELEGRAM_ALLOWED_USER_IDS= # comma-separated chat ids; empty = allow all (dev)
# --- WA Toolbox (WhatsApp) ---
WA_WEBHOOK_SECRET= # random token guarding POST /wa/<secret>; empty = endpoint DISABLED (no insecure fallback)
# --- Rate limiting (per user+channel; in-memory fixed window) ---
RATE_LIMIT_WINDOW_MS=60000 # fixed window length
RATE_LIMIT_MAX_PER_WINDOW=5 # max messages per window before throttling
RATE_LIMIT_MIN_INTERVAL_MS=3000 # cooldown floor between two messages
# --- LLM (via LiteLLM OpenAI-compatible gateway) ---
LLM_BASE_URL=http://litellm:4000/v1
LLM_API_KEY= # LiteLLM master key
LLM_MODEL=mem0-openai # LiteLLM alias for gpt-5-mini (openai primary + openrouter failover)
SUMMARY_MODEL= # optional cheaper alias for background memory summarization; empty = LLM_MODEL
SUMMARY_ENABLED=true # false disables user-memory + summarization entirely
# --- PostgreSQL (mem0-postgres container on the DSM mem0 stack) ---
POSTGRES_HOST=mem0-postgres
POSTGRES_PORT=5432
POSTGRES_USER=mem0
POSTGRES_PASSWORD=
POSTGRES_DB=mem0 # connection/bootstrap db; bot creates `bot` db on first start
BOT_DB_NAME=bot
# --- n8n (tool integration; internal network) ---
N8N_BASE_URL=http://n8n:5678
N8N_API_KEY=
N8N_ALLOWED_PATHS= # comma-separated allowlist of webhook workflow paths (Phase 2)
# --- NocoDB (AlistAccess base; free-account provisioning, Phase 2) ---
# Bot inserts Customers + CustomerProducts directly; W1/W2 webhooks provision AList.
NOCODB_BASE_URL=http://nocodb:10380
NOCODB_TOKEN= # XC token (see SECRETS.md §2)
NOCODB_BASE_ID= # NocoDB base id
TRIAL_DAYS_DEFAULT=14 # free-trial length when product has no trial_days