Dashboard rows for ipx-web and ipx-directory; Caddy logs requests (#210)
Caddy logs one JSON line a request, filtered: no ?token= in the address and no request headers, which hold the session cookie and Access's token. Its default log, errors included, has the same filter, since an error line carries the request too. The directory logs a line a refresher round, so the dashboard can show its progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,11 +8,41 @@
|
||||
{
|
||||
admin off
|
||||
auto_https off
|
||||
# Everything else Caddy logs, its errors among them, which carry the request too: the same
|
||||
# filter as the access log's below.
|
||||
log default {
|
||||
output stderr
|
||||
format filter {
|
||||
wrap json
|
||||
fields {
|
||||
request>uri query {
|
||||
delete token
|
||||
}
|
||||
request>headers delete
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
http://{$WEB_BIND::8080} {
|
||||
root * {$WEB_ROOT:/srv}
|
||||
|
||||
# One JSON line a request on stdout, for Loki and the dashboard's Page row (#210). Not the
|
||||
# shared token a ?token= link carries, nor the request's headers, which hold the session
|
||||
# cookie and Cloudflare Access's token.
|
||||
log {
|
||||
output stdout
|
||||
format filter {
|
||||
wrap json
|
||||
fields {
|
||||
request>uri query {
|
||||
delete token
|
||||
}
|
||||
request>headers delete
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Before anything else, so no page or API call sees them: only ipx sets these.
|
||||
@forged not remote_ip {$TUNNEL_PEER:255.255.255.255}
|
||||
request_header @forged -Cf-Access-Authenticated-User-Email
|
||||
|
||||
Reference in New Issue
Block a user