mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-08 06:16:37 +08:00
feat(telegram): admin-toggleable Bot registration + remove duplicate 最近入库 on 运行状态
- Add telegram.registration_enabled setting (default off); admins toggle via Settings page or /registration on|off bot command. - Add /register (/reg /signup) bot command: when enabled, regular users can create a MediaStation account and auto-bind their Telegram. Reuses AuthService (username-taken / user-limit handling) and keeps new accounts as regular users. - Regular users still limited to bind / adult-toggle / start / help; all other commands remain admin-only. - Update /start and /help text to surface registration when enabled. - Remove the duplicate 最近入库 module from the 运行状态 (stats) page; the homepage already shows recently added. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -109,7 +109,6 @@ func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Cont
|
||||
backup := NewBackupService(cfg, log, repos.DB)
|
||||
notifier := NewNotifierService(log, repos)
|
||||
notifyChannels := NewNotifyChannelService(log, repos)
|
||||
telegramBot := NewTelegramBotService(log, repos, crypto)
|
||||
playProfiles := NewPlayProfileService(log, repos)
|
||||
permissions := NewPermissionService(log, repos)
|
||||
storageCfg := NewStorageConfigService(log, repos, crypto)
|
||||
@@ -120,6 +119,8 @@ func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Cont
|
||||
|
||||
// 初始化认证相关服务
|
||||
tokenSvc := NewTokenService(cfg, log, repos)
|
||||
authSvc := NewAuthService(cfg, log, repos, tokenSvc, permissions)
|
||||
telegramBot := NewTelegramBotService(log, repos, crypto, authSvc)
|
||||
apiConfigSvc := NewApiConfigService(cfg, log, repos, crypto)
|
||||
downloadMgr := NewDownloadManager(log, repos, crypto)
|
||||
notifySvc := NewNotifyService(log, repos, crypto)
|
||||
@@ -159,7 +160,7 @@ func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Cont
|
||||
Repo: repos,
|
||||
WSHub: hub,
|
||||
SSEHub: sseHub,
|
||||
Auth: NewAuthService(cfg, log, repos, tokenSvc, permissions),
|
||||
Auth: authSvc,
|
||||
Media: NewMediaService(cfg, log, repos),
|
||||
Scan: scanner,
|
||||
Stream: NewStreamService(cfg, log, repos, transcoder),
|
||||
|
||||
Reference in New Issue
Block a user