v0.41.1
This commit is contained in:
1 parent
96eec3b1c6
commit
b9a5b3c153
30 files changed
+1100
-374
No files matched your search
@@ -2,6 +2,16 @@
|
||||
|
||||
Release history focused on **features, settings, default behavior, compatibility and fixes**. Changes to internal code structure and preliminary performance experiments are intentionally omitted. Historical descriptions reflect their respective releases; consult the current documentation for the settings available in the latest release.
|
||||
|
||||
## 0.41.1 — Stored logs: rotation fix, per-host log files and rebuilt explorer
|
||||
|
||||
- **Logging — rotation fix:** access logs (shared and per-Vhost) and the error log now notice external rotation (logrotate `create`, `mv`, `rm`) about once per second and reopen the configured path. Up to 0.41.0 RustProxy kept writing into the renamed file until a restart, so after `compress` those records were lost and the stored-log reader showed an old rotation (e.g. `.10.gz`) as the newest data. No `postrotate` or `copytruncate` is needed; a sample logrotate policy is in [Logs](docs/LOGS.md#per-site-files-and-rotation).
|
||||
- **Logging — redirect and 404 hosts:** with per-Vhost access logs, requests answered by a redirect host go to `<id>.redirect.jsonl` and requests answered by a local 404 host to `<id>.host404.jsonl` instead of `_unmatched.jsonl`; their records carry `redirect_host` / `local_host` (omitted otherwise, also available as custom format fields). They are not counted as Vhost traffic.
|
||||
- **Stored logs — rebuilt explorer:** sources are grouped per log (Vhosts, Redirect hosts, 404 hosts, Other traffic, shared access log, error log) with a separate **File** picker (current file, `.1`, `.2.gz`, …). Rotations are ordered by number instead of modification time and uncompressed rotations (`.1`) are included; a log is read newest-first so the newest records are always complete, and the status line shows the time range, the files read and how to reach older ones. New **Period** filter (`since_ms`, stops before older rotations), status/protocol-error chips, **← Newer / Older →** paging, an inline search-syntax panel with tap-to-use examples (the old popover opened off-screen on phones), source names instead of file ids, status-coloured cards on phones. API: `/api/file-logs` sources gain `rotation`, `scope` and `site`; queries accept `since_ms` and return `files`, `files_skipped`, `stopped_at_period`, `newest_ms` and `oldest_ms`; `consolidate_vhosts` now merges any log's rotations.
|
||||
- **Panel CSS:** removed the styles of the old search-syntax popover, the *Merge rotations* switch and the old header-rule titles (and the unused `headerRule` text); shared rules keep their other selectors.
|
||||
- **Upgrade note:** if logs are rotated externally, restart the service once after upgrading — a process older than 0.41.1 keeps writing into the rotated file until it restarts.
|
||||
- **Compatibility:** configuration format unchanged. Access-log records gain `redirect_host` / `local_host` only for requests answered by redirect or local 404 hosts. Redirect/404 traffic moves from `_unmatched.jsonl` to its own files when per-Vhost logs are enabled.
|
||||
- **Verification:** new unit tests for rotation detection (rename, delete, recreate, rate limit), per-site log names, rotation ordering independent of modification time, uncompressed `.1` rotations, newest-first reading, the period filter stopping before older rotations and single-file reads; full suite (1053 library tests, 7 CLI tests), `cargo clippy --all-targets` and `cargo fmt --check` clean. The real binary in headless mode wrote a Vhost, a redirect host, a 404 host and an unknown host to their own files, and after the current files were renamed (as logrotate does) new records went to newly created files within a second. The explorer was exercised in Chrome (desktop and a 390 px phone viewport) on eleven rotations whose oldest file had the newest modification time. Not tested: a real logrotate run and production traffic.
|
||||
|
||||
## 0.41.0 — Conditional routing: request conditions and whole-host rules
|
||||
|
||||
- **Location conditions (HAProxy `use_backend … if <acl>` style):** a custom location accepts `conditions` — up to 16 tests on `header`, `cookie`, `query` (parameter), `method`, `ip` (client address after trusted forwarding/Cloudflare, `cidr` with IPs or networks), `host` or `country` (GeoIP/Cloudflare), with the operators `equals`, `exists`, `prefix`, `suffix`, `contains`, `regex` and `cidr`, `negate` and `ignore_case`. All conditions must hold (AND); a condition matches when any of its values matches (OR). A location whose conditions fail is skipped and the next candidate is used, so `/api/` + `X-Beta: 1` → beta backends can sit next to a plain `/api/`. For exact paths and prefixes of equal length the conditional location wins; regular expressions are tried in list order, and a conditional regex placed after an identical unconditional one is rejected as unreachable. See [Request conditions](docs/CUSTOM_LOCATIONS.md#request-conditions-routing-by-header-cookie-ip).
|
||||
|
||||
Reference in new issue
Block a user