B6 backend: probe notification engine — hub-faithful sweep (offline/recovery with flap discipline, traffic steps, expiry digest + auto-renewal, login), Telegram via the panel bot + webhook channel, notify settings/test/coverage API, login hook

This commit is contained in:
Muse
2026-10-22 23:50:07 +00:00
parent f646212df2
commit 031b422365
14 changed files with 2353 additions and 0 deletions
+13
View File
@@ -365,6 +365,19 @@ func (s *Server) startTask(restartXray bool, loc *time.Location) {
job.NewProbeHistoryJob().Run()
}()
// Probe notifications (item 7 B6): the connectivity/traffic sweep
// every 30s (the hub's cadence — an offline alert trails its
// grace period by at most one sweep), and the expiry
// housekeeping hourly on the hour so a date rolls within seconds
// of midnight, plus the same one-minute startup kick as above
// (the hub runs its housekeeping immediately at boot).
_, _ = s.cron.AddJob("@every 30s", job.NewProbeNotifyJob())
_, _ = s.cron.AddJob("@hourly", job.NewProbeNotifyHousekeepingJob())
go func() {
time.Sleep(time.Minute)
job.NewProbeNotifyHousekeepingJob().Run()
}()
// check client ips from log file every day
_, _ = s.cron.AddJob("@daily", job.NewClearLogsJob())
_, _ = s.cron.AddJob(cadenceXrayLogPrune, job.NewPruneXrayLogsJob())