fix: host filter accepts all and comma lists; hub no longer drops traefik lines after a copytruncate rotation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19afd221e2
commit
7b90d9e40f
15 files changed
+329
-85
No files matched your search
@@ -96,16 +96,12 @@ func figuresOf(t store.Totals, tr store.TrafficData) reportFigures {
|
||||
// trafficOf is what /api/v1/traffic answers for all domains, merged with the peers.
|
||||
func (s *Server) trafficOf(r *http.Request, rg store.Range, host string) store.TrafficData {
|
||||
var parts []store.TrafficData
|
||||
self := s.opt.Store.Name()
|
||||
if host == "all" || host == self {
|
||||
sel, _ := s.parseHosts(host)
|
||||
if sel.local {
|
||||
parts = append(parts, s.opt.Store.TrafficFor(rg, "all"))
|
||||
}
|
||||
if s.opt.Hub != nil && host != self {
|
||||
only := ""
|
||||
if host != "all" {
|
||||
only = host
|
||||
}
|
||||
parts = append(parts, s.opt.Hub.TrafficFor(r.Context(), rg, "all", only)...)
|
||||
if s.opt.Hub != nil && (sel.all || len(sel.peers) > 0) {
|
||||
parts = append(parts, s.opt.Hub.TrafficFor(r.Context(), rg, "all", sel.only())...)
|
||||
}
|
||||
return store.MergeTraffic(host, parts)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user