Repository navigation
Traffic: keep the statistics 14 days by default and IPv6 clients by their /64 alone - #828
Merged
Merged
Conversation
Requests and client addresses stay recorded by default, but an install that never set a retention now keeps the day files, and the addresses in them, for 14 days instead of 90. An IPv6 client is noted by its /64 alone, so the full address is neither written to the files nor returned by GET /admin/traffic (clients[].address is gone; the network says it all). An upgrade note says that recording is on from the upgrade on and where to turn it off; the deployment docs name the address column. Fixes #758 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJamFAQZiLpD3FjPBYJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #758
What changes
Requests and client addresses are still recorded by default. What changes is how long they are kept and how much of an IPv6 address is stored.
TrafficSettings::default()keeps the day files forDEFAULT_RETENTION_DAYS = 14. The client addresses live in the same files, so they go when the files do. An install that saved its own retention keeps it. Because 2.2.0 is unreleased, no released install loses data.note_clientnow passesclient_network(ip), so the rest of the address is dropped before the request is counted. The full /128 is never kept in memory, never written to the files and never returned by the API. Theaddresscolumn of the day files now holds the address the network was located by: the IPv4 address, or the first address of the /64.GET /admin/trafficno longer returnsclients[].address. It only ever repeated the network, so the field, the TypeScript type and the grey line under the network in Admin → Traffic are removed. The API is new in 2.2.0, so no released client depends on it.docs/deployment.mdsays recording is on unless an administrator turns it off and gives the 14-day default. It names thenetworkandaddresscolumns and what each holds, and says that a longer retention keeps the addresses as long.docs/changes/2.2.0/758.upgrade.md: from the upgrade on, requests and client addresses are recorded. It says how long they are kept and where to turn recording off.709.feature.mdnow gives the 14-day default.The issue's milestone moved from 2.3.0 to 2.2.0 because that is the release this merges into, and the fragment is in that milestone's directory.
Tests
cargo test -p forge-traffic: the pruning test now checks both a 90-day retention and the 14-day default.an_ipv6_client_is_noted_by_its_64_aloneincrates/server/src/traffic/mod.rs.vitest run src/routes/admin/trafficandpnpm run tscpass.cargo fmt --checkis clean.Generated by Claude Code