Per user decision 2026-10-21 (reverses the 2026-10-20 drop-Telegram call): port the upstream 3x-ui v3.7.0-generation Telegram bot wholesale instead of rewriting a minimal set, adapted to this fork. - new internal/web/service/tgbot package (telego): bot lifecycle, commands, reports, callback router, send helpers; token validation via telego; custom API server URL passes the fork's SSRF sanitizer (loopback/private bases fall back to the default endpoint, logged) - settings: full upstream key set (tgBotEnable/Token/Proxy/APIServer/ ChatId, tgRunTime, tgBotBackup, tgCpu/tgMemory, tgLang, tgEnabledEvents) with getters/setters; settings page gains a Telegram tab + sidebar entry; token shown masked, clearTgBotToken honored - wiring (web.go): stats-notify cron registered from tgRunTime when the bot is enabled; CheckHashStorage job; CPU/memory alarm jobs gated on tgEnabledEvents + thresholds; login notifications via event bus; POST /panel/api/setting/testTgBot and /panel/api/backuptotgbot - lite adaptation: StatsNotifyJob no longer gates on a local Xray core (this panel never runs one) so the periodic report and the scheduled DB backup (sendDocument) can actually fire - translations: upstream TG keys restored across all locales End-to-end smoke (real binary + fake Telegram API over HTTPS at a public-looking address, browser form wire format): bot starts on settings change (getMe), testTgBot delivers, panel restart re-arms the bot, tgRunTime='@every 1m' cron really fires sendDocument carrying the panel SQLite DB (magic verified) plus the report sendMessage, login notification delivered, dead-endpoint failure is logged not silent. 13/13 PASS — see P9-REPORT.md.
92 lines
3.8 KiB
AMPL
92 lines
3.8 KiB
AMPL
module github.com/mhsanaei/3x-ui/v3
|
|
|
|
go 1.27.0
|
|
|
|
require (
|
|
github.com/amnezia-vpn/amneziawg-go/v3 v3.1.20260814
|
|
github.com/gin-contrib/gzip v1.2.6
|
|
github.com/gin-contrib/sessions v1.1.0
|
|
github.com/gin-gonic/gin v1.12.0
|
|
github.com/go-playground/validator/v10 v10.30.3
|
|
github.com/goccy/go-json v0.10.6
|
|
github.com/goccy/go-yaml v1.19.2
|
|
github.com/google/uuid v1.6.0
|
|
github.com/gorilla/websocket v1.5.3
|
|
github.com/joho/godotenv v1.5.1
|
|
github.com/klauspost/compress v1.19.2
|
|
github.com/mattn/go-sqlite3 v1.14.50
|
|
github.com/mymmrac/telego v1.11.2
|
|
github.com/nicksnyder/go-i18n/v2 v2.6.1
|
|
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
|
github.com/refraction-networking/utls v1.8.3-0.20260301010127-aa6edf4b11af
|
|
github.com/robfig/cron/v3 v3.0.1
|
|
github.com/shirou/gopsutil/v4 v4.26.7
|
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
|
github.com/valyala/fasthttp v1.73.0
|
|
go.uber.org/atomic v1.11.0
|
|
golang.org/x/crypto v0.55.0
|
|
golang.org/x/net v0.58.0
|
|
golang.org/x/sys v0.47.0
|
|
golang.org/x/text v0.41.0
|
|
google.golang.org/grpc v1.83.1
|
|
google.golang.org/protobuf v1.36.12
|
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
|
gorm.io/driver/postgres v1.6.2
|
|
gorm.io/driver/sqlite v1.6.0
|
|
gorm.io/gorm v1.31.2
|
|
gvisor.dev/gvisor v0.0.0-20260122175437-89a5d21be8f0
|
|
pgregory.net/rapid v1.3.0
|
|
)
|
|
|
|
require (
|
|
github.com/andybalholm/brotli v1.2.2 // indirect
|
|
github.com/bytedance/gopkg v0.1.4 // indirect
|
|
github.com/bytedance/sonic v1.15.2 // indirect
|
|
github.com/bytedance/sonic/loader v0.5.2 // indirect
|
|
github.com/cloudwego/base64x v0.1.7 // indirect
|
|
github.com/ebitengine/purego v0.10.2 // indirect
|
|
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
|
|
github.com/gin-contrib/sse v1.1.1 // indirect
|
|
github.com/go-ole/go-ole v1.3.0 // indirect
|
|
github.com/go-playground/locales v0.14.1 // indirect
|
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
|
github.com/google/btree v1.1.3 // indirect
|
|
github.com/gorilla/context v1.1.2 // indirect
|
|
github.com/gorilla/securecookie v1.1.2 // indirect
|
|
github.com/gorilla/sessions v1.4.0 // indirect
|
|
github.com/grbit/go-json v0.11.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
github.com/jackc/pgx/v5 v5.10.0 // indirect
|
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
|
github.com/jinzhu/now v1.1.5 // indirect
|
|
github.com/json-iterator/go v1.1.12 // indirect
|
|
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
|
|
github.com/leodido/go-urn v1.5.0 // indirect
|
|
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect
|
|
github.com/mattn/go-isatty v0.0.24 // indirect
|
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
|
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
|
|
github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect
|
|
github.com/quic-go/qpack v0.6.0 // indirect
|
|
github.com/quic-go/quic-go v0.61.0 // indirect
|
|
github.com/stretchr/testify v1.12.1 // indirect
|
|
github.com/tklauser/go-sysconf v0.4.0 // indirect
|
|
github.com/tklauser/numcpus v0.12.0 // indirect
|
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
|
github.com/ugorji/go/codec v1.3.2 // indirect
|
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
|
github.com/valyala/fastjson v1.6.10 // indirect
|
|
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
|
go.mongodb.org/mongo-driver/v2 v2.8.0 // indirect
|
|
go.yaml.in/yaml/v3 v3.0.5 // indirect
|
|
golang.org/x/arch v0.30.0 // indirect
|
|
golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect
|
|
golang.org/x/sync v0.22.0 // indirect
|
|
golang.org/x/time v0.15.0 // indirect
|
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect
|
|
)
|