Files
2026-04-23 22:06:19 +08:00

48 lines
2.2 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# https://my.telegram.org 申请
TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=你的api_hash
# 目标 Bot 的用户名(可带或不带 @)。多个用英文逗号分隔;POST /v1/forward 的 bot 须在此列表内(企微「开」→ AJL05_bot,「慢开」→ QingBaoJuXWsgkbot)
TELEGRAM_BOT_USERNAME=AJL05_bot,QingBaoJuXWsgkbot
# TELEGRAM_BOT_USERNAME=YourBotName
# Session 持久化(SQLite,一般只需 login_cli 一次)。默认:wx_python 根目录下 tg_bridge.session
# TELEGRAM_SESSION_PATH=D:/data/tg_bridge.session
# HTTP 监听
BRIDGE_HOST=0.0.0.0
BRIDGE_PORT=18080
# Windows + Telethon:若用手动 uvicorn,必须加(否则会 Proactor+121):
# --loop tg_bridge.uvicorn_loop:selector_loop_factory
# 可选;设置后 POST /v1/forward 必须带 Bearer 或 X-Bridge-Token
# BRIDGE_TOKEN=随机长字符串
# Telegram 连接代理(Clash / v2ray 本地 HTTP 或 SOCKS5,填一种即可;不设则直连)
# TELEGRAM_PROXY_TYPE=http
# TELEGRAM_PROXY_TYPE=socks5
# TELEGRAM_PROXY_HOST=127.0.0.1
# TELEGRAM_PROXY_PORT=7890
# TELEGRAM_PROXY_USER=
# TELEGRAM_PROXY_PASSWORD=
# SOCKS5 若仍超时,可显式关闭代理侧解析域名(默认 socks 已为 false,http 默认为 true)
# TELEGRAM_PROXY_RDNS=false
# Telethon 连接超时(秒),经代理建议 60~120
# TELEGRAM_CONNECT_TIMEOUT=90
# TELEGRAM_CONNECTION_RETRIES=5
# TELEGRAM_RETRY_DELAY=3
# 传输模式:遇 Windows WinError 121 可改为 tcp_obfuscated 或 tcp_intermediate
# TELEGRAM_CONNECTION=tcp_full
# TELEGRAM_CONNECTION=tcp_obfuscated
# /v1/forward 默认 wait_reply=true 时,等 Bot 回复的最长时间(秒)
# TELEGRAM_BOT_REPLY_TIMEOUT=120
# Bot 先发「查询中」再发结果时,可默认取第 2 条(请求里 reply_take_nth 可覆盖)
# BOT_REPLY_TAKE_NTH=2
# 业务日志中附带正文/回复预览的最大字符数(0 或未设置则只记录长度,避免日志含敏感全文)
# BRIDGE_LOG_PREVIEW_CHARS=120
# 文件日志目录(默认 wx_python/logs);当前写入 tg_bridge.log,每日午夜滚动为 tg_bridge.log.YYYY-MM-DD
# BRIDGE_LOG_DIR=D:/data/tg_bridge_logs
# 保留的滚动日志文件个数(默认 30)
# BRIDGE_LOG_BACKUP_COUNT=30
# tg_bridge 日志级别:DEBUG / INFO / WARNING …
# BRIDGE_LOG_LEVEL=INFO