449 lines
20 KiB
Text
449 lines
20 KiB
Text
# Optional local config file for telesrv.
|
|
# Copy to .env for local development. Do not commit real tokens or passwords.
|
|
# Complete reference:
|
|
# docs/configuration.en.md
|
|
# docs/configuration.zh-CN.md
|
|
#
|
|
# This file has two parts:
|
|
# 1. Everyday settings (below) -- IPs, ports, passwords, login methods,
|
|
# SMTP, links, calls/streaming. These are the ones the server-panel.py
|
|
# TUI shows and lets you edit, grouped the same way as here.
|
|
# 2. "Advanced / internal tuning" (further down) -- queue sizes, cache
|
|
# limits, retention windows and similar performance knobs. Sensible
|
|
# defaults are already set; most self-hosters never need to touch this
|
|
# part, so it's left out of the panel to keep that screen readable.
|
|
|
|
## Server & Network -- Where the server listens and what address it tells clients to connect to.
|
|
|
|
# Address and port the server listens on for MTProto client connections.
|
|
TELESRV_LISTEN=0.0.0.0:2398
|
|
# Your server's public IP address.
|
|
TELESRV_ADVERTISE_IP=127.0.0.1
|
|
# Which "data center" number this server presents itself as. There's only
|
|
# ever one physical server, so this normally stays 2 -- no need to change it.
|
|
TELESRV_DC=2
|
|
|
|
## Phone Login Codes -- How a login code gets to a phone number when someone signs in.
|
|
|
|
# development: every phone number accepts the same fixed code below (fine
|
|
# for local testing, or when only email/Telegram sign-in is used). webhook:
|
|
# sends a real random code to TELESRV_OTP_WEBHOOK_URL for actual delivery.
|
|
TELESRV_PHONE_CODE_DELIVERY_PROVIDER=development
|
|
# The fixed code accepted for every phone number when the provider above is
|
|
# "development". Change this if you keep phone login open in that mode.
|
|
TELESRV_DEV_AUTH_CODE=12345
|
|
# How many digits a real (webhook-delivered) login code has.
|
|
TELESRV_PHONE_CODE_LENGTH=5
|
|
# How long a login code stays valid after being sent.
|
|
TELESRV_AUTH_CODE_TTL=5m
|
|
# How many wrong guesses are allowed before a code is rejected outright.
|
|
TELESRV_AUTH_CODE_MAX_ATTEMPTS=5
|
|
# Where webhook-delivered codes are POSTed, and the shared secret used to
|
|
# sign that request (see docs/otp-delivery.md for the exact payload).
|
|
TELESRV_OTP_WEBHOOK_URL=
|
|
TELESRV_OTP_WEBHOOK_SECRET=
|
|
TELESRV_OTP_WEBHOOK_TIMEOUT=5s
|
|
|
|
## Email Login & Signup -- Signing in (or registering) with an email address instead of a phone number.
|
|
|
|
# Lets an existing phone-number account also add an email address for login
|
|
# codes. REQUIRE_SETUP forces every account without one to set it up.
|
|
TELESRV_LOGIN_EMAIL_ENABLE=false
|
|
TELESRV_LOGIN_EMAIL_REQUIRE_SETUP=false
|
|
# How many digits an email login code has.
|
|
TELESRV_LOGIN_EMAIL_CODE_LENGTH=6
|
|
# How an email login code is actually delivered: smtp (send it yourself,
|
|
# see the SMTP section below) or webhook (reuses the phone webhook above).
|
|
TELESRV_EMAIL_CODE_DELIVERY_PROVIDER=smtp
|
|
# Lets people register and log in with just an email address, no phone
|
|
# number at all. Uses the same SMTP/webhook delivery as email login above.
|
|
TELESRV_EMAIL_SIGNUP_ENABLE=false
|
|
# Comma-separated phone-number prefixes randomly assigned as the visible
|
|
# "phone number" for email-signup accounts, e.g. "888,380,373". Purely
|
|
# cosmetic -- doesn't need a client update to change.
|
|
TELESRV_EMAIL_SIGNUP_PHONE_PREFIXES=888
|
|
|
|
## SMTP (Outgoing Email) -- The mail server used to send login/signup codes by email.
|
|
|
|
TELESRV_SMTP_HOST=
|
|
TELESRV_SMTP_PORT=587
|
|
TELESRV_SMTP_USERNAME=
|
|
TELESRV_SMTP_PASSWORD=
|
|
# Sender address and display name shown on outgoing emails.
|
|
TELESRV_SMTP_FROM=
|
|
TELESRV_SMTP_FROM_NAME=OwpenGram
|
|
# Encryption mode: starttls, tls, or none (use "none" for a local test
|
|
# server like Mailpit that doesn't support encryption at all).
|
|
TELESRV_SMTP_TLS=starttls
|
|
TELESRV_SMTP_TIMEOUT=10s
|
|
|
|
## Public Links & Branding -- What clients show/open for links, and your product's name.
|
|
|
|
# Public web address for links this server generates (invite links, sticker
|
|
# packs, etc). Use your real domain once you have one, e.g. https://example.com.
|
|
TELESRV_PUBLIC_BASE_URL=http://127.0.0.1
|
|
# Custom URL scheme (like "owpg://") that public pages use to open your
|
|
# patched client. Must match what your client builds were compiled with.
|
|
TELESRV_PUBLIC_APP_SCHEME=owpg
|
|
# Optional: use "scheme://yourdomain.com/..." links instead of plain
|
|
# "scheme://...". Leave empty unless you specifically need this.
|
|
TELESRV_PUBLIC_APP_LINK_BASE=
|
|
# Address of your web client (if you have one) and the product name shown
|
|
# on public landing pages.
|
|
TELESRV_PUBLIC_WEB_BASE_URL=https://web.telesrv.net
|
|
TELESRV_PUBLIC_APP_NAME=OwpenGram
|
|
# Where the "Download" button on public pages links to.
|
|
TELESRV_PUBLIC_DOWNLOAD_URL=https://owpengram.org
|
|
# Warning text shown on a profile/channel the admin panel flagged as
|
|
# scam/fake. Leave empty to use the built-in English text.
|
|
TELESRV_SCAM_WARNING=
|
|
TELESRV_FAKE_WARNING=
|
|
|
|
## Admin Panel -- Login and access for the web-based admin dashboard.
|
|
|
|
# Secret token shared between the main server and the admin panel process --
|
|
# both must use the exact same value, or the admin panel can't save changes.
|
|
TELESRV_ADMIN_API_TOKEN=
|
|
# Password to log into the admin panel (or use a token below instead; set
|
|
# at least one of the two).
|
|
TELESRV_ADMIN_UI_PASSWORD=
|
|
TELESRV_ADMIN_UI_TOKEN=
|
|
# Encrypts the admin panel's login session cookie. Use a random string of
|
|
# at least 32 characters; changing it logs everyone out.
|
|
TELESRV_ADMIN_SESSION_KEY=
|
|
# Address the main server exposes its admin API on. Leave empty to disable
|
|
# the admin panel entirely; set to a loopback address (127.0.0.1:...) to
|
|
# enable it without exposing it outside this machine.
|
|
TELESRV_ADMIN_API_ADDR=
|
|
# Address the admin panel's own web UI listens on.
|
|
TELESRV_ADMIN_UI_ADDR=127.0.0.1:2600
|
|
|
|
## Bot API Gateway -- Optional HTTP gateway for bot libraries (e.g. python-telegram-bot).
|
|
|
|
# Leave empty to disable. Set to an address like 127.0.0.1:2500 to enable.
|
|
TELESRV_BOT_API_ADDR=
|
|
|
|
## Database -- Where the server stores its data.
|
|
|
|
TELESRV_POSTGRES_DSN=postgres://owpengram:owpengram@127.0.0.1:5432/owpengram?sslmode=disable
|
|
TELESRV_REDIS_ADDR=127.0.0.1:6399
|
|
TELESRV_REDIS_PASSWORD=
|
|
TELESRV_REDIS_DB=0
|
|
|
|
## Public Web Listener -- Serves public profile pages, avatars, and sticker/emoji pack previews.
|
|
|
|
# Host:port this listens on (not a URL). Let nginx (or similar) proxy
|
|
# public traffic to it rather than exposing this port directly.
|
|
TELESRV_PUBLIC_LINK_WEB_ADDR=0.0.0.0:2401
|
|
|
|
## Telegram Login (OpenID Connect) -- Self-hosted "Log in with Telegram" for third-party sites.
|
|
|
|
# Keep disabled until you've generated the required key files with:
|
|
# go run ./cmd/telegramloginkeygen -mode init
|
|
TELESRV_TELEGRAM_LOGIN_ENABLE=false
|
|
# The public HTTPS origin this login provider identifies itself as.
|
|
TELESRV_TELEGRAM_LOGIN_ISSUER=https://telesrv.net
|
|
# Allow plain HTTP instead of HTTPS (only for local testing).
|
|
TELESRV_TELEGRAM_LOGIN_ALLOW_HTTP=false
|
|
|
|
## Passkey Login (WebAuthn) -- Signing in with a device passkey/fingerprint instead of a code.
|
|
|
|
# Must match the real public domain you serve this from, or passkey login
|
|
# will fail (browsers check this against their own address bar).
|
|
TELESRV_PASSKEY_RP_ID=telesrv.net
|
|
|
|
## Calls -- Voice/video calls (1-to-1 and group), and the relay servers they need to work across networks.
|
|
|
|
# Turns off the TURN relay for 1-to-1 calls (falls back to direct
|
|
# connections only, which fail across most home/mobile networks).
|
|
TELESRV_TURN_ENABLE=true
|
|
# Port the built-in TURN/STUN relay listens on. Must be open in your firewall.
|
|
TELESRV_TURN_UDP_PORT=12400
|
|
# Public IP the relay tells clients to connect to. Leave empty to reuse
|
|
# TELESRV_ADVERTISE_IP above.
|
|
TELESRV_TURN_ADVERTISE_IP=
|
|
# Secret used to sign relay credentials. Leave empty for a random one
|
|
# generated at startup (fine for a single server instance).
|
|
TELESRV_TURN_SECRET=
|
|
# Port range the relay hands out for active call media. Must be open in
|
|
# your firewall.
|
|
TELESRV_TURN_RELAY_MIN_PORT=12500
|
|
TELESRV_TURN_RELAY_MAX_PORT=12999
|
|
# Turns off the group-call media server (SFU) -- group calls become
|
|
# signaling-only, with no actual audio/video.
|
|
TELESRV_SFU_ENABLE=true
|
|
# Single UDP port the group-call media server listens on. Must be open in
|
|
# your firewall.
|
|
TELESRV_SFU_UDP_PORT=12399
|
|
# Public IP the group-call media server tells clients to connect to. Leave
|
|
# empty to reuse TELESRV_ADVERTISE_IP above. Warning: setting this to
|
|
# 127.0.0.1 silently breaks calls from real devices.
|
|
TELESRV_SFU_ADVERTISE_IP=
|
|
# Maximum number of people allowed in one group call.
|
|
TELESRV_GROUPCALL_MAX_PARTICIPANTS=32
|
|
|
|
## Live Streaming -- Broadcasting live video into a channel (RTMP ingest, e.g. from OBS).
|
|
|
|
TELESRV_LIVESTREAM_ENABLE=true
|
|
# TCP address the RTMP ingest listens on for incoming streams.
|
|
TELESRV_LIVESTREAM_RTMP_ADDR=:2400
|
|
# Path to the ffmpeg executable used to process incoming streams. Leave as
|
|
# "ffmpeg" if it's already on your system PATH.
|
|
TELESRV_LIVESTREAM_FFMPEG_PATH=ffmpeg
|
|
|
|
## Maps -- Optional map previews (e.g. for shared locations) in patched clients.
|
|
|
|
# Mapbox access token. Leave empty to disable map previews.
|
|
TELESRV_MAPBOX_TOKEN=
|
|
|
|
## AI Features -- Optional AI-assisted message composing, business auto-replies, and translation.
|
|
|
|
# Master switch for the "improve my message" AI button in patched clients.
|
|
TELESRV_AI_ENABLED=true
|
|
# Auto-reply generator for Business accounts: "echo" just echoes the
|
|
# message back (safe default to verify the feature works end-to-end).
|
|
TELESRV_BUSINESS_AI_PROVIDER=echo
|
|
# Master switch for in-app message/chat translation.
|
|
TELESRV_TRANSLATION_ENABLED=true
|
|
|
|
|
|
# ==============================================================================
|
|
# Advanced / internal tuning
|
|
#
|
|
# Everything below this line is NOT shown in the server-panel.py TUI. These
|
|
# are performance/capacity knobs (queue sizes, cache limits, retention
|
|
# windows, economy tuning, etc.) with defaults that work fine for a single
|
|
# self-hosted server. Edit them here directly if you actually need to.
|
|
# ==============================================================================
|
|
|
|
# RSA key: server identity used in the MTProto key exchange. Auto-generated
|
|
# on first run if the file doesn't exist yet.
|
|
TELESRV_RSA_KEY=data/server_rsa.pem
|
|
# Enforces exact DC-ID matching during key exchange. Leave off (default):
|
|
# this server is always a single physical backend, but client forks
|
|
# intentionally send DC IDs 1..5 for it, which is expected, not an attack.
|
|
TELESRV_STRICT_DC_CHECK=false
|
|
# Enables MTProto-over-WebSocket on the same port (for web-based clients),
|
|
# and which browser page origins are allowed to open that connection.
|
|
TELESRV_WEBSOCKET_ENABLE=true
|
|
TELESRV_WEBSOCKET_ALLOWED_ORIGINS=http://localhost:1234,http://127.0.0.1:1234
|
|
# pprof debug/profiling endpoint (CPU/heap/goroutine snapshots). Keep this
|
|
# on loopback; use an SSH tunnel to reach it remotely. Empty disables it.
|
|
TELESRV_DEBUG_ADDR=127.0.0.1:6060
|
|
|
|
# MTProto admission and shared inbound RPC budgets. Negative connection/handshake limits disable
|
|
# that gate; non-positive RPC values fall back to the built-in safe defaults.
|
|
TELESRV_MTPROTO_MAX_CONNECTIONS=200000
|
|
TELESRV_MTPROTO_MAX_CONNECTIONS_PER_IP=4096
|
|
TELESRV_MTPROTO_MAX_CONCURRENT_HANDSHAKES=256
|
|
TELESRV_MTPROTO_RPC_MAX_INFLIGHT=32
|
|
TELESRV_MTPROTO_RPC_QUEUE_SIZE=64
|
|
TELESRV_MTPROTO_RPC_TIMEOUT=30s
|
|
TELESRV_MTPROTO_RPC_GLOBAL_WORKERS=256
|
|
TELESRV_MTPROTO_RPC_GLOBAL_MAX_TASKS=8192
|
|
TELESRV_MTPROTO_RPC_GLOBAL_MAX_BYTES=536870912
|
|
# In-memory cache of recent RPC results, used to safely retry a request the
|
|
# client resends. Keep the limits ordered global >= auth >= session.
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_MAX_ENTRIES=262144
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_MAX_BYTES=67108864
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_AUTH_MAX_ENTRIES=32768
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_AUTH_MAX_BYTES=33554432
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_SESSION_MAX_ENTRIES=16384
|
|
TELESRV_MTPROTO_RPC_RESULT_CACHE_SESSION_MAX_BYTES=16777216
|
|
TELESRV_MTPROTO_RPC_RESULT_PENDING_PER_AUTH=2048
|
|
# Process-wide in-flight transport wire + decrypted plaintext reservation.
|
|
TELESRV_MTPROTO_INBOUND_FRAME_GLOBAL_MAX_BYTES=536870912
|
|
# Per-connection outbound mailboxes (normal/control) and process-wide resend pending bodies.
|
|
TELESRV_MTPROTO_OUTBOUND_QUEUE_SIZE=128
|
|
TELESRV_MTPROTO_OUTBOUND_CONTROL_QUEUE_SIZE=32
|
|
TELESRV_MTPROTO_OUTBOUND_TRACKED_GLOBAL_MAX_BYTES=536870912
|
|
# Concurrent encrypted wire/codec/obfuscation scratch (shared bounded pool, not per connection).
|
|
TELESRV_MTPROTO_OUTBOUND_WRITE_GLOBAL_MAX_BYTES=536870912
|
|
|
|
# Unauthenticated login-code issuance rate limits, by phone number digest and by connection.
|
|
TELESRV_AUTH_CODE_PHONE_RATE_LIMIT=5
|
|
TELESRV_AUTH_CODE_AUTH_KEY_RATE_LIMIT=20
|
|
TELESRV_AUTH_CODE_RATE_WINDOW=10m
|
|
|
|
# Postgres connection pool sizing.
|
|
TELESRV_POSTGRES_MAX_CONNS=50
|
|
TELESRV_POSTGRES_MIN_CONNS=16
|
|
|
|
# Cache linking each temporary encryption key to the permanent account key it
|
|
# belongs to (part of Perfect Forward Secrecy). Entries are removed as soon
|
|
# as a key is revoked or replaced, so this is just a performance cache.
|
|
TELESRV_TEMP_KEY_CACHE_MAX_ENTRIES=262144
|
|
TELESRV_TEMP_KEY_CACHE_TTL=30m
|
|
|
|
# In-memory read caches for channel rows/members/dialogs/boosts, kept fresh
|
|
# by database change notifications. Lower values use less RAM.
|
|
TELESRV_CHANNEL_ROW_CACHE_MAX=50000
|
|
TELESRV_CHANNEL_MEMBER_CACHE_MAX=100000
|
|
TELESRV_CHANNEL_DIALOG_CACHE_MAX=100000
|
|
TELESRV_CHANNEL_BOOST_CACHE_MAX=100000
|
|
TELESRV_CHANNEL_BOOST_CACHE_TTL=10s
|
|
|
|
# Background delivery workers that push new-message/update notifications to clients.
|
|
TELESRV_OUTBOX_WORKERS=4
|
|
TELESRV_OUTBOX_BATCH=100
|
|
TELESRV_OUTBOX_INTERVAL=200ms
|
|
TELESRV_OUTBOX_LEASE_TIMEOUT=30s
|
|
# Terminal failed outbox heads are kept briefly for diagnosis, then only the online
|
|
# delivery task is removed. The durable update remains available to getDifference.
|
|
TELESRV_OUTBOX_POISON_RETENTION=1m
|
|
TELESRV_OUTBOX_POISON_CLEANUP_INTERVAL=15s
|
|
TELESRV_OUTBOUND_PUSH_TIMEOUT=200ms
|
|
# How many messages an account may send per rate-limit window; <=0 disables this limit.
|
|
TELESRV_SEND_RATE_LIMIT=30
|
|
TELESRV_SEND_RATE_WINDOW=1m
|
|
# Rate limit for "catch up on missed updates" requests; <=0 disables it.
|
|
TELESRV_CATCHUP_RATE_LIMIT=0
|
|
TELESRV_CATCHUP_RATE_WINDOW=1m
|
|
# Cap on how many members get individually notified when a large channel changes; <=0 uses the built-in default.
|
|
TELESRV_CHANNEL_NUDGE_MAX_TARGETS=0
|
|
|
|
# Bounded retention/GC. User/channel update rows are only pruned behind protocol-safe floors.
|
|
TELESRV_UPDATE_EVENT_RETENTION=168h
|
|
TELESRV_BOT_API_UPDATE_RETENTION=24h
|
|
TELESRV_ORPHAN_AUTH_KEY_RETENTION=24h
|
|
TELESRV_RETENTION_INTERVAL=1h
|
|
TELESRV_RETENTION_BATCH=10000
|
|
# Cleanup of abandoned (never-finished) file upload fragments.
|
|
TELESRV_UPLOAD_PART_TTL=24h
|
|
TELESRV_UPLOAD_PART_GC_INTERVAL=30m
|
|
TELESRV_UPLOAD_PART_GC_BATCH=10000
|
|
TELESRV_UPLOAD_INFLIGHT_MAX_BYTES=4194304000
|
|
TELESRV_UPLOAD_INFLIGHT_MAX_PARTS=8000
|
|
TELESRV_UPLOAD_INFLIGHT_MAX_FILES=64
|
|
|
|
# Server-side fetching of external media links and link-preview cards (SSRF-safe fetch + size/rate limits).
|
|
TELESRV_EXTERNAL_MEDIA_ENABLE=true
|
|
TELESRV_EXTERNAL_MEDIA_MAX_BYTES=10485760
|
|
TELESRV_EXTERNAL_MEDIA_RATE_PER_MIN=60
|
|
TELESRV_WEBPAGE_PREVIEW_ENABLE=true
|
|
TELESRV_WEBPAGE_PREVIEW_MAX_BYTES=5242880
|
|
TELESRV_WEBPAGE_PREVIEW_RATE_PER_MIN=300
|
|
|
|
# Map tile disk cache location (paired with TELESRV_MAPBOX_TOKEN above).
|
|
TELESRV_MAPTILE_CACHE_DIR=data/maptiles
|
|
|
|
# Data directories the server seeds/serves media and content from.
|
|
TELESRV_LANGPACK_SEED_DIR=data/langpack
|
|
TELESRV_OFFICIAL_GIFTS_DIR=data/official-gifts
|
|
TELESRV_BLOB_DIR=data/blobs
|
|
TELESRV_STICKER_SEED_DIR=data/sticker-seed
|
|
# Caps how many built-in sticker sets get imported on startup; <=0 means no limit.
|
|
TELESRV_STICKER_SEED_MAX_SETS=300
|
|
# Sticker set auto-installed for every newly registered account; <=0 disables this.
|
|
TELESRV_DEFAULT_STICKER_SET_ID=0
|
|
|
|
# New-account perks: free Telegram Premium months and starting Stars balance.
|
|
TELESRV_PREMIUM_GRANT_MONTHS=3
|
|
TELESRV_STARS_STARTING_GRANT=1000
|
|
TELESRV_PREMIUM_SWEEP_INTERVAL=1m
|
|
TELESRV_PREMIUM_SWEEP_BATCH=500
|
|
|
|
# Origins allowed for WebAuthn/passkey requests; empty means any origin is accepted
|
|
# (the server usually can't predict a mobile app's origin ahead of time).
|
|
TELESRV_PASSKEY_ALLOWED_ORIGINS=
|
|
|
|
# Star Gifts: unique collectible gifts, transfer/resale, crafting/upgrades, auctions. TON
|
|
# values are a purely local ledger inside the server -- no real wallet, Fragment, or
|
|
# blockchain is ever contacted.
|
|
TELESRV_STARGIFT_SWEEP_INTERVAL=15s
|
|
TELESRV_STARGIFT_SWEEP_BATCH=1000
|
|
# Internal nanoton granted once per user on first local-ledger access.
|
|
TELESRV_STARGIFT_TON_STARTING_GRANT=10000000000
|
|
TELESRV_STARGIFT_TRANSFER_STARS=25
|
|
TELESRV_STARGIFT_DROP_DETAILS_STARS=25
|
|
TELESRV_STARGIFT_OFFER_MIN_STARS=1
|
|
TELESRV_STARGIFT_STARS_PROCEEDS_PERMILLE=1000
|
|
TELESRV_STARGIFT_TON_PROCEEDS_PERMILLE=1000
|
|
TELESRV_STARGIFT_EXPORT_DELAY=0s
|
|
TELESRV_STARGIFT_TRANSFER_DELAY=0s
|
|
TELESRV_STARGIFT_RESELL_DELAY=0s
|
|
TELESRV_STARGIFT_CRAFT_DELAY=0s
|
|
TELESRV_STARGIFT_CRAFT_CHANCE_PERMILLE=250
|
|
|
|
# 1-to-1 call timing/limits.
|
|
TELESRV_CALL_RING_TIMEOUT=90s
|
|
TELESRV_CALL_TOMBSTONE_TTL=60s
|
|
TELESRV_CALL_MAX_ACTIVE_PER_USER=4
|
|
TELESRV_CALL_SIGNALING_MAX_BYTES=65536
|
|
TELESRV_CALL_SIGNALING_RATE=50
|
|
TELESRV_CALL_EXPIRY_INTERVAL=1s
|
|
TELESRV_CALL_TURN_CREDENTIAL_TTL=6h
|
|
# Forces calls through the TURN relay even when a direct connection would work (debugging only).
|
|
TELESRV_CALL_FORCE_RELAY=false
|
|
|
|
# Group call housekeeping (participant liveness checks, stale-entry cleanup).
|
|
TELESRV_GROUPCALL_CHECK_TTL=45s
|
|
TELESRV_GROUPCALL_SWEEP_INTERVAL=10s
|
|
|
|
# Extra live-streaming options: where the "connect OBS here" URL points (auto-derived if
|
|
# empty), the working directory for stream segments, and how many seconds of each stream
|
|
# are kept in memory.
|
|
TELESRV_LIVESTREAM_RTMP_URL=
|
|
TELESRV_LIVESTREAM_WORK_DIR=
|
|
TELESRV_LIVESTREAM_SEGMENT_KEEP=32
|
|
|
|
# Telegram Login (OpenID Connect) advanced settings: local key files (generate with
|
|
# `go run ./cmd/telegramloginkeygen -mode init`), token lifetimes, and cleanup.
|
|
TELESRV_TELEGRAM_LOGIN_SIGNING_KEYS_FILE=data/telegram-login/signing-keys.json
|
|
TELESRV_TELEGRAM_LOGIN_CODE_KEYS_FILE=data/telegram-login/code-keys.json
|
|
TELESRV_TELEGRAM_LOGIN_SECRET_PEPPER_FILE=data/telegram-login/client-secret-pepper
|
|
TELESRV_TELEGRAM_LOGIN_REQUEST_TTL=5m
|
|
TELESRV_TELEGRAM_LOGIN_CODE_TTL=2m
|
|
TELESRV_TELEGRAM_LOGIN_ID_TOKEN_TTL=1h
|
|
# Trust only the loopback nginx hop in the documented single-host deployment.
|
|
TELESRV_TELEGRAM_LOGIN_TRUSTED_PROXY_CIDRS=127.0.0.1/32,::1/128
|
|
TELESRV_TELEGRAM_LOGIN_RETENTION=168h
|
|
TELESRV_TELEGRAM_LOGIN_SWEEP_INTERVAL=5m
|
|
TELESRV_TELEGRAM_LOGIN_SWEEP_BATCH=500
|
|
|
|
# AI compose provider chain (tried in order; "local" is deterministic and never leaves
|
|
# the server) and its limits.
|
|
TELESRV_AI_PROVIDERS=local
|
|
TELESRV_AI_TIMEOUT=15s
|
|
TELESRV_AI_RATE_LIMIT=20
|
|
TELESRV_AI_RATE_WINDOW=1m
|
|
# When false (default), logs only length/provider/status for AI calls -- never the
|
|
# user's actual input or generated text.
|
|
TELESRV_AI_LOG_CONTENT=false
|
|
|
|
# Chat/message translation reuses the remote providers declared above. The
|
|
# deterministic "local" AI provider is excluded because it cannot translate.
|
|
# Leave TRANSLATION_PROVIDERS empty to use all configured remote AI providers,
|
|
# or provide a comma-separated subset such as "openai,gemini".
|
|
TELESRV_TRANSLATION_PROVIDERS=
|
|
TELESRV_TRANSLATION_TIMEOUT=15s
|
|
# Counts translated text items, not RPC envelopes (one RPC may contain 20).
|
|
TELESRV_TRANSLATION_RATE_LIMIT=60
|
|
TELESRV_TRANSLATION_RATE_WINDOW=1m
|
|
|
|
# External AI providers are optional. Keep API keys in TELESRV_* variables here;
|
|
# the loader rejects non-TELESRV keys from .env files by design.
|
|
# TELESRV_AI_OPENAI_KIND=openai_responses
|
|
# TELESRV_AI_OPENAI_API_KEY=
|
|
# TELESRV_AI_OPENAI_MODEL=
|
|
# TELESRV_AI_OPENAI_BASE_URL=
|
|
# TELESRV_AI_OPENAI_MAX_OUTPUT_TOKENS=1024
|
|
# TELESRV_AI_OPENAI_TEMPERATURE=0.2
|
|
# TELESRV_AI_OPENAI_OMIT_TEMPERATURE=false
|
|
# TELESRV_AI_OPENAI_THINKING=
|
|
# TELESRV_AI_GEMINI_KIND=gemini
|
|
# TELESRV_AI_GEMINI_API_KEY=
|
|
# TELESRV_AI_GEMINI_MODEL=
|
|
# TELESRV_AI_GEMINI_TEMPERATURE=0.2
|
|
# TELESRV_AI_ANTHROPIC_KIND=anthropic
|
|
# TELESRV_AI_ANTHROPIC_API_KEY=
|
|
# TELESRV_AI_ANTHROPIC_MODEL=
|
|
|
|
# Kimi/Moonshot can be used as an OpenAI-compatible Chat Completions provider.
|
|
# TELESRV_AI_PROVIDERS=kimi,local
|
|
# TELESRV_AI_KIMI_KIND=openai_chat
|
|
# TELESRV_AI_KIMI_API_KEY=
|
|
# TELESRV_AI_KIMI_BASE_URL=https://api.moonshot.cn/v1
|
|
# TELESRV_AI_KIMI_MODEL=kimi-k2.6
|
|
# TELESRV_AI_KIMI_THINKING=disabled
|
|
# TELESRV_AI_KIMI_TEMPERATURE=0.6
|