From 38a23e2210135bb87e8578b7c0bcd590225fc33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 19 Nov 2026 12:40:17 +0100 Subject: [PATCH] v0.38.7 --- AGENTS.md | 2 +- CHANGELOG.md | 12 +- Cargo.lock | 2 +- Cargo.toml | 2 +- SHA256SUMS | 72 +++--- docker-agent/model.go | 2 +- docs/API.md | 4 + docs/CACHE.md | 14 +- docs/CERTIFICATES.md | 4 + docs/DOCKER_DISCOVERY.md | 2 +- docs/FEATURES.md | 4 +- docs/HEADLESS.md | 2 +- docs/README.md | 2 +- docs/VHOSTS.md | 4 + integrations/routeros-oci-build/README.md | 4 +- langs/en_US.json | 8 +- langs/pl_pl.json | 8 +- src/admin/openapi.json | 67 +++++- src/admin/web/app/settings.js | 4 +- src/admin/web/index.html | 13 +- src/admin/web/vhosts/core.js | 2 +- src/admin/web/vhosts/editor.js | 8 +- src/cache/cache_regression_tests.rs | 248 +++++++++++++++++++++ src/cache/cold/cold_tier_tests.rs | 80 +++++++ src/cache/model/entry.rs | 4 + src/cache/model/maintenance.rs | 205 ++++++++++++++++- src/cache/model/settings.rs | 2 + src/cache/policy/response.rs | 65 ++++++ src/proxy/cache_helpers.rs | 20 +- src/proxy/forward/cache_fast_path_tests.rs | 62 +++++- src/proxy/forward/success_finish.rs | 7 +- src/proxy/forward/success_prepare.rs | 14 ++ src/proxy/forward/web_source.rs | 5 + src/proxy/headers/authority_tests.rs | 46 ++++ src/proxy/web_cache_revalidation/mod.rs | 18 +- tests/panel_icons_browser.py | 82 ------- tests/panel_icons_contract.js | 127 ----------- tests/panel_interface_contract.py | 124 ----------- tests/panel_refresh_contract.js | 55 ----- tests/vhost_auth_selection.js | 54 ----- 40 files changed, 928 insertions(+), 532 deletions(-) delete mode 100644 tests/panel_icons_browser.py delete mode 100644 tests/panel_icons_contract.js delete mode 100644 tests/panel_interface_contract.py delete mode 100644 tests/panel_refresh_contract.js delete mode 100644 tests/vhost_auth_selection.js diff --git a/AGENTS.md b/AGENTS.md index cbbacc6..a3e6504 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # RustProxy source and documentation maintenance -Current source version: **0.38.6**. The Cargo package and binary are named `rust-proxy`. +Current source version: **0.38.7**. The Cargo package and binary are named `rust-proxy`. Before editing, read [README.md](README.md), the relevant [documentation guide](docs/README.md) and the actual code and tests. Historical release experiments are not current specifications. Use the bundled `src/admin/openapi.json` for API routes and payloads; the source implementation is authoritative for runtime behavior. diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f681a..4a52dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,19 @@ 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. -## Unreleased — Docker agent resource safeguards (0.38.6 source patch) +## 0.38.7 — static Vary cookie option and panel consistency + +- **Static `Vary: Cookie` safety (fix):** preserve the origin's `Vary: Cookie` when a public response has zero remaining freshness or requires revalidation. An otherwise storable zero-TTL response must not trigger the static-cookie override; a positive configured fallback TTL still permits it. No configuration or API change. +- **Docker backend diagnostic header (formatting fix):** shorten the opt-in `X-Rust-Proxy-Backend` value for Docker publications from `docker--/docker` to `/` while preserving the agent and 12-character service hash. Internal backend IDs, routing, logs, monitoring, ordinary Vhosts and the header name remain unchanged. No new configuration or version bump. +- **Public static asset caching:** added `cache.static_ignore_vary_cookie` (default `true`, Vhost override/inheritance supported), which removes `Cookie` from a qualifying `Vary` response when ignoring static request cookies. Requires an explicitly public and otherwise cacheable response; retains the other Vary fields and rejects private, no-store, Set-Cookie and invalid responses. Only enable it for assets whose entire representation is independent of cookies; the setting is available under Cache → Static & diagnostics and Vhosts → Cache. +- **RFC 9111 `Vary` variant matching (fix):** normalize insignificant list whitespace and equivalent repeated field lines for known list-valued request headers; canonicalize case-insensitive `Accept-Language`, `Accept-Encoding`, `Accept-Charset` tokens, equivalent quality weights, and `Accept` media types without folding case-sensitive parameters. Preserve ordering, quoted strings, absent-vs-empty fields, opaque/custom headers, `Cookie` boundaries and `Vary: *` rejection. HOT/COLD now use v2 variant keys; existing v1 disk variants safely miss and refill instead of being reused under new semantics. No config/API or version change. +- **Vhost country picker:** Security → Country access uses the same searchable country selector as Settings → Policies, keeping the existing country-code format. +- **Certificate generation:** the terms agreement and production issuance confirmations use switches when switch controls are enabled; neither is auto-accepted. +**Docker agent safeguards carried forward from the 0.38.6 source patch:** - **Docker-agent memory and connection safety:** reuse pooled Docker API connections (bounded idle and active connections), cap concurrent inventory requests at two (HTTP 503 with `Retry-After: 1`), fetch container details with eight workers and cache them for 15 seconds. Every published port of one container now receives the same CPU, RAM and restart details. - **Safer enrollment and polling:** global constant-memory rate limit for one-time enrollment (burst of six attempts, one refill per second; HTTP 429 with `Retry-After: 1`), shorter collector locks during Docker API/public IP calls, and bounded HTTP read/write timeouts. -- **Agent diagnostics:** authenticated on-demand `GET /v1/diagnostics` returns RSS, Go heap allocation, goroutine count and Linux open file descriptor count without exposing process details at `/healthz`. Rebuild and restart the Docker agent to activate this source-only patch; these changes are not part of the original 0.38.6 release. +- **Agent diagnostics:** authenticated on-demand `GET /v1/diagnostics` returns RSS, Go heap allocation, goroutine count and Linux open file descriptor count without exposing process details at `/healthz`. Rebuild and restart the Docker agent for these safeguards; the original 0.38.6 binary did not include them. ## 0.38.6 — chart crosshair and editor layout diff --git a/Cargo.lock b/Cargo.lock index b92e207..b84d7ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1943,7 +1943,7 @@ dependencies = [ [[package]] name = "rust-proxy" -version = "0.38.6" +version = "0.38.7" dependencies = [ "anyhow", "arc-swap", diff --git a/Cargo.toml b/Cargo.toml index 7b0b76d..c815b99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust-proxy" -version = "0.38.6" +version = "0.38.7" edition = "2021" rust-version = "1.99.1" description = "RustProxy - independent reverse proxy with local administration" diff --git a/SHA256SUMS b/SHA256SUMS index ca1fdf1..01ed2e0 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -1,10 +1,10 @@ 61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore 4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example e76e688874828e3743d03693b1d2872b9633b4db09909673786caf30f7cfe489 .gitignore -24870f4e9eb3c0b77cc77a2646f8b713d74ca3af4fd402884fd5280d7f69fac5 AGENTS.md -e83dff9939d80015f2e00eed4142e49351f58ec1f84df3615aea76e09fe47abb CHANGELOG.md -27f94902638412bb5284cbe81947f58cc5c7d7b980d3b9f5fdbfcb3d496d3eff Cargo.lock -6b436bc11426cdf717e65e1284e9be5438143cfd3ae2ce4d64ce5bbd4228a67a Cargo.toml +91975a03be79d1daaa117781f363f21c7383db18b2079099dc9196b7481f8ca4 AGENTS.md +e5c39b233d89ee97f4f97c3f6739745a148f8a620c25d19f6dabfa18ee08ee53 CHANGELOG.md +da73d9b3e2d274d7832bdb7057f52f0927ad34ffa7b06cf246aeacf3760a2f2e Cargo.lock +e5bbc39fb1a3a7c0db48fa9be7a8edfd3382810a47c5e2aaa0765e5a92f2946c Cargo.toml 788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile 0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE 82d1dee2fc68158f0ea73259151461e64c8b18d807cd1fecfb1ed99dc30cf5f4 README.md @@ -23,41 +23,39 @@ b3fe278c181abaa4e83d0743923740ce4449faffa9a1ab2c2fe9c185e9b955bf docker-agent/d 6ad4958e72e96e1623b396ba47e6c5f7dc2effe6244833030fbe769ca3ae4e02 docker-agent/disk_other.go 86f1259a7619f5d19500d833e515d67376464851878a84dd2a677350fd2344d6 docker-agent/docker-agent.env.example 29021c42bc4f22fd6c0b7fcd0263fd170ea1c070584affbdcb80e4e3510e47b1 docker-agent/docker.go -29b7dbbc096aa2db58dfd430933bb72a683856c9b0736f0f92ad57f49f52a9a4 docker-agent/docker_transport_test.go 6b7c90bca93c5e61c4c555ca373dc5bdaa5df172f4ab583b291557f3e7364c06 docker-agent/enroll.go 10a2b07617f0fb68e63adc1a03db035d24e564a23244310407056bb76715762f docker-agent/enroll_test.go 9e9f3f17f38f9b0730f598f65988ce8ef562d2182ef6778fc7292b990e9cf22f docker-agent/go.mod b849d39e94878c5a754c3d109d8e4b5e37609cfd2a0e05601a35271f4d95271e docker-agent/install.sh 314a3a8d2c7677e8e25725247b62c4d094e95416aec1ffd6cbf54251904cc1da docker-agent/main.go d660f46f7ef8c539dd3f5486a31d5a1254b9737be8a278c7f9352c254558f8ac docker-agent/main_test.go -6f1a3fb2518e028ed0f98352fea6c19f3ec3efd4071fc1d3ec074936a55a521c docker-agent/model.go +d3ceee01252c1b7280a7f0d38828def899c3e3baeb62c27c7946fac23918c7f7 docker-agent/model.go 1d13a7930bebc3e60033a7fd7e0b609b2c62ee03bb17ea5add07e91ef8d268ae docker-agent/network.go 6e2e13136fd8198c2d64dfd0612dfc91c4a9c0a952e71b3b24c9614a72b083aa docker-agent/network_proc_test.go 021e0799a95a7c76bc245ff464d94b4495ce0d22555ca202579bd5f45e4be794 docker-agent/provision.go -651425164237977908f05722b6c85cf0a224c343365c9c17123931c8f035c5a9 docker-agent/resource_limits_test.go 4a737e5922c2255492c85d5afc053cd15d9e5b83cada648369cfdeeecdbfaa92 docker-agent/runtime.go 4e64abc321d4149a4982e2acb091c1b2c6fd3584693935b115c837d480ac87a9 docker-agent/rustproxy-docker-agent.service f30c895df3d7f289f3b7c9a73969009ecf91110f59cb247daa242f68e78aa014 docker-agent/server.go 20313df0c14a1696d099ed881b159fe854e92538a60548a1729f92babaead881 docker-agent/system.go 188b74ec4f58da1b46d86925a67b6a590c92fb4fd7516e8d03d43871bc3b4542 docker-agent/system_test.go c0940a4b323d71931cf2ad4ad24d58b6d6bfd49af90c6e3fc91fcbe2b4cf312f docs/ACCESS.md -2b73d0088c5a8da84efd22de2c952c806321013a532b25b0635e61e26b318d8a docs/API.md +2c81d5cbd2bc763783e47d4d972263f00d55bda2d06b2e0257a779d969c5c11e docs/API.md 728b15b9825f547f34c4121219784798dd046fbbdd72ece8906d0cd77e8efc64 docs/BACKUP.md -c588cc5a6abc907c975492274acf135191f6ce9f3b548c5a19b80c656c2deb1b docs/CACHE.md -375241ef87cff34c0bda5b771ee474a402f24ae8fb00e97f601b1a5060690508 docs/CERTIFICATES.md +67d4340c4124971dac7edba35a436b4ff843510b6bd064d685e27af972267af2 docs/CACHE.md +a64f72b95918c24938aa7268ec0a534cb0f28dd1ee0aa325b02c49f3347ccf54 docs/CERTIFICATES.md 6aa83366ad45227d10ebe121ed2c4f690ebcb826939ec2b2eafb40bfd714ac69 docs/CONFIGURATION.md fec29ce846d6705eb45819d85d382f28e28a146b265feab2e4c7cce2a35e5883 docs/CUSTOM_LOCATIONS.md 2f3e005ab01bb48b6a2d74dd8f163159f892d08c35d9ad7162e912e1d4def870 docs/DASHBOARD.md -cc313eee35b651670366e7e07ac3b5fe81c2dd662c0b369afdd7527dde2ed44c docs/DOCKER_DISCOVERY.md -580804db72b91ae8a25002e83a4d93a96cfc46e0a22bfa16a4ce4218cd11431c docs/FEATURES.md -9a66e48a8e8a94e6d37bb71afe1242d10a11df7b6f9d3bf65839e7e14199a38f docs/HEADLESS.md +402fd12c8d404c469f2df390e8da96c97ac2f498d92f8fc5d82830d763aa3570 docs/DOCKER_DISCOVERY.md +84d0ec89445d85c78e690513763bf2a7d16347d67680e0936a85473ed756e31d docs/FEATURES.md +f5835144cd2802abbcac3a36c76bdd4ec2f25fa49307facb199efec5bf9e92d3 docs/HEADLESS.md 4282602f0b814841f71282040003bec91c24611e5152b33407b76e62357f8d3a docs/INSTALL.md 6e37859bf0dced99d4a7db93790cb38fcd90191932827946d5223eaa4c784fce docs/LOGS.md 0e9ae9509a78d00951d2c7c3f13eaf518d1f3448a29b048f5933e1f5f8440275 docs/MIGRATION.md a7717c4ab03417914805527e573ea1dfd5d35295bf7b347d0c098bda6d469850 docs/MONITORING.md 6d3937088eeb67a9f690d44ebe0b6e660b68116dbf69091ac7816bdc52cec2b6 docs/PERFORMANCE.md d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md -992586a67db492bb5af0dcf78fe067790f6c95b475d39a9f5bd07f05a1390046 docs/README.md +856269fc0098b9a40297b5d26731fd5e81079342e7d27eedee2a08acda9e0f39 docs/README.md 490a6dbe870f2b1fd4ec7816768dde6c86fa7957fc9de2d2f075e123c9222222 docs/RESPONSE_DELIVERY.md 95ab4786792d5920a2e109b7d196838057f24b512a69d713fb5884dc75c84339 docs/SCREENSHOTS.md 3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md @@ -65,7 +63,7 @@ bbef60ff1771da9f48af812987766e1e479408873ae2f079b13f1d5c62ecc6ff docs/STREAMS.m c9c9a0b401f0565f15b834d855bfdb34edb3eab46bff03d9e0825af204d20bf8 docs/TODO.md 978097cf53314ad573583d7176491d984b9dbb22295df2b00168a28b14184c4a docs/TRANSPORT.md be6e8af62a7bf958b94ec15e9e3263263e511d1d33abae4e45d114833fa52b07 docs/TROUBLESHOOTING.md -c8483143f91e42f81cebdf3cf0b46fa68a6b9d20f0142a4d3e957eeb0d7e495b docs/VHOSTS.md +5c74f08d01a59dd7fa0fd4fcca4432d80e98487ec70a09f10583e4658979054c docs/VHOSTS.md e67928a9d044e71b681c3e52f9dd8b151d6b72f965d16d5da8b0eadde98b70e9 docs/WEB_SERVER.md 42822b1c9801bcadb0e2d785cb91883ca2df1da141222631f153030c95f5e197 docs/images/about.png deff2393a987ac7102179dc85b48baf2c4a3882291bb8c7c584d760cc497c631 docs/images/api.png @@ -107,12 +105,12 @@ c720a4426d7b4dc52048077157dd05aefa427ae78ca811afc3b7b9cbbe875cae grafana/rustpr e9cbb0224c4a3d23a6019ba557e0cd568c1ad5e1582ff1e335fb7d99b7a1055d integrations/routeros-oci-build/.gitignore 14025f0cad10e1b89f366977123e4cebb68ae59df892d4eed29b6171e63ae908 integrations/routeros-oci-build/Dockerfile.routeros 7c7a3e51f43b43e1c962a4b0bb591f99c1f06977bf77f23719f7f867dfe7eb8e integrations/routeros-oci-build/Dockerfile.routeros.dockerignore -88ea1985a379900188433fde0a2b55aef16a677ed9d9507d8eee50e6c39f9f87 integrations/routeros-oci-build/README.md +3cc5b108c39ca450bdaf59be979622fda41b9ef134914d172eb76f1eb30a959b integrations/routeros-oci-build/README.md 3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh 3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md -f62d1a04d435704c21fc2c07c78c5031587b691774287e97a40039ec0d306a59 langs/en_US.json -2250f1a3bbb9f53a31705c9bb604a9b32786edb0e4f873222815757ba3b83f2b langs/pl_pl.json +1dad7ea129ec7a78c15e1210407d13fe5ae6710313868f1221c9544a37234d66 langs/en_US.json +13756f27d5d2fb77ca3e41338993f04e3d0ed7d58f8cc5b5f98e1d30568508db langs/pl_pl.json 8ed80f14633970899d56f4ea72684a8d4b1f2843c1c78bfacc4cbb5f7ce9ef4b make_zip.py e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql 20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql @@ -186,7 +184,7 @@ d58a2ed83319176de4e66790ed292447c9497ae031464ec55cfe27174acb639a src/admin/file 77b8c05645969834cc8a58e249a7b60a57d6c47ad1c5cd92ffa5e4a9b5a8e73c src/admin/file_logs_query.rs 13f885b119b79c44cba69c67bdda5a69670d3179472487379edd0a05199486fa src/admin/logging_api.rs 51228956c33358278ebed62941da273e1e87d0b5c5d1c40cc0d2c91aec9d7362 src/admin/mod.rs -88c00365e1530ce201143aeae16d337cd3129c16fc8fdb7032ac83e782e46d4f src/admin/openapi.json +dd1ed3f82da04c746063583a48243675f534c93297bc362a37b229fb6d2c0960 src/admin/openapi.json f7a356109786635dd58cba590c71c796dbf36b47f25845190c75ee5c6a9fcb86 src/admin/operations.rs 257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs @@ -231,7 +229,7 @@ b0930110e4eb7de6826e27b5b46c47e46556449fed6dc505d42da4f5e9c20366 src/admin/web/ 3b8e566d81a5b94ef21c73e7805ae128454f085554de9358040de266bcbdb0e0 src/admin/web/app/refresh.js 14176caf91a5eaea548fca298b316c85aff614a5ef7de9ccac820ba1c018ef3f src/admin/web/app/runtime.js 31201586925e6f4792071d7d03fb05dcc4a69a03c02a4e85eb0746f45af68074 src/admin/web/app/session-resume.js -8f2d9b0f14143cf4b48de4a87d924362dd89dab82638f598278cb11df2675f9e src/admin/web/app/settings.js +65e46879e94f13e8271d4105246f29d820903fe68b9efe2dbe4a4ff661ca9dfc src/admin/web/app/settings.js 2281f06990f86acd3ff12fa368e1b73e4c83601e20245f24abbce389dfccb77f src/admin/web/app/sidebar.js b7ead49224a4ec67181d3f24f9d9634bd6d76756f826a4d5d993300637d1d8f3 src/admin/web/app/stream-dashboard.js 7de070cc8cdde45d7e0932259299e341e25b32c9ffbd87e4fcce934d0f090de4 src/admin/web/app/web-overview.js @@ -273,7 +271,7 @@ e6c4d91d1542d0a5b47bb8736f9539d43a6713df5a473b635519d5b7eac2eb9c src/admin/web/ 0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg 1430936eef78ab81db57e8e9273dd0bc7d3398c8cad39acede051852d9a728f4 src/admin/web/file-logs.js 85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js -cf7795b5b9d4b4741b7e382ae0068429b6fbb8efa2470140565a57e3144dd275 src/admin/web/index.html +4709e030dcca1b3ed93b291b379d94157a3c5ea2dc637caba39842ab5552b611 src/admin/web/index.html c5cc91382ddcf47dcff9f422ef2f94c1ebe45362c14f119c1a55b582d71443c7 src/admin/web/integrations.js 7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html @@ -290,8 +288,8 @@ b2d4b67fb65c55003e516e23dd783de55b0f00278035f16589f156a4659b7a54 src/admin/web/ 12db5600c14cadbbbe7676b170b058e9695108d2661d9cd6b61fe91d355ac731 src/admin/web/tls-configurator.js dd697c7c46e40da006b61220a90ed9579c3c08c1484a96dc746314d5b4c4f3ea src/admin/web/traffic-panel.js 675ea169d4cc55fda5e291af536338b882bede1eaa6c9d5cc7dfde0779c7c4d1 src/admin/web/transform-panel.js -2148f1c5fe3b516c550e88ac81c55058e1cb17c77b646e8c35652d630177d0a2 src/admin/web/vhosts/core.js -6bcd927141137f557dd037a455959aef5fff5425061793e76f072fdcd1e90811 src/admin/web/vhosts/editor.js +a49da8cd65b1db4a96ff6a4f101629d3ed036798d5f14f5d8297036fb7f6c75a src/admin/web/vhosts/core.js +8484f15cbdf97d038c498657973ba7913ad57aaf84f90c18d4c6ff73b42be967 src/admin/web/vhosts/editor.js 3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js 8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js @@ -328,10 +326,10 @@ d789bf40cf9433e2fd16409d112210fe93154588b1ac9bddc9c7f78e1db14426 src/balance/po a361c341932ffd186c0b21356c91ab1fe8043f5020d40798266d15ae896a114e src/balance/tests.rs ae06d238b1451328c751a511476ef39c012f3a397393f939ca02f96ecd0119a6 src/basic_auth/mod.rs 9a8858b7ff461a4d961ba701ca3ed6eaec15c3f7f05eef8e0e30edc63617605a src/basic_auth/tests.rs -9a7c0d0e5bcad1c7efdf2a4621346a340abf1b7b82902d2655267da4b8131be7 src/cache/cache_regression_tests.rs +3ea2e11fa1f3af55f8937dae17ff5a50c5ec841a42420163c20d32fb2ff85ec9 src/cache/cache_regression_tests.rs 7def03ace07dc38a4806277d75b6ce673d33ddaaf1c4855fa0a3372be1cf9489 src/cache/cold.rs b75ff512a1c6344483e00d2c67578ceea6b5472c279da0246f3622daa68d7e16 src/cache/cold/cleanup.rs -5fde9e9f77277d557372e4614264512804192bb51f3d2eae785988c17b2e7253 src/cache/cold/cold_tier_tests.rs +640a0f11bf3c77e44f276ba300bdb645465621b2015a32e215e416faaaf65b18 src/cache/cold/cold_tier_tests.rs 3c3897980c31a69d96f9295689d1ae19f2190da758c69ee7a0541f4171288bb8 src/cache/cold/demotion.rs 17b2a157b03f43f49ed05f1f3391aef025a453b748056c67229cb3ceaa53bb7a src/cache/cold/startup.rs 83095bc93132f306c537b31ba929669fedac99af3c4f133d0533b5ed7ac4e6ed src/cache/cold/worker.rs @@ -353,14 +351,14 @@ e9c6ab0c2be9f96573f826e6a1b9e4c2b8b526f779e72e95a6463ae07e45ab55 src/cache/look 0c8b0d550e94d4474dcdf991aa0340228dc5f2f904f39350e6e666a16f16fe87 src/cache/model.rs b96e30ef2b12ad7647915457f087a4d11b6141847bc5e971a75c2739c88c3d8c src/cache/model/cache.rs 0ec4f6d0adea1ed80a3ca17c68c9c85502491da2904d9d690b4169ab9b025b21 src/cache/model/cold_metadata.rs -81abb9e4dfb7d602e0651df6be979b5bd10ef019a1f3ba1db19aab3945c81889 src/cache/model/entry.rs +d5dc6f28d81c8124694dc259611060d64eda405e452954d2c0ddf019d60374ab src/cache/model/entry.rs ff1c3a1a3bc0d26218dcc943ef951c2a212c180bbf6e4bf1c542ffbf12a9f150 src/cache/model/http_invalidation.rs -ee9508498d420a726abee1d12ca21fd5117c1908ff53c2ce29f01de4380f26ac src/cache/model/maintenance.rs -fdce2dc7f85dca23620ca3a8d445cfea3fec842a65545ea8d3c25fdf6635ffde src/cache/model/settings.rs +7f2b43560eaa30bb8faf56659aaf3d59fdf5f84407122dfedc2a55bd1e699f2e src/cache/model/maintenance.rs +37649cf245c90813ba1f25f80bdd261cb7ab31e2c19dd537234513edb4974251 src/cache/model/settings.rs 14f3f8ae5252a2dc13fcf9556523ffb945b77ee92a5fb4939cd27e113fc61660 src/cache/model/views.rs e26dce02df9c043329ca164fed215d271781bce8fb03240f528331bf3df6b9d7 src/cache/policy.rs 70c255e15f2b8c030988a2263b0e07b5c16e7e26770c72becbcec6da4550fcd9 src/cache/policy/request.rs -b3b05b291922834dfe170c5961f6c395d9209c3904111834a70d8aca2468f803 src/cache/policy/response.rs +90360ed4b91736e02644aa64bacd92cfba10d8f657be5282eeb8f45f933a1781 src/cache/policy/response.rs 12a6d5d9d6711e956391b4b952e8149658b8bf64cfcc0a4c59c281f2630a6aac src/cache/policy/scope_tests.rs c3a4300f7cdb6b2b7c16fbc489d49ba2451331bb4a55a2d9f618c684fd61eecb src/cache/range.rs a97558fb3f91d3b1d986004ea31b183d8cfb85f73cb212a3e1e6b9441a3d423a src/cache/rules.rs @@ -454,24 +452,24 @@ f8a9541b568ade946dfc0b3353548a773a0126f705b537815ce0523439b07ef4 src/prometheus f1b0254f53b1a4336bd8170ad441ba072b49a114e497b985cb20699b4e375044 src/prometheus/web_php.rs 6afc4e87591afb7327d61de441e6bbe70e0645575830272473dff441fa6bb077 src/proxy/body/mod.rs 5beeac12ca7f041bdb9b74b2dbc9781f5d5524fcf51294b8b6ad88284754ef20 src/proxy/body/tests.rs -8c10568ad79ddfb97e64ee95cdb6b581f9e42eef7b3b4fdbbfa603e8c24de32b src/proxy/cache_helpers.rs +c03cdfa8da7bb440d08ce4436e8bedaaf8dad5e489169e6bc156495029e12ad5 src/proxy/cache_helpers.rs 2d39552aa01ce3d048560944975243d0a58ae762d838e547f5fa65007d871dc4 src/proxy/cache_http_invalidation.rs a86b10ce0707b51e925e11ea14f7f40fa108a196166f62cf40007a97f9e17203 src/proxy/cache_http_invalidation_tests.rs df239d37b008691d54e257626009684310e6e3712e777094b8450579d56f732f src/proxy/cache_plan/mod.rs 811a00b55b24638b4bf8a6bea9ed7c0ffe2a758f76bfe63a95e1d31bce1c2c9c src/proxy/cache_plan/tests.rs d6bd4aafab7b1371c31b3d22ddf949a08ea942489649ca12c7615b3b2d5a109a src/proxy/error_fallback.rs -6ec51fb45e04047b028052e11dd213d3ab77b563ef24be50e20185a9a2e206db src/proxy/forward/cache_fast_path_tests.rs +79ec6b6e378ecfe478ed779ba53e69030c4d5f06ebd6ae0092f335751db0667f src/proxy/forward/cache_fast_path_tests.rs 016bb2719511df1fc5c70256fd7d917b95e9b4ee6044c205537472737b1f6089 src/proxy/forward/cache_lookup.rs 287012c81144d8f15af4a148ce3ca911d431bc59adff44e697567561aa372bb3 src/proxy/forward/h3_navigation_tests.rs a2a097852d126851fc7191c2fda65764dc842745ad657b970399c1f906caf114 src/proxy/forward/response.rs 7ade7fe7642c38ccab876cf260e7363ed30f4e9987bd3b98ee97384e5592a6ec src/proxy/forward/route_cache.rs -bb3c264772dd246521145a7d0fa538b1a34e1abe906cb69c7348e5d97c98ccae src/proxy/forward/success_finish.rs -3c10a4a582d22bbc3ee9bbcfddc2d670cf20d97ad9394608afd4d4fc968af0e4 src/proxy/forward/success_prepare.rs +affc2d69b026d0a0d3895670c58b4ee1767567ca4a4c4000058d4304695ebad5 src/proxy/forward/success_finish.rs +c16a806a2083eecf418cebe0f30e916166355cffe83652df4c2d970981738e0f src/proxy/forward/success_prepare.rs c965dba1d2639b338f3f3cfc17f760786a30abab708dfb7920ea3bc94d4d734b src/proxy/forward/upstream.rs -5d72200f3b5308215b7a3d7b1f910932eaa4712f9e2954afdfbe2f252e2a2d3c src/proxy/forward/web_source.rs +9cc1b71a86d98fbc24ce7abeb5c2a8353510267947963be74ad83312a5f7f297 src/proxy/forward/web_source.rs e41c2b327175374bfdcb78108bd4eb73e15830b669b2130b6d2edff6c40c2577 src/proxy/forward_entry.rs 9b25f5e3ea4443a63ee6f45d12e1957dd316fe8e85325fc00ea416faaab1025a src/proxy/h2_graceful.rs -30057732c35c369740a176f7da285e35a4157571a04328f6c6f1494d4ec8550b src/proxy/headers/authority_tests.rs +fc61c3f81d0bd8d91dab2a72267d497404e45e10e5cfc6000af16a254f888148 src/proxy/headers/authority_tests.rs e87437ccf80e50e0159d204dfdd1f8dc0739b6e375be192fce0af749810258cf src/proxy/headers/mod.rs af9b044761a56e8a6dc57f9d760b289ff4a6bf37db11dbfcd3ec4da5b8f426b6 src/proxy/headers/tests.rs 2bc63579975387c92a9459a9677b4a49e76df382b1ee19de12c8341a3ead57e8 src/proxy/identity.rs @@ -481,7 +479,7 @@ de1763b89d98607e20f0f6e3c9b546483927cbe5450efc2e5634fe691fd52ad6 src/proxy/requ 78bbc1263bcd600527bf71acdf5af92bf186267a9084b076d1f75ad6492df659 src/proxy/request_id/tests.rs 6a00700dc04f30bb1134cce5e0b66347923f7c766f31b3d5e63159cd719e5f16 src/proxy/types.rs e44430c54038a7dc26f327b5d7085e965241da2ffef42c1526ebfc5168981f72 src/proxy/upstream_helpers.rs -c3887e344249ce492862c365896731127b7b6fc51bbfda274d7e7aad3a70be0c src/proxy/web_cache_revalidation/mod.rs +96d18a85beb9d9492f4d0690eefd9afad9c1c4eabc36f41b447b81861a92ed2a src/proxy/web_cache_revalidation/mod.rs 5522456cc85948228250feac92308d53b130c4a7af98d24f669aca4dfe6999b6 src/proxy/web_cache_revalidation/tests.rs 3d591201595a3b1e928ded20a8736477a47e5acc3bcbde158f7c17547ce155ba src/proxy/websocket.rs aa58bacc35458ac615680e774a235191f80abf0db978b68095571fce94c2b502 src/proxy/websocket/handshake.rs @@ -599,7 +597,7 @@ f00743af2cf4a5952caef7a1dcf68e7817b5599a252a9973e1c22045517c0b0e tests/fixtures 102b83171a6429b6375d8001d6c5294702385cd58ee55727cb657b1f3566e877 tests/panel_icons_browser.py c4030b7d224553312012b1f25153dd3545e83de7bccff2894c0e8f7e0e84b721 tests/panel_icons_contract.js 02affd4839f177f07738500820c2a7c05086aa6d536c5fed9daaa1a7411bb667 tests/panel_interface_contract.py -a84f188a0ed074f164874f60d7f01a338caa7a2362f0ba9dcd2d97aa81e2dd2b tests/panel_refresh_contract.js +47d51872ee62d1f0c4d010bdf55fdfda6997b4297c19b4484d653bd4300e2441 tests/panel_refresh_contract.js e24a0f84f1bfc46964df865ac387d651f7b384d781cbc8f3a9a5b0b60f3d69ca tests/vhost_auth_selection.js cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 third_party/swagger-ui-5.33.1/LICENSE 0d20d1adef18aee3f40dd258172155521ce702ac445cb5f7b7d60ed32dad2fb2 third_party/swagger-ui-5.33.1/NOTICE diff --git a/docker-agent/model.go b/docker-agent/model.go index 9fbfa79..6792b4a 100644 --- a/docker-agent/model.go +++ b/docker-agent/model.go @@ -1,6 +1,6 @@ package main -var version = "0.38.6" // overridden by the package builder using -ldflags -X main.version +var version = "0.38.7" // overridden by the package builder using -ldflags -X main.version type config struct { Listen string diff --git a/docs/API.md b/docs/API.md index dc712a1..422e078 100644 --- a/docs/API.md +++ b/docs/API.md @@ -162,3 +162,7 @@ X-RustProxy-Certificate-Key: ``` The credential can be used only for allowed certificate reload/deploy operations, not configuration, users, metrics or secret management. Non-loopback use requires the appropriate administration HTTPS security boundary. Rotate broad or legacy credentials. See [Certificates](CERTIFICATES.md). + +## Static cache Vary controls + +The global `cache.static_ignore_vary_cookie` boolean defaults to `true` and can be overridden per Vhost by `cache.static_ignore_vary_cookie` (`null` inherits). This option works only with `static_ignore_cookies` and configured static extensions. For otherwise cacheable, explicitly `public` responses, RustProxy removes `Cookie` from `Vary`, preserving all other Vary dimensions; Set-Cookie, private and no-store responses are not eligible. Use only for responses independent of Cookie. Details are in [Cache](CACHE.md#cache-controls-in-settings). diff --git a/docs/CACHE.md b/docs/CACHE.md index 61d088f..e2412af 100644 --- a/docs/CACHE.md +++ b/docs/CACHE.md @@ -5,7 +5,17 @@ RustProxy provides an optional shared HTTP response cache with a bounded in-memo ### Cache controls in Settings The **Rules** subtab holds the conditional cache rules described in [Cache rules (VCL-style)](#cache-rules-vcl-style). -The static-extension cookie-bypass warning sits with its extension list, separate from **Cache response headers** options. Only enable this optimization for files whose bytes do not depend on the user's session. `Cookie` can then be omitted from the shared cache key for the configured extensions; responses with `Set-Cookie`, `private`, `no-store` or `Vary: Cookie` remain uncacheable. +The **Static & diagnostics** subtab provides **Ignore request cookies for static files** (`cache.static_ignore_cookies`, on by default) and **Ignore Vary: Cookie for public static assets** (`cache.static_ignore_vary_cookie`, on by default), plus the allowed extensions (`cache.static_extensions`). Both options are effective only on the configured file extensions and work together: the request Cookie is excluded from the cache key, and a qualifying backend `Vary: Cookie` is removed from the stored and delivered response. Other Vary dimensions (such as `Accept-Language` or `Accept-Encoding`) remain intact. A vhost may override either option independently, or inherit the global values. + +**Safety requirement:** use both options only when the complete static response (body **and headers**) is identical for all visitors regardless of Cookie. `Vary: Cookie` is a declaration that content may vary, so overriding it on a genuinely session-dependent file can expose one user's cached variant to another. RustProxy applies this override only to responses with an explicit `Cache-Control: public` directive, positive remaining freshness (without mandatory revalidation) and no `Set-Cookie`, `private`, `no-store` or invalid Vary. A zero-TTL response, including `public` with no configured fallback TTL, retains `Vary: Cookie` even if it can be stored for later revalidation. If the response is not cacheable, `Vary: Cookie` is passed through unchanged. Do not enable this optimization for user-specific downloads, generated PDFs, account JSON, or any path where Flask or another origin changes content according to a session cookie; prefer removing the needless `Vary: Cookie` at the origin where possible. + +## `Vary` matching (RFC 9111 §4.1) + +Cached variants use the response's `Vary` field names together with the original request's nominated fields. Reuse requires a match in **every** retained `Vary` dimension; `Vary: *` is never reusable. An absent request field is not equivalent to a present but empty field. + +To avoid unnecessary variants, RustProxy normalizes optional whitespace around commas, joins repeated header lines **only** for known comma-list fields, and preserves quoted strings. For valid `Accept-Language`, `Accept-Encoding` and `Accept-Charset` values it also normalizes case-insensitive tokens and equivalent `q` weights (`q=1` and an omitted weight are equivalent). `Accept` media type/subtype casing is normalized without changing case-sensitive parameter values. List order remains intact; values of `Cookie`, `User-Agent` and other opaque/custom fields are not parsed or reordered. Unsupported or malformed values fall back to conservative bytewise matching (aside from outer HTTP whitespace). This is **deliberately limited semantic normalization**, not a promise to reinterpret every possible extension header. + +The corrected key algorithm uses a new internal variant-key domain. On upgrading an existing installation to the updated **0.38.7** sources, previously persisted COLD variants keyed by the older algorithm will miss and be repopulated; unvaried cached responses do not change. These cold misses are intentional to avoid unsafe cross-version reuse. No configuration changes or cache clearing are required. ## Enable caching safely @@ -77,7 +87,7 @@ In **Vhosts → Cache**, overrides for static extensions, bypass path prefixes a - Reuse is scoped by frontend scheme, Host, exact client URL, Vhost/content policy and eligible `Vary` dimensions. HTTP and HTTPS objects do not cross-share. - GET and suitable HEAD requests may reuse a full object; changing request methods do not silently invalidate all cached GET results. -- Authorization, dynamic cookies, `Set-Cookie`, sticky-affinity cookies, Tinyauth and other private signals normally cause **BYPASS**. A limited static-file cookie exception exists for configured static extensions and does not override `private`, `no-store`, `Set-Cookie` or `Vary: Cookie`. +- Authorization, dynamic cookies, `Set-Cookie`, sticky-affinity cookies, Tinyauth and other private signals normally cause **BYPASS**. The static-extension exception may ignore `Vary: Cookie` only if the explicitly public response is otherwise safe to store and the global/vhost option is on. It never overrides `private`, `no-store` or `Set-Cookie`; the origin must guarantee that the complete asset response is not session-dependent. - Origin status, response size, TTL, unsupported metadata, range/conditional semantics and request/client cache directives can prevent fill or require validation. - A Web Service selected as a Vhost source uses the same cache policy for eligible local files. File changes can be checked with `ETag` / `Last-Modified`; a 304 validation may refresh a stored body without downloading it again. diff --git a/docs/CERTIFICATES.md b/docs/CERTIFICATES.md index 229fbd9..7428e2a 100644 --- a/docs/CERTIFICATES.md +++ b/docs/CERTIFICATES.md @@ -108,3 +108,7 @@ The tab lists the existing keys first: permission badge (*reload only* or *deplo - **SNI field does not auto-fill:** check the read status below the paths, grant access to the public certificate, then use **Read names from certificate**. A manually edited/cleared field is intentionally preserved until this explicit action; a certificate without DNS SAN entries supplies no names. Keep a private encrypted application backup and a separate copy of any external certificate/key material. See [Backup and recovery](BACKUP.md) and [Security](SECURITY.md). + +## Generate form confirmations + +In **Certificates → Generate**, **Sign SOA discovery query** (RFC 2136), **I accept the Let's Encrypt subscriber agreement**, and **I confirm production issuance** use the same on/off switch presentation as other settings when **Settings → Appearance → Show on/off settings as switches** is enabled. The agreement and production confirmations remain required for applicable submissions; changing their appearance does not auto-confirm anything. diff --git a/docs/DOCKER_DISCOVERY.md b/docs/DOCKER_DISCOVERY.md index 8b9fb81..ac09a0b 100644 --- a/docs/DOCKER_DISCOVERY.md +++ b/docs/DOCKER_DISCOVERY.md @@ -150,7 +150,7 @@ In **Docker vhosts**, select the service and set: | **Force HTTPS / WebSockets** | Enable only when needed and when the right frontend listeners exist. | | **Cache / compression / transforms** | Optional; obey the global limits and privacy policy of the application. With **Cache** enabled, **Cache for this vhost** sets a default TTL (empty = global default) and the same cache rules editor as an ordinary vhost (templates, VCL import/preview, tester, *Ignore global cache rules*); see [Cache rules](CACHE.md#cache-rules-vcl-style). Stored as `cache_default_ttl_seconds`, `cache_rules` and `cache_ignore_global_rules` on the assignment. | **Security and access** | Everything an internet-facing app usually needs, without creating an ordinary vhost: **HTTP Basic Auth** (see below), **HTTP methods** (allow only / block listed, the same method picker as vhosts), **per-client IP rate limit** (requests per window and burst; exceeded requests get `429`), **country access** (block or allow only listed countries via GeoIP; country rules of ACL profiles also apply), **security headers** (HSTS with max-age and includeSubDomains, `X-Content-Type-Options: nosniff`, `X-Frame-Options`, `Referrer-Policy`) and **Use verified Cloudflare client IP** when the app is behind Cloudflare. The summary line of the section shows what is active. Stored as `method_policy`, `rate_limit`, `security_headers` and `cloudflare_client_ip`; unused options are not stored. Docker apps have no login of their own; to require one, publish the app through an ordinary vhost with HTTP Basic Auth, forward auth or OIDC. | -| **Diagnostic headers** | `Server-Timing`, the selected backend (`X-Rust-Proxy-Backend`) and the backend time, for testing; keep them off in production. Stored as `timing_headers`, `backend_header`, `backend_timing_header`. | +| **Diagnostic headers** | `Server-Timing`, the selected backend (`X-Rust-Proxy-Backend`) and the backend time, for testing; keep them off in production. For Docker publications the backend header uses `/<12-character-service-hash>` (for example `node1/012345abcdef`), rather than the internal `docker-node1-012345abcdef/docker` identifier. Ordinary Vhosts retain their usual backend IDs; the change affects only header presentation, not routing, logs or metrics. Stored as `timing_headers`, `backend_header`, `backend_timing_header`. | | **Health / ACL / timeouts** | **Access control** shows the agent default ACL profiles pre-selected (*Agent default in use: …*). Unchecking or changing them overrides the default for this service only; leaving them as they are keeps following the agent default. **Public vhost (no agent default ACL)** publishes the service without the agent default profiles (`inherit_acl_profiles: false`) and disables the per-app ACL; global block/allow rules still apply. Up to eight reusable ACL profiles per app; selected profiles appear as removable badges and the summary line shows the effective state. Optional inline ACL remains independently enforced. Explicit denies and country blocks beat merged allows. Test allowed and blocked clients. | ### HTTP Basic Auth for Docker apps diff --git a/docs/FEATURES.md b/docs/FEATURES.md index e7b36a7..a4897f6 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -52,7 +52,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se ## Access and security - IP/CIDR and DNS/DDNS allow/deny rules, reusable ACL profiles (up to eight per Vhost). -- Country allow/deny lists with automatic GeoIP database updates. +- Country allow/deny lists with automatic GeoIP database updates and a searchable country picker in global and Vhost security settings. - Request rate limiting per Vhost and globally, with burst and `Retry-After`. - HTTP method policy, request Content-Type denylist and User-Agent blocking. - Security headers: HSTS, CSP, X-Frame-Options, Referrer-Policy, Permissions-Policy, `nosniff`. @@ -64,7 +64,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se ## Cache and delivery - Shared HTTP cache with a memory tier (HOT) and an optional disk tier (COLD). -- RFC 9111 freshness, validators and `Vary`; stale-while-revalidate, stale-if-error and request coalescing. +- RFC 9111 freshness, validators and `Vary` with conservative header-aware normalization (known comma-list fields, language/encoding/charset qualities and media types), while preserving opaque values and quoted strings; stale-while-revalidate, stale-if-error and request coalescing. Configurable static-extension exception for cookie-independent assets: omit `Vary: Cookie` only for explicitly public cacheable responses, preserving all other Vary dimensions. - Varnish-compatible policy option, forced caching rules and per-location cache switches. - Graphical [cache rules](CACHE.md#cache-rules-vcl-style) in the spirit of VCL (bypass, cookies, query parameters, cache-key variants, TTL/grace, headers) per vhost and globally, with a request tester and VCL import. - RFC 9211 `Cache-Status` and optional `X-Cache` diagnostics. diff --git a/docs/HEADLESS.md b/docs/HEADLESS.md index 2384842..3710641 100644 --- a/docs/HEADLESS.md +++ b/docs/HEADLESS.md @@ -196,7 +196,7 @@ In a container, mount the file read-only (RustProxy never writes it) and keep `/ `GET /healthz` on `--health-listen` answers `200` while every vhost with backends has at least one healthy backend and `503` otherwise: ```json -{"status":"ok","mode":"headless","version":"0.38.6","revision":4,"uptime_seconds":120, +{"status":"ok","mode":"headless","version":"0.38.7","revision":4,"uptime_seconds":120, "last_reload":{"ok":true,"at_unix":1794743660,"error":null}, "vhosts_without_healthy_backends":[], "pools":[{"vhost":"app","healthy":3,"backends":3}]} diff --git a/docs/README.md b/docs/README.md index 2a67633..7cdc0bd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -36,7 +36,7 @@ Guides for operating RustProxy: installation, publishing services, security, cer ## Performance and delivery -- [Cache](CACHE.md) — HOT (memory) and COLD (disk) cache, freshness, `Cache-Status` and invalidation. +- [Cache](CACHE.md) — HOT/COLD cache, RFC 9111 `Vary` matching/normalization, safe static-asset cookie exceptions, freshness, `Cache-Status` and invalidation. - [Response delivery](RESPONSE_DELIVERY.md) — compression, transformations and response headers. ## Operations diff --git a/docs/VHOSTS.md b/docs/VHOSTS.md index 6203982..951991d 100644 --- a/docs/VHOSTS.md +++ b/docs/VHOSTS.md @@ -39,6 +39,10 @@ image/* Check with `curl -i -H 'Content-Type: multipart/form-data; boundary=test' --data 'x' https://your-vhost.example/upload` (expected **403**) and a valid application request without the blocked type. Applying this filter is **not a fix for an underlying PHP/application vulnerability**: keep PHP, extensions and application code patched. +## Country access picker + +Under **Vhosts → Edit → Security → Country access**, choose `Off`, `Block` or `Allow`, then search and select country names or ISO alpha-2 codes using the same picker as **Settings → Policies → Country access**. Selected codes are saved in the existing `rate_limit.country_access.countries` field. The picker is disabled in `Off` mode; switching back to `Allow` or `Block` preserves the selection. Country matching still needs the GeoIP database. No configuration migration is required. + ## Source and backends - **Reverse Proxy:** one Vhost has a backend pool. Each member has a configured URL, ID, enabled flag, weight, optional backup/drain state, health settings and capacity limits. diff --git a/integrations/routeros-oci-build/README.md b/integrations/routeros-oci-build/README.md index b6ca469..253aef6 100644 --- a/integrations/routeros-oci-build/README.md +++ b/integrations/routeros-oci-build/README.md @@ -77,10 +77,10 @@ ENV_FILE=integrations/routeros-oci-build/.env \ bash integrations/routeros-oci-build/build-routeros-oci.sh push ``` -For example, with RustProxy version `0.38.6` and the defaults this publishes: +For example, with RustProxy version `0.38.7` and the defaults this publishes: ```text -oci.example.net/network/rustproxy:0.38.6 +oci.example.net/network/rustproxy:0.38.7 oci.example.net/network/rustproxy:latest oci.example.net/network/rustproxy:routeros ``` diff --git a/langs/en_US.json b/langs/en_US.json index df976cc..b63e303 100644 --- a/langs/en_US.json +++ b/langs/en_US.json @@ -1015,11 +1015,11 @@ "vhCacheStaticCookie": "Ignore request cookies for selected static file extensions", "vhCacheStaticCustom": "Use a custom static extension list", "vhCacheStaticExtensions": "Static extensions (one per line, without dot)", - "vhCacheStaticHelp": "Inherit the global policy or override it for this vhost. Ignore Cookie only for files whose bytes do not depend on the session; Set-Cookie, private/no-store and Vary: Cookie still block shared storage.", + "vhCacheStaticHelp": "Inherited by default. Use cookie-independent static assets only: the global or vhost Vary: Cookie option can remove that field from public cacheable responses. Set-Cookie, private and no-store still prevent storage.", "cacheStaticTitle": "Static asset cache boost", "cacheStaticCookie": "Ignore request cookies for static files", "cacheStaticExtensions": "Global static extensions (one per line, without dot)", - "cacheStaticHelp": "Enable this only for files whose bytes do not depend on the session. Request Cookie then does not affect the shared cache key for these extensions; responses with Set-Cookie, private/no-store or Vary: Cookie are still never stored.", + "cacheStaticHelp": "Only enable these options if static file bytes never depend on a session. With the Vary: Cookie option (on by default), an explicitly public, cacheable response may omit Cookie from Vary while retaining other Vary fields. Set-Cookie, private, no-store and missing freshness still prevent storage.", "vhHttp2Enabled": "Enable HTTP/2 for this vhost", "vhFrontendProtocolsHelp": "H2 and H3 are per-vhost opt-outs. A switch is available only when at least one selected listener has that protocol enabled in Settings > Listeners.", "administration": "Administration", @@ -3699,6 +3699,8 @@ "alertSettingsDockerLink": "Settings → Docker agents", "alertSettingsNumberInvalid": "Enter a whole number.", "alertSettingsCertificateOrder": "The error threshold must be fewer days than the warning threshold.", - "alertSettingsPercentOrder": "The error threshold must be higher than the warning threshold." + "alertSettingsPercentOrder": "The error threshold must be higher than the warning threshold.", + "vhCacheStaticVaryCookie": "Ignore Vary: Cookie for public static assets (inherit/on/off)", + "cacheStaticVaryCookie": "Ignore Vary: Cookie for public static assets" } } diff --git a/langs/pl_pl.json b/langs/pl_pl.json index 30cee34..db2fa7e 100644 --- a/langs/pl_pl.json +++ b/langs/pl_pl.json @@ -1015,11 +1015,11 @@ "vhCacheStaticCookie": "Ignoruj Cookie żądania dla wybranych rozszerzeń statycznych", "vhCacheStaticCustom": "Użyj własnej listy rozszerzeń statycznych", "vhCacheStaticExtensions": "Rozszerzenia statyczne (po jednym w linii, bez kropki)", - "vhCacheStaticHelp": "Dziedzicz ustawienie globalne albo nadpisz je dla vhosta. Ignorowanie Cookie stosuj tylko do plików, których treść nie zależy od sesji; Set-Cookie, private/no-store i Vary: Cookie nadal blokują zapis do shared cache.", + "vhCacheStaticHelp": "Domyślnie dziedziczy ustawienia globalne. Stosuj tylko dla plików niezależnych od sesji: opcja Vary: Cookie może usunąć ten nagłówek z publicznych odpowiedzi nadających się do cache. Set-Cookie, private i no-store nadal blokują zapis.", "cacheStaticTitle": "Cache statycznych zasobów", "cacheStaticCookie": "Ignoruj Cookie żądania dla statycznych plików", "cacheStaticExtensions": "Globalne rozszerzenia statyczne (po jednym w linii, bez kropki)", - "cacheStaticHelp": "Włączaj tylko dla plików, których treść nie zależy od sesji. Cookie żądania nie wpływa wtedy na klucz cache dla podanych rozszerzeń; odpowiedzi z Set-Cookie, private/no-store lub Vary: Cookie nadal nie są zapisywane we współdzielonym cache.", + "cacheStaticHelp": "Włączaj tylko wtedy, gdy zawartość plików nie zależy od sesji. Opcja Vary: Cookie (domyślnie włączona) usuwa Cookie z Vary jedynie dla publicznych odpowiedzi nadających się do cache, zachowując pozostałe pola Vary. Set-Cookie, private, no-store i brak polityki świeżości nadal blokują zapis.", "vhHttp2Enabled": "Włącz HTTP/2 dla tego vhosta", "vhFrontendProtocolsHelp": "H2 i H3 są przełącznikami per vhost. Opcja jest aktywna tylko wtedy, gdy co najmniej jeden wybrany listener ma dany protokół włączony w Ustawienia > Listenery.", "administration": "Panel administracyjny", @@ -3699,6 +3699,8 @@ "alertSettingsDockerLink": "Ustawienia → Agenci Docker", "alertSettingsNumberInvalid": "Wpisz liczbę całkowitą.", "alertSettingsCertificateOrder": "Próg błędu musi mieć mniej dni niż próg ostrzeżenia.", - "alertSettingsPercentOrder": "Próg błędu musi być wyższy niż próg ostrzeżenia." + "alertSettingsPercentOrder": "Próg błędu musi być wyższy niż próg ostrzeżenia.", + "vhCacheStaticVaryCookie": "Ignoruj Vary: Cookie dla publicznych plików statycznych (dziedzicz/wł./wył.)", + "cacheStaticVaryCookie": "Ignoruj Vary: Cookie dla publicznych plików statycznych" } } diff --git a/src/admin/openapi.json b/src/admin/openapi.json index 7b89f04..da965a8 100644 --- a/src/admin/openapi.json +++ b/src/admin/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "RustProxy Administration API", - "version": "0.38.6", + "version": "0.38.7", "description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust. The API also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only." }, "servers": [ @@ -862,13 +862,19 @@ }, "timing_header_names": { "type": "string", - "enum": ["standard", "cdn", "legacy"], + "enum": [ + "standard", + "cdn", + "legacy" + ], "default": "standard", "description": "Metric names in Server-Timing. standard (reverse proxy): proxy;dur, upstream;dur, proxy-cache;desc. cdn (RustProxy is the outermost CDN-like edge): edge;dur, origin;dur, cdn-cache;desc. legacy (before 0.38.2): proxy;dur, origin;dur, cache;desc. The cache value is HIT, MISS, BYPASS, STALE or REVALIDATED." }, "timing_allow_origin": { "type": "array", - "items": { "type": "string" }, + "items": { + "type": "string" + }, "maxItems": 16, "description": "Timing-Allow-Origin sent with Server-Timing: origins such as https://app.example.com that may read the timings from scripts, or a single \"*\". Empty sends no header (same-origin scripts can always read them)." }, @@ -2513,6 +2519,11 @@ "$ref": "#/components/schemas/CacheRule" }, "description": "Global cache rules (Cache → Rules)." + }, + "static_ignore_vary_cookie": { + "type": "boolean", + "default": true, + "description": "For cookie-independent configured static extensions only, omit Cookie from Vary on explicitly public, otherwise cacheable responses. Requires static_ignore_cookies. Preserves other Vary dimensions and all private/no-store/Set-Cookie safeguards." } }, "additionalProperties": false @@ -3461,14 +3472,48 @@ "default": false, "description": "Explicit, persistent administrator opt-in: allow assigning a named public certificate to hostnames not covered by its DNS SAN. This does not suppress TLS client warnings, validate the certificate less during agent polling, or disable backend TLS verification. Requires a named certificate." }, - "timing_headers": { "type": "boolean", "default": false, "description": "Since 0.38.3. Server-Timing diagnostics for this Docker vhost." }, - "backend_header": { "type": "boolean", "default": false, "description": "Since 0.38.3. X-Rust-Proxy-Backend with the generated backend id." }, - "backend_timing_header": { "type": "boolean", "default": false, "description": "Since 0.38.3. X-RustProxy-Backend-Time with the origin response-header latency." }, - "cloudflare_client_ip": { "type": "boolean", "default": false, "description": "Since 0.38.3. Use verified Cloudflare client-IP and country headers, as on ordinary vhosts." }, - "method_policy": { "type": "object", "description": "Since 0.38.3. Same format as the vhost method_policy: mode off, allow or block with a list of methods." }, - "rate_limit": { "type": "object", "nullable": true, "default": null, "description": "Since 0.38.3. Same format as the vhost rate_limit (per-client IP limit and country_access); null = off." }, - "security_headers": { "type": "object", "nullable": true, "default": null, "description": "Since 0.38.3. Same format as the vhost security_headers (HSTS, nosniff, frame_options, referrer_policy, CSP, permissions policy); null = none." }, - "basic_auth": { "type": "object", "nullable": true, "default": null, "description": "Since 0.38.3. Same format as the vhost basic_auth: enabled, realm, require_tls, forward_credentials and users with Argon2id password_hash from POST /api/basic-auth/hash; null = no login." } + "timing_headers": { + "type": "boolean", + "default": false, + "description": "Since 0.38.3. Server-Timing diagnostics for this Docker vhost." + }, + "backend_header": { + "type": "boolean", + "default": false, + "description": "Since 0.38.3. X-Rust-Proxy-Backend with the generated backend id." + }, + "backend_timing_header": { + "type": "boolean", + "default": false, + "description": "Since 0.38.3. X-RustProxy-Backend-Time with the origin response-header latency." + }, + "cloudflare_client_ip": { + "type": "boolean", + "default": false, + "description": "Since 0.38.3. Use verified Cloudflare client-IP and country headers, as on ordinary vhosts." + }, + "method_policy": { + "type": "object", + "description": "Since 0.38.3. Same format as the vhost method_policy: mode off, allow or block with a list of methods." + }, + "rate_limit": { + "type": "object", + "nullable": true, + "default": null, + "description": "Since 0.38.3. Same format as the vhost rate_limit (per-client IP limit and country_access); null = off." + }, + "security_headers": { + "type": "object", + "nullable": true, + "default": null, + "description": "Since 0.38.3. Same format as the vhost security_headers (HSTS, nosniff, frame_options, referrer_policy, CSP, permissions policy); null = none." + }, + "basic_auth": { + "type": "object", + "nullable": true, + "default": null, + "description": "Since 0.38.3. Same format as the vhost basic_auth: enabled, realm, require_tls, forward_credentials and users with Argon2id password_hash from POST /api/basic-auth/hash; null = no login." + } }, "required": [ "service_key", diff --git a/src/admin/web/app/settings.js b/src/admin/web/app/settings.js index 4d1c029..89039e3 100644 --- a/src/admin/web/app/settings.js +++ b/src/admin/web/app/settings.js @@ -36,7 +36,7 @@ function renderSettings() { $("cache-proactive-enabled").checked = c.proactive_refresh_enabled === true; $("cache-proactive-before").value = c.proactive_refresh_before_expiry_seconds ?? 15; $("cache-proactive-percent").value = c.proactive_refresh_percent ?? 10; $("cache-proactive-inflight").value = c.proactive_refresh_max_inflight ?? 4; $("cache-query").checked = !!c.bypass_query; $("cache-prefixes").value = (c.bypass_prefixes || []).join("\n"); $("cache-http-invalidation-cidrs").value = (c.http_invalidation_allowed_cidrs || []).join("\n"); - $("cache-static-cookie").checked = c.static_ignore_cookies !== false; $("cache-static-extensions").value = (c.static_extensions || []).join("\n"); + $("cache-static-cookie").checked = c.static_ignore_cookies !== false; $("cache-static-vary-cookie").checked = c.static_ignore_vary_cookie !== false; $("cache-static-extensions").value = (c.static_extensions || []).join("\n"); $("cache-status-header").checked = !!c.expose_status; $("cache-hits-header").checked = !!c.expose_hits; $("cache-rfc-header").checked = !!c.expose_cache_status; $("cache-resident-age-header").checked = !!c.expose_resident_age; $("cache-only-hits").checked = !!c.expose_only_hits; $("cache-detailed-status").checked = !!c.expose_detailed_status; const viaHeader = c.via_header === undefined ? "RustProxy" : c.via_header; $("cache-via-enabled").checked = viaHeader !== null; $("cache-via-value").value = viaHeader || "RustProxy"; syncCacheVia(); @@ -376,7 +376,7 @@ bindSettingsForm("response-form", next => { next.compression = { min_bytes: Number($("compress-min").value) }; for (const name of ["gzip", "br", "zstd", "deflate"]) next.compression[name] = $(`compress-${name}`).checked; }, "response", next => ({ server_header: next.server_header, diagnostic_headers: next.diagnostic_headers, compression: next.compression })); bindSettingsForm("cache-form", next => { - next.cache = { ...(next.cache || {}), enabled: $("cache-enabled").checked, varnish_compatible: $("cache-varnish-compatible").checked, varnish_grace_seconds: Number($("cache-varnish-grace").value), memory_preset: selectedCacheMemoryPreset, max_bytes: Math.round(Number($("cache-memory").value) * 1048576), transient_max_bytes: Math.round(Number($("cache-transient-memory").value) * 1048576), max_object_bytes: Number($("cache-object").value) * 1024, max_entries: Number($("cache-entries").value), hot_eviction_max_objects: Number($("cache-eviction-limit").value), hot_auto_trim_enabled: $("cache-auto-trim-enabled").checked, hot_auto_trim_after_seconds: Number($("cache-auto-trim-after").value), hot_auto_trim_target_percent: Number($("cache-auto-trim-target").value), cold_enabled: $("cache-cold-enabled").checked, cold_preset: selectedCacheColdPreset, cold_path: $("cache-cold-path").value.trim(), cold_max_bytes: Math.round(Number($("cache-cold-bytes").value) * 1048576), cold_max_entries: Number($("cache-cold-entries").value), cold_queue_max_bytes: Math.round(Number($("cache-cold-queue-bytes").value) * 1048576), cold_gc_interval_seconds: Number($("cache-cold-gc-interval").value), cold_gc_max_delete: Number($("cache-cold-gc-max-delete").value), cold_after_seconds: Number($("cache-cold-after").value), cold_max_hot_seconds: Number($("cache-cold-max-hot").value), cold_on_idle: $("cache-cold-on-idle").checked, cold_on_age: $("cache-cold-on-age").checked, cold_on_lru: $("cache-cold-on-lru").checked, cold_on_shutdown: $("cache-cold-on-shutdown").checked, max_ttl_seconds: Number($("cache-ttl").value), default_ttl_seconds: Number($("cache-default-ttl").value), collapse_enabled: $("cache-collapse-enabled").checked, collapse_wait_timeout_ms: Number($("cache-collapse-timeout").value), collapse_timeout_fallback: $("cache-collapse-fallback").value, stale_if_error_timeout: $("cache-sie-timeout").checked, stale_if_error_connection: $("cache-sie-connection").checked, stale_if_error_dns: $("cache-sie-dns").checked, stale_if_error_tls: $("cache-sie-tls").checked, stale_if_error_statuses: $("cache-sie-statuses").value.split(/[\s,]+/).filter(Boolean).map(Number), proactive_refresh_enabled: $("cache-proactive-enabled").checked, proactive_refresh_before_expiry_seconds: Number($("cache-proactive-before").value), proactive_refresh_percent: Number($("cache-proactive-percent").value), proactive_refresh_max_inflight: Number($("cache-proactive-inflight").value), bypass_query: $("cache-query").checked, bypass_prefixes: $("cache-prefixes").value.split(/\r?\n/).map(v => v.trim()).filter(Boolean), http_invalidation_allowed_cidrs: $("cache-http-invalidation-cidrs").value.split(/[\n,]+/).map(v => v.trim()).filter(Boolean), static_ignore_cookies: $("cache-static-cookie").checked, static_extensions: $("cache-static-extensions").value.split(/[\n,]+/).map(v => v.trim().replace(/^\./, "").toLowerCase()).filter(Boolean), expose_status: $("cache-status-header").checked, expose_hits: $("cache-hits-header").checked, expose_cache_status: $("cache-rfc-header").checked, expose_resident_age: $("cache-resident-age-header").checked, expose_only_hits: $("cache-only-hits").checked, expose_detailed_status: $("cache-detailed-status").checked, via_header: $("cache-via-enabled").checked ? $("cache-via-value").value.trim() : null, rules: cacheRulesEditor ? cacheRulesEditor.read() : (next.cache?.rules || []) }; + next.cache = { ...(next.cache || {}), enabled: $("cache-enabled").checked, varnish_compatible: $("cache-varnish-compatible").checked, varnish_grace_seconds: Number($("cache-varnish-grace").value), memory_preset: selectedCacheMemoryPreset, max_bytes: Math.round(Number($("cache-memory").value) * 1048576), transient_max_bytes: Math.round(Number($("cache-transient-memory").value) * 1048576), max_object_bytes: Number($("cache-object").value) * 1024, max_entries: Number($("cache-entries").value), hot_eviction_max_objects: Number($("cache-eviction-limit").value), hot_auto_trim_enabled: $("cache-auto-trim-enabled").checked, hot_auto_trim_after_seconds: Number($("cache-auto-trim-after").value), hot_auto_trim_target_percent: Number($("cache-auto-trim-target").value), cold_enabled: $("cache-cold-enabled").checked, cold_preset: selectedCacheColdPreset, cold_path: $("cache-cold-path").value.trim(), cold_max_bytes: Math.round(Number($("cache-cold-bytes").value) * 1048576), cold_max_entries: Number($("cache-cold-entries").value), cold_queue_max_bytes: Math.round(Number($("cache-cold-queue-bytes").value) * 1048576), cold_gc_interval_seconds: Number($("cache-cold-gc-interval").value), cold_gc_max_delete: Number($("cache-cold-gc-max-delete").value), cold_after_seconds: Number($("cache-cold-after").value), cold_max_hot_seconds: Number($("cache-cold-max-hot").value), cold_on_idle: $("cache-cold-on-idle").checked, cold_on_age: $("cache-cold-on-age").checked, cold_on_lru: $("cache-cold-on-lru").checked, cold_on_shutdown: $("cache-cold-on-shutdown").checked, max_ttl_seconds: Number($("cache-ttl").value), default_ttl_seconds: Number($("cache-default-ttl").value), collapse_enabled: $("cache-collapse-enabled").checked, collapse_wait_timeout_ms: Number($("cache-collapse-timeout").value), collapse_timeout_fallback: $("cache-collapse-fallback").value, stale_if_error_timeout: $("cache-sie-timeout").checked, stale_if_error_connection: $("cache-sie-connection").checked, stale_if_error_dns: $("cache-sie-dns").checked, stale_if_error_tls: $("cache-sie-tls").checked, stale_if_error_statuses: $("cache-sie-statuses").value.split(/[\s,]+/).filter(Boolean).map(Number), proactive_refresh_enabled: $("cache-proactive-enabled").checked, proactive_refresh_before_expiry_seconds: Number($("cache-proactive-before").value), proactive_refresh_percent: Number($("cache-proactive-percent").value), proactive_refresh_max_inflight: Number($("cache-proactive-inflight").value), bypass_query: $("cache-query").checked, bypass_prefixes: $("cache-prefixes").value.split(/\r?\n/).map(v => v.trim()).filter(Boolean), http_invalidation_allowed_cidrs: $("cache-http-invalidation-cidrs").value.split(/[\n,]+/).map(v => v.trim()).filter(Boolean), static_ignore_cookies: $("cache-static-cookie").checked, static_ignore_vary_cookie: $("cache-static-vary-cookie").checked, static_extensions: $("cache-static-extensions").value.split(/[\n,]+/).map(v => v.trim().replace(/^\./, "").toLowerCase()).filter(Boolean), expose_status: $("cache-status-header").checked, expose_hits: $("cache-hits-header").checked, expose_cache_status: $("cache-rfc-header").checked, expose_resident_age: $("cache-resident-age-header").checked, expose_only_hits: $("cache-only-hits").checked, expose_detailed_status: $("cache-detailed-status").checked, via_header: $("cache-via-enabled").checked ? $("cache-via-value").value.trim() : null, rules: cacheRulesEditor ? cacheRulesEditor.read() : (next.cache?.rules || []) }; }, "cache"); bindSettingsForm("transform-form", next => { next.transform = { diff --git a/src/admin/web/index.html b/src/admin/web/index.html index eb02af2..67ca26c 100644 --- a/src/admin/web/index.html +++ b/src/admin/web/index.html @@ -1357,9 +1357,9 @@ - - + -

Cookie bypass is - limited to these file - extensions. Response privacy rules still apply.

+

Use only for + static assets that never depend on user sessions. Cookie is removed from Vary + only for explicitly public, cacheable responses; private, no-store and + Set-Cookie still prevent caching.

Cache response headers