docs: screenshots of every page, egress and enforce demo data
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 14s
Release / Gitea release (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 14s
Release / Gitea release (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c33cca22e3
commit
5d3374ee11
81 files changed
+271
-14
No files matched your search
@@ -205,10 +205,36 @@ type traefik struct {
|
||||
Referer string `json:"request_Referer,omitempty"`
|
||||
Duration int64 `json:"Duration"`
|
||||
Size int64 `json:"DownstreamContentSize"`
|
||||
Proto string `json:"RequestProtocol,omitempty"`
|
||||
Scheme string `json:"RequestScheme,omitempty"`
|
||||
TLSVer string `json:"TLSVersion,omitempty"`
|
||||
TLSCipher string `json:"TLSCipher,omitempty"`
|
||||
}
|
||||
|
||||
// protoOf varia o protocolo conforme o cliente: navegadores em HTTP/2 e HTTP/3,
|
||||
// ferramentas e scanners em HTTP/1.1 (TLS 1.2) e alguns em HTTP/1.0 sem TLS.
|
||||
func protoOf(ip netip.Addr, ua string) (proto, scheme, ver, cipher string) {
|
||||
h := 0
|
||||
for _, c := range ip.String() {
|
||||
h = h*31 + int(c)
|
||||
}
|
||||
browser := strings.Contains(ua, "Chrome/") || strings.Contains(ua, "Safari/") || strings.Contains(ua, "Firefox/")
|
||||
switch {
|
||||
case browser && !strings.Contains(ua, "bot") && h%4 == 0:
|
||||
return "HTTP/3.0", "https", "1.3", "TLS_AES_128_GCM_SHA256"
|
||||
case browser && h%7 != 0:
|
||||
return "HTTP/2.0", "https", "1.3", "TLS_AES_256_GCM_SHA384"
|
||||
case h%5 == 0:
|
||||
return "HTTP/1.0", "http", "", ""
|
||||
case h%3 == 0:
|
||||
return "HTTP/1.1", "https", "1.2", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
||||
}
|
||||
return "HTTP/1.1", "https", "1.3", "TLS_AES_128_GCM_SHA256"
|
||||
}
|
||||
|
||||
func webLine(t time.Time, ip netip.Addr, domain, method, path string, status int, ua, ref string, dur time.Duration, size int64) line {
|
||||
b, _ := json.Marshal(traefik{ip.String(), domain, method, path, status, t.UTC().Format("2006-01-02T15:04:05.000000000Z"), ua, ref, int64(dur), size})
|
||||
pr, sc, tv, tc := protoOf(ip, ua)
|
||||
b, _ := json.Marshal(traefik{ip.String(), domain, method, path, status, t.UTC().Format("2006-01-02T15:04:05.000000000Z"), ua, ref, int64(dur), size, pr, sc, tv, tc})
|
||||
return line{t, string(b)}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user