release: 1.6.0: 30-day send stats and optional auto level-2 rate limits
30-day sending statistics per domain and application, plus optional auto level-2 rate limits derived from average send rate. Added: - Domain page **Sending statistics** card: total messages, peak and average - Level-2 rate limit **Manual** / **Auto** mode on domain and application - Domain export JSON now includes rate limits (`mode`, `auto_multiplier`, Changed: - Auto mode uses the level-1 window (`RATE_LIMIT_WINDOW_SECONDS`); manual Full detail: CHANGELOG.md (1.6.0).
This commit is contained in:
@@ -202,14 +202,10 @@ func (s *Service) RateLimit(appID int64) (store.RateLimit, bool, error) {
|
||||
// SaveRateLimit stores the application-level trusted-IP override (guide § Rate
|
||||
// limiting). The caller has validated the IPs and numbers (security.md); the
|
||||
// milter reads the row live, so no reload is needed.
|
||||
func (s *Service) SaveRateLimit(appID int64, ips []string, maxMessages, windowSeconds int) error {
|
||||
return s.store.SetRateLimit(store.RateLimit{
|
||||
Scope: store.RateLimitScopeApp,
|
||||
RefID: appID,
|
||||
AllowedIPs: ips,
|
||||
MaxMessages: maxMessages,
|
||||
WindowSeconds: windowSeconds,
|
||||
})
|
||||
func (s *Service) SaveRateLimit(appID int64, rl store.RateLimit) error {
|
||||
rl.Scope = store.RateLimitScopeApp
|
||||
rl.RefID = appID
|
||||
return s.store.SetRateLimit(rl)
|
||||
}
|
||||
|
||||
// ClearRateLimit removes the application-level rate limit (guide § Rate
|
||||
|
||||
Reference in New Issue
Block a user