feat: 1.3.0 thirteen new pages, charts, tooltips and error analysis
Release / Plan (reuse the published image?) (push) Successful in 3s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 28s
CI / Dependency audit (push) Successful in 20s
CI / Tests (Linux, race detector) (push) Successful in 1m10s
Release / ci (push) Successful in 1m10s
Release / Build image (arm64) (push) Successful in 55s
Release / Build image (amd64) (push) Successful in 1m16s
Release / Publish tags (push) Successful in 14s
Release / Gitea release (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 3s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 28s
CI / Dependency audit (push) Successful in 20s
CI / Tests (Linux, race detector) (push) Successful in 1m10s
Release / ci (push) Successful in 1m10s
Release / Build image (arm64) (push) Successful in 55s
Release / Build image (amd64) (push) Successful in 1m16s
Release / Publish tags (push) Successful in 14s
Release / Gitea release (push) Skipped
New pages grouped in the rail (Monitor, Investigate, Analyze, Operate, Reports): Services (SLO, Apdex, latency app vs proxy), Sessions (stage funnel), Campaigns, Event search, MITRE ATT&CK matrix, Evolution, Concentration (Pareto, Gini), Survival (Kaplan-Meier per attack episode, recidivists), Where errors come from (application vs failed attack vs proxy vs client), Protocols and TLS, Defense (fail2ban, SSH, blocklist), Integrity, and a printable executive report. Chart library (donut, radar, stacked area, bars, heatmap, gauge), glossary with accessible "?" tooltips, self-explanatory category names (nonexistent page 404), page loader through pages.json. Unique visitors fixed: real browsers opening a page, one per IP per day, deduplicated across domains, with non-human clients counted apart. Anonymous legitimate visits on the Live page (?visits=1, no IP). Traefik origin, service, protocol and TLS fields parsed. Paths and Referer paths drop e-mail and token segments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b7462c14fa
commit
2ebda1e4d7
79 files changed
+9091
-171
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
@@ -271,3 +272,34 @@ func TestPeerBlocklistOffUsesLocalOnly(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPeerStreamVisitsOnlyOnRequestAndNoIP(t *testing.T) {
|
||||
const ptok = "peer-secret-0123456789-abcdefghijklmnopqr"
|
||||
for _, q := range []string{"", "?visits=1"} {
|
||||
st := store.New(store.Config{Name: "edge", Version: "t"})
|
||||
st.SetEnricher(fakeGeo{})
|
||||
ts := httptest.NewServer(New(Options{Token: utok, PeerTokens: []string{ptok}, Version: "t", Store: st}))
|
||||
req, _ := http.NewRequest("GET", ts.URL+"/api/v1/peer/stream"+q, nil)
|
||||
req.Header.Set("Authorization", "Bearer "+ptok)
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil || resp.StatusCode != 200 {
|
||||
t.Fatal(err, resp)
|
||||
}
|
||||
go func() {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
st.Traffic(core.Event{Time: time.Now(), IP: "200.1.1.9", Cat: core.OK, Source: "traefik", Domain: "a.example", Method: "GET", Path: "/", Status: 200, UA: "Mozilla/5.0 x",
|
||||
E: core.Enrich{Device: "desktop"}})
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
resp.Body.Close()
|
||||
}()
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
got := strings.Contains(string(body), "event: visit")
|
||||
if got != (q != "") {
|
||||
t.Fatalf("query %q: visit event present=%v\n%s", q, got, body)
|
||||
}
|
||||
if strings.Contains(string(body), "200.1.1.9") || strings.Contains(string(body), `"ip"`) || strings.Contains(string(body), "Mozilla") {
|
||||
t.Fatalf("address in stream: %s", body)
|
||||
}
|
||||
ts.Close()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user