Skip to content

Traffic: keep the statistics 14 days by default and IPv6 clients by their /64 alone - #828

Merged
schmitch merged 1 commit into
mainfrom
claude/upbeat-babbage-ceugzy
Nov 3, 2026
Merged

schmitch merged 1 commit into
mainfrom
claude/upbeat-babbage-ceugzy

Conversation

@schmitch

@schmitch schmitch commented Nov 3, 2026

Copy link
Copy Markdown
Member

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.

  • Retention 14 days by default (was 90). TrafficSettings::default() keeps the day files for DEFAULT_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.
  • IPv6 is stored by its /64 only. The server's note_client now passes client_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. The address column 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/traffic no longer returns clients[].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 and changelog
    • docs/deployment.md says recording is on unless an administrator turns it off and gives the 14-day default. It names the network and address columns and what each holds, and says that a longer retention keeps the addresses as long.
    • New fragment 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.md now gives the 14-day default.
    • The settings screen's Client addresses description says how long addresses are kept and that IPv6 is kept by its /64.

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.
  • New an_ipv6_client_is_noted_by_its_64_alone in crates/server/src/traffic/mod.rs.
  • vitest run src/routes/admin/traffic and pnpm run tsc pass. cargo fmt --check is clean.

Generated by Claude Code

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
@schmitch
schmitch added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 0bf2754 Nov 3, 2026
20 checks passed
@schmitch
schmitch deleted the claude/upbeat-babbage-ceugzy branch November 3, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traffic: client addresses are recorded by default from the upgrade on, and the full IPv6 address is stored although the docs say /64

2 participants