v0.42.1
This commit is contained in:
1 parent
167861fc16
commit
aa0a271a1c
38 files changed
+3642
-1058
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
# RustProxy source and documentation maintenance
|
# RustProxy source and documentation maintenance
|
||||||
|
|
||||||
Current source version: **0.42.0**. The Cargo package and binary are named `rust-proxy`.
|
Current source version: **0.42.1**. 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.
|
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.
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
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.
|
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.42.1 — HTTP policy scenarios and editor improvements
|
||||||
|
|
||||||
|
- **Scenario presets:** the shared HTTP policy editor replaces the two standalone Vary preset buttons with a searchable, grouped catalog of 40 practical scenarios built from 54 rules. Recipes cover header cleanup, CORS, browser security, private/signed/preview requests, cache TTL/grace and revalidation, event streams, access filters, redirects, path rewrites, maintenance, backend selection and transaction diagnostics. Descriptions, setup notes and rule previews show each recipe's effect; configurable or sensitive additions start disabled. Location scope offers 39 scenarios because `pre_route` rewriting precedes location selection. Adding a scenario appends uniquely identified draft rules; saving the containing form activates enabled rules.
|
||||||
|
- **Condition builder:** added conditions have a readable list/count with advanced JSON available separately. The builder starts with a path comparison, checks missing and numeric values and condition limits, preserves nested AND/OR groups, and limits case-insensitive matching to suitable operators. Invalid JSON remains protected when switching views or rebuilding the editor. Available actions follow the selected policy stage.
|
||||||
|
- **Consistent layout and controls:** the stop-after-match setting occupies its own full-width row below the stage controls, with its scope explained. Policy checkboxes follow the administrator's switch preference, Documentation is styled as a matching button, and listener-choice cards have consistent alignment. The shared policy improvements appear in Vhosts, `settings?tab=policies`, Docker assignments and custom locations, with English and Polish text.
|
||||||
|
- **Panel layout:** aligned monitoring refresh buttons with their filters, listener switches, logging-format actions, Web Service preset controls and profile ID/name fields. Mobile live-log filters and actions keep readable widths; cache scenario and rule toolbars wrap cleanly, and cache pagination separates its counter from the navigation buttons. Redirect rule actions occupy their own row, while only the main editor footer stays sticky.
|
||||||
|
- **Vhost editor organization:** removed the separate Advanced tab. Locations JSON, Inline ACL JSON and Header rules JSON now sit beside the matching visual editors under Custom locations, Security and Headers. The drawers provide Apply JSON to draft, Format JSON and Reload from form, show unapplied changes, block saving invalid or pending JSON and reject overwriting a section changed concurrently in the visual form. Applying JSON updates the draft; Save Vhost remains the activation step. Existing `routes`, `acl` and `headers` fields are retained.
|
||||||
|
|
||||||
## 0.42.0 — HTTP policy rules with VCL cooperation
|
## 0.42.0 — HTTP policy rules with VCL cooperation
|
||||||
|
|
||||||
- **Source cleanup:** the preflight script now only checks the four core project files and never modifies the source tree. Removed legacy repair logic and commands/references to absent development tools. VCL test type aliases fix strict Clippy `type_complexity` diagnostics without suppressing warnings.
|
- **Source cleanup:** the preflight script now only checks the four core project files and never modifies the source tree. Removed legacy repair logic and commands/references to absent development tools. VCL test type aliases fix strict Clippy `type_complexity` diagnostics without suppressing warnings.
|
||||||
@@ -464,7 +472,7 @@ Panel-only release: no configuration, API or proxy behavior changes. Measured on
|
|||||||
- **Performance guide:** new documentation page with the benchmark method, a comparison with a similarly configured Nginx and production tuning advice.
|
- **Performance guide:** new documentation page with the benchmark method, a comparison with a similarly configured Nginx and production tuning advice.
|
||||||
- **About window:** redesigned with the project description, copyright, a GNU AGPL v3.0-or-later license summary and links to the project website, source code, built-in documentation and the full license text.
|
- **About window:** redesigned with the project description, copyright, a GNU AGPL v3.0-or-later license summary and links to the project website, source code, built-in documentation and the full license text.
|
||||||
- **License:** RustProxy is published under the GNU Affero General Public License v3.0 or later. The license text is included in the built-in documentation.
|
- **License:** RustProxy is published under the GNU Affero General Public License v3.0 or later. The license text is included in the built-in documentation.
|
||||||
- **Documentation:** rewritten project overview with a complete feature list, panel screenshots and links to [rustproxy.linuxiarz.pl](https://rustproxy.linuxiarz.pl/). Container, API access, post-quantum TLS and integration notes were merged into the related guides. The built-in Reader now displays tables and bold text.
|
- **Documentation:** rewritten project overview with a complete feature list, panel screenshots and links to [repo.linuxiarz.pl](https://repo.linuxiarz.pl/). Container, API access, post-quantum TLS and integration notes were merged into the related guides. The built-in Reader now displays tables and bold text.
|
||||||
|
|
||||||
## 0.35.0 — encoded-slash proxy compatibility and release cleanup
|
## 0.35.0 — encoded-slash proxy compatibility and release cleanup
|
||||||
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -1914,7 +1914,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rust-proxy"
|
name = "rust-proxy"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rust-proxy"
|
name = "rust-proxy"
|
||||||
version = "0.42.0"
|
version = "0.42.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.99.1"
|
rust-version = "1.99.1"
|
||||||
description = "RustProxy - independent reverse proxy with local administration"
|
description = "RustProxy - independent reverse proxy with local administration"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
**RustProxy** is a reverse proxy, web server, certificate manager and traffic monitor in a single service, managed from a built-in browser panel. It publishes many domains and backends without a separate configuration language: every setting is validated before it is applied and can be changed live from the panel or the API.
|
**RustProxy** is a reverse proxy, web server, certificate manager and traffic monitor in a single service, managed from a built-in browser panel. It publishes many domains and backends without a separate configuration language: every setting is validated before it is applied and can be changed live from the panel or the API.
|
||||||
|
|
||||||
- Website and packages: [rustproxy.linuxiarz.pl](https://rustproxy.linuxiarz.pl/)
|
- Website: [rustproxy.linuxiarz.pl](https://rustproxy.linuxiarz.pl/)
|
||||||
- Source code: [git.linuxiarz.pl/gru/RustProxy](https://git.linuxiarz.pl/gru/RustProxy)
|
- Source code: [git.linuxiarz.pl/gru/RustProxy](https://git.linuxiarz.pl/gru/RustProxy)
|
||||||
- Documentation: [docs/README.md](docs/README.md) (also built into the panel at `/docs`)
|
- Documentation: [docs/README.md](docs/README.md) (also built into the panel at `/docs`)
|
||||||
- License: [GNU AGPL v3.0 or later](LICENSE)
|
- License: [GNU AGPL v3.0 or later](LICENSE)
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
| Area | Capabilities |
|
| Area | Capabilities |
|
||||||
|---|---|
|
| --- | --- |
|
||||||
| Reverse proxy | HTTP/HTTPS backends, HTTP/1.1, HTTP/2 and H2C upstreams, load balancing, health checks, connection reuse, WebSockets, custom locations, retries and error fallbacks |
|
| Reverse proxy | HTTP/HTTPS backends, HTTP/1.1, HTTP/2 and H2C upstreams, load balancing, health checks, connection reuse, WebSockets, custom locations, retries and error fallbacks |
|
||||||
| Frontends | HTTP, HTTPS, HTTP/2, HTTP/3 (QUIC), named listeners, exact and wildcard domains, redirects, optional post-quantum TLS key exchange |
|
| Frontends | HTTP, HTTPS, HTTP/2, HTTP/3 (QUIC), named listeners, exact and wildcard domains, redirects, optional post-quantum TLS key exchange |
|
||||||
| Web Server | Static sites and downloads, `try_files`, rewrites, `.htaccess` subset, byte ranges, precompressed files, PHP-FPM |
|
| Web Server | Static sites and downloads, `try_files`, rewrites, `.htaccess` subset, byte ranges, precompressed files, PHP-FPM |
|
||||||
@@ -28,9 +28,9 @@ The complete list is in [Feature list](docs/FEATURES.md); a visual tour is in [S
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
| Platform | Method |
|
| Platform | Method |
|
||||||
|---|---|
|
| --- | --- |
|
||||||
| Debian, Ubuntu, RHEL, Rocky, Alma, Fedora | DEB/RPM packages from [rustproxy.linuxiarz.pl](https://rustproxy.linuxiarz.pl/) |
|
| Debian, Ubuntu, RHEL, Rocky, Alma, Fedora | DEB/RPM packages from [repo.linuxiarz.pl](https://repo.linuxiarz.pl/) |
|
||||||
| OPNsense | Plugin from [rustproxy-opn.linuxiarz.pl](https://rustproxy-opn.linuxiarz.pl/) |
|
| OPNsense | Plugin from [repo.linuxiarz.pl](https://repo.linuxiarz.pl/) |
|
||||||
| Debian 13+ from source | `install-debian13.sh` bootstrap script |
|
| Debian 13+ from source | `install-debian13.sh` bootstrap script |
|
||||||
| Any Linux with systemd | `cargo build --release`, then `install.sh` |
|
| Any Linux with systemd | `cargo build --release`, then `install.sh` |
|
||||||
| Docker / OCI | Included `Dockerfile` |
|
| Docker / OCI | Included `Dockerfile` |
|
||||||
|
|||||||
+35
-36
@@ -1,13 +1,13 @@
|
|||||||
61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore
|
61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore
|
||||||
4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example
|
4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example
|
||||||
0a5e87541831edca0e7164c6469dba01a8a7053ab14dbfb8019c83e4db10edc2 .gitignore
|
0a5e87541831edca0e7164c6469dba01a8a7053ab14dbfb8019c83e4db10edc2 .gitignore
|
||||||
e0fb5e3c9802fa95f8fcfecee18f5bed936e7c93c15ae81a20006a1c883bb70a AGENTS.md
|
1b9b764f579ce64485c2b2c9b0d717eb1875ac0c2aa86df2a24bcce16456ac54 AGENTS.md
|
||||||
6a3d09a98ed3cd62fd0a50897d8d00709f4d56e585a788b9edffaa9738bd747b CHANGELOG.md
|
f0b2ce9432c0c742bb528941a1b394ebd245822b2e3ec909d9e5cb56787a53b6 CHANGELOG.md
|
||||||
5ea6dce0bfe8db7e5e12807edbd0804e0269894f6648083a25e56d34c19ca527 Cargo.lock
|
aaf6d97af6fe4dc5a983fbc347934a50f20ce12beee6ffb9c681ec353794166f Cargo.lock
|
||||||
9240c31771784cb86f24f194ba79f594dbb898823a6a41705932acae48885177 Cargo.toml
|
1249af090f77e46e1cb1bb5bc2fcf22be7781b86fc9fccf626dc73e5b6e7c75f Cargo.toml
|
||||||
788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile
|
788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile
|
||||||
0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE
|
0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE
|
||||||
97dadb97158d0d7eccb11f9e882218a9496cd585f8fb28cf9c6a31a79114f4c2 README.md
|
6889fb8bc1edbb5aae65ec7a799270e2028ad6625f8c38488f3cb25d437e8c6c README.md
|
||||||
da8311e3db945290666324a2f24bf4521b365272d7ac3f862ded1be993eea646 UPDATE_CHECK.toml
|
da8311e3db945290666324a2f24bf4521b365272d7ac3f862ded1be993eea646 UPDATE_CHECK.toml
|
||||||
120609370b79e192c9a2a72c1706225aa5da06c5806efa26a010b733e120322b build.rs
|
120609370b79e192c9a2a72c1706225aa5da06c5806efa26a010b733e120322b build.rs
|
||||||
95ececaba550a4bcfd6754073877ba0633373b1e1451521b9ac905a51e8ca6eb deploy/README.md
|
95ececaba550a4bcfd6754073877ba0633373b1e1451521b9ac905a51e8ca6eb deploy/README.md
|
||||||
@@ -48,17 +48,17 @@ bfe96dd91dfc6e07918a662d98b036f12ceb011a5aa8381b3778bd0c964b19ab docs/CACHE.md
|
|||||||
209664f5937d88c857aab2db3ced9fdfc264b526671ef59b999a00c5d7678aa3 docs/CUSTOM_LOCATIONS.md
|
209664f5937d88c857aab2db3ced9fdfc264b526671ef59b999a00c5d7678aa3 docs/CUSTOM_LOCATIONS.md
|
||||||
16d4510e38d43c3bbde9b7dab7af3aeb0cb837dc2f1956cfaad7a9a11bea3bfc docs/DASHBOARD.md
|
16d4510e38d43c3bbde9b7dab7af3aeb0cb837dc2f1956cfaad7a9a11bea3bfc docs/DASHBOARD.md
|
||||||
53cb0ce7db5ce25e4c2381de3a6e875d212deeed08861da63050de6c51a442bd docs/DOCKER_DISCOVERY.md
|
53cb0ce7db5ce25e4c2381de3a6e875d212deeed08861da63050de6c51a442bd docs/DOCKER_DISCOVERY.md
|
||||||
ffb639a56c2d4d14a6e8c2a0f95a4cf6baca9062363386ac9c30e1609e14fa33 docs/FEATURES.md
|
f42182261c07849fe3a19be72cc71305175ce33524bdaf791ed8d66656d96e2b docs/FEATURES.md
|
||||||
f7bb59821e0d6c45ae2a1789086fd9dab33d91c0ceae784ae68f64bd13b5f496 docs/HEADLESS.md
|
f7bb59821e0d6c45ae2a1789086fd9dab33d91c0ceae784ae68f64bd13b5f496 docs/HEADLESS.md
|
||||||
4282602f0b814841f71282040003bec91c24611e5152b33407b76e62357f8d3a docs/INSTALL.md
|
bce732d845c23ad677ae811e7529b9322ab41d04ca808e04087d0f76bccd9309 docs/INSTALL.md
|
||||||
3268808766ad66263e465f251dce18cff2e7ede355638dc2b0975870b1a5eead docs/LOAD_BALANCING.md
|
3268808766ad66263e465f251dce18cff2e7ede355638dc2b0975870b1a5eead docs/LOAD_BALANCING.md
|
||||||
425f1ca32172d987b6fabbd08076bbd091101193e103e9fe5452e0709159a2bd docs/LOGS.md
|
425f1ca32172d987b6fabbd08076bbd091101193e103e9fe5452e0709159a2bd docs/LOGS.md
|
||||||
3b889851ba3405247861391aefbcfcaa5a96cf9b09b3e0e0e412ec2f54e11b1a docs/MIGRATION.md
|
3b889851ba3405247861391aefbcfcaa5a96cf9b09b3e0e0e412ec2f54e11b1a docs/MIGRATION.md
|
||||||
48105c4303401aa99ffff00d3ebaf3024535a492a4a7b883c6803e4732b37434 docs/MONITORING.md
|
48105c4303401aa99ffff00d3ebaf3024535a492a4a7b883c6803e4732b37434 docs/MONITORING.md
|
||||||
6d3937088eeb67a9f690d44ebe0b6e660b68116dbf69091ac7816bdc52cec2b6 docs/PERFORMANCE.md
|
6d3937088eeb67a9f690d44ebe0b6e660b68116dbf69091ac7816bdc52cec2b6 docs/PERFORMANCE.md
|
||||||
d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md
|
d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md
|
||||||
46e8d3017f644d8bd293d2ccca2555aa83e4261f743a64c47552022ee5a6bfd8 docs/POLICY.md
|
45ce24998bda40e60f34756bef29616114aec9fd5cdd5e1aed692ff2371a3af1 docs/POLICY.md
|
||||||
eb1876d1a2f76108be40a6e8745ec9c41437024ab2ae8374e11c319d3ec0741f docs/README.md
|
28f4c4faa850dc13e9431eeec2a3c776f227f6839d071dc0baeab7e50c3faa38 docs/README.md
|
||||||
e90842a75459ddb5892334f66a4139d9301280b4d0c17077d211749bd7c90d80 docs/RESPONSE_DELIVERY.md
|
e90842a75459ddb5892334f66a4139d9301280b4d0c17077d211749bd7c90d80 docs/RESPONSE_DELIVERY.md
|
||||||
95ab4786792d5920a2e109b7d196838057f24b512a69d713fb5884dc75c84339 docs/SCREENSHOTS.md
|
95ab4786792d5920a2e109b7d196838057f24b512a69d713fb5884dc75c84339 docs/SCREENSHOTS.md
|
||||||
3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md
|
3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md
|
||||||
@@ -66,10 +66,10 @@ a1f69782b08d395a9672250eaac4595ffb1465b66a7a62901781a01a9030c6a0 docs/STREAMS.m
|
|||||||
c9c9a0b401f0565f15b834d855bfdb34edb3eab46bff03d9e0825af204d20bf8 docs/TODO.md
|
c9c9a0b401f0565f15b834d855bfdb34edb3eab46bff03d9e0825af204d20bf8 docs/TODO.md
|
||||||
c4407cbd70d181e87f64e8d1736624d7b8b59a04b915ad3464f0e1f16d474e99 docs/TRANSPORT.md
|
c4407cbd70d181e87f64e8d1736624d7b8b59a04b915ad3464f0e1f16d474e99 docs/TRANSPORT.md
|
||||||
1335bc863391858ff4d584eb7f8ad771e270d36708061f2a1bff09de7906a8ab docs/TROUBLESHOOTING.md
|
1335bc863391858ff4d584eb7f8ad771e270d36708061f2a1bff09de7906a8ab docs/TROUBLESHOOTING.md
|
||||||
a9bd4c63756ec7021a437bc361b32ba8721167140e14473aed8df1bd58b165db docs/VCL.md
|
53005e1eeb460c960794e2b2f1ab7cfc472c510b14bea3193d25f5f81ba7a1e4 docs/VCL.md
|
||||||
0656fb488d6c9ff449ff0205ee22287e488267a82e7f9cf9d0e4dff44925b76f docs/VCL_SUPPORT_MATRIX.md
|
4a5534b628c18f4e83c67c6136b60969c884391fbe55cc6bd4f2354711d8ffb7 docs/VCL_SUPPORT_MATRIX.md
|
||||||
382e084a1f9e35627ccb43eaf451c18fb6d0cc752397c2178108d71de592a931 docs/VCL_TRAFFIC_COOKBOOK.md
|
382e084a1f9e35627ccb43eaf451c18fb6d0cc752397c2178108d71de592a931 docs/VCL_TRAFFIC_COOKBOOK.md
|
||||||
8d65c10ac7be9a315c788cacd0ddb0b02433a7774f0567c6574d92e0cd69f2da docs/VHOSTS.md
|
181444ea2c28171ed89ead25dcfc60ee6bd05f7b01c1a49d8248a307dc9be7a4 docs/VHOSTS.md
|
||||||
495c9977cb24995acb8cc846bd18cedc3957ab262c5134362bb0e9c9d2246680 docs/WEB_SERVER.md
|
495c9977cb24995acb8cc846bd18cedc3957ab262c5134362bb0e9c9d2246680 docs/WEB_SERVER.md
|
||||||
42822b1c9801bcadb0e2d785cb91883ca2df1da141222631f153030c95f5e197 docs/images/about.png
|
42822b1c9801bcadb0e2d785cb91883ca2df1da141222631f153030c95f5e197 docs/images/about.png
|
||||||
deff2393a987ac7102179dc85b48baf2c4a3882291bb8c7c584d760cc497c631 docs/images/api.png
|
deff2393a987ac7102179dc85b48baf2c4a3882291bb8c7c584d760cc497c631 docs/images/api.png
|
||||||
@@ -136,8 +136,8 @@ e9cbb0224c4a3d23a6019ba557e0cd568c1ad5e1582ff1e335fb7d99b7a1055d integrations/r
|
|||||||
3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh
|
3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh
|
||||||
3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh
|
3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh
|
||||||
ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md
|
ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md
|
||||||
1bc02d07b52899120c019d071d09d40e2a0676479bbe6dcd7075386f332c8ade langs/en_US.json
|
fd79669fb238461aac1953c3103770b58eb4e405a48a164eada45e85d27ab085 langs/en_US.json
|
||||||
00bd1ce68b5dedbb0ed1fc0d55b07bdcbeed7977a8669fc90873c65cfa5c1b3b langs/pl_pl.json
|
96f0f4349d4f524bcba80ee11ce2ce568dc5fca98910f8958007179ea3f6deb7 langs/pl_pl.json
|
||||||
38773ed251a8c24af353f4744e498ae2bc7d4151df7927e942c4ac223f6008e1 make_zip.py
|
38773ed251a8c24af353f4744e498ae2bc7d4151df7927e942c4ac223f6008e1 make_zip.py
|
||||||
e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql
|
e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql
|
||||||
20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql
|
20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql
|
||||||
@@ -175,6 +175,7 @@ be88ca2163d84913e0d9ee97f95d3217d4a92fc7df122927336deae5f8fcfb3d scripts/prefli
|
|||||||
3d6a0503afc25beab79ddc86864bcbb15248ded7368d33aa64321b8cdff59933 scripts/resolve_dependencies_0312.sh
|
3d6a0503afc25beab79ddc86864bcbb15248ded7368d33aa64321b8cdff59933 scripts/resolve_dependencies_0312.sh
|
||||||
2a95ee85848d347b419dcc2c3a1c65b62d491081a554f5fb50623770a5c15b80 scripts/runtime/acme_provider.py
|
2a95ee85848d347b419dcc2c3a1c65b62d491081a554f5fb50623770a5c15b80 scripts/runtime/acme_provider.py
|
||||||
e69813fb1d3a4cdcfb7243964cc323fc21a603087bf2e84188fa42b9d3cee4b5 scripts/runtime/acme_rfc2136.py
|
e69813fb1d3a4cdcfb7243964cc323fc21a603087bf2e84188fa42b9d3cee4b5 scripts/runtime/acme_rfc2136.py
|
||||||
|
91c883cfdce94c8c22c98749f611317f538a112d29be4f3fb1fa460b8f29ceaa scripts/start_stream_backends.sh
|
||||||
22e880e98c7b9d700c7a4c02b9b1d543e5dbd1f4ecdca42813a1083165b32a19 scripts/version.py
|
22e880e98c7b9d700c7a4c02b9b1d543e5dbd1f4ecdca42813a1083165b32a19 scripts/version.py
|
||||||
78efae6c43732c0f5527d467bf07d1f890da361925416c89b58bc449d852fc2b src/acl.rs
|
78efae6c43732c0f5527d467bf07d1f890da361925416c89b58bc449d852fc2b src/acl.rs
|
||||||
1d55ecb2e104be1d3b19623a1380584724c106ed234d2e79fd2a2fef1d891ee3 src/acl/dynamic/mod.rs
|
1d55ecb2e104be1d3b19623a1380584724c106ed234d2e79fd2a2fef1d891ee3 src/acl/dynamic/mod.rs
|
||||||
@@ -210,7 +211,7 @@ f9b2c8fe62cc92d7693e46145b2543b12dd6d4943fe2d52c67ed6958d4af83de src/admin/docu
|
|||||||
e2253599b5e39510946729920d240711403a3889cc495eb49824296228f1d080 src/admin/file_logs_query.rs
|
e2253599b5e39510946729920d240711403a3889cc495eb49824296228f1d080 src/admin/file_logs_query.rs
|
||||||
1594c8666991c1d07487a6a718211ef404cf49114721960f7e119bb7f605e3d2 src/admin/logging_api.rs
|
1594c8666991c1d07487a6a718211ef404cf49114721960f7e119bb7f605e3d2 src/admin/logging_api.rs
|
||||||
781fd5f176dd8f2372f75bd90edcf160708e2d0a8d6a115ba4b283c0cd49eb2d src/admin/mod.rs
|
781fd5f176dd8f2372f75bd90edcf160708e2d0a8d6a115ba4b283c0cd49eb2d src/admin/mod.rs
|
||||||
0639c54b11b6ca908244c0d0b11c81383d0299ba58eb6644bb41314d3817679d src/admin/openapi.json
|
c0780d0016315050b7d487f48a55a056b1a58ac013d02f2a3ef30c7c73ddd527 src/admin/openapi.json
|
||||||
9f8842cdec27d703d1795dd6eb37d9420e9f5a2e56a0df93278c92bace5d1f4c src/admin/operations.rs
|
9f8842cdec27d703d1795dd6eb37d9420e9f5a2e56a0df93278c92bace5d1f4c src/admin/operations.rs
|
||||||
257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs
|
257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs
|
||||||
f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs
|
f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs
|
||||||
@@ -222,7 +223,7 @@ ea202c67d9acb7614046f153beecdff10d5822b3d5627eaf2ebda33954b36474 src/admin/pref
|
|||||||
62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs
|
62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs
|
||||||
7a00e4ab943f74d2b1bdcbfab7f9cd3f584e9f59536b4aca6c4c31f5f5508d12 src/admin/public/tests.rs
|
7a00e4ab943f74d2b1bdcbfab7f9cd3f584e9f59536b4aca6c4c31f5f5508d12 src/admin/public/tests.rs
|
||||||
6930b4f4b45257772b321b20a9becdf9bc4610274852948ba38c2d0cdf02dfaf src/admin/refresh_preferences.rs
|
6930b4f4b45257772b321b20a9becdf9bc4610274852948ba38c2d0cdf02dfaf src/admin/refresh_preferences.rs
|
||||||
9085350f0859101249cbb1356a60234c747b10a92557f3781cdfdab29df8fe09 src/admin/router.rs
|
7a680e100aec9ad68b360ed23d364e755915b6a810cacbd82890e8d99856187f src/admin/router.rs
|
||||||
fba52102e77ca8871a42f97c91be8f10a9aa4f997868652d550fff3fbd41b66e src/admin/session.rs
|
fba52102e77ca8871a42f97c91be8f10a9aa4f997868652d550fff3fbd41b66e src/admin/session.rs
|
||||||
1c4d04b14a508fca7537f54e660124f4dae1964b48d7bd3b878ec4faa7156805 src/admin/status.rs
|
1c4d04b14a508fca7537f54e660124f4dae1964b48d7bd3b878ec4faa7156805 src/admin/status.rs
|
||||||
9b5bc1a439c5e5611c47732fe86097877b50b09b10a0838d9813314ea6232d0c src/admin/status_live.rs
|
9b5bc1a439c5e5611c47732fe86097877b50b09b10a0838d9813314ea6232d0c src/admin/status_live.rs
|
||||||
@@ -264,16 +265,16 @@ b7ead49224a4ec67181d3f24f9d9634bd6d76756f826a4d5d993300637d1d8f3 src/admin/web/
|
|||||||
ba22ff211f408052aee0aa75a5a52734b1c257247e7112972aff75a9646faf22 src/admin/web/cache-panel.js
|
ba22ff211f408052aee0aa75a5a52734b1c257247e7112972aff75a9646faf22 src/admin/web/cache-panel.js
|
||||||
433f5ccf0a4df1c4452f746f7b2f351f6712ee73873cb07204638c205e4f2c88 src/admin/web/cache-rules.js
|
433f5ccf0a4df1c4452f746f7b2f351f6712ee73873cb07204638c205e4f2c88 src/admin/web/cache-rules.js
|
||||||
6288b0a8228d828ac2e2535ace2d1aefd1c04011e789eb97f7279129874ac35c src/admin/web/certificate-api.js
|
6288b0a8228d828ac2e2535ace2d1aefd1c04011e789eb97f7279129874ac35c src/admin/web/certificate-api.js
|
||||||
f554ca7179fe4d97ae24aa004d4bc9ada5f84fc78257891933a7fed728006ef8 src/admin/web/css/00-tokens.css
|
c2912a5e218896177776d4c5920e240092a3de66f9a4b95c1631796771e0ce3c src/admin/web/css/00-tokens.css
|
||||||
fd33db7132f8d6f98c46b60e882d1521cdae905176900fc50cfc7cc58d22d7b3 src/admin/web/css/10-base.css
|
79f62673d36fd7ddc2b79729bcfc2b80d290712e38d3b6f18fca4573487c6959 src/admin/web/css/10-base.css
|
||||||
2e163a7f82c51525df24fb7895c8f6d9cb374fd58544b3f4516882c6003ab316 src/admin/web/css/20-shell.css
|
9cd9b62ff8cfba47cb180e29ea5f69b8e97c7817dfcfddcb55fc4e08d11a7184 src/admin/web/css/20-shell.css
|
||||||
5c2b8f73624d83801ad7f408680e93f7761749f221791995da52f0bb475c9037 src/admin/web/css/30-overview.css
|
5af483ff7937ff245d8718179dc6001716d2b279f6ce935f5aa0c9fcfa370ab8 src/admin/web/css/30-overview.css
|
||||||
585c5146f86c5bb91e0e5167c57cbc441bb4d46bffcaa01bf34ff636af70672d src/admin/web/css/40-editors.css
|
2763ff8969567cbd001ba4b5d5b669aea7aec347088ffe7c2b164b82396755d5 src/admin/web/css/40-editors.css
|
||||||
53ceb0dc4b958f1eded1e1a0e58e585ef13e4ebb45b797ba1b8534b552ea6c16 src/admin/web/css/50-settings.css
|
5dc4d6c8329e44e9a5bba4b5ef8d5afaca8fabf580954c3578e63187eee6f92d src/admin/web/css/50-settings.css
|
||||||
80df922a015bc6a390652ca74d5eeea726af32678b453ec8bec0e5d5ff8d30e6 src/admin/web/css/55-policy.css
|
3c6914b1a896627abd83efca18c7c4d769b8d6e301bf5cf95044b0325cb26082 src/admin/web/css/55-policy.css
|
||||||
6c369dc95db9f60680f38218fb504eb552bb05da3e819eeca44527f14a23d51e src/admin/web/css/60-monitoring.css
|
1bda60afe216056d74776774c2afbb9dfda1ff6b4628835fa6951e7bdee1a171 src/admin/web/css/60-monitoring.css
|
||||||
5ca5f911d7ded39a34c5c65980f82cc4d39cfa911cb9554550dfc78bba48461d src/admin/web/css/70-responsive.css
|
28202c943f6b98157eb4f25354f51a245ffa0b6e035f997901e460ea24d538b8 src/admin/web/css/70-responsive.css
|
||||||
2b17a65d83ce699a25bc74142e02f0aeb2d849004d7479dda158501029ad23fb src/admin/web/css/README.md
|
4149881632a6ed48340443c51362c59d2ac7ae16eba8d724fa9a9555d2af8314 src/admin/web/css/README.md
|
||||||
ea08fbe1a616042f2dab32d829dba837660a5facb068bb9d5a9b3abdb5c00717 src/admin/web/css/manifest.json
|
ea08fbe1a616042f2dab32d829dba837660a5facb068bb9d5a9b3abdb5c00717 src/admin/web/css/manifest.json
|
||||||
7d3c09f13e3026e3230f35472a9d163b790c7c68b672127ed9fb0e66b26e3d70 src/admin/web/dashboard-builtin-presets.json
|
7d3c09f13e3026e3230f35472a9d163b790c7c68b672127ed9fb0e66b26e3d70 src/admin/web/dashboard-builtin-presets.json
|
||||||
78bf6179f769b68d518028464697e50dea5d75e33ecb1b89d88e2c2b01e86bf2 src/admin/web/dashboard-defaults.json
|
78bf6179f769b68d518028464697e50dea5d75e33ecb1b89d88e2c2b01e86bf2 src/admin/web/dashboard-defaults.json
|
||||||
@@ -300,7 +301,7 @@ e6c4d91d1542d0a5b47bb8736f9539d43a6713df5a473b635519d5b7eac2eb9c src/admin/web/
|
|||||||
0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg
|
0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg
|
||||||
e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js
|
e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js
|
||||||
85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js
|
85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js
|
||||||
45cb6a2228e412226d23b1598ce0c4fe5b5f7f102fc8c9196a0dc63401164a0e src/admin/web/index.html
|
2fd6a462dc2d66d617052cbfffba24086809fa7b2650b17982180907f1b5a889 src/admin/web/index.html
|
||||||
be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js
|
be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js
|
||||||
7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json
|
7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json
|
||||||
ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html
|
ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html
|
||||||
@@ -308,27 +309,25 @@ c2e5f554810b8e34fb47361fb90a01073a2e332ee26d82e030956fad3ec1f83e src/admin/web/
|
|||||||
6185182b81273372dbd506fa57281ee81d3cd1233ac328640a7f33794f754e1b src/admin/web/management.js
|
6185182b81273372dbd506fa57281ee81d3cd1233ac328640a7f33794f754e1b src/admin/web/management.js
|
||||||
1f3d10e389c9c20e6eb019509fa6e82b50c6b43bbf988c1210a4d42bb73985d0 src/admin/web/partials/overview-charts.html
|
1f3d10e389c9c20e6eb019509fa6e82b50c6b43bbf988c1210a4d42bb73985d0 src/admin/web/partials/overview-charts.html
|
||||||
bd94e61e051a6bebe0afbda0a21aa36349c2067516b974986765555ed47455cc src/admin/web/partials/overview-metrics.html
|
bd94e61e051a6bebe0afbda0a21aa36349c2067516b974986765555ed47455cc src/admin/web/partials/overview-metrics.html
|
||||||
f8173daf375c43f9356bf19c7290ca8d17db3a735f6922ce82a6603ca5acd85e src/admin/web/policy.js
|
8bb503677f51362dc3cc9522596affa65c5960ab5e44b1c935cb4abf85505429 src/admin/web/policy-presets.js
|
||||||
|
943121aaaaddcee81ce70fb153820666d06a41abab17d60c20c7e3dba1894f8c src/admin/web/policy.js
|
||||||
80d6eb03f204a90f7b140c5b053d0fd8facb350b1c96b74fa1402e2a35d4fb10 src/admin/web/prometheus-token.js
|
80d6eb03f204a90f7b140c5b053d0fd8facb350b1c96b74fa1402e2a35d4fb10 src/admin/web/prometheus-token.js
|
||||||
b2d4b67fb65c55003e516e23dd783de55b0f00278035f16589f156a4659b7a54 src/admin/web/redirects.js
|
bb16f579d1de89c565c95adb496def4051553f17d928d2128f4bf08ca66e5ca1 src/admin/web/redirects.js
|
||||||
86700d2cb268ecf6eae8292acc6513b9c650810a5290823e7e2d69f836ba3537 src/admin/web/settings.js
|
86700d2cb268ecf6eae8292acc6513b9c650810a5290823e7e2d69f836ba3537 src/admin/web/settings.js
|
||||||
8eadbada619b15087783dcfa0e889a81f88e78034d084c5ab616f7912b835940 src/admin/web/status_200.html
|
8eadbada619b15087783dcfa0e889a81f88e78034d084c5ab616f7912b835940 src/admin/web/status_200.html
|
||||||
6322e589c449eee6db9c3499bb5643d6261f5fc3a5d730cff12cef70d5699fa2 src/admin/web/streams.js
|
6322e589c449eee6db9c3499bb5643d6261f5fc3a5d730cff12cef70d5699fa2 src/admin/web/streams.js
|
||||||
14ef42dec556c5fa62ff4ed4d6865d28f322e8e963dc43e3a714ef9d0af12ac6 src/admin/web/system-info.js
|
14ef42dec556c5fa62ff4ed4d6865d28f322e8e963dc43e3a714ef9d0af12ac6 src/admin/web/system-info.js
|
||||||
cb125143a071c89a686be2f8fb684ed73c350bd2e2423c34e640fb33236686f4 src/admin/web/tests/cache-rules.dom.test.cjs
|
|
||||||
9896ce1af9e1793b33e555c283e83e7956eaa03263805e0fd074bfdb1b455214 src/admin/web/tests/policy.dom.test.cjs
|
|
||||||
af19ed0f3545b7f8184e4ff73ab3e654d15223813df197dac887e91e0154b287 src/admin/web/tests/policy.test.cjs
|
|
||||||
12db5600c14cadbbbe7676b170b058e9695108d2661d9cd6b61fe91d355ac731 src/admin/web/tls-configurator.js
|
12db5600c14cadbbbe7676b170b058e9695108d2661d9cd6b61fe91d355ac731 src/admin/web/tls-configurator.js
|
||||||
336cc5b2a3e5e2514b6b15eed5f2b1ba714458d0e3e913d6f9ad7c870623c758 src/admin/web/traffic-panel.js
|
336cc5b2a3e5e2514b6b15eed5f2b1ba714458d0e3e913d6f9ad7c870623c758 src/admin/web/traffic-panel.js
|
||||||
675ea169d4cc55fda5e291af536338b882bede1eaa6c9d5cc7dfde0779c7c4d1 src/admin/web/transform-panel.js
|
675ea169d4cc55fda5e291af536338b882bede1eaa6c9d5cc7dfde0779c7c4d1 src/admin/web/transform-panel.js
|
||||||
c30373b0f2dc5672f88bc6fad0ffd5f6d85496d75da8fae83c6aa306e4e0f676 src/admin/web/vhosts/balancing.js
|
c30373b0f2dc5672f88bc6fad0ffd5f6d85496d75da8fae83c6aa306e4e0f676 src/admin/web/vhosts/balancing.js
|
||||||
fd3bb828c0daeb06ca7bdc108c7e471c7ac4421b02caacbf8563e80ad6ec7b9f src/admin/web/vhosts/core.js
|
2035bbee6d91aa124fecc0de4fb97c418b7cdba7fb06a3dde0885b929bc9ffff src/admin/web/vhosts/core.js
|
||||||
786f89e025e9273a9c550b128871f0539789129c118220e52ed6201a0affd418 src/admin/web/vhosts/editor.js
|
3865d62d562f1aed0405bc4a392c2c977ecbe8a330f344bb501a70edb028ea20 src/admin/web/vhosts/editor.js
|
||||||
f082588c35d981fc689542d4c12a7614638279335220d587fdee5d3fff822e80 src/admin/web/vhosts/headers-tab.js
|
f082588c35d981fc689542d4c12a7614638279335220d587fdee5d3fff822e80 src/admin/web/vhosts/headers-tab.js
|
||||||
3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js
|
3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js
|
||||||
b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js
|
b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js
|
||||||
8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js
|
8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js
|
||||||
812349f5a83c324f626ead937a791a97b50c8ab92f1e66b0fc798d417b752269 src/admin/web/vhosts/render.js
|
fafb4f9e8f123c93a5277052a375a9d2dd8f986322abd17f2206c16f0c37df06 src/admin/web/vhosts/render.js
|
||||||
90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js
|
90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js
|
||||||
683b6506989d6ca9f3a0b1da7c1c931dce3ea3fbcb95dd9c56b038ac9a1c977c src/admin/web/web-server-profiles.js
|
683b6506989d6ca9f3a0b1da7c1c931dce3ea3fbcb95dd9c56b038ac9a1c977c src/admin/web/web-server-profiles.js
|
||||||
f9854526ff1567de47ecb02af872bca6e13c0adb984ad5ef0c256e5fdbb3902e src/admin/web/web-server.js
|
f9854526ff1567de47ecb02af872bca6e13c0adb984ad5ef0c256e5fdbb3902e src/admin/web/web-server.js
|
||||||
@@ -465,7 +464,7 @@ e8399753a6ff49b7de19edb0a268bf871c9979a518354160cf07b4669051fcbb src/logging.rs
|
|||||||
2da02bccfffa206305d95b34a4d73924db2873d5706e17a6d409083b41ab436e src/logging/runtime.rs
|
2da02bccfffa206305d95b34a4d73924db2873d5706e17a6d409083b41ab436e src/logging/runtime.rs
|
||||||
1e161754359808f921bf19fe2b124fcd99c70983fa4800bb93b0ac9e3068f47e src/logging/tests.rs
|
1e161754359808f921bf19fe2b124fcd99c70983fa4800bb93b0ac9e3068f47e src/logging/tests.rs
|
||||||
560c3a022a163a751d7b568d9493076500effdac34dc29cf5aa2954487504619 src/main.rs
|
560c3a022a163a751d7b568d9493076500effdac34dc29cf5aa2954487504619 src/main.rs
|
||||||
68cdb4581e5940d2440ed2c3bd34d82511897a691c0c8c9b7b32ca2fbacb4dee src/main/admin_runtime.rs
|
adbe7240ed3230dbdf37e5f5678718a14fa234e15c1907a16dc81ae8961470b7 src/main/admin_runtime.rs
|
||||||
9a58cb68f64f8d0c55de754832d8c638ee65e93ae48f492a43538951a71679a0 src/main/bootstrap.rs
|
9a58cb68f64f8d0c55de754832d8c638ee65e93ae48f492a43538951a71679a0 src/main/bootstrap.rs
|
||||||
48d5261771a382b6581ac02eb1fabbb4a5b8af44468a5a8a81b8a6db0792fb1b src/main/headless.rs
|
48d5261771a382b6581ac02eb1fabbb4a5b8af44468a5a8a81b8a6db0792fb1b src/main/headless.rs
|
||||||
5a98d0e249338e73aa57ae2e352dc16db2f79c2d042c1544ce1c2022da76a31c src/main/proxy_runtime.rs
|
5a98d0e249338e73aa57ae2e352dc16db2f79c2d042c1544ce1c2022da76a31c src/main/proxy_runtime.rs
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
|
|||||||
|
|
||||||
| Feature | Details |
|
| Feature | Details |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Vhosts | Exact and wildcard hostnames, aliases, several listeners per Vhost, per-Vhost HTTP/2 and HTTP/3 switches |
|
| Vhosts | Exact and wildcard hostnames, aliases, several listeners per Vhost, per-Vhost HTTP/2 and HTTP/3 switches; visual editors with scoped JSON drawers for locations, inline IP ACLs and headers |
|
||||||
| Backends | HTTP and HTTPS origins, HTTP/1.1, automatic ALPN (H2/H1), strict HTTP/2 and H2C, optional upstream certificate verification with custom CA and server name |
|
| Backends | HTTP and HTTPS origins, HTTP/1.1, automatic ALPN (H2/H1), strict HTTP/2 and H2C, optional upstream certificate verification with custom CA and server name |
|
||||||
| Load balancing | Least connections (default), round robin, least traffic, adaptive, random (two choices), consistent hash of path / URI / host / header / cookie / query parameter / client IP with optional bounded load, and IP hash; member weights, backup and draining members, sticky cookie or IP affinity; per-location backend groups with their own algorithm (HAProxy `use_backend` style); in-panel distribution simulator. Conditional routing: locations and whole-host rules selected by header, cookie, query parameter, method, client IP/CIDR, host or country (AND of conditions, negation, regex), with an in-panel routing tester. Header rules accept HAProxy-style variables (`%[srv_id]`, `%[location]`, `%[hash_key]`, `%[cache_status]`, …) with one-click diagnostic header presets. See [Load balancing](LOAD_BALANCING.md) |
|
| Load balancing | Least connections (default), round robin, least traffic, adaptive, random (two choices), consistent hash of path / URI / host / header / cookie / query parameter / client IP with optional bounded load, and IP hash; member weights, backup and draining members, sticky cookie or IP affinity; per-location backend groups with their own algorithm (HAProxy `use_backend` style); in-panel distribution simulator. Conditional routing: locations and whole-host rules selected by header, cookie, query parameter, method, client IP/CIDR, host or country (AND of conditions, negation, regex), with an in-panel routing tester. Header rules accept HAProxy-style variables (`%[srv_id]`, `%[location]`, `%[hash_key]`, `%[cache_status]`, …) with one-click diagnostic header presets. See [Load balancing](LOAD_BALANCING.md) |
|
||||||
| Health checks | Active TCP or HTTP probes with thresholds, optional separate probe port, expected response text and live health status per member |
|
| Health checks | Active TCP or HTTP probes with thresholds, optional separate probe port, expected response text and live health status per member |
|
||||||
@@ -16,7 +16,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
|
|||||||
| Custom locations | Prefix, exact and regex paths, path rewriting, per-location backends, Web Services, local responses, redirects and internal error fallbacks |
|
| Custom locations | Prefix, exact and regex paths, path rewriting, per-location backends, Web Services, local responses, redirects and internal error fallbacks |
|
||||||
| WebSockets | HTTP/1.1 Upgrade, RFC 8441 (HTTP/2) and RFC 9220 (HTTP/3) Extended CONNECT |
|
| WebSockets | HTTP/1.1 Upgrade, RFC 8441 (HTTP/2) and RFC 9220 (HTTP/3) Extended CONNECT |
|
||||||
| Forwarding headers | `X-Forwarded-*`, `Forwarded`, `X-Real-IP`, trusted proxy ranges, Cloudflare client IP and country |
|
| Forwarding headers | `X-Forwarded-*`, `Forwarded`, `X-Real-IP`, trusted proxy ranges, Cloudflare client IP and country |
|
||||||
| HTTP policies | Optional global, Vhost, Docker-assignment and location policies: named ACLs, nested AND/OR/NOT, typed samples, maps, transaction variables, header/list operations and explicit request/response stages. Strict HAProxy subset importer, draft tester and [VCL cooperation](POLICY.md) with legacy precedence preserved. |
|
| HTTP policies | Optional global, Vhost, Docker-assignment and location policies: named ACLs, nested AND/OR/NOT, typed samples, maps, transaction variables, header/list operations and explicit request/response stages. Shared editor with 40 searchable scenarios built from 54 rules (39 scenarios at location scope), condition builder, JSON view, strict HAProxy subset importer and draft tester. Application/CORS/cache/security/routing presets show their defaults; recipes requiring setup are added disabled. [VCL cooperation](POLICY.md) preserves legacy precedence. |
|
||||||
| Redirects and pages | Redirect hosts, canonical host and HTTPS redirects, 404 hosts, custom error pages and direct-IP pages |
|
| Redirects and pages | Redirect hosts, canonical host and HTTPS redirects, 404 hosts, custom error pages and direct-IP pages |
|
||||||
| TCP/UDP Streams | Layer-4 forwarding with backend pools, health checks, session limits and idle timeouts |
|
| TCP/UDP Streams | Layer-4 forwarding with backend pools, health checks, session limits and idle timeouts |
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -5,10 +5,10 @@ Use maintained packages whenever possible. For custom installations, use the scr
|
|||||||
## Supported entry points
|
## Supported entry points
|
||||||
|
|
||||||
| Installation | Recommended starting point |
|
| Installation | Recommended starting point |
|
||||||
|---|---|
|
| --- | --- |
|
||||||
| Linux DEB/RPM (RustProxy server) | https://rustproxy.linuxiarz.pl/ |
|
| Linux DEB/RPM (RustProxy server) | <https://re.linuxiarz.pl/> |
|
||||||
| Docker host discovery agent (independent DEB/RPM) | `sudo apt install rustproxy-docker-agent` or `sudo dnf install rustproxy-docker-agent`; see [Docker discovery](DOCKER_DISCOVERY.md) |
|
| Docker host discovery agent (independent DEB/RPM)po | `sudo apt install rustproxy-docker-agent` or `sudo dnf install rustproxy-docker-agent`; see [Docker discovery](DOCKER_DISCOVERY.md) |
|
||||||
| OPNsense plugin | https://rustproxy-opn.linuxiarz.pl/ |
|
| OPNsense plugin | <https://rustproxy-opn.linuxiarz.pl/> |
|
||||||
| Debian 13+ source bootstrap | `install-debian13.sh` from the project repository |
|
| Debian 13+ source bootstrap | `install-debian13.sh` from the project repository |
|
||||||
| Manual Linux/systemd install | Compile the application; use `install.sh` and `update.sh` |
|
| Manual Linux/systemd install | Compile the application; use `install.sh` and `update.sh` |
|
||||||
| OCI container | Included `Dockerfile`; see [Docker / OCI container](#docker--oci-container) |
|
| OCI container | Included `Dockerfile`; see [Docker / OCI container](#docker--oci-container) |
|
||||||
@@ -56,7 +56,7 @@ Use `--plan` to inspect changes first. The installer refuses existing unmanaged/
|
|||||||
For the standard managed Linux installation:
|
For the standard managed Linux installation:
|
||||||
|
|
||||||
| Item | Default |
|
| Item | Default |
|
||||||
|---|---|
|
| --- | --- |
|
||||||
| HTTP frontend | `0.0.0.0:80` |
|
| HTTP frontend | `0.0.0.0:80` |
|
||||||
| HTTPS frontend | `0.0.0.0:443` with an initially self-signed certificate |
|
| HTTPS frontend | `0.0.0.0:443` with an initially self-signed certificate |
|
||||||
| Administration | `127.0.0.1:9090`, HTTP on loopback |
|
| Administration | `127.0.0.1:9090`, HTTP on loopback |
|
||||||
|
|||||||
+119
-2
@@ -18,8 +18,9 @@ below. VCL remains the owner of its existing cache-rule precedence and terminal
|
|||||||
- In the panel, open **Settings → Rules & headers → HTTP policies** globally,
|
- In the panel, open **Settings → Rules & headers → HTTP policies** globally,
|
||||||
**Vhost → Headers → HTTP policies**, the location's **HTTP policies** section,
|
**Vhost → Headers → HTTP policies**, the location's **HTTP policies** section,
|
||||||
or the Docker assignment's policy section. The shared editor offers a rule
|
or the Docker assignment's policy section. The shared editor offers a rule
|
||||||
builder, a JSON view, import preview and a draft tester. Reordering uses the
|
builder, scenario presets, a JSON view, import preview and a draft tester.
|
||||||
visible rule order; switching views preserves the same policy object.
|
Global settings use the same editor at `settings?tab=policies`. Reordering uses
|
||||||
|
the visible rule order; switching views preserves the same policy object.
|
||||||
- Set `policy` in the complete configuration, `vhosts[].policy`, or
|
- Set `policy` in the complete configuration, `vhosts[].policy`, or
|
||||||
`vhosts[].routes[].policy`. A Docker assignment stores its policy with that
|
`vhosts[].routes[].policy`. A Docker assignment stores its policy with that
|
||||||
assignment so discovery does not discard the customization.
|
assignment so discovery does not discard the customization.
|
||||||
@@ -39,6 +40,122 @@ headless test after adjusting its backend address. The
|
|||||||
[cooperation example](../examples/policy-vcl-cooperation.json) demonstrates a
|
[cooperation example](../examples/policy-vcl-cooperation.json) demonstrates a
|
||||||
request classification consumed by VCL-style cache rules.
|
request classification consumed by VCL-style cache rules.
|
||||||
|
|
||||||
|
## Scenario presets and the rule builder
|
||||||
|
|
||||||
|
Since 0.42.1, **Scenario presets** beside **Add HTTP rule** opens a searchable catalog
|
||||||
|
grouped by headers, cache, security, routing and diagnostics. Select a scenario
|
||||||
|
to read its purpose and application notes; **Preview rules** shows its policy
|
||||||
|
data. **Add scenario** appends the complete scenario to the current draft with
|
||||||
|
unique rule IDs. It keeps the existing rules, ACLs and maps. Nothing is activated
|
||||||
|
until the containing Settings, Vhost, Docker assignment or location form is
|
||||||
|
saved. The **Documentation** button in the editor toolbar opens this guide;
|
||||||
|
Vhosts and global settings use the same control.
|
||||||
|
|
||||||
|
The catalog contains **40 scenarios built from 54 rules**. Global and Vhost
|
||||||
|
editors offer all 40. Location editors offer 39: the prefix rewrite uses
|
||||||
|
`pre_route`, which runs before a location has been selected.
|
||||||
|
|
||||||
|
### General scenarios
|
||||||
|
|
||||||
|
The following recipes create enabled draft rules, except the disabled legacy
|
||||||
|
redirect. They still require saving the containing form to become active.
|
||||||
|
|
||||||
|
| Scenario | Effect and review points |
|
||||||
|
| --- | --- |
|
||||||
|
| Normalize `Vary` | Normalize the final token list, keeping existing dimensions and `*`. |
|
||||||
|
| Exact duplicate `Vary` | Match the two full fields in the [original example](#exact-duplicate-vary-rule) and replace only that exact combination before cache planning. |
|
||||||
|
| Hide origin headers | Remove `Server`, `X-Powered-By` and `X-AspNet-Version` from the final response. |
|
||||||
|
| Basic security headers | Add `X-Content-Type-Options: nosniff` and `Referrer-Policy: strict-origin-when-cross-origin` only when missing; application-provided values remain in place. |
|
||||||
|
| Private routes | Bypass shared lookup/storage and send private/no-store response headers on common account, administration and checkout paths. Adjust the path list. |
|
||||||
|
| Authorization bypass | Bypass shared caching when an `Authorization` header is present and send private/no-store response headers. |
|
||||||
|
| Cookie bypass | Bypass shared caching when a `Cookie` header is present and send private/no-store response headers. This also excludes anonymous requests with tracking cookies. |
|
||||||
|
| Responses with `Set-Cookie` | Prevent storage of matching origin responses without deleting the cookie; send `Cache-Control: private, no-store`. |
|
||||||
|
| Error responses | Prevent storage of origin responses with status `400`–`599`; send `Cache-Control: no-store` on final error responses. |
|
||||||
|
| Health endpoints | Keep common health/readiness paths out of shared caching and mark their responses no-store. Adjust the paths to match your service. |
|
||||||
|
| Server-sent events | Bypass shared cache for `Accept: text/event-stream`; prevent storage and disable RustProxy compression for event-stream responses. This does not remove origin compression. |
|
||||||
|
| Block unwanted methods | Return `403` for `TRACE` and `CONNECT`; review them against protocols used by the service. |
|
||||||
|
| Block sensitive files | Return `403` for literal `.env`, `.env.*`, `.git`, `.svn` and `.hg` path segments. The pattern leaves `.well-known` available and does not cover all encoded aliases. |
|
||||||
|
| Request correlation | Add the transaction request ID as `X-Correlation-ID` at final delivery when absent; preserve application correlation IDs. |
|
||||||
|
| Legacy path redirect | Add a disabled exact `/old-path` → `/new-path` redirect with status `302`. Edit the paths and enable the rule; this example drops the original query string. |
|
||||||
|
|
||||||
|
### Application and API scenarios
|
||||||
|
|
||||||
|
**Off** means the scenario is added with every rule disabled. Edit its example
|
||||||
|
domains, paths, networks or values, enable the required rules, then save. Keep
|
||||||
|
the order of a scenario containing several rules.
|
||||||
|
|
||||||
|
| Scenario | Added state | Effect and review points |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Language variants | Off | Merge `Accept-Language` into `Vary` before cache planning for `/localized/`; use only when the origin actually varies its response by that header. |
|
||||||
|
| CORS for one frontend | Off | On `/api/`, remove previous allowed-origin/credentials headers, allow the fixed `https://app.example.test` origin, and merge `Origin` into `Vary` for all matching responses. |
|
||||||
|
| CORS exposed headers | On | Merge `ETag` and `X-Correlation-ID` into `Access-Control-Expose-Headers` only when an allowed-origin response header already exists. Does not grant CORS access or create those diagnostic headers. |
|
||||||
|
| Internal redirect locations | Off | Replace the configured internal HTTP host in `3xx` `Location` fields with a fixed public HTTPS host, preserving the captured path/query. Does not rewrite page content. |
|
||||||
|
| Download attachments | Off | Set `Content-Disposition: attachment` on successful responses under `/downloads/`; edit the path. No filename or access permission is generated. |
|
||||||
|
| Same-origin framing | Off | Add `X-Frame-Options: SAMEORIGIN` when missing. Review embedded applications and any existing CSP `frame-ancestors` directive. |
|
||||||
|
| Trial HSTS | Off | Add missing `Strict-Transport-Security: max-age=300` only on the actual TLS listener; no `includeSubDomains` or `preload`. Verify HTTPS first. |
|
||||||
|
| Browser device permissions | Off | Add missing `Permissions-Policy` denying camera, microphone and geolocation; remove restrictions required by the application. |
|
||||||
|
| CSP report-only audit | Off | Add a missing report-only CSP for self-hosted resources, no objects and a self-only base URI. Review browser-console violations; no report endpoint is configured. |
|
||||||
|
| Staging noindex | Off | Send `X-Robots-Tag: noindex, nofollow` throughout the selected scope. This is crawler advice, not authentication. |
|
||||||
|
| Cross-site write requests | Off | Deny `POST`, `PUT`, `PATCH` and `DELETE` carrying `Sec-Fetch-Site: cross-site`. Keep application CSRF protection; clients without that header are unaffected. |
|
||||||
|
| JSON API writes | Off | Require exactly one `Content-Type` field declaring `application/json` or `application/*+json` for `POST`, `PUT` and `PATCH` below `/api/`, otherwise return `415`. Missing or duplicate fields are rejected. This checks headers, not body validity. |
|
||||||
|
| Internal path by client network | Off | Deny `/internal` outside the configured trusted client-IP CIDR. Replace the example `203.0.113.0/24` and path before enabling. |
|
||||||
|
| Preview/draft query parameters | Off | Bypass lookup/storage and send private/no-store when literal `preview` or `draft` query names exist, even with empty or false values. Does not authorize draft access. |
|
||||||
|
| Signed/token URLs | Off | Bypass lookup/storage for configured literal signing/token query names. The application still validates the signature and expiry. |
|
||||||
|
| HTML revalidation | On | Add `Cache-Control: no-cache` only to HTML responses lacking `Cache-Control`. Existing privacy directives remain; the shared object's TTL is unchanged. |
|
||||||
|
| Public API TTL/grace | Off | Set 60-second TTL and 30-second grace defaults for explicitly public `/api/public` responses without `Set-Cookie`, `private`, `no-cache` or `no-store`. Requires enabled cache. |
|
||||||
|
| Canonical host | Off | Redirect a configured alias to a fixed HTTPS hostname with `308`, preserving path, query and method. Edit both domains and verify the certificate. |
|
||||||
|
| HTTP to HTTPS for one host | Off | Redirect the configured host with `308` when received without TLS. Uses listener TLS, not forwarding headers; review external TLS termination to avoid loops. |
|
||||||
|
| Remove a path prefix | Off | Rewrite `/legacy/…` to `/…` in `pre_route`, retaining query parameters. Review routing/access for the resulting path; available globally and on Vhosts only. |
|
||||||
|
| Move a URL subtree | Off | Redirect `/docs-old/…` to `/docs/…` with `308`, preserving the rest of the path, query and method. Edit the condition and replacement together. |
|
||||||
|
| Maintenance response | Off | Return a local `503` after access/authentication checks and add `Retry-After: 300` using a transaction marker. Enable both rules together; the initial condition covers the whole scope. |
|
||||||
|
| Selected API backend | Off | Send `/api-v2/` to an existing backend member ID. Set the real ID before enabling; backend selection bypasses shared cache. Global use requires that member in each affected Vhost. |
|
||||||
|
| Cache outcome header | On | Add missing `X-Cache` from `cache_status` at final delivery. Preserves an application header and does not change cache decisions. |
|
||||||
|
| API/web classification | Off | Set `txn.ui_request_class` to `web` or `api`, then expose it as `X-Request-Class` at delivery. Edit `/api/` and retain all three rules in order; the label is not a trusted identity. |
|
||||||
|
|
||||||
|
The CORS recipe configures **response headers only**. The application must handle
|
||||||
|
`OPTIONS` preflight and authentication. The recipe does not allow credentialed
|
||||||
|
browser requests or reflect an arbitrary request origin. Enable both rules
|
||||||
|
together so every applicable response retains `Vary: Origin`.
|
||||||
|
|
||||||
|
The public-API TTL/grace recipe does not force cache lookup or weaken credential
|
||||||
|
and storage privacy checks. Existing VCL TTL/grace assignments take precedence.
|
||||||
|
Its backend-response stage retains the background-refresh restrictions below.
|
||||||
|
`no-cache` in the HTML recipe means revalidation, not a prohibition on storage.
|
||||||
|
|
||||||
|
Presets are editable starting points; they do not install authentication or
|
||||||
|
replace existing access rules.
|
||||||
|
For global policies, review the effects across every affected Vhost. Response
|
||||||
|
storage rules do not purge existing cache entries or run the backend-response
|
||||||
|
stage on a HIT. Backend-response rules also retain the background-refresh
|
||||||
|
restrictions described under [cache boundaries](#actions-and-cache-boundaries).
|
||||||
|
For the event-stream preset, clients must send `Accept: text/event-stream` to
|
||||||
|
bypass any existing cache entry before the origin's response type is known.
|
||||||
|
|
||||||
|
### Add and inspect conditions
|
||||||
|
|
||||||
|
Open a rule's conditions, enter a sample expression, choose an operator and
|
||||||
|
enter one comparison value per line. **Add condition** commits those fields to
|
||||||
|
the rule and updates its visible condition list/count. The initial sample is
|
||||||
|
`path` with a prefix comparison; enter the intended path before adding it.
|
||||||
|
Choose **AND** to require both the existing condition and the new comparison,
|
||||||
|
or **OR** to allow either. Existing nested expressions remain grouped.
|
||||||
|
|
||||||
|
The builder checks for missing samples/values, invalid numeric values and
|
||||||
|
condition/value limits before adding a comparison. **exists** takes no values;
|
||||||
|
case-insensitive matching applies to text comparisons, not numeric, CIDR or
|
||||||
|
existence tests. **Advanced condition JSON** remains available for nested
|
||||||
|
AND/OR/NOT expressions and named ACL references. Invalid JSON must be corrected
|
||||||
|
before switching views or applying changes that would rebuild the editor.
|
||||||
|
The server still validates sample syntax, stage compatibility and the complete
|
||||||
|
policy before activation.
|
||||||
|
|
||||||
|
Action choices follow the selected stage. **Stop this scope's stage after
|
||||||
|
matching** has its own row below the stage settings; it ends only the matching
|
||||||
|
scope's chain at that stage. Policy on/off controls follow **Show on/off settings
|
||||||
|
as switches** in Appearance, including dynamically added rules and conditions.
|
||||||
|
The same behavior applies in global settings, Vhosts, Docker assignments and
|
||||||
|
locations.
|
||||||
|
|
||||||
## Stages and existing rules
|
## Stages and existing rules
|
||||||
|
|
||||||
| Stage | Runs when | Relationship to VCL and existing headers |
|
| Stage | Runs when | Relationship to VCL and existing headers |
|
||||||
|
|||||||
+2
-2
@@ -16,13 +16,13 @@ Guides for operating RustProxy: installation, publishing services, security, cer
|
|||||||
|
|
||||||
- [Installation and updates](INSTALL.md) — packages, source build, Docker image, first administrator, systemd and updates.
|
- [Installation and updates](INSTALL.md) — packages, source build, Docker image, first administrator, systemd and updates.
|
||||||
- [Configuration](CONFIGURATION.md) — SQLite or JSON configuration source, configuration map and changes that need a restart.
|
- [Configuration](CONFIGURATION.md) — SQLite or JSON configuration source, configuration map and changes that need a restart.
|
||||||
- [HTTP policy rules](POLICY.md) — named ACLs, maps, variables, HAProxy subset import, header/list operations, stage order and cooperation with existing VCL.
|
- [HTTP policy rules](POLICY.md) — 40 scenario presets with defaults and previews, condition builder, named ACLs, maps, variables, HAProxy subset import, header/list operations, stage order and cooperation with existing VCL.
|
||||||
- [Headless mode](HEADLESS.md) — proxy and load balancer configured only from a JSON file, without the panel.
|
- [Headless mode](HEADLESS.md) — proxy and load balancer configured only from a JSON file, without the panel.
|
||||||
- [Troubleshooting](TROUBLESHOOTING.md) — symptom-based checks and a rollout checklist.
|
- [Troubleshooting](TROUBLESHOOTING.md) — symptom-based checks and a rollout checklist.
|
||||||
|
|
||||||
## Publishing services
|
## Publishing services
|
||||||
|
|
||||||
- [Vhosts and backends](VHOSTS.md) — domains, listeners, backends, balancing, health checks and redirects.
|
- [Vhosts and backends](VHOSTS.md) — domains, listeners, backends, balancing, health checks, redirects and scoped location/ACL/header JSON editors.
|
||||||
- [Custom locations](CUSTOM_LOCATIONS.md) — path routing, request conditions (header, cookie, IP, method, country), whole-host rules, rewrites, local responses and error fallbacks.
|
- [Custom locations](CUSTOM_LOCATIONS.md) — path routing, request conditions (header, cookie, IP, method, country), whole-host rules, rewrites, local responses and error fallbacks.
|
||||||
- [Load balancing](LOAD_BALANCING.md) — algorithms, consistent hashing by path/header/cookie/query/IP, location backend groups and the distribution simulator.
|
- [Load balancing](LOAD_BALANCING.md) — algorithms, consistent hashing by path/header/cookie/query/IP, location backend groups and the distribution simulator.
|
||||||
- [Web Server](WEB_SERVER.md) — static sites, downloads, `try_files`, rewrites, `.htaccess` subset and error pages.
|
- [Web Server](WEB_SERVER.md) — static sites, downloads, `try_files`, rewrites, `.htaccess` subset and error pages.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# VCL import: supported instructions and exact effects
|
# VCL import: supported instructions and exact effects
|
||||||
|
|
||||||
This guide describes the VCL **subset implemented by RustProxy 0.42.0**, not the full Varnish Configuration Language. It is based on the VCL importer and cache-rule engine. Importing VCL **converts statements into graphical cache rules (which must then be saved)**; RustProxy does not execute arbitrary VCL text at request time. Unsupported instructions may be skipped with warnings or cause a parse error; they are not executed as Varnish code. **In the graphical importer, warnings pause conversion:** no rules are added until you explicitly choose **Add partial import (reviewed)**. Even after adding, you must separately save the configuration. The read-only VCL export for ordinary flat rules is a human-oriented preview, **not** a lossless backup or a guaranteed re-importable VCL program. Structured VCL imports use a JSON preview/export that preserves their control flow.
|
This guide describes the VCL **subset implemented by RustProxy 0.42.1**, not the full Varnish Configuration Language. It is based on the VCL importer and cache-rule engine. Importing VCL **converts statements into graphical cache rules (which must then be saved)**; RustProxy does not execute arbitrary VCL text at request time. Unsupported instructions may be skipped with warnings or cause a parse error; they are not executed as Varnish code. **In the graphical importer, warnings pause conversion:** no rules are added until you explicitly choose **Add partial import (reviewed)**. Even after adding, you must separately save the configuration. The read-only VCL export for ordinary flat rules is a human-oriented preview, **not** a lossless backup or a guaranteed re-importable VCL program. Structured VCL imports use a JSON preview/export that preserves their control flow.
|
||||||
|
|
||||||
For a short operational reference inside the panel, open **Cache & VCL guide** from **Settings → Cache**, the ordinary **Vhost → Cache** editor or **Docker vhosts → Cache**. The same modal works in all three places; example VCL is pasted into the importer of the editor that opened the guide, and the modal labels that scope. The modal shows the current compatibility-mode, fallback-TTL and grace settings, explains `Vary` and header mutations with examples, and identifies unsupported Varnish hooks. It complements this exact syntax reference; it does not execute VCL or save settings.
|
For a short operational reference inside the panel, open **Cache & VCL guide** from **Settings → Cache**, the ordinary **Vhost → Cache** editor or **Docker vhosts → Cache**. The same modal works in all three places; example VCL is pasted into the importer of the editor that opened the guide, and the modal labels that scope. The modal shows the current compatibility-mode, fallback-TTL and grace settings, explains `Vary` and header mutations with examples, and identifies unsupported Varnish hooks. It complements this exact syntax reference; it does not execute VCL or save settings.
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Practical examples and traffic scenarios
|
## Practical examples and traffic scenarios
|
||||||
|
|
||||||
The VCL subset below is preserved in 0.42.0. Optional [HTTP policy rules](POLICY.md)
|
The VCL subset below is preserved in 0.42.1. Optional [HTTP policy rules](POLICY.md)
|
||||||
add named ACLs, header counts, maps, variables and staged operations alongside
|
add named ACLs, header counts, maps, variables and staged operations alongside
|
||||||
VCL, with explicit integration points. Those native capabilities are not new
|
VCL, with explicit integration points. Those native capabilities are not new
|
||||||
VCL syntax and do not imply full Varnish compatibility.
|
VCL syntax and do not imply full Varnish compatibility.
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ A **Vhost** publishes one or more hostnames on named HTTP/HTTPS listeners. Its s
|
|||||||
|
|
||||||
A Vhost may bind several frontends. Hostnames and selected listeners must match: the existence of a certificate or an upstream does not create DNS entries or a listening socket. Existing Vhosts retain their bindings when new listeners are created.
|
A Vhost may bind several frontends. Hostnames and selected listeners must match: the existence of a certificate or an upstream does not create DNS entries or a listening socket. Existing Vhosts retain their bindings when new listeners are created.
|
||||||
|
|
||||||
|
The listener choices use aligned cards with the same spacing whether on/off
|
||||||
|
controls are displayed as switches or checkboxes. Long listener descriptions
|
||||||
|
wrap inside their cards; this presentation does not change selected listener
|
||||||
|
IDs or grant access to a disabled listener.
|
||||||
|
|
||||||
## Cache rules: tester and VCL guide
|
## Cache rules: tester and VCL guide
|
||||||
|
|
||||||
In **Vhosts → Edit → Cache**, use the same compact **Test a request** form as in global Cache settings and Docker vhosts. The request and example backend response have separate groups. Tests preview the **unsaved local rules** with the **saved global rules** for that vhost (or exclude them if **Ignore global cache rules** is checked). For a path-only URL the current hostname field is used as the `Host` header, unless you specify `Host` explicitly. This simulates rule decisions without contacting the backend and does not model other unsaved cache settings.
|
In **Vhosts → Edit → Cache**, use the same compact **Test a request** form as in global Cache settings and Docker vhosts. The request and example backend response have separate groups. Tests preview the **unsaved local rules** with the **saved global rules** for that vhost (or exclude them if **Ignore global cache rules** is checked). For a path-only URL the current hostname field is used as the `Host` header, unless you specify `Host` explicitly. This simulates rule decisions without contacting the backend and does not model other unsaved cache settings.
|
||||||
@@ -103,6 +108,35 @@ Keep Vhost IDs stable for monitoring/history unless renaming is intentional. Ren
|
|||||||
|
|
||||||
## Editor layout
|
## Editor layout
|
||||||
|
|
||||||
|
Since 0.42.1, the Vhost editor no longer has a separate **Advanced** tab. Its
|
||||||
|
location, inline ACL and custom-header JSON controls live beside their visual
|
||||||
|
editors:
|
||||||
|
|
||||||
|
| Tab and section | JSON drawer | Saved Vhost field |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| **Custom locations** | **Locations JSON** | `routes` |
|
||||||
|
| **Security → Traffic policy → Vhost IP access list** | **Inline ACL JSON** | `acl` |
|
||||||
|
| **Headers → Custom header rules (request / response)** | **Header rules JSON** | `headers` |
|
||||||
|
|
||||||
|
Open the drawer to inspect or edit the same section's data. **Format JSON**
|
||||||
|
validates and formats the text. **Apply JSON to draft** validates its structure
|
||||||
|
and updates the visual editor; it does not activate changes. **Reload from
|
||||||
|
form** reloads the current visual values and asks before discarding unapplied
|
||||||
|
JSON edits. Save the Vhost after applying the intended changes.
|
||||||
|
|
||||||
|
Unapplied or invalid JSON blocks Vhost saving, including when its drawer is
|
||||||
|
closed; validation reveals the relevant tab and editor. If the same section's
|
||||||
|
visual form changes while JSON edits are pending, applying them is refused
|
||||||
|
until **Reload from form** resolves the conflict. Keep a copy of any JSON edits
|
||||||
|
you want to reapply before reloading. Using `null` for the inline ACL disables
|
||||||
|
that inline list only; assigned ACL profiles remain independent. Configuration
|
||||||
|
field names, server validation and access precedence are unchanged.
|
||||||
|
|
||||||
|
The **Headers → HTTP policies** editor has a separate rule builder and JSON
|
||||||
|
view, plus the [scenario catalog](POLICY.md#scenario-presets-and-the-rule-builder).
|
||||||
|
Its **Documentation** control is a button matching the other editor actions.
|
||||||
|
Global HTTP policies at `settings?tab=policies` use the same catalog and button.
|
||||||
|
|
||||||
Within the Vhost editor, **SSL certificates** contains the named certificate selection and the explicit certificate/domain mismatch exception. The next **SSL settings** section contains the optional override of the global TLS 1.2/1.3 and cipher policy. Turning off the TLS override retains the inherited global policy. These two sections are on the same **SSL** tab.
|
Within the Vhost editor, **SSL certificates** contains the named certificate selection and the explicit certificate/domain mismatch exception. The next **SSL settings** section contains the optional override of the global TLS 1.2/1.3 and cipher policy. Turning off the TLS override retains the inherited global policy. These two sections are on the same **SSL** tab.
|
||||||
|
|
||||||
The **Security** tab groups Traffic policy by reusable ACL profiles, HTTP methods, per-IP limits, country access, country-specific limits and User-Agent limits. It also separates HSTS, other security response headers and per-Vhost User-Agent blocking. Since 0.41.0 the **Headers** tab collects everything else about headers: **Backend diagnostics** (Server-Timing, `X-Rust-Proxy-Backend`, backend time and one-click diagnostic header presets), **Response identity and diagnostics** (Server header, request ID) and the **custom header rules** for requests and responses, including `%[variables]`. The tab starts with a live **header preview** of the unsaved draft for both directions (choose an example backend, location and cache result) and marks where every header comes from; rules show the rendered example value or an error while you type. Within **Custom locations → Access**, profile, HTTP method, country and inline IP/CIDR rules are likewise separated. **Details** separates base Vhost properties from WebSocket options; **Backends** separates balancing strategy, retry behavior and keepalive/connection reuse. The visual grouping does not change saved configuration keys or access precedence.
|
The **Security** tab groups Traffic policy by reusable ACL profiles, HTTP methods, per-IP limits, country access, country-specific limits and User-Agent limits. It also separates HSTS, other security response headers and per-Vhost User-Agent blocking. Since 0.41.0 the **Headers** tab collects everything else about headers: **Backend diagnostics** (Server-Timing, `X-Rust-Proxy-Backend`, backend time and one-click diagnostic header presets), **Response identity and diagnostics** (Server header, request ID) and the **custom header rules** for requests and responses, including `%[variables]`. The tab starts with a live **header preview** of the unsaved draft for both directions (choose an example backend, location and cache result) and marks where every header comes from; rules show the rendered example value or an error while you type. Within **Custom locations → Access**, profile, HTTP method, country and inline IP/CIDR rules are likewise separated. **Details** separates base Vhost properties from WebSocket options; **Backends** separates balancing strategy, retry behavior and keepalive/connection reuse. The visual grouping does not change saved configuration keys or access precedence.
|
||||||
|
|||||||
+195
-4
@@ -2321,7 +2321,7 @@
|
|||||||
"aboutLicenseValue": "GNU AGPL v3.0 or later",
|
"aboutLicenseValue": "GNU AGPL v3.0 or later",
|
||||||
"aboutOpenSourceText": "RustProxy is free and open-source software. You may use, study, modify and redistribute it under the terms of the GNU Affero General Public License, version 3 or any later version.",
|
"aboutOpenSourceText": "RustProxy is free and open-source software. You may use, study, modify and redistribute it under the terms of the GNU Affero General Public License, version 3 or any later version.",
|
||||||
"aboutRepository": "Source code",
|
"aboutRepository": "Source code",
|
||||||
"aboutPackagesRepository": "Website and packages",
|
"aboutPackagesRepository": "Packages",
|
||||||
"aboutPythonRuntime": "Certificate Python runtime",
|
"aboutPythonRuntime": "Certificate Python runtime",
|
||||||
"runtimePython": "Python",
|
"runtimePython": "Python",
|
||||||
"runtimePip": "pip",
|
"runtimePip": "pip",
|
||||||
@@ -4143,7 +4143,7 @@
|
|||||||
"policyIgnoreCase": "Ignore ASCII letter case",
|
"policyIgnoreCase": "Ignore ASCII letter case",
|
||||||
"policyCombine": "Combine conditions with",
|
"policyCombine": "Combine conditions with",
|
||||||
"policyAddCondition": "Add condition",
|
"policyAddCondition": "Add condition",
|
||||||
"policyConditionsHelp": "An empty all group always matches. Values within a comparison are alternatives. Use full-header fetches (fhdr) to preserve commas and fhdr_cnt to count field occurrences. Named ACL: {\"acl\":\"name\"}.",
|
"policyConditionsHelp": "Add conditions with AND or OR. Values within one comparison are alternatives. Existing nested expressions stay intact; use Advanced condition JSON for NOT and named ACLs. Full-header fetches (fhdr) preserve commas; fhdr_cnt counts field occurrences.",
|
||||||
"policyActions": "Actions in order",
|
"policyActions": "Actions in order",
|
||||||
"policyAddAction": "Add action",
|
"policyAddAction": "Add action",
|
||||||
"policyActionLimit": "A rule can contain at most 16 actions.",
|
"policyActionLimit": "A rule can contain at most 16 actions.",
|
||||||
@@ -4243,6 +4243,197 @@
|
|||||||
"policyScope": "Scope / Vhost / location",
|
"policyScope": "Scope / Vhost / location",
|
||||||
"policyMatches": "Matches",
|
"policyMatches": "Matches",
|
||||||
"policyErrors": "Action errors",
|
"policyErrors": "Action errors",
|
||||||
"policyCountersEmpty": "No enabled policy rules in the saved configuration."
|
"policyCountersEmpty": "No enabled policy rules in the saved configuration.",
|
||||||
|
"policyConditionSingleNumber": "Numeric comparisons other than eq require exactly one value.",
|
||||||
|
"policyTemplateAvailable": "Scenarios: {count}",
|
||||||
|
"policyTemplates": "Scenario presets",
|
||||||
|
"policyTemplatesIntro": "Choose a scenario to add its rules to this draft. Review the values, then save the configuration.",
|
||||||
|
"policyTemplateSearch": "Search scenarios",
|
||||||
|
"policyTemplateCategory": "Category",
|
||||||
|
"policyTemplateAll": "All scenarios",
|
||||||
|
"policyTemplateAdd": "Add scenario",
|
||||||
|
"policyTemplatePreview": "Preview rules",
|
||||||
|
"policyTemplateNone": "No scenarios match your search.",
|
||||||
|
"policyTemplateCount": "Rules: {count}",
|
||||||
|
"policyTemplateAdded": "Added “{name}”. Rules: {count}. Review and save to activate.",
|
||||||
|
"policyConditionEmpty": "No conditions — matches every request reaching this stage.",
|
||||||
|
"policyConditionsCount": "Conditions: {count}",
|
||||||
|
"policyConditionAlways": "Always",
|
||||||
|
"policyConditionNever": "Never (empty OR group)",
|
||||||
|
"policyConditionAdded": "Condition added.",
|
||||||
|
"policyConditionFetchRequired": "Enter a sample expression, for example path or req.fhdr(Host).",
|
||||||
|
"policyConditionValuesRequired": "Enter at least one value, one per line.",
|
||||||
|
"policyConditionLimit": "A condition group can contain at most 32 entries.",
|
||||||
|
"policyConditionValueLimit": "A comparison can contain at most 64 values.",
|
||||||
|
"policyConditionNumber": "Numeric comparisons require whole-number values.",
|
||||||
|
"policyConditionDraft": "Fill in the condition, then choose Add condition.",
|
||||||
|
"policyConditionAdvanced": "Advanced condition JSON",
|
||||||
|
"policyConditionRemove": "Remove condition",
|
||||||
|
"policyActionStage": "This action is not available in the selected stage. Choose another action or stage.",
|
||||||
|
"policyStopHelp": "Stops later rules in this scope and stage only; other scopes and stages still run.",
|
||||||
|
"policyPresetCategoryHeaders": "Headers",
|
||||||
|
"policyPresetCategoryCache": "Cache and streaming",
|
||||||
|
"policyPresetCategorySecurity": "Security",
|
||||||
|
"policyPresetCategoryRouting": "Routing and redirects",
|
||||||
|
"policyPresetCategoryDiagnostics": "Diagnostics",
|
||||||
|
"policyPresetNormalizeDescription": "Merge repeated Vary fields and remove duplicate tokens at final delivery, preserving every representation dimension.",
|
||||||
|
"policyPresetNormalizeNote": "Preserves Vary: * and leaves malformed values unchanged. Does not make a private response cacheable.",
|
||||||
|
"policyPresetVaryDescription": "Repair exactly two Vary fields: Accept-Encoding plus Accept, Accept-Encoding, before cache admission.",
|
||||||
|
"policyPresetVaryNote": "Other field counts or values do not match. For general cleanup, use Normalize Vary. Backend-response policies disable background cache refresh.",
|
||||||
|
"policyPresetSecurityHeaders": "Add missing security headers",
|
||||||
|
"policyPresetSecurityHeadersDescription": "Add X-Content-Type-Options: nosniff and Referrer-Policy: strict-origin-when-cross-origin only when absent.",
|
||||||
|
"policyPresetSecurityHeadersNote": "Keeps the application’s existing values. Check that scripts and styles have the correct Content-Type.",
|
||||||
|
"policyPresetHideOrigin": "Hide server technology headers",
|
||||||
|
"policyPresetHideOriginDescription": "Remove Server, X-Powered-By and X-AspNet-Version from the final response.",
|
||||||
|
"policyPresetHideOriginNote": "Only removes these response headers; it does not hide information exposed by page content or error bodies.",
|
||||||
|
"policyPresetPrivateRoutes": "Keep account and checkout pages private",
|
||||||
|
"policyPresetPrivateRoutesDescription": "Bypass cache and storage for admin, account, login, logout, cart, checkout, payment, billing and orders paths; send private, no-store.",
|
||||||
|
"policyPresetPrivateRoutesNote": "Adjust the path expression to your application. This recipe does not add authentication or remove existing cache entries.",
|
||||||
|
"policyPresetPrivateRoutesRequest": "Private routes — bypass and prevent storage",
|
||||||
|
"policyPresetPrivateRoutesResponse": "Private routes — browser cache headers",
|
||||||
|
"policyPresetAuthorizationBypass": "Bypass cache for Authorization",
|
||||||
|
"policyPresetAuthorizationBypassDescription": "Requests carrying Authorization bypass cache and storage; their final responses receive Cache-Control: private, no-store.",
|
||||||
|
"policyPresetAuthorizationBypassNote": "Matches the presence of any Authorization field. The header is preserved; this recipe does not validate credentials.",
|
||||||
|
"policyPresetAuthorizationBypassRequest": "Authorization — bypass and prevent storage",
|
||||||
|
"policyPresetAuthorizationBypassResponse": "Authorization — browser cache headers",
|
||||||
|
"policyPresetCookieBypass": "Bypass cache for any Cookie",
|
||||||
|
"policyPresetCookieBypassDescription": "Requests with Cookie bypass cache and storage, with private, no-store on the final response.",
|
||||||
|
"policyPresetCookieBypassNote": "Includes analytics and consent cookies. For narrower matching, replace the condition with req.cook(your_session_cookie).",
|
||||||
|
"policyPresetCookieBypassRequest": "Cookies — bypass and prevent storage",
|
||||||
|
"policyPresetCookieBypassResponse": "Cookies — browser cache headers",
|
||||||
|
"policyPresetSetCookieNoStore": "Do not store responses setting cookies",
|
||||||
|
"policyPresetSetCookieNoStoreDescription": "Prevent storage when an origin response has Set-Cookie, and send Cache-Control: private, no-store to clients.",
|
||||||
|
"policyPresetSetCookieNoStoreNote": "Preserves every Set-Cookie field. Existing cache entries are not purged. Backend-response policies disable background cache refresh.",
|
||||||
|
"policyPresetSetCookieNoStoreResponse": "Set-Cookie — browser cache headers",
|
||||||
|
"policyPresetErrorsNoStore": "Do not cache HTTP errors",
|
||||||
|
"policyPresetErrorsNoStoreDescription": "Prevent storage of backend 4xx/5xx responses and set Cache-Control: no-store on final error responses.",
|
||||||
|
"policyPresetErrorsNoStoreNote": "Does not retry requests or change error status/body. Existing entries are not purged; backend-response policies disable background cache refresh.",
|
||||||
|
"policyPresetErrorsNoStoreResponse": "HTTP errors — browser cache headers",
|
||||||
|
"policyPresetHealthBypass": "Keep health checks and metrics fresh",
|
||||||
|
"policyPresetHealthBypassDescription": "Bypass cache and storage for health, healthz, readyz, livez and metrics paths; send private, no-store.",
|
||||||
|
"policyPresetHealthBypassNote": "Adjust endpoint names. This changes cache handling only and does not grant or restrict endpoint access.",
|
||||||
|
"policyPresetHealthBypassRequest": "Health checks — bypass and prevent storage",
|
||||||
|
"policyPresetHealthBypassResponse": "Health checks — browser cache headers",
|
||||||
|
"policyPresetSse": "Keep server-sent events streaming",
|
||||||
|
"policyPresetSseDescription": "Bypass cache for Accept: text/event-stream; prevent event-stream storage and disable RustProxy compression before delivery.",
|
||||||
|
"policyPresetSseNote": "Clients must send Accept: text/event-stream to bypass existing entries. Origin compression is unchanged. Backend-response policies disable background cache refresh.",
|
||||||
|
"policyPresetSseRequest": "SSE — request cache bypass",
|
||||||
|
"policyPresetSseOrigin": "SSE — prevent origin response storage",
|
||||||
|
"policyPresetSseResponse": "SSE — uncompressed delivery",
|
||||||
|
"policyPresetBlockMethods": "Block TRACE and CONNECT",
|
||||||
|
"policyPresetBlockMethodsDescription": "Return 403 for TRACE and CONNECT requests after access and authentication checks.",
|
||||||
|
"policyPresetBlockMethodsNote": "Other methods are unchanged. Existing listener or access rules can reject these requests before this policy runs.",
|
||||||
|
"policyPresetBlockSensitiveFiles": "Block .env and repository paths",
|
||||||
|
"policyPresetBlockSensitiveFilesDescription": "Return 403 for literal .env, .env.* and .git/.svn/.hg path segments, including nested paths.",
|
||||||
|
"policyPresetBlockSensitiveFilesNote": "Does not block .well-known. Matches the path as received, not all encoded aliases; keep secrets outside the document root.",
|
||||||
|
"policyPresetRequestId": "Expose a request correlation ID",
|
||||||
|
"policyPresetRequestIdDescription": "Add X-Correlation-ID from the current request ID at final delivery, only when that response header is absent.",
|
||||||
|
"policyPresetRequestIdNote": "Uses the proxy’s req_id sample and preserves application correlation IDs. The protected X-Request-ID header is unchanged.",
|
||||||
|
"policyPresetLegacyRedirect": "Redirect a retired URL",
|
||||||
|
"policyPresetLegacyRedirectDescription": "Start with an exact /old-path → /new-path redirect using HTTP 302 after access and authentication checks.",
|
||||||
|
"policyPresetLegacyRedirectNote": "Added disabled. Edit both paths, choose the redirect status, then enable. The example drops the original query string.",
|
||||||
|
"policyPresetVaryLanguage": "Separate language variants",
|
||||||
|
"policyPresetVaryLanguageDescription": "Merge Accept-Language into Vary for /localized/ responses before the shared cache plan.",
|
||||||
|
"policyPresetVaryLanguageNote": "Added disabled. Edit the path; use only when the origin actually varies by this header. Keeps existing Vary dimensions. Backend-response policies disable background refresh.",
|
||||||
|
"policyPresetCorsOriginReset": "CORS — reset access and vary by Origin",
|
||||||
|
"policyPresetCorsOriginAllow": "CORS — allow the configured frontend",
|
||||||
|
"policyPresetCorsOrigin": "CORS for one frontend, without credentials",
|
||||||
|
"policyPresetCorsOriginDescription": "For /api/, clear previous CORS origin/credential headers and allow only https://app.example.test; merge Origin into Vary on every matching response.",
|
||||||
|
"policyPresetCorsOriginNote": "Added disabled. Edit the origin and path in both rules. The application must handle OPTIONS/preflight and authentication. This recipe does not allow credentialed browser requests.",
|
||||||
|
"policyPresetCorsExpose": "Expose ETag and correlation ID to CORS clients",
|
||||||
|
"policyPresetCorsExposeDescription": "Merge ETag and X-Correlation-ID into Access-Control-Expose-Headers when the response already permits a CORS origin.",
|
||||||
|
"policyPresetCorsExposeNote": "Preserves existing exposed names. Does not create the two headers or grant CORS access; configure the application’s origin/preflight policy separately.",
|
||||||
|
"policyPresetRewriteLocation": "Rewrite internal redirect locations",
|
||||||
|
"policyPresetRewriteLocationDescription": "Replace http://backend.internal[:port]/… in 3xx Location headers with https://app.example.test/…, preserving the path and query.",
|
||||||
|
"policyPresetRewriteLocationNote": "Added disabled. Edit both hosts and the regex. Only matching Location fields change; this does not rewrite links inside response bodies.",
|
||||||
|
"policyPresetDownloadAttachment": "Download a selected path as an attachment",
|
||||||
|
"policyPresetDownloadAttachmentDescription": "Set Content-Disposition: attachment on successful 2xx responses below /downloads/.",
|
||||||
|
"policyPresetDownloadAttachmentNote": "Added disabled. Edit the path. No filename is generated; the browser uses its normal fallback. This changes presentation, not file authorization.",
|
||||||
|
"policyPresetSameOriginFrames": "Restrict framing to the same origin",
|
||||||
|
"policyPresetSameOriginFramesDescription": "Add X-Frame-Options: SAMEORIGIN when the application has not provided that header.",
|
||||||
|
"policyPresetSameOriginFramesNote": "Added disabled. Review embedded dashboards and widgets first. An existing CSP frame-ancestors directive can take precedence and must be checked separately.",
|
||||||
|
"policyPresetHstsTls": "Trial HSTS on HTTPS responses",
|
||||||
|
"policyPresetHstsTlsDescription": "Add Strict-Transport-Security: max-age=300 only on TLS requests, without includeSubDomains or preload.",
|
||||||
|
"policyPresetHstsTlsNote": "Added disabled. Verify a working trusted HTTPS endpoint before enabling. Uses the actual RustProxy listener’s TLS state and preserves any existing HSTS value.",
|
||||||
|
"policyPresetPermissionsPolicy": "Disable unused browser device permissions",
|
||||||
|
"policyPresetPermissionsPolicyDescription": "Add Permissions-Policy denying camera, microphone and geolocation when that header is absent.",
|
||||||
|
"policyPresetPermissionsPolicyNote": "Added disabled. Remove restrictions your application needs, including embedded content. Existing application policy is preserved.",
|
||||||
|
"policyPresetCspReportOnly": "Audit a self-only Content Security Policy",
|
||||||
|
"policyPresetCspReportOnlyDescription": "Add a report-only CSP using default-src and base-uri self, with object-src none, without blocking resources.",
|
||||||
|
"policyPresetCspReportOnlyNote": "Added disabled. Review browser-console violations and adapt resource origins. No report endpoint is configured; existing report-only CSP is kept.",
|
||||||
|
"policyPresetRobotsNoindex": "Keep a staging site out of search indexes",
|
||||||
|
"policyPresetRobotsNoindexDescription": "Set X-Robots-Tag: noindex, nofollow on responses in the selected policy scope.",
|
||||||
|
"policyPresetRobotsNoindexNote": "Added disabled. Use only on sites that should not be indexed; global scope affects every applicable Vhost. This is crawler advice, not access protection.",
|
||||||
|
"policyPresetCrosssiteMutations": "Reject browser cross-site write requests",
|
||||||
|
"policyPresetCrosssiteMutationsDescription": "Return 403 for POST, PUT, PATCH or DELETE when Sec-Fetch-Site is cross-site.",
|
||||||
|
"policyPresetCrosssiteMutationsNote": "Added disabled. Review cross-site forms and integrations first. Requests without this browser header are unaffected; keep the application’s CSRF protection.",
|
||||||
|
"policyPresetApiJsonOnly": "Require JSON Content-Type for API writes",
|
||||||
|
"policyPresetApiJsonOnlyDescription": "Return 415 for POST, PUT and PATCH below /api/ unless exactly one Content-Type field declares application/json or an application/*+json type.",
|
||||||
|
"policyPresetApiJsonOnlyNote": "Added disabled. Edit the API path and exclude upload/form endpoints. Missing or duplicate Content-Type fields are rejected. This checks headers only; the application must still parse and validate the body.",
|
||||||
|
"policyPresetRestrictedPathNetwork": "Limit an internal path to a client network",
|
||||||
|
"policyPresetRestrictedPathNetworkDescription": "Return 403 below /internal unless the trusted client IP is in the configured CIDR range.",
|
||||||
|
"policyPresetRestrictedPathNetworkNote": "Added disabled. Replace the example 203.0.113.0/24 network and path before enabling. This supplements existing access/authentication checks and does not trust arbitrary forwarding headers.",
|
||||||
|
"policyPresetPreviewQueryRequest": "Preview query — bypass and prevent storage",
|
||||||
|
"policyPresetPreviewQueryResponse": "Preview query — browser cache headers",
|
||||||
|
"policyPresetPreviewQuery": "Keep preview and draft URLs out of cache",
|
||||||
|
"policyPresetPreviewQueryDescription": "Bypass cache/storage when preview or draft query parameters are present, and send private, no-store on the final response.",
|
||||||
|
"policyPresetPreviewQueryNote": "Added disabled. Match uses literal query names; adapt them to your app. Any value, even empty or false, matches. This does not authorize draft access.",
|
||||||
|
"policyPresetSignedUrlRequest": "Signed URL — bypass and prevent storage",
|
||||||
|
"policyPresetSignedUrlResponse": "Signed URL — browser cache headers",
|
||||||
|
"policyPresetSignedUrlBypass": "Keep signed and token URLs out of cache",
|
||||||
|
"policyPresetSignedUrlBypassDescription": "Bypass cache/storage for token, signature, X-Amz-Signature or X-Goog-Signature query parameters; send private, no-store.",
|
||||||
|
"policyPresetSignedUrlBypassNote": "Added disabled. Uses literal parameter names; adapt them to your signing scheme. The application still validates signatures/expiry; existing entries are not purged.",
|
||||||
|
"policyPresetHtmlRevalidate": "Revalidate HTML without cache instructions",
|
||||||
|
"policyPresetHtmlRevalidateDescription": "Add Cache-Control: no-cache to text/html responses only when Cache-Control is absent.",
|
||||||
|
"policyPresetHtmlRevalidateNote": "Keeps existing private/no-store and other cache directives. Affects downstream revalidation, not the stored object’s shared-cache TTL; no-cache is not no-store.",
|
||||||
|
"policyPresetPublicApiTtl": "Set TTL and grace for an explicitly public API",
|
||||||
|
"policyPresetPublicApiTtlDescription": "Use 60 seconds TTL and 30 seconds grace for /api/public responses explicitly marked public, without Set-Cookie or private/no-cache/no-store directives.",
|
||||||
|
"policyPresetPublicApiTtlNote": "Added disabled. Edit the path/durations. Requires cache; credential/privacy checks remain. VCL TTL/grace wins, and backend-response policies disable background refresh.",
|
||||||
|
"policyPresetCanonicalHost": "Redirect an alias to the canonical host",
|
||||||
|
"policyPresetCanonicalHostDescription": "Redirect www.example.test to https://example.test with HTTP 308, preserving path, query and request method.",
|
||||||
|
"policyPresetCanonicalHostNote": "Added disabled. Edit both domains and verify the destination certificate. The target host is fixed, never reflected from an arbitrary client Host header.",
|
||||||
|
"policyPresetHttpsHost": "Redirect one host from HTTP to HTTPS",
|
||||||
|
"policyPresetHttpsHostDescription": "For app.example.test received without TLS, return an HTTP 308 redirect to the fixed HTTPS host and original URL.",
|
||||||
|
"policyPresetHttpsHostNote": "Added disabled. Edit the domain and verify HTTPS. Uses listener TLS, not X-Forwarded-Proto; review external TLS termination to avoid redirect loops.",
|
||||||
|
"policyPresetStripPrefix": "Remove a path prefix before routing",
|
||||||
|
"policyPresetStripPrefixDescription": "Rewrite /legacy/… to /… before location selection while preserving the query string.",
|
||||||
|
"policyPresetStripPrefixNote": "Added disabled. Edit the prefix and review location/access rules for the resulting path. Global and Vhost scopes only; no browser redirect is sent.",
|
||||||
|
"policyPresetRedirectPrefix": "Move a URL subtree and keep its query",
|
||||||
|
"policyPresetRedirectPrefixDescription": "Redirect /docs-old/… to /docs/… with HTTP 308 while keeping the remaining path, query and method.",
|
||||||
|
"policyPresetRedirectPrefixNote": "Added disabled. Edit both prefixes consistently in the condition and replacement. Permanent redirects can be remembered by clients.",
|
||||||
|
"policyPresetMaintenanceReturn": "Maintenance — mark and return 503",
|
||||||
|
"policyPresetMaintenanceRetry": "Maintenance — retry advice",
|
||||||
|
"policyPresetMaintenance": "Serve a temporary maintenance response",
|
||||||
|
"policyPresetMaintenanceDescription": "Return a local 503 after access/authentication checks and attach Retry-After: 300 to that maintenance response.",
|
||||||
|
"policyPresetMaintenanceNote": "Added disabled. Applies to every request in this scope; narrow the first rule if needed and enable both rules together. Local no-store protection remains.",
|
||||||
|
"policyPresetBackendRoute": "Send one API path to a selected backend",
|
||||||
|
"policyPresetBackendRouteDescription": "Select the configured backend member api-v2 for requests below /api-v2/.",
|
||||||
|
"policyPresetBackendRouteNote": "Added disabled. Set an existing member ID and the desired path before enabling. Policy backend selection bypasses shared cache; global use requires that member in every affected Vhost.",
|
||||||
|
"policyPresetCacheStatus": "Expose cache outcome on the final response",
|
||||||
|
"policyPresetCacheStatusDescription": "Add X-Cache from the current cache_status sample, only when that sample exists and the response header is absent.",
|
||||||
|
"policyPresetCacheStatusNote": "A delivery-only diagnostic: does not change stored objects or caching decisions. Preserves the application’s existing X-Cache header.",
|
||||||
|
"policyPresetRequestClassDefault": "Request class — default to web",
|
||||||
|
"policyPresetRequestClassApi": "Request class — identify API",
|
||||||
|
"policyPresetRequestClassResponse": "Request class — final response header",
|
||||||
|
"policyPresetRequestClassification": "Classify API and web requests across stages",
|
||||||
|
"policyPresetRequestClassificationDescription": "Set a per-request txn.ui_request_class variable to web or api, then expose it as X-Request-Class at final delivery.",
|
||||||
|
"policyPresetRequestClassificationNote": "Added disabled. Edit the /api/ classification path and enable all three rules in order. This label is diagnostic, not a trusted identity or an authorization decision.",
|
||||||
|
"vhLocationsJson": "Locations JSON",
|
||||||
|
"vhAclJson": "Inline ACL JSON",
|
||||||
|
"vhHeadersJson": "Header rules JSON",
|
||||||
|
"vhLocationsJsonHelp": "Edit the same location rules shown above. Apply JSON to update this draft, then save the Vhost.",
|
||||||
|
"vhAclJsonHelp": "Edit this Vhost’s inline IP/CIDR access list. Use null to disable it; assigned ACL profiles remain separate.",
|
||||||
|
"vhHeadersJsonHelp": "Edit request and response header rules together. Apply JSON to update the visual editor; save the Vhost to activate changes.",
|
||||||
|
"vhJsonApply": "Apply JSON to draft",
|
||||||
|
"vhJsonReload": "Reload from form",
|
||||||
|
"vhJsonFormat": "Format JSON",
|
||||||
|
"vhJsonPending": "Apply or discard the JSON edits before saving the Vhost.",
|
||||||
|
"vhJsonConflict": "The form changed after you started editing JSON. Reload from form before applying your changes.",
|
||||||
|
"vhJsonApplied": "JSON applied to this draft. Save the Vhost to activate it.",
|
||||||
|
"vhJsonSynced": "In sync with form",
|
||||||
|
"vhJsonDraft": "Unapplied JSON edits",
|
||||||
|
"vhJsonReloadConfirm": "Discard the unapplied JSON edits and reload the current form values?",
|
||||||
|
"vhJsonInvalidAcl": "Use null or an ACL object with an allow/deny default and IP/CIDR rules.",
|
||||||
|
"vhJsonInvalidPaths": "Use an array of up to 64 location objects."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+195
-4
@@ -2321,7 +2321,7 @@
|
|||||||
"aboutLicenseValue": "GNU AGPL v3.0 lub nowsza",
|
"aboutLicenseValue": "GNU AGPL v3.0 lub nowsza",
|
||||||
"aboutOpenSourceText": "RustProxy jest wolnym oprogramowaniem o otwartym kodzie. Możesz go używać, analizować, modyfikować i rozpowszechniać na warunkach licencji GNU Affero General Public License w wersji 3 lub dowolnej późniejszej.",
|
"aboutOpenSourceText": "RustProxy jest wolnym oprogramowaniem o otwartym kodzie. Możesz go używać, analizować, modyfikować i rozpowszechniać na warunkach licencji GNU Affero General Public License w wersji 3 lub dowolnej późniejszej.",
|
||||||
"aboutRepository": "Kod źródłowy",
|
"aboutRepository": "Kod źródłowy",
|
||||||
"aboutPackagesRepository": "Strona i pakiety",
|
"aboutPackagesRepository": "Pakiety",
|
||||||
"aboutPythonRuntime": "Środowisko Python certyfikatów",
|
"aboutPythonRuntime": "Środowisko Python certyfikatów",
|
||||||
"runtimePython": "Python",
|
"runtimePython": "Python",
|
||||||
"runtimePip": "pip",
|
"runtimePip": "pip",
|
||||||
@@ -4143,7 +4143,7 @@
|
|||||||
"policyIgnoreCase": "Ignoruj wielkość liter ASCII",
|
"policyIgnoreCase": "Ignoruj wielkość liter ASCII",
|
||||||
"policyCombine": "Łącz warunki przez",
|
"policyCombine": "Łącz warunki przez",
|
||||||
"policyAddCondition": "Dodaj warunek",
|
"policyAddCondition": "Dodaj warunek",
|
||||||
"policyConditionsHelp": "Pusta grupa all pasuje zawsze. Wartości jednego porównania są alternatywami. fhdr zachowuje przecinki, a fhdr_cnt zlicza wystąpienia pola. Nazwana ACL: {\"acl\":\"nazwa\"}.",
|
"policyConditionsHelp": "Dodawaj warunki połączone przez AND lub OR. Wartości jednego porównania są alternatywami. Istniejące zagnieżdżone wyrażenia są zachowywane; NOT i nazwane ACL edytuj w zaawansowanym JSON. Próbki fhdr zachowują przecinki, a fhdr_cnt zlicza wystąpienia pól.",
|
||||||
"policyActions": "Akcje w kolejności",
|
"policyActions": "Akcje w kolejności",
|
||||||
"policyAddAction": "Dodaj akcję",
|
"policyAddAction": "Dodaj akcję",
|
||||||
"policyActionLimit": "Reguła może zawierać najwyżej 16 akcji.",
|
"policyActionLimit": "Reguła może zawierać najwyżej 16 akcji.",
|
||||||
@@ -4243,6 +4243,197 @@
|
|||||||
"policyScope": "Zakres / Vhost / lokalizacja",
|
"policyScope": "Zakres / Vhost / lokalizacja",
|
||||||
"policyMatches": "Dopasowania",
|
"policyMatches": "Dopasowania",
|
||||||
"policyErrors": "Błędy akcji",
|
"policyErrors": "Błędy akcji",
|
||||||
"policyCountersEmpty": "Brak aktywnych reguł HTTP w zapisanej konfiguracji."
|
"policyCountersEmpty": "Brak aktywnych reguł HTTP w zapisanej konfiguracji.",
|
||||||
|
"policyConditionSingleNumber": "Porównania liczbowe inne niż eq wymagają dokładnie jednej wartości.",
|
||||||
|
"policyTemplateAvailable": "Scenariusze: {count}",
|
||||||
|
"policyTemplates": "Gotowe scenariusze",
|
||||||
|
"policyTemplatesIntro": "Wybierz scenariusz, aby dodać jego reguły do szkicu. Sprawdź wartości, a następnie zapisz konfigurację.",
|
||||||
|
"policyTemplateSearch": "Szukaj scenariuszy",
|
||||||
|
"policyTemplateCategory": "Kategoria",
|
||||||
|
"policyTemplateAll": "Wszystkie scenariusze",
|
||||||
|
"policyTemplateAdd": "Dodaj scenariusz",
|
||||||
|
"policyTemplatePreview": "Podgląd reguł",
|
||||||
|
"policyTemplateNone": "Brak scenariuszy pasujących do wyszukiwania.",
|
||||||
|
"policyTemplateCount": "Reguły: {count}",
|
||||||
|
"policyTemplateAdded": "Dodano „{name}”. Reguły: {count}. Sprawdź i zapisz konfigurację, aby je aktywować.",
|
||||||
|
"policyConditionEmpty": "Brak warunków — pasuje do każdego żądania, które dotarło do tego etapu.",
|
||||||
|
"policyConditionsCount": "Warunki: {count}",
|
||||||
|
"policyConditionAlways": "Zawsze",
|
||||||
|
"policyConditionNever": "Nigdy (pusta grupa OR)",
|
||||||
|
"policyConditionAdded": "Dodano warunek.",
|
||||||
|
"policyConditionFetchRequired": "Wpisz wyrażenie próbki, np. path lub req.fhdr(Host).",
|
||||||
|
"policyConditionValuesRequired": "Podaj co najmniej jedną wartość, po jednej w wierszu.",
|
||||||
|
"policyConditionLimit": "Grupa warunków może zawierać maksymalnie 32 elementy.",
|
||||||
|
"policyConditionValueLimit": "Porównanie może zawierać maksymalnie 64 wartości.",
|
||||||
|
"policyConditionNumber": "Porównania liczbowe wymagają wartości całkowitych.",
|
||||||
|
"policyConditionDraft": "Uzupełnij warunek, a następnie wybierz Dodaj warunek.",
|
||||||
|
"policyConditionAdvanced": "Zaawansowany warunek JSON",
|
||||||
|
"policyConditionRemove": "Usuń warunek",
|
||||||
|
"policyActionStage": "Ta akcja nie jest dostępna w wybranym etapie. Wybierz inną akcję lub etap.",
|
||||||
|
"policyStopHelp": "Zatrzymuje kolejne reguły tylko w tym zakresie i etapie; pozostałe zakresy i etapy nadal są wykonywane.",
|
||||||
|
"policyPresetCategoryHeaders": "Nagłówki",
|
||||||
|
"policyPresetCategoryCache": "Cache i strumieniowanie",
|
||||||
|
"policyPresetCategorySecurity": "Bezpieczeństwo",
|
||||||
|
"policyPresetCategoryRouting": "Routing i przekierowania",
|
||||||
|
"policyPresetCategoryDiagnostics": "Diagnostyka",
|
||||||
|
"policyPresetNormalizeDescription": "Scal powtarzające się pola Vary i usuń zduplikowane tokeny przy końcowym dostarczeniu, zachowując wszystkie wymiary reprezentacji.",
|
||||||
|
"policyPresetNormalizeNote": "Zachowuje Vary: * i pozostawia błędne wartości bez zmian. Nie zezwala na cache odpowiedzi prywatnych.",
|
||||||
|
"policyPresetVaryDescription": "Napraw dokładnie dwa pola Vary: Accept-Encoding oraz Accept, Accept-Encoding, przed decyzją o zapisie w cache.",
|
||||||
|
"policyPresetVaryNote": "Inna liczba pól lub inne wartości nie pasują. Do ogólnego porządkowania użyj Normalizuj Vary. Reguły backend_response wyłączają odświeżanie cache w tle.",
|
||||||
|
"policyPresetSecurityHeaders": "Uzupełnij nagłówki bezpieczeństwa",
|
||||||
|
"policyPresetSecurityHeadersDescription": "Dodaj X-Content-Type-Options: nosniff i Referrer-Policy: strict-origin-when-cross-origin, jeśli ich brakuje.",
|
||||||
|
"policyPresetSecurityHeadersNote": "Zachowuje istniejące wartości aplikacji. Sprawdź, czy skrypty i style mają poprawny Content-Type.",
|
||||||
|
"policyPresetHideOrigin": "Ukryj nagłówki technologii serwera",
|
||||||
|
"policyPresetHideOriginDescription": "Usuń Server, X-Powered-By i X-AspNet-Version z końcowej odpowiedzi.",
|
||||||
|
"policyPresetHideOriginNote": "Usuwa wyłącznie te nagłówki odpowiedzi; nie ukrywa informacji w treści stron ani komunikatach błędów.",
|
||||||
|
"policyPresetPrivateRoutes": "Wyłącz cache kont i zakupów",
|
||||||
|
"policyPresetPrivateRoutesDescription": "Pomiń odczyt i zapis cache dla ścieżek admin, account, login, logout, cart, checkout, payment, billing i orders; wyślij private, no-store.",
|
||||||
|
"policyPresetPrivateRoutesNote": "Dostosuj wyrażenie ścieżek do aplikacji. Scenariusz nie dodaje uwierzytelniania ani nie usuwa istniejących wpisów cache.",
|
||||||
|
"policyPresetPrivateRoutesRequest": "Prywatne ścieżki — pomiń cache i zapis",
|
||||||
|
"policyPresetPrivateRoutesResponse": "Prywatne ścieżki — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetAuthorizationBypass": "Pomiń cache dla Authorization",
|
||||||
|
"policyPresetAuthorizationBypassDescription": "Żądania z Authorization pomijają odczyt i zapis cache; ich końcowe odpowiedzi otrzymują Cache-Control: private, no-store.",
|
||||||
|
"policyPresetAuthorizationBypassNote": "Pasuje do obecności dowolnego pola Authorization. Nagłówek jest zachowywany; scenariusz nie weryfikuje danych logowania.",
|
||||||
|
"policyPresetAuthorizationBypassRequest": "Authorization — pomiń cache i zapis",
|
||||||
|
"policyPresetAuthorizationBypassResponse": "Authorization — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetCookieBypass": "Pomiń cache dla każdego Cookie",
|
||||||
|
"policyPresetCookieBypassDescription": "Żądania z Cookie pomijają odczyt i zapis cache, a końcowa odpowiedź otrzymuje private, no-store.",
|
||||||
|
"policyPresetCookieBypassNote": "Obejmuje również ciasteczka analityczne i zgody. Aby zawęzić dopasowanie, zmień warunek na req.cook(nazwa_ciasteczka_sesji).",
|
||||||
|
"policyPresetCookieBypassRequest": "Ciasteczka — pomiń cache i zapis",
|
||||||
|
"policyPresetCookieBypassResponse": "Ciasteczka — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetSetCookieNoStore": "Nie zapisuj odpowiedzi ustawiających cookies",
|
||||||
|
"policyPresetSetCookieNoStoreDescription": "Zablokuj zapis, gdy odpowiedź backendu zawiera Set-Cookie, i wyślij klientom Cache-Control: private, no-store.",
|
||||||
|
"policyPresetSetCookieNoStoreNote": "Zachowuje każde pole Set-Cookie. Istniejące wpisy cache nie są usuwane. Reguły backend_response wyłączają odświeżanie cache w tle.",
|
||||||
|
"policyPresetSetCookieNoStoreResponse": "Set-Cookie — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetErrorsNoStore": "Nie zapisuj błędów HTTP w cache",
|
||||||
|
"policyPresetErrorsNoStoreDescription": "Zablokuj zapis odpowiedzi backendu 4xx/5xx i ustaw Cache-Control: no-store w końcowych odpowiedziach błędów.",
|
||||||
|
"policyPresetErrorsNoStoreNote": "Nie ponawia żądań ani nie zmienia statusu i treści błędu. Nie usuwa istniejących wpisów; reguły backend_response wyłączają odświeżanie cache w tle.",
|
||||||
|
"policyPresetErrorsNoStoreResponse": "Błędy HTTP — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetHealthBypass": "Zawsze aktualne health checki i metryki",
|
||||||
|
"policyPresetHealthBypassDescription": "Pomiń odczyt i zapis cache dla ścieżek health, healthz, readyz, livez i metrics; wyślij private, no-store.",
|
||||||
|
"policyPresetHealthBypassNote": "Dostosuj nazwy endpointów. Zmienia wyłącznie obsługę cache; nie przyznaje ani nie ogranicza dostępu do endpointów.",
|
||||||
|
"policyPresetHealthBypassRequest": "Health checki — pomiń cache i zapis",
|
||||||
|
"policyPresetHealthBypassResponse": "Health checki — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetSse": "Strumieniowanie zdarzeń SSE",
|
||||||
|
"policyPresetSseDescription": "Pomiń cache dla Accept: text/event-stream; zablokuj zapis strumienia zdarzeń i wyłącz kompresję RustProxy przed dostarczeniem.",
|
||||||
|
"policyPresetSseNote": "Klient musi wysłać Accept: text/event-stream, aby pominąć istniejące wpisy. Kompresja backendu pozostaje bez zmian. Reguły backend_response wyłączają odświeżanie cache w tle.",
|
||||||
|
"policyPresetSseRequest": "SSE — pomiń cache żądania",
|
||||||
|
"policyPresetSseOrigin": "SSE — zablokuj zapis odpowiedzi backendu",
|
||||||
|
"policyPresetSseResponse": "SSE — dostarczenie bez kompresji",
|
||||||
|
"policyPresetBlockMethods": "Blokuj TRACE i CONNECT",
|
||||||
|
"policyPresetBlockMethodsDescription": "Zwróć 403 dla żądań TRACE i CONNECT po sprawdzeniu dostępu i uwierzytelnianiu.",
|
||||||
|
"policyPresetBlockMethodsNote": "Pozostałe metody pozostają bez zmian. Reguły listenera lub dostępu mogą odrzucić takie żądania przed wykonaniem tej reguły.",
|
||||||
|
"policyPresetBlockSensitiveFiles": "Blokuj .env i ścieżki repozytoriów",
|
||||||
|
"policyPresetBlockSensitiveFilesDescription": "Zwróć 403 dla dosłownych segmentów ścieżki .env, .env.* i .git/.svn/.hg, również zagnieżdżonych.",
|
||||||
|
"policyPresetBlockSensitiveFilesNote": "Nie blokuje .well-known. Dopasowuje otrzymaną ścieżkę, nie wszystkie jej zakodowane warianty; przechowuj sekrety poza katalogiem publikowanym przez serwer.",
|
||||||
|
"policyPresetRequestId": "Udostępnij identyfikator żądania",
|
||||||
|
"policyPresetRequestIdDescription": "Dodaj X-Correlation-ID z identyfikatora bieżącego żądania przy końcowym dostarczeniu, jeśli odpowiedź nie ma tego nagłówka.",
|
||||||
|
"policyPresetRequestIdNote": "Używa próbki req_id proxy i zachowuje identyfikatory korelacji aplikacji. Chroniony nagłówek X-Request-ID pozostaje bez zmian.",
|
||||||
|
"policyPresetLegacyRedirect": "Przekieruj nieaktualny adres URL",
|
||||||
|
"policyPresetLegacyRedirectDescription": "Zacznij od dokładnego przekierowania /old-path → /new-path ze statusem HTTP 302 po sprawdzeniu dostępu i uwierzytelnianiu.",
|
||||||
|
"policyPresetLegacyRedirectNote": "Dodawany jako wyłączony. Zmień obie ścieżki, wybierz status przekierowania, a następnie włącz. Przykład usuwa pierwotny query string.",
|
||||||
|
"policyPresetVaryLanguage": "Rozdziel warianty językowe",
|
||||||
|
"policyPresetVaryLanguageDescription": "Dodaj Accept-Language do Vary w odpowiedziach /localized/ przed planowaniem współdzielonego cache.",
|
||||||
|
"policyPresetVaryLanguageNote": "Dodany wyłączony. Zmień ścieżkę; użyj, jeśli aplikacja rzeczywiście różnicuje treść tym nagłówkiem. Zachowuje istniejące wymiary Vary. Reguły odpowiedzi backendu wyłączają odświeżanie cache w tle.",
|
||||||
|
"policyPresetCorsOriginReset": "CORS — wyczyść dostęp i różnicuj po Origin",
|
||||||
|
"policyPresetCorsOriginAllow": "CORS — dopuść wskazany frontend",
|
||||||
|
"policyPresetCorsOrigin": "CORS dla jednego frontendu, bez poświadczeń",
|
||||||
|
"policyPresetCorsOriginDescription": "Dla /api/ usuń wcześniejsze nagłówki CORS origin/credentials i dopuść tylko https://app.example.test; dodaj Origin do Vary w każdej pasującej odpowiedzi.",
|
||||||
|
"policyPresetCorsOriginNote": "Dodany wyłączony. Zmień origin i ścieżkę w obu regułach. Aplikacja musi obsługiwać OPTIONS/preflight i uwierzytelnianie. Ten szablon nie zezwala na żądania przeglądarki z poświadczeniami.",
|
||||||
|
"policyPresetCorsExpose": "Udostępnij ETag i ID korelacji klientom CORS",
|
||||||
|
"policyPresetCorsExposeDescription": "Dodaj ETag i X-Correlation-ID do Access-Control-Expose-Headers, gdy odpowiedź już dopuszcza origin CORS.",
|
||||||
|
"policyPresetCorsExposeNote": "Zachowuje już udostępnione nazwy. Nie tworzy tych dwóch nagłówków ani nie przyznaje dostępu CORS; origin i preflight skonfiguruj oddzielnie.",
|
||||||
|
"policyPresetRewriteLocation": "Przepisz wewnętrzne adresy przekierowań",
|
||||||
|
"policyPresetRewriteLocationDescription": "Zamień http://backend.internal[:port]/… w nagłówkach Location odpowiedzi 3xx na https://app.example.test/…, zachowując ścieżkę i query.",
|
||||||
|
"policyPresetRewriteLocationNote": "Dodany wyłączony. Zmień oba hosty i wyrażenie regularne. Zmienia tylko pasujące pola Location; nie przepisuje linków w treści odpowiedzi.",
|
||||||
|
"policyPresetDownloadAttachment": "Pobieraj pliki z wybranej ścieżki jako załączniki",
|
||||||
|
"policyPresetDownloadAttachmentDescription": "Ustaw Content-Disposition: attachment dla poprawnych odpowiedzi 2xx spod /downloads/.",
|
||||||
|
"policyPresetDownloadAttachmentNote": "Dodany wyłączony. Zmień ścieżkę. Nazwa pliku nie jest generowana; przeglądarka dobiera ją standardowo. Zmienia sposób pobierania, nie autoryzację dostępu.",
|
||||||
|
"policyPresetSameOriginFrames": "Ogranicz osadzanie w ramkach do tego samego originu",
|
||||||
|
"policyPresetSameOriginFramesDescription": "Dodaj X-Frame-Options: SAMEORIGIN, jeżeli aplikacja nie ustawiła tego nagłówka.",
|
||||||
|
"policyPresetSameOriginFramesNote": "Dodany wyłączony. Najpierw sprawdź osadzane panele i widżety. Istniejąca dyrektywa CSP frame-ancestors może mieć pierwszeństwo i wymaga osobnej kontroli.",
|
||||||
|
"policyPresetHstsTls": "Przetestuj HSTS na odpowiedziach HTTPS",
|
||||||
|
"policyPresetHstsTlsDescription": "Dodaj Strict-Transport-Security: max-age=300 tylko dla żądań TLS, bez includeSubDomains i preload.",
|
||||||
|
"policyPresetHstsTlsNote": "Dodany wyłączony. Przed włączeniem sprawdź działający HTTPS z zaufanym certyfikatem. Korzysta ze stanu TLS listenera RustProxy i zachowuje istniejącą wartość HSTS.",
|
||||||
|
"policyPresetPermissionsPolicy": "Wyłącz nieużywane uprawnienia przeglądarki",
|
||||||
|
"policyPresetPermissionsPolicyDescription": "Dodaj Permissions-Policy blokujące kamerę, mikrofon i geolokalizację, jeśli nagłówek nie istnieje.",
|
||||||
|
"policyPresetPermissionsPolicyNote": "Dodany wyłączony. Usuń ograniczenia funkcji potrzebnych aplikacji, również osadzanym treściom. Zachowuje istniejącą politykę aplikacji.",
|
||||||
|
"policyPresetCspReportOnly": "Sprawdź CSP dopuszczające własne zasoby",
|
||||||
|
"policyPresetCspReportOnlyDescription": "Dodaj CSP w trybie report-only z default-src i base-uri self oraz object-src none, bez blokowania zasobów.",
|
||||||
|
"policyPresetCspReportOnlyNote": "Dodany wyłączony. Sprawdź naruszenia w konsoli przeglądarki i dostosuj źródła zasobów. Nie ustawia endpointu raportów; zachowuje istniejące CSP report-only.",
|
||||||
|
"policyPresetRobotsNoindex": "Wyłącz indeksowanie witryny testowej",
|
||||||
|
"policyPresetRobotsNoindexDescription": "Ustaw X-Robots-Tag: noindex, nofollow w odpowiedziach wybranego zakresu polityki.",
|
||||||
|
"policyPresetRobotsNoindexNote": "Dodany wyłączony. Używaj tylko na witrynach, które nie powinny być indeksowane; zakres globalny obejmuje wszystkie pasujące Vhosty. To wskazówka dla robotów, nie ochrona dostępu.",
|
||||||
|
"policyPresetCrosssiteMutations": "Odrzucaj zapisy przeglądarki z innych witryn",
|
||||||
|
"policyPresetCrosssiteMutationsDescription": "Zwróć 403 dla POST, PUT, PATCH i DELETE z Sec-Fetch-Site: cross-site.",
|
||||||
|
"policyPresetCrosssiteMutationsNote": "Dodany wyłączony. Najpierw sprawdź formularze i integracje między witrynami. Nie obejmuje żądań bez tego nagłówka przeglądarki; zachowaj ochronę CSRF aplikacji.",
|
||||||
|
"policyPresetApiJsonOnly": "Wymagaj Content-Type JSON przy zapisie do API",
|
||||||
|
"policyPresetApiJsonOnlyDescription": "Zwróć 415 dla POST, PUT i PATCH pod /api/, jeśli nie ma dokładnie jednego pola Content-Type z application/json lub typem application/*+json.",
|
||||||
|
"policyPresetApiJsonOnlyNote": "Dodany wyłączony. Zmień ścieżkę API i wyklucz uploady oraz formularze. Odrzuca brak Content-Type oraz powtórzone pola tego nagłówka. Sprawdza tylko nagłówki; aplikacja nadal musi parsować i walidować treść.",
|
||||||
|
"policyPresetRestrictedPathNetwork": "Ogranicz wewnętrzną ścieżkę do sieci klientów",
|
||||||
|
"policyPresetRestrictedPathNetworkDescription": "Zwróć 403 pod /internal, jeśli zaufany adres IP klienta nie należy do wskazanej sieci CIDR.",
|
||||||
|
"policyPresetRestrictedPathNetworkNote": "Dodany wyłączony. Przed włączeniem zastąp przykładową sieć 203.0.113.0/24 i ścieżkę. Uzupełnia istniejącą kontrolę dostępu i logowania; nie ufa dowolnym nagłówkom przekazującym IP.",
|
||||||
|
"policyPresetPreviewQueryRequest": "Query podglądu — pomiń cache i zapis",
|
||||||
|
"policyPresetPreviewQueryResponse": "Query podglądu — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetPreviewQuery": "Wyłącz cache dla URL-i podglądu i wersji roboczych",
|
||||||
|
"policyPresetPreviewQueryDescription": "Pomiń cache i zapis, gdy query zawiera parametr preview lub draft; wyślij private, no-store w odpowiedzi końcowej.",
|
||||||
|
"policyPresetPreviewQueryNote": "Dodany wyłączony. Dopasowuje dosłowne nazwy parametrów query; dostosuj je do aplikacji. Pasuje każda wartość, także pusta lub false. Nie przyznaje dostępu do wersji roboczych.",
|
||||||
|
"policyPresetSignedUrlRequest": "Podpisany URL — pomiń cache i zapis",
|
||||||
|
"policyPresetSignedUrlResponse": "Podpisany URL — nagłówki cache przeglądarki",
|
||||||
|
"policyPresetSignedUrlBypass": "Wyłącz cache dla podpisanych URL-i i tokenów",
|
||||||
|
"policyPresetSignedUrlBypassDescription": "Pomiń cache i zapis dla parametrów query token, signature, X-Amz-Signature lub X-Goog-Signature; wyślij private, no-store.",
|
||||||
|
"policyPresetSignedUrlBypassNote": "Dodany wyłączony. Korzysta z dosłownych nazw parametrów; dostosuj je do podpisywania. Podpisy i terminy ważności nadal sprawdza aplikacja; istniejące wpisy cache nie są czyszczone.",
|
||||||
|
"policyPresetHtmlRevalidate": "Rewaliduj HTML bez instrukcji cache",
|
||||||
|
"policyPresetHtmlRevalidateDescription": "Dodaj Cache-Control: no-cache do odpowiedzi text/html tylko wtedy, gdy Cache-Control nie istnieje.",
|
||||||
|
"policyPresetHtmlRevalidateNote": "Zachowuje istniejące private/no-store i inne dyrektywy cache. Wpływa na rewalidację u odbiorców, nie na TTL obiektu we współdzielonym cache; no-cache nie oznacza no-store.",
|
||||||
|
"policyPresetPublicApiTtl": "Ustaw TTL i grace dla jawnie publicznego API",
|
||||||
|
"policyPresetPublicApiTtlDescription": "Użyj TTL 60 s i grace 30 s dla odpowiedzi /api/public jawnie oznaczonych public, bez Set-Cookie oraz dyrektyw private/no-cache/no-store.",
|
||||||
|
"policyPresetPublicApiTtlNote": "Dodany wyłączony. Zmień ścieżkę i czasy. Wymaga cache; zachowuje kontrolę poświadczeń i prywatności. TTL/grace z VCL ma pierwszeństwo, a reguły odpowiedzi backendu wyłączają odświeżanie w tle.",
|
||||||
|
"policyPresetCanonicalHost": "Przekieruj alias na główny host",
|
||||||
|
"policyPresetCanonicalHostDescription": "Przekieruj www.example.test na https://example.test kodem 308, zachowując ścieżkę, query i metodę żądania.",
|
||||||
|
"policyPresetCanonicalHostNote": "Dodany wyłączony. Zmień obie domeny i sprawdź certyfikat celu. Host docelowy jest stały; nie jest kopiowany z dowolnego nagłówka Host klienta.",
|
||||||
|
"policyPresetHttpsHost": "Przekieruj jeden host z HTTP na HTTPS",
|
||||||
|
"policyPresetHttpsHostDescription": "Dla app.example.test odebranego bez TLS zwróć 308 do stałego hosta HTTPS z oryginalnym URL-em.",
|
||||||
|
"policyPresetHttpsHostNote": "Dodany wyłączony. Zmień domenę i sprawdź HTTPS. Korzysta z TLS listenera, nie X-Forwarded-Proto; przy zewnętrznym zakończeniu TLS sprawdź ryzyko pętli przekierowań.",
|
||||||
|
"policyPresetStripPrefix": "Usuń prefiks ścieżki przed routingiem",
|
||||||
|
"policyPresetStripPrefixDescription": "Przepisz /legacy/… na /… przed wyborem lokalizacji, zachowując query string.",
|
||||||
|
"policyPresetStripPrefixNote": "Dodany wyłączony. Zmień prefiks i sprawdź lokalizacje oraz reguły dostępu dla nowej ścieżki. Tylko zakres globalny i Vhost; nie wysyła przekierowania przeglądarce.",
|
||||||
|
"policyPresetRedirectPrefix": "Przenieś poddrzewo URL-i z zachowaniem query",
|
||||||
|
"policyPresetRedirectPrefixDescription": "Przekieruj /docs-old/… na /docs/… kodem 308, zachowując dalszą ścieżkę, query i metodę.",
|
||||||
|
"policyPresetRedirectPrefixNote": "Dodany wyłączony. Spójnie zmień oba prefiksy w warunku i zamianie. Klient może zapamiętać stałe przekierowanie.",
|
||||||
|
"policyPresetMaintenanceReturn": "Przerwa techniczna — oznacz i zwróć 503",
|
||||||
|
"policyPresetMaintenanceRetry": "Przerwa techniczna — czas ponowienia",
|
||||||
|
"policyPresetMaintenance": "Wyświetl odpowiedź przerwy technicznej",
|
||||||
|
"policyPresetMaintenanceDescription": "Zwróć lokalne 503 po kontroli dostępu i logowania oraz dołącz Retry-After: 300 do tej odpowiedzi technicznej.",
|
||||||
|
"policyPresetMaintenanceNote": "Dodany wyłączony. Obejmuje każde żądanie w tym zakresie; w razie potrzeby zawęź pierwszą regułę i włącz obie razem. Zachowuje ochronę no-store odpowiedzi lokalnych.",
|
||||||
|
"policyPresetBackendRoute": "Skieruj ścieżkę API do wybranego backendu",
|
||||||
|
"policyPresetBackendRouteDescription": "Wybierz skonfigurowany backend api-v2 dla żądań pod /api-v2/.",
|
||||||
|
"policyPresetBackendRouteNote": "Dodany wyłączony. Przed włączeniem wskaż istniejące ID backendu i ścieżkę. Wybór backendu przez politykę pomija współdzielony cache; globalnie wymaga takiego backendu w każdym objętym Vhoście.",
|
||||||
|
"policyPresetCacheStatus": "Pokaż wynik cache w odpowiedzi końcowej",
|
||||||
|
"policyPresetCacheStatusDescription": "Dodaj X-Cache z bieżącego cache_status, jeśli próbka istnieje, a nagłówka odpowiedzi jeszcze nie ma.",
|
||||||
|
"policyPresetCacheStatusNote": "Diagnostyka tylko na etapie dostarczania: nie zmienia zapisanych obiektów ani decyzji cache. Zachowuje istniejący X-Cache aplikacji.",
|
||||||
|
"policyPresetRequestClassDefault": "Klasa żądania — domyślnie WWW",
|
||||||
|
"policyPresetRequestClassApi": "Klasa żądania — rozpoznaj API",
|
||||||
|
"policyPresetRequestClassResponse": "Klasa żądania — końcowy nagłówek odpowiedzi",
|
||||||
|
"policyPresetRequestClassification": "Klasyfikuj żądania API i WWW pomiędzy etapami",
|
||||||
|
"policyPresetRequestClassificationDescription": "Ustaw zmienną żądania txn.ui_request_class na web lub api, a potem pokaż ją jako X-Request-Class przy końcowym dostarczeniu.",
|
||||||
|
"policyPresetRequestClassificationNote": "Dodany wyłączony. Dostosuj ścieżkę klasyfikacji /api/ i włącz wszystkie trzy reguły w tej kolejności. Etykieta służy diagnostyce, nie potwierdza tożsamości ani uprawnień.",
|
||||||
|
"vhLocationsJson": "JSON lokalizacji",
|
||||||
|
"vhAclJson": "JSON lokalnej ACL",
|
||||||
|
"vhHeadersJson": "JSON reguł nagłówków",
|
||||||
|
"vhLocationsJsonHelp": "Edytuj te same reguły lokalizacji, które widzisz powyżej. Zastosuj JSON do szkicu, a następnie zapisz Vhost.",
|
||||||
|
"vhAclJsonHelp": "Edytuj lokalną listę dostępu IP/CIDR tego Vhosta. Użyj null, aby ją wyłączyć; przypisane profile ACL pozostają niezależne.",
|
||||||
|
"vhHeadersJsonHelp": "Edytuj razem reguły nagłówków żądań i odpowiedzi. Zastosuj JSON, aby zaktualizować edytor graficzny; zapisz Vhost, aby aktywować zmiany.",
|
||||||
|
"vhJsonApply": "Zastosuj JSON do szkicu",
|
||||||
|
"vhJsonReload": "Wczytaj z formularza",
|
||||||
|
"vhJsonFormat": "Formatuj JSON",
|
||||||
|
"vhJsonPending": "Przed zapisaniem Vhosta zastosuj lub odrzuć zmiany JSON.",
|
||||||
|
"vhJsonConflict": "Formularz zmienił się po rozpoczęciu edycji JSON. Wczytaj dane z formularza przed zastosowaniem zmian.",
|
||||||
|
"vhJsonApplied": "JSON zastosowano do szkicu. Zapisz Vhost, aby go aktywować.",
|
||||||
|
"vhJsonSynced": "Zgodny z formularzem",
|
||||||
|
"vhJsonDraft": "Niezastosowane zmiany JSON",
|
||||||
|
"vhJsonReloadConfirm": "Odrzucić niezastosowane zmiany JSON i wczytać aktualne wartości formularza?",
|
||||||
|
"vhJsonInvalidAcl": "Użyj null albo obiektu ACL z domyślną akcją allow/deny i regułami IP/CIDR.",
|
||||||
|
"vhJsonInvalidPaths": "Użyj tablicy zawierającej najwyżej 64 obiekty lokalizacji."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"openapi": "3.0.3",
|
"openapi": "3.0.3",
|
||||||
"info": {
|
"info": {
|
||||||
"title": "RustProxy Administration API",
|
"title": "RustProxy Administration API",
|
||||||
"version": "0.42.0",
|
"version": "0.42.1",
|
||||||
"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."
|
"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": [
|
"servers": [
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ fn admin_app_javascript() -> &'static str {
|
|||||||
include_str!("web/integrations.js"),
|
include_str!("web/integrations.js"),
|
||||||
include_str!("web/acl-picker.js"),
|
include_str!("web/acl-picker.js"),
|
||||||
include_str!("web/cache-rules.js"),
|
include_str!("web/cache-rules.js"),
|
||||||
|
include_str!("web/policy-presets.js"),
|
||||||
include_str!("web/policy.js"),
|
include_str!("web/policy.js"),
|
||||||
admin_vhosts_javascript(),
|
admin_vhosts_javascript(),
|
||||||
include_str!("web/web-server-profiles.js"),
|
include_str!("web/web-server-profiles.js"),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
--bg: #131615;
|
--bg: #131615;
|
||||||
@@ -709,4 +708,4 @@ html[data-corner-style=extra] {
|
|||||||
--rp-radius-surface: 18px;
|
--rp-radius-surface: 18px;
|
||||||
--rp-radius-control: 12px;
|
--rp-radius-control: 12px;
|
||||||
--rp-progress-radius: 999px;
|
--rp-progress-radius: 999px;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
|
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
|
||||||
@@ -493,9 +492,6 @@ button.is-saving {
|
|||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The 13px top margin lines a single toggle up with labelled fields above
|
|
||||||
it; stacked toggles only need a small step, and toggles laid out in rows
|
|
||||||
or editor grids use the container gap instead. */
|
|
||||||
.check+.check {
|
.check+.check {
|
||||||
margin-top: 6px !important;
|
margin-top: 6px !important;
|
||||||
}
|
}
|
||||||
@@ -1152,11 +1148,6 @@ html[data-dashboard-density=compact] #panel-overview .dashboard-overview-grid>.c
|
|||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On/off switch: an ordinary checkbox with class "switch". Used for settings
|
|
||||||
that turn a feature or section on; option lists, row selection and risk
|
|
||||||
confirmations stay plain checkboxes. The account preference
|
|
||||||
switch_controls=false (html[data-switch-controls="false"]) keeps the plain
|
|
||||||
checkbox look. */
|
|
||||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch {
|
html:not([data-switch-controls="false"]) input[type=checkbox].switch {
|
||||||
--rp-switch-h: calc(var(--ui-check-size) + 1px);
|
--rp-switch-h: calc(var(--ui-check-size) + 1px);
|
||||||
--rp-switch-w: calc(var(--rp-switch-h) * 1.875);
|
--rp-switch-w: calc(var(--rp-switch-h) * 1.875);
|
||||||
@@ -1669,10 +1660,11 @@ html[data-table-density=ultra] :is(table th, table td) {
|
|||||||
.path-permissions-actions {
|
.path-permissions-actions {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-interface-icons="true"] :is(button, a, summary)>svg.ui-icon {
|
html[data-interface-icons="true"] :is(button, a, summary)>svg.ui-icon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: static;
|
position: static;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
html.app-loading .shell {
|
html.app-loading .shell {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@@ -195,18 +194,31 @@ nav {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.app-health-button.is-checking,
|
.app-health-button.is-checking,
|
||||||
.app-health-summary.is-checking { color: var(--muted); }
|
.app-health-summary.is-checking {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
.app-health-button.is-ok,
|
.app-health-button.is-ok,
|
||||||
.app-health-summary.is-ok,
|
.app-health-summary.is-ok,
|
||||||
.app-health-check.is-ok { color: var(--green); }
|
.app-health-check.is-ok {
|
||||||
|
color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
.app-health-button.is-warning,
|
.app-health-button.is-warning,
|
||||||
.app-health-summary.is-warning,
|
.app-health-summary.is-warning,
|
||||||
.app-health-check.is-warning { color: var(--notice-text); }
|
.app-health-check.is-warning {
|
||||||
|
color: var(--notice-text);
|
||||||
|
}
|
||||||
|
|
||||||
.app-health-button.is-error,
|
.app-health-button.is-error,
|
||||||
.app-health-summary.is-error,
|
.app-health-summary.is-error,
|
||||||
.app-health-check.is-error { color: var(--red); }
|
.app-health-check.is-error {
|
||||||
|
color: var(--red);
|
||||||
|
}
|
||||||
|
|
||||||
.app-health-button:hover { opacity: .82; }
|
.app-health-button:hover {
|
||||||
|
opacity: .82;
|
||||||
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -840,6 +852,7 @@ main {
|
|||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-mark .brand-letter {
|
.brand-mark .brand-letter {
|
||||||
font: inherit;
|
font: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -1035,6 +1048,7 @@ a.brand>.brand-mark[data-logo-effect="wobble"]>span {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 851px) {
|
@media (min-width: 851px) {
|
||||||
|
|
||||||
html.sidebar-collapsed .shell,
|
html.sidebar-collapsed .shell,
|
||||||
html.sidebar-peek .shell {
|
html.sidebar-peek .shell {
|
||||||
grid-template-columns: 58px minmax(0, 1fr);
|
grid-template-columns: 58px minmax(0, 1fr);
|
||||||
@@ -1113,4 +1127,4 @@ a.brand>.brand-mark[data-logo-effect="wobble"]>span {
|
|||||||
.sidebar-collapse {
|
.sidebar-collapse {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3840,9 +3840,6 @@ html[data-table-density=ultra] .bo-traffic-text {
|
|||||||
font: 11px var(--mono);
|
font: 11px var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep the ordinary table layout when the option is disabled. In responsive
|
|
||||||
mode only the three sparkline columns consume surplus table width. Native
|
|
||||||
table sizing still preserves intrinsic text widths and horizontal scrolling. */
|
|
||||||
.bo-table.bo-responsive-charts {
|
.bo-table.bo-responsive-charts {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,9 +80,6 @@
|
|||||||
gap: 7px;
|
gap: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Switches never share a row with ordinary fields: a field after a switch
|
|
||||||
and a switch after a field each start a new row. Consecutive switches
|
|
||||||
still sit side by side (for example TLS 1.2 / TLS 1.3). */
|
|
||||||
.vh-grid>.check+:not(.check),
|
.vh-grid>.check+:not(.check),
|
||||||
.vh-grid>:not(.check)+.check {
|
.vh-grid>:not(.check)+.check {
|
||||||
grid-column-start: 1;
|
grid-column-start: 1;
|
||||||
@@ -97,26 +94,32 @@
|
|||||||
margin-top: 6px !important;
|
margin-top: 6px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fields in one row line up: each field spans a caption row and a control
|
|
||||||
row of the editor grid, and a plain caption + control field uses those
|
:is(.vh-grid, .field-grid)>:is(.vh-field, label:not([class]), .auto-id-field) {
|
||||||
rows as a subgrid, so a caption that wraps to more lines makes the whole
|
|
||||||
caption row taller and every control in the row still starts on the same
|
|
||||||
line. Multi-line text areas take the whole row instead of a narrow column. */
|
|
||||||
:is(.vh-grid>.vh-field, .field-grid>label:not([class])) {
|
|
||||||
grid-row: span 2;
|
grid-row: span 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
:is(.vh-grid>.vh-field, .field-grid>label:not([class])):has(>:nth-child(2):last-child) {
|
:is(.vh-grid, .field-grid)>:is(.vh-field, label:not([class]), .auto-id-field):is(:has(>:nth-child(2):last-child), .auto-id-field.is-compact) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: subgrid;
|
grid-template-rows: subgrid;
|
||||||
row-gap: 4px;
|
row-gap: 4px;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
:is(.vh-grid>.vh-field, .field-grid>label:not([class])):has(>:nth-child(2):last-child)>:first-child {
|
:is(.vh-grid, .field-grid)>:is(.vh-field, label:not([class]), .auto-id-field):is(:has(>:nth-child(2):last-child), .auto-id-field.is-compact)>:first-child {
|
||||||
align-self: end;
|
align-self: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:is(.vh-grid, .field-grid):has(>.auto-id-field:not(.is-compact))>:is(.vh-field, label:not([class]), .auto-id-field) {
|
||||||
|
grid-template-rows: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:is(.vh-grid, .field-grid)>.auto-id-field:not(.is-compact) {
|
||||||
|
display: grid;
|
||||||
|
align-content: start;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.vh-grid>.vh-field:has(>textarea) {
|
.vh-grid>.vh-field:has(>textarea) {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
@@ -144,6 +147,78 @@
|
|||||||
font-family: var(--mono);
|
font-family: var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vh-json-editor {
|
||||||
|
min-width: 0;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: var(--rp-radius-surface, 0px);
|
||||||
|
background: var(--panel2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-editor>summary {
|
||||||
|
padding: 10px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-status {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 10px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-editor.has-json-draft {
|
||||||
|
border-color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-editor.has-json-draft .vh-json-status {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-body {
|
||||||
|
padding: 12px;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-body>textarea[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-body>.vh-field {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-source {
|
||||||
|
min-height: 180px;
|
||||||
|
line-height: 1.5;
|
||||||
|
tab-size: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-toolbar {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-toolbar>button {
|
||||||
|
width: auto;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-message {
|
||||||
|
margin: 0;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vh-json-message.is-error {
|
||||||
|
color: var(--red);
|
||||||
|
}
|
||||||
|
|
||||||
.vh-check {
|
.vh-check {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
@@ -407,7 +482,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vh-form .form-actions {
|
.vh-form>.form-actions {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: -14px;
|
bottom: -14px;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
@@ -437,10 +512,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listener-choices {
|
.listener-choices {
|
||||||
flex-wrap: wrap;
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
|
||||||
|
align-items: stretch;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listener-choices>.fine {
|
.listener-choices>.fine {
|
||||||
@@ -455,11 +531,21 @@
|
|||||||
border-radius: var(--rp-radius-control, 4px);
|
border-radius: var(--rp-radius-control, 4px);
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
min-height: 44px;
|
min-height: 44px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.listener-choices>.check {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listener-choices>.check>span {
|
||||||
|
min-width: 0;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
dialog.vhost-dialog,
|
dialog.vhost-dialog,
|
||||||
dialog.audit-dialog,
|
dialog.audit-dialog,
|
||||||
dialog.config-history-dialog,
|
dialog.config-history-dialog,
|
||||||
@@ -1083,6 +1169,16 @@ p,
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.redirect-rule-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
padding-top: 8px;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
.redirect-card .vhost-detail-strip {
|
.redirect-card .vhost-detail-strip {
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
@@ -2170,7 +2266,7 @@ h2+.fine {
|
|||||||
justify-self: start;
|
justify-self: start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Load-balancing editor and distribution simulator (vhost and location). */
|
|
||||||
.lb-editor {
|
.lb-editor {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -2323,7 +2419,6 @@ h2+.fine {
|
|||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Location conditions and routing tester. */
|
|
||||||
.rt-conditions {
|
.rt-conditions {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
@@ -2417,7 +2512,6 @@ h2+.fine {
|
|||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header value variables and diagnostic header presets. */
|
|
||||||
.hdr-vars,
|
.hdr-vars,
|
||||||
.hdr-presets {
|
.hdr-presets {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -2439,7 +2533,6 @@ h2+.fine {
|
|||||||
font: 11px var(--mono);
|
font: 11px var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Headers tab: live preview, diagnostic cards and compact header rules. */
|
|
||||||
.hdr-preview {
|
.hdr-preview {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -2614,4 +2707,4 @@ h2+.fine {
|
|||||||
|
|
||||||
.hdr-row.is-invalid .hdr-row-hint {
|
.hdr-row.is-invalid .hdr-row-hint {
|
||||||
color: var(--red);
|
color: var(--red);
|
||||||
}
|
}
|
||||||
@@ -238,8 +238,6 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
/* Many service cards: skip layout and paint of cards outside the
|
|
||||||
viewport; the browser remembers each card's last rendered size. */
|
|
||||||
content-visibility: auto;
|
content-visibility: auto;
|
||||||
contain-intrinsic-size: auto 320px;
|
contain-intrinsic-size: auto 320px;
|
||||||
}
|
}
|
||||||
@@ -2310,6 +2308,28 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#logging-settings-card .logging-format-actions {
|
||||||
|
--logging-action-height: max(var(--button-min-height), var(--ui-field-min-height));
|
||||||
|
margin-block: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logging-settings-card .logging-format-actions>label {
|
||||||
|
display: grid;
|
||||||
|
gap: 6px;
|
||||||
|
min-width: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logging-settings-card .logging-builder-action {
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logging-settings-card .logging-format-actions :is(select, button) {
|
||||||
|
height: var(--logging-action-height);
|
||||||
|
min-height: var(--logging-action-height);
|
||||||
|
padding-block: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.global-policy-summary {
|
.global-policy-summary {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -2427,6 +2447,10 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
border-top: 1px solid var(--line);
|
border-top: 1px solid var(--line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.listener-card-body>.vh-grid>.check {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.listener-card.is-collapsed>.listener-card-body {
|
.listener-card.is-collapsed>.listener-card-body {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -2450,8 +2474,10 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rules {
|
.cache-rules {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-toolbar {
|
.cache-rules-toolbar {
|
||||||
@@ -2459,20 +2485,19 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-toolbar>.cache-rules-templates {
|
.cache-rules-toolbar>.cache-rules-templates {
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 220px;
|
min-width: min(220px, 100%);
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-toolbar>.primary {
|
.cache-rules-toolbar>.primary {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Searchable, grouped one-click cache/VCL rule library. The native select
|
|
||||||
above remains for quick keyboard access and existing editor workflows. */
|
|
||||||
.cache-rule-catalog {
|
.cache-rule-catalog {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -2485,9 +2510,13 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rule-catalog>h4,
|
.cache-rule-catalog>h4,
|
||||||
.cache-rule-catalog>p,
|
.cache-rule-catalog>p,
|
||||||
.cache-rule-catalog-card p { margin: 0; }
|
.cache-rule-catalog-card p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-rule-catalog-search { width: min(100%, 480px); }
|
.cache-rule-catalog-search {
|
||||||
|
width: min(100%, 480px);
|
||||||
|
}
|
||||||
|
|
||||||
.cache-rule-catalog-groups {
|
.cache-rule-catalog-groups {
|
||||||
max-height: 540px;
|
max-height: 540px;
|
||||||
@@ -2497,8 +2526,16 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rule-catalog-group { display: grid; gap: 7px; min-width: 0; }
|
.cache-rule-catalog-group {
|
||||||
.cache-rule-catalog-group>h5 { margin: 0; font-size: 13px; }
|
display: grid;
|
||||||
|
gap: 7px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog-group>h5 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-rule-catalog-card {
|
.cache-rule-catalog-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -2519,14 +2556,63 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rule-catalog-card-copy strong { font-size: 13px; line-height: 1.4; }
|
.cache-rule-catalog-card-copy strong {
|
||||||
.cache-rule-catalog-card-copy p { font-size: 12px; }
|
font-size: 13px;
|
||||||
.cache-rule-catalog-review { color: var(--accent); font-size: 11px; }
|
line-height: 1.4;
|
||||||
.cache-rule-catalog-card>button { flex: 0 0 auto; }
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog-card-copy p {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog-review {
|
||||||
|
color: var(--accent);
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog-card>button {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 540px) {
|
@media (max-width: 540px) {
|
||||||
.cache-rule-catalog { padding: 9px; }
|
.cache-rules-toolbar {
|
||||||
.cache-rule-catalog-card { align-items: flex-start; }
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-toolbar>.cache-rules-templates {
|
||||||
|
grid-column: 1/-1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-toolbar>button {
|
||||||
|
min-width: 0;
|
||||||
|
width: 100%;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-toolbar>.primary {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-head {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-head>.cache-rule-actions {
|
||||||
|
flex: 1 0 100%;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog {
|
||||||
|
padding: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rule-catalog-card {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-notices {
|
.cache-rules-notices {
|
||||||
@@ -2545,6 +2631,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rules-list {
|
.cache-rules-list {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2627,6 +2714,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rule-body {
|
.cache-rule-body {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 10px 12px 12px;
|
padding: 10px 12px 12px;
|
||||||
border-top: 1px solid var(--line);
|
border-top: 1px solid var(--line);
|
||||||
@@ -2669,6 +2757,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rule-rows {
|
.cache-rule-rows {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2681,7 +2770,8 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
|
|
||||||
.cache-rule-row>select {
|
.cache-rule-row>select {
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 150px;
|
min-width: min(150px, 100%);
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rule-row>.cache-rule-name {
|
.cache-rule-row>.cache-rule-name {
|
||||||
@@ -2759,8 +2849,6 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shared compact rule tester (global Cache, Vhosts and Docker vhosts).
|
|
||||||
Keep controls aligned without the vhost editor's two-row subgrid. */
|
|
||||||
.cache-rules-vhost-links {
|
.cache-rules-vhost-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -2912,7 +3000,9 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-tester-result:empty { display: none; }
|
.cache-rules-tester-result:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-rules-result-line {
|
.cache-rules-result-line {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -2924,19 +3014,48 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-result-line>strong { min-width: 0; }
|
.cache-rules-result-line>strong {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@container (max-width: 550px) {
|
@container (max-width: 550px) {
|
||||||
.cache-rules-tester-body { padding: 9px; }
|
.cache-rules-tester-body {
|
||||||
.cache-rules-tester-pane { padding: 9px; }
|
padding: 9px;
|
||||||
.cache-rules-tester-request-grid { grid-template-columns: minmax(105px, 1fr) minmax(0, 1fr); }
|
}
|
||||||
|
|
||||||
|
.cache-rules-tester-pane {
|
||||||
|
padding: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-tester-request-grid {
|
||||||
|
grid-template-columns: minmax(105px, 1fr) minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
.cache-rules-tester-request-grid>.is-url,
|
.cache-rules-tester-request-grid>.is-url,
|
||||||
.cache-rules-tester-request-grid>.is-vhost { grid-column: 1 / -1; }
|
.cache-rules-tester-request-grid>.is-vhost {
|
||||||
.cache-rules-tester-request-grid>.is-ip { grid-column: span 1; }
|
grid-column: 1 / -1;
|
||||||
.cache-rules-tester-response-grid { grid-template-columns: minmax(0, 1fr); }
|
}
|
||||||
.cache-rules-tester-response-grid>.is-status { max-width: 170px; }
|
|
||||||
.cache-rules-tester-response-grid>.is-response-headers { grid-column: 1 / -1; }
|
.cache-rules-tester-request-grid>.is-ip {
|
||||||
.cache-rules-result-line { grid-template-columns: minmax(0, 1fr); gap: 3px; }
|
grid-column: span 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-tester-response-grid {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-tester-response-grid>.is-status {
|
||||||
|
max-width: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-tester-response-grid>.is-response-headers {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-rules-result-line {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
gap: 3px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-rules-result-line.is-ok>strong {
|
.cache-rules-result-line.is-ok>strong {
|
||||||
@@ -3438,6 +3557,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
gap: var(--ui-gap-sm, 8px);
|
gap: var(--ui-gap-sm, 8px);
|
||||||
padding: 0 8px 8px;
|
padding: 0 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.docker-security-grid,
|
.docker-security-grid,
|
||||||
.docker-diagnostics-grid {
|
.docker-diagnostics-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -3551,6 +3671,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
|
|
||||||
.docker-security-grid,
|
.docker-security-grid,
|
||||||
.docker-diagnostics-grid {
|
.docker-diagnostics-grid {
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
@@ -3613,7 +3734,6 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Contextual cache / VCL help in Settings -> Cache. */
|
|
||||||
.cache-guide-heading-actions {
|
.cache-guide-heading-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -3621,44 +3741,86 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
#cache-form .cache-guide-trigger { width: auto; }
|
|
||||||
#cache-form [data-cache-settings-page=rules]>.cache-guide-trigger { margin-left: 10px; }
|
#cache-form .cache-guide-trigger {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cache-form [data-cache-settings-page=rules]>.cache-guide-trigger {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-vcl-guide-dialog {
|
.cache-vcl-guide-dialog {
|
||||||
width: calc(min(980px, 100vw - 24px) / var(--ui-scale, 1));
|
width: calc(min(980px, 100vw - 24px) / var(--ui-scale, 1));
|
||||||
max-height: calc((100dvh - 28px) / var(--ui-scale, 1));
|
max-height: calc((100dvh - 28px) / var(--ui-scale, 1));
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.cache-guide-dialog-heading { justify-content: space-between; }
|
|
||||||
.cache-guide-dialog-heading h2 { margin: 3px 0 0; }
|
.cache-guide-dialog-heading {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-dialog-heading h2 {
|
||||||
|
margin: 3px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-guide-content {
|
.cache-guide-content {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: calc((100dvh - 110px) / var(--ui-scale, 1));
|
max-height: calc((100dvh - 110px) / var(--ui-scale, 1));
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
}
|
}
|
||||||
.cache-guide-content>.fine { margin: 0 0 12px; }
|
|
||||||
|
.cache-guide-content>.fine {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-guide-current {
|
.cache-guide-current {
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: var(--panel2);
|
background: var(--panel2);
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
.cache-guide-current-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
|
|
||||||
.cache-guide-current p { margin: 5px 0 0; }
|
.cache-guide-current-pills {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 7px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-current p {
|
||||||
|
margin: 5px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-guide-grid {
|
.cache-guide-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-guide-card {
|
.cache-guide-card {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
padding: 13px;
|
padding: 13px;
|
||||||
}
|
}
|
||||||
.cache-guide-card h3 { margin: 0 0 8px; font-size: 14px; }
|
|
||||||
.cache-guide-card p { font-size: 12px; line-height: 1.55; margin: 0; }
|
.cache-guide-card h3 {
|
||||||
.cache-guide-card p+p { margin-top: 9px; }
|
margin: 0 0 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-card p {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.55;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-card p+p {
|
||||||
|
margin-top: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-guide-card pre {
|
.cache-guide-card pre {
|
||||||
margin: 9px 0;
|
margin: 9px 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@@ -3671,12 +3833,39 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
tab-size: 2;
|
tab-size: 2;
|
||||||
}
|
}
|
||||||
.cache-guide-card pre code { white-space: pre; }
|
|
||||||
.cache-guide-import-example { margin-top: 4px; width: auto; }
|
.cache-guide-card pre code {
|
||||||
.cache-guide-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 13px; }
|
white-space: pre;
|
||||||
.cache-guide-footer>.fine { flex: 1 1 100%; margin: 0; }
|
|
||||||
@media (max-width: 720px) {
|
|
||||||
.cache-guide-grid { grid-template-columns: minmax(0, 1fr); }
|
|
||||||
.cache-guide-content { padding: 10px; }
|
|
||||||
.cache-guide-card { padding: 11px; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cache-guide-import-example {
|
||||||
|
margin-top: 4px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-footer {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px 14px;
|
||||||
|
margin-top: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-footer>.fine {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.cache-guide-grid {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-content {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-guide-card {
|
||||||
|
padding: 11px;
|
||||||
|
}
|
||||||
|
}
|
||||||
+465
-43
@@ -9,10 +9,29 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.http-policy-editor { width: 100%; margin-top: 10px; }
|
|
||||||
|
.http-policy-editor {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-visual,
|
||||||
|
.policy-raw {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
min-inline-size: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.http-policy-editor p,
|
.http-policy-editor p,
|
||||||
.http-policy-editor h4 { margin: 0; }
|
.http-policy-editor h4 {
|
||||||
.http-policy-editor [hidden] { display: none !important; }
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.http-policy-editor [hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.policy-toolbar,
|
.policy-toolbar,
|
||||||
.policy-row-controls,
|
.policy-row-controls,
|
||||||
.policy-rule-heading {
|
.policy-rule-heading {
|
||||||
@@ -21,17 +40,94 @@
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.policy-toolbar > button,
|
|
||||||
.policy-row-controls > button { width: auto; }
|
.policy-toolbar>button,
|
||||||
.policy-toolbar > [aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
|
.policy-row-controls>button {
|
||||||
.policy-guide { margin-left: auto; }
|
width: auto;
|
||||||
.policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
|
}
|
||||||
.policy-wide { grid-column: 1 / -1; }
|
|
||||||
.policy-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
|
.policy-toolbar>[aria-pressed="true"] {
|
||||||
.policy-field > :is(input, select, textarea) { min-width: 0; width: 100%; margin: 0; }
|
border-color: var(--accent);
|
||||||
.policy-field > textarea { resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.5; }
|
color: var(--accent);
|
||||||
.policy-check { display: flex; gap: 8px; align-items: center; }
|
}
|
||||||
.policy-check > input { width: auto; flex: 0 0 auto; }
|
|
||||||
|
.policy-add-toolbar {
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-add-toolbar>[aria-expanded="true"] {
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent);
|
||||||
|
background: var(--panel2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-guide {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule-meta {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-wide {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-field {
|
||||||
|
display: grid;
|
||||||
|
gap: 5px;
|
||||||
|
min-width: 0;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-field> :is(input, select, textarea) {
|
||||||
|
min-width: 0;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-field>textarea {
|
||||||
|
resize: vertical;
|
||||||
|
font-family: ui-monospace, monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-check {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-check>input {
|
||||||
|
width: auto;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-check>span {
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-stop {
|
||||||
|
display: grid;
|
||||||
|
gap: 5px;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-stop .policy-check {
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
.policy-rule {
|
.policy-rule {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 14px;
|
gap: 14px;
|
||||||
@@ -42,13 +138,31 @@
|
|||||||
background: var(--panel2);
|
background: var(--panel2);
|
||||||
border-radius: var(--rp-radius-surface, 0px);
|
border-radius: var(--rp-radius-surface, 0px);
|
||||||
}
|
}
|
||||||
.policy-rule.is-disabled { border-left-color: var(--muted); }
|
|
||||||
.policy-rule.is-disabled .policy-order { color: var(--muted); }
|
.policy-rule.is-disabled {
|
||||||
.policy-rule-heading > .policy-field:not(.policy-check) { flex: 1 1 180px; }
|
border-left-color: var(--muted);
|
||||||
.policy-order { color: var(--accent); }
|
}
|
||||||
|
|
||||||
|
.policy-rule.is-disabled .policy-order {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule-heading>.policy-field:not(.policy-check) {
|
||||||
|
flex: 1 1 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule-heading>.policy-field:not(.policy-check)>input {
|
||||||
|
position: relative;
|
||||||
|
top: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-order {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
.policy-action {
|
.policy-action {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
@@ -56,12 +170,234 @@
|
|||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.policy-action > .policy-row-controls { grid-column: 1 / -1; justify-content: flex-end; }
|
|
||||||
.http-policy-editor details { min-width: 0; border: 1px solid var(--line); border-radius: var(--rp-radius-surface, 0px); }
|
.policy-action>.policy-row-controls {
|
||||||
.http-policy-editor details > summary { padding: 10px 12px; cursor: pointer; color: var(--text); font-weight: 600; }
|
grid-column: 1 / -1;
|
||||||
.policy-detail-body { padding: 12px; border-top: 1px solid var(--line); }
|
justify-content: flex-end;
|
||||||
.policy-rule > button,
|
}
|
||||||
.policy-detail-body > button { justify-self: start; }
|
|
||||||
|
.policy-action[data-policy-fields="1"],
|
||||||
|
.policy-action[data-policy-fields="3"] {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-action[data-policy-fields="0"] {
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-action[data-policy-fields="0"]>.policy-row-controls {
|
||||||
|
grid-column: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.http-policy-editor details {
|
||||||
|
min-width: 0;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: var(--rp-radius-surface, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.http-policy-editor details>summary {
|
||||||
|
padding: 10px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--text);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-detail-body {
|
||||||
|
padding: 12px;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-count {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 10px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--muted);
|
||||||
|
border-radius: var(--rp-radius-control, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-list {
|
||||||
|
display: grid;
|
||||||
|
gap: 8px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-join {
|
||||||
|
color: var(--accent);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: .05em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
background: var(--panel);
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-row>code {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-row>button {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.http-policy-editor .policy-condition-advanced>summary {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-builder {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
background: var(--panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-controls {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-controls>button {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-feedback {
|
||||||
|
color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-library {
|
||||||
|
display: grid;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 16px;
|
||||||
|
border: 1px solid var(--accent);
|
||||||
|
background: var(--panel2);
|
||||||
|
min-width: 0;
|
||||||
|
border-radius: var(--rp-radius-surface, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-heading {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-heading>h4 {
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-heading>button {
|
||||||
|
width: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-count {
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-filters {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-cards {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
max-height: 580px;
|
||||||
|
max-height: min(64vh, 580px);
|
||||||
|
overflow: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 14px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
background: var(--panel);
|
||||||
|
min-width: 0;
|
||||||
|
border-radius: var(--rp-radius-surface, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-card>h4 {
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-card p {
|
||||||
|
line-height: 1.5;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-card>button {
|
||||||
|
width: auto;
|
||||||
|
align-self: flex-start;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-badges {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-badges>span {
|
||||||
|
padding: 3px 7px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 11px;
|
||||||
|
border-radius: var(--rp-radius-control, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-note {
|
||||||
|
padding-left: 10px;
|
||||||
|
border-left: 2px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.http-policy-editor .policy-template-preview>summary {
|
||||||
|
padding: 7px 9px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-preview>.policy-result {
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid var(--line);
|
||||||
|
max-height: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-visual>p.fine {
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px dashed var(--line);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule>button,
|
||||||
|
.policy-detail-body>button {
|
||||||
|
justify-self: start;
|
||||||
|
}
|
||||||
|
|
||||||
.policy-result {
|
.policy-result {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
@@ -75,22 +411,108 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.policy-message { padding: 10px; border: 1px solid var(--line); white-space: pre-wrap; }
|
|
||||||
.policy-message.is-error { color: var(--red); border-color: var(--danger-line-strong); }
|
.policy-message {
|
||||||
.policy-trace { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
|
padding: 10px;
|
||||||
.policy-trace th,
|
border: 1px solid var(--line);
|
||||||
.policy-trace td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
|
white-space: pre-wrap;
|
||||||
.policy-trace .is-matched td:first-child { color: var(--green); }
|
|
||||||
.policy-trace .is-skipped { color: var(--muted); }
|
|
||||||
.policy-counter-scroll { overflow: auto; display: grid; gap: 10px; }
|
|
||||||
.policy-counter-scroll > table { min-width: 520px; }
|
|
||||||
.docker-policy-editor { margin: 12px 0; border: 1px solid var(--line); padding: 12px; }
|
|
||||||
.docker-policy-editor > summary { cursor: pointer; font-weight: 600; }
|
|
||||||
@media (max-width: 760px) {
|
|
||||||
.policy-grid { grid-template-columns: 1fr; }
|
|
||||||
.policy-rule { padding: 12px; }
|
|
||||||
.policy-rule-heading > .policy-row-controls { width: 100%; justify-content: flex-end; }
|
|
||||||
.policy-action { grid-template-columns: minmax(0, 1fr); }
|
|
||||||
.policy-toolbar > button { flex: 1 1 auto; }
|
|
||||||
.policy-guide { margin: 0; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.policy-message.is-error {
|
||||||
|
color: var(--red);
|
||||||
|
border-color: var(--danger-line-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-trace {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
font-size: 12px;
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-trace th,
|
||||||
|
.policy-trace td {
|
||||||
|
padding: 8px;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid var(--line);
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-trace .is-matched td:first-child {
|
||||||
|
color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-trace .is-skipped {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-counter-scroll {
|
||||||
|
overflow: auto;
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-counter-scroll>table {
|
||||||
|
min-width: 520px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docker-policy-editor {
|
||||||
|
margin: 12px 0;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docker-policy-editor>summary {
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 760px) {
|
||||||
|
.policy-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-filters,
|
||||||
|
.policy-template-cards {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-template-library {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-row {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-condition-row>button {
|
||||||
|
justify-self: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-rule-heading>.policy-row-controls {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-action,
|
||||||
|
.policy-action[data-policy-fields] {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-action[data-policy-fields="0"]>.policy-row-controls {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-toolbar>button {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.policy-guide {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
.certificate-card .pill,
|
.certificate-card .pill,
|
||||||
.cache-miss-key,
|
.cache-miss-key,
|
||||||
.file-logs-table th .file-log-sort-button:hover,
|
.file-logs-table th .file-log-sort-button:hover,
|
||||||
@@ -164,7 +163,7 @@
|
|||||||
.cache-toolbar {
|
.cache-toolbar {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
@@ -381,9 +380,17 @@ html[data-dashboard-density] #panel-overview .dashboard-overview-grid>.card.pool
|
|||||||
.cache-toolbar-status {
|
.cache-toolbar-status {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 6px 12px;
|
||||||
white-space: nowrap;
|
min-width: 0;
|
||||||
|
min-height: var(--button-min-height);
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-toolbar-status>.check {
|
||||||
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.traffic-line {
|
.traffic-line {
|
||||||
@@ -494,8 +501,6 @@ html[data-dashboard-density] #panel-overview .dashboard-overview-grid>.card.pool
|
|||||||
color: var(--chart-quaternary);
|
color: var(--chart-quaternary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Legend keys use the same chart palette variables as their lines, so they
|
|
||||||
still match when a chart style (for example colour-blind) is selected. */
|
|
||||||
.cache-hit-key,
|
.cache-hit-key,
|
||||||
.cache-fill-key {
|
.cache-fill-key {
|
||||||
color: var(--chart-secondary);
|
color: var(--chart-secondary);
|
||||||
@@ -805,7 +810,6 @@ button.config-history-day.is-selected,
|
|||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search syntax help: an inline panel inside the workspace (never off-screen). */
|
|
||||||
.file-log-syntax {
|
.file-log-syntax {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-column: 1/-1;
|
grid-column: 1/-1;
|
||||||
@@ -859,10 +863,18 @@ button.config-history-day.is-selected,
|
|||||||
background: var(--panel2);
|
background: var(--panel2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-log-chip.is-2xx.active { border-color: var(--green); }
|
.file-log-chip.is-2xx.active {
|
||||||
|
border-color: var(--green);
|
||||||
|
}
|
||||||
|
|
||||||
.file-log-chip.is-4xx.active,
|
.file-log-chip.is-4xx.active,
|
||||||
.file-log-chip.is-protocol.active { border-color: var(--notice-line); }
|
.file-log-chip.is-protocol.active {
|
||||||
.file-log-chip.is-5xx.active { border-color: var(--red); }
|
border-color: var(--notice-line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-log-chip.is-5xx.active {
|
||||||
|
border-color: var(--red);
|
||||||
|
}
|
||||||
|
|
||||||
#file-log-summary strong {
|
#file-log-summary strong {
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
@@ -1226,67 +1238,347 @@ html[data-table-density=ultra] .file-log-inline-detail pre {
|
|||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
#panel-cache .cache-table .cache-reasons { min-width: 200px; max-width: 320px; }
|
#panel-cache .cache-table .cache-reasons {
|
||||||
.cache-reason-line { display: inline-flex; align-items: baseline; gap: 4px; margin: 0 10px 0 0; font-size: 11px; line-height: 1.5; white-space: nowrap; }
|
min-width: 200px;
|
||||||
.cache-reason-name { color: var(--muted); }
|
max-width: 320px;
|
||||||
.cache-reason-count { font-variant-numeric: tabular-nums; font-weight: 600; }
|
}
|
||||||
.cache-reason-more { color: var(--muted); cursor: help; margin-right: 0; }
|
|
||||||
.cache-reason-none { color: var(--muted); }
|
.cache-reason-line {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 4px;
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reason-name {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reason-count {
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reason-more {
|
||||||
|
color: var(--muted);
|
||||||
|
cursor: help;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reason-none {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
#cache-object-scroll .cache-table td:nth-child(n+6):nth-child(-n+12),
|
#cache-object-scroll .cache-table td:nth-child(n+6):nth-child(-n+12),
|
||||||
#cache-object-scroll .cache-table th:nth-child(n+6):nth-child(-n+12) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
#cache-object-scroll .cache-table th:nth-child(n+6):nth-child(-n+12) {
|
||||||
|
text-align: right;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
#cache-object-scroll .cache-table td:nth-child(3),
|
#cache-object-scroll .cache-table td:nth-child(3),
|
||||||
#cache-object-scroll .cache-table td:nth-child(4) { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
|
#cache-object-scroll .cache-table td:nth-child(4) {
|
||||||
|
max-width: 240px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow-wrap: normal;
|
||||||
|
}
|
||||||
|
|
||||||
#cache-object-scroll .cache-table td:nth-child(3):hover,
|
#cache-object-scroll .cache-table td:nth-child(3):hover,
|
||||||
#cache-object-scroll .cache-table td:nth-child(4):hover { white-space: normal; overflow-wrap: anywhere; }
|
#cache-object-scroll .cache-table td:nth-child(4):hover {
|
||||||
#cache-object-scroll .cache-table tbody tr:hover { background: var(--panel2); }
|
white-space: normal;
|
||||||
.cache-tier-pill { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--pill-line); border-radius: var(--rp-radius-control, 0); color: var(--muted); font: 9px var(--mono); letter-spacing: 1px; text-transform: uppercase; }
|
overflow-wrap: anywhere;
|
||||||
.cache-tier-pill.is-hot { color: var(--green); border-color: var(--pill-live-line); }
|
}
|
||||||
|
|
||||||
.cache-pager { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--rp-radius-control, 6px); overflow: hidden; }
|
#cache-object-scroll .cache-table tbody tr:hover {
|
||||||
.cache-pager button { border: 0; border-radius: 0; min-width: 88px; margin: 0; }
|
background: var(--panel2);
|
||||||
.cache-pager button:disabled { opacity: .45; }
|
}
|
||||||
.cache-pager #cache-page { padding: 0 14px; min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; border-inline: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; justify-content: center; }
|
|
||||||
.cache-pager #cache-next { flex-direction: row-reverse; }
|
|
||||||
|
|
||||||
.transform-vhost-table :is(th, td):nth-child(n+2), .transform-type-table :is(th, td):nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
.cache-tier-pill {
|
||||||
.transform-vhost-table td, .transform-type-table td { vertical-align: middle; }
|
display: inline-flex;
|
||||||
.transform-vhost-table td:first-child { color: var(--text); font-weight: 600; }
|
align-items: center;
|
||||||
.transform-type-table td:first-child { color: var(--muted); }
|
padding: 2px 6px;
|
||||||
.transform-vhost-table tbody tr:hover, .transform-type-table tbody tr:hover { background: var(--panel2); }
|
border: 1px solid var(--pill-line);
|
||||||
.transform-zero { color: var(--muted); }
|
border-radius: var(--rp-radius-control, 0);
|
||||||
.transform-errors-nonzero { color: var(--red, #e5534b); font-weight: 600; }
|
color: var(--muted);
|
||||||
.transform-reason-list { gap: 4px 12px; }
|
font: 9px var(--mono);
|
||||||
.transform-reason-list .cache-reason-line { margin: 0; }
|
letter-spacing: 1px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
.cache-ratio-meter, .cache-ratio-meter>i { border-radius: var(--rp-progress-radius, 0); }
|
.cache-tier-pill.is-hot {
|
||||||
|
color: var(--green);
|
||||||
|
border-color: var(--pill-live-line);
|
||||||
|
}
|
||||||
|
|
||||||
.cache-reasons .cache-reason-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; margin: 0 0 6px; white-space: nowrap; }
|
.cache-pager {
|
||||||
.cache-reasons .cache-reason-name { overflow: hidden; text-overflow: ellipsis; }
|
display: inline-flex;
|
||||||
.cache-reasons .cache-reason-track { grid-column: 1 / -1; display: block; height: 2px; margin-top: 3px; background: var(--line); border-radius: var(--rp-progress-radius, 0); overflow: hidden; }
|
align-items: center;
|
||||||
.cache-reasons .cache-reason-track>i { display: block; height: 100%; background: var(--muted); opacity: .7; border-radius: var(--rp-progress-radius, 0); }
|
gap: 0;
|
||||||
.cache-reasons .cache-reason-more { cursor: default; }
|
border: 1px solid var(--line);
|
||||||
.cache-reasons .cache-reason-more>summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; margin: 0 0 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--rp-radius-control, 0); font: 10px/1.5 var(--mono); color: var(--muted); list-style: none; user-select: none; }
|
border-radius: var(--rp-radius-control, 6px);
|
||||||
.cache-reasons .cache-reason-more>summary::-webkit-details-marker { display: none; }
|
overflow: hidden;
|
||||||
.cache-reasons .cache-reason-more>summary::before { content: "›"; display: inline-block; font-size: 12px; line-height: 1; transition: transform .15s ease; }
|
}
|
||||||
.cache-reasons .cache-reason-more[open]>summary::before { transform: rotate(90deg); }
|
|
||||||
.cache-reasons .cache-reason-more>summary:hover { color: var(--text); border-color: var(--muted); }
|
|
||||||
|
|
||||||
.cache-target-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
.cache-pager button {
|
||||||
.cache-target-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
border: 0;
|
||||||
.cache-target-wrap .cache-transform-badge { flex: 0 0 auto; margin-left: 0; }
|
border-radius: 0;
|
||||||
|
min-width: 88px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#panel-cache .card-heading:has(.cache-pager) { flex-wrap: wrap; row-gap: 8px; }
|
.cache-pager button:disabled {
|
||||||
.cache-pager { flex-wrap: nowrap; flex: 0 0 auto; max-width: 100%; margin-left: auto; }
|
opacity: .45;
|
||||||
.cache-pager button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex: 0 0 auto; }
|
}
|
||||||
.cache-pager #cache-page { flex: 1 1 auto; white-space: nowrap; }
|
|
||||||
|
|
||||||
.cache-pager { overflow: visible; border-radius: var(--rp-radius-control, 0px); }
|
.cache-pager #cache-page {
|
||||||
.cache-pager button { border-radius: 0; }
|
padding: 0 14px;
|
||||||
.cache-pager>button:first-child { border-radius: max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)); }
|
min-width: 120px;
|
||||||
.cache-pager>button:last-child { border-radius: 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0; }
|
text-align: center;
|
||||||
.cache-pager button:focus-visible { outline-offset: -2px; }
|
font-variant-numeric: tabular-nums;
|
||||||
|
border-inline: 1px solid var(--line);
|
||||||
|
align-self: stretch;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
#panel-cache .cache-pager>button { border-radius: 0 !important; }
|
.cache-pager #cache-next {
|
||||||
#panel-cache .cache-pager>button:first-child { border-radius: max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) !important; }
|
flex-direction: row-reverse;
|
||||||
#panel-cache .cache-pager>button:last-child { border-radius: 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 !important; }
|
}
|
||||||
|
|
||||||
|
.transform-vhost-table :is(th, td):nth-child(n+2),
|
||||||
|
.transform-type-table :is(th, td):nth-child(2) {
|
||||||
|
text-align: right;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-vhost-table td,
|
||||||
|
.transform-type-table td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-vhost-table td:first-child {
|
||||||
|
color: var(--text);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-type-table td:first-child {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-vhost-table tbody tr:hover,
|
||||||
|
.transform-type-table tbody tr:hover {
|
||||||
|
background: var(--panel2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-zero {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-errors-nonzero {
|
||||||
|
color: var(--red, #e5534b);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-reason-list {
|
||||||
|
gap: 4px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transform-reason-list .cache-reason-line {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-ratio-meter,
|
||||||
|
.cache-ratio-meter>i {
|
||||||
|
border-radius: var(--rp-progress-radius, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-line {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
|
column-gap: 10px;
|
||||||
|
align-items: baseline;
|
||||||
|
margin: 0 0 6px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-name {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-track {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
display: block;
|
||||||
|
height: 2px;
|
||||||
|
margin-top: 3px;
|
||||||
|
background: var(--line);
|
||||||
|
border-radius: var(--rp-progress-radius, 0);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-track>i {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
background: var(--muted);
|
||||||
|
opacity: .7;
|
||||||
|
border-radius: var(--rp-progress-radius, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more>summary {
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
margin: 0 0 6px;
|
||||||
|
padding: 1px 6px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: var(--rp-radius-control, 0);
|
||||||
|
font: 10px/1.5 var(--mono);
|
||||||
|
color: var(--muted);
|
||||||
|
list-style: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more>summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more>summary::before {
|
||||||
|
content: "›";
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1;
|
||||||
|
transition: transform .15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more[open]>summary::before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-reasons .cache-reason-more>summary:hover {
|
||||||
|
color: var(--text);
|
||||||
|
border-color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-target-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-target-text {
|
||||||
|
flex: 0 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-target-wrap .cache-transform-badge {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .card-heading:has(.cache-pager),
|
||||||
|
#panel-cache .card-heading:has(.cache-domain-filter) {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
row-gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
max-width: 100%;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager button {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
white-space: nowrap;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager #cache-page {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager {
|
||||||
|
overflow: visible;
|
||||||
|
border-radius: var(--rp-radius-control, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager button {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager>button:first-child {
|
||||||
|
border-radius: max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px));
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager>button:last-child {
|
||||||
|
border-radius: 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager button:focus-visible {
|
||||||
|
outline-offset: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .cache-pager>button {
|
||||||
|
border-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .cache-pager>button:first-child {
|
||||||
|
border-radius: max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .cache-pager>button:last-child {
|
||||||
|
border-radius: 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 620px) {
|
||||||
|
.cache-pager {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager #cache-page {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
grid-row: 1;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: var(--button-min-height);
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-inline: 0;
|
||||||
|
border-bottom: 1px solid var(--line);
|
||||||
|
white-space: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cache-pager #cache-next {
|
||||||
|
border-inline-start: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .cache-pager>button:first-child {
|
||||||
|
border-radius: 0 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel-cache .cache-pager>button:last-child {
|
||||||
|
border-radius: 0 0 max(0px, calc(var(--rp-radius-control, 0px) - 1px)) 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -938,7 +938,7 @@
|
|||||||
|
|
||||||
.log-tools button {
|
.log-tools button {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
max-width: 85px;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-footer {
|
.page-footer {
|
||||||
@@ -1072,9 +1072,12 @@
|
|||||||
max-height: calc((50dvh) / var(--ui-scale, 1));
|
max-height: calc((50dvh) / var(--ui-scale, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-tools select {
|
.log-tools>button,
|
||||||
max-width: 140px;
|
.log-tools>.log-column-picker,
|
||||||
flex: 1;
|
.log-tools select,
|
||||||
|
.log-tools input:not([type=checkbox]):not([type=radio]) {
|
||||||
|
max-width: 100%;
|
||||||
|
flex: 1 1 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logs-dialog.docked {
|
.logs-dialog.docked {
|
||||||
@@ -1166,9 +1169,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep the disclosure arrow and the title on one line; the route hint
|
|
||||||
wraps below them. A column layout put the arrow on its own row and let
|
|
||||||
the summary items spread vertically, leaving large empty gaps. */
|
|
||||||
details.docker-service-editor>summary {
|
details.docker-service-editor>summary {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -2101,9 +2101,9 @@
|
|||||||
flex: 0 0 190px;
|
flex: 0 0 190px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
/* Plain request records do not need an "Event: request" line on phones. */
|
|
||||||
#panel-filelogs .file-logs-table tbody tr:not([data-event]) td[data-mobile-column=event] {
|
#panel-filelogs .file-logs-table tbody tr:not([data-event]) td[data-mobile-column=event] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,15 +13,16 @@ documentation Reader/API page keeps its independent `../docs.css` stylesheet.
|
|||||||
## Module ownership and order
|
## Module ownership and order
|
||||||
|
|
||||||
| Order | File | Responsibility |
|
| Order | File | Responsibility |
|
||||||
|---|---|---|
|
| --- | --- | --- |
|
||||||
| 1 | `00-tokens.css` | Theme palettes, appearance tokens and custom properties shared with JavaScript preferences |
|
| 1 | `00-tokens.css` | Theme palettes, appearance tokens and custom properties shared with JavaScript preferences |
|
||||||
| 2 | `10-base.css` | Reset, typography, buttons, form fields, tables, shared cards, dialogs and overlays |
|
| 2 | `10-base.css` | Reset, typography, buttons, form fields, tables, shared cards, dialogs and overlays |
|
||||||
| 3 | `20-shell.css` | Startup, login, navigation, page structure and editor draft dock |
|
| 3 | `20-shell.css` | Startup, login, navigation, page structure and editor draft dock |
|
||||||
| 4 | `30-overview.css` | Shared charts/legends and Overview metrics, density, widget layout controls and dashboard presets |
|
| 4 | `30-overview.css` | Shared charts/legends and Overview metrics, density, widget layout controls and dashboard presets |
|
||||||
| 5 | `40-editors.css` | Vhosts and backends, Web Server, Streams, redirects, 404 hosts and ACL controls |
|
| 5 | `40-editors.css` | Vhosts and backends, Web Server, Streams, redirects, 404 hosts and ACL controls |
|
||||||
| 6 | `50-settings.css` | Settings, certificates, integrations and Docker service/agent management |
|
| 6 | `50-settings.css` | Settings, certificates, integrations and Docker service/agent management |
|
||||||
| 7 | `60-monitoring.css` | Traffic, cache, transformations, live/stored logs and configuration history |
|
| 7 | `55-policy.css` | Shared visual HTTP policy editor and preset library |
|
||||||
| 8 | `70-responsive.css` | All viewport/container queries and reduced-motion adjustments, in their required cascade order |
|
| 8 | `60-monitoring.css` | Traffic, cache, transformations, live/stored logs and configuration history |
|
||||||
|
| 9 | `70-responsive.css` | All viewport/container queries and reduced-motion adjustments, in their required cascade order |
|
||||||
|
|
||||||
## Editing rules
|
## Editing rules
|
||||||
|
|
||||||
|
|||||||
+362
-232
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+169
-55
@@ -1,9 +1,15 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
// The editor only builds configuration. Import, validation and test evaluation use
|
|
||||||
// the same Rust compiler/evaluator as live traffic; there is no JS policy engine.
|
|
||||||
window.rustProxyPolicy = (() => {
|
window.rustProxyPolicy = (() => {
|
||||||
const STAGES = ["pre_route", "request", "backend_request", "backend_response", "deliver", "after_response"];
|
const STAGES = ["pre_route", "request", "backend_request", "backend_response", "deliver", "after_response"];
|
||||||
const OPERATORS = ["equals", "contains", "prefix", "suffix", "regex", "exists", "cidr", "eq", "ne", "gt", "ge", "lt", "le"];
|
const OPERATORS = ["equals", "contains", "prefix", "suffix", "regex", "exists", "cidr", "eq", "ne", "gt", "ge", "lt", "le"];
|
||||||
|
const TEXT_OPERATORS = ["equals", "contains", "prefix", "suffix", "regex"];
|
||||||
|
const NUMBER_OPERATORS = ["eq", "ne", "gt", "ge", "lt", "le"];
|
||||||
|
const ACTION_STAGES = {
|
||||||
|
set_path: ["pre_route"], set_query: ["pre_route"], use_backend: ["pre_route", "request"], deny: ["pre_route", "request"],
|
||||||
|
return: ["request"], redirect: ["request"], pass: ["pre_route", "request"], lookup: ["pre_route", "request"], hash_header: ["pre_route", "request"],
|
||||||
|
no_store: ["pre_route", "request", "backend_response"], set_ttl: ["backend_response"], set_grace: ["backend_response"],
|
||||||
|
disable_compression: STAGES.filter(stage => stage !== "after_response")
|
||||||
|
};
|
||||||
const ACTION_FIELDS = {
|
const ACTION_FIELDS = {
|
||||||
set_header: ["name", "value"], append_header: ["name", "value"], remove_header: ["name"], set_if_missing: ["name", "value"],
|
set_header: ["name", "value"], append_header: ["name", "value"], remove_header: ["name"], set_if_missing: ["name", "value"],
|
||||||
normalize_header: ["name"], merge_header: ["name", "value"], remove_value: ["name", "value"], replace_header: ["name", "pattern", "replacement"], replace_value: ["name", "pattern", "replacement"],
|
normalize_header: ["name"], merge_header: ["name", "value"], remove_value: ["name", "value"], replace_header: ["name", "pattern", "replacement"], replace_value: ["name", "pattern", "replacement"],
|
||||||
@@ -12,15 +18,20 @@ window.rustProxyPolicy = (() => {
|
|||||||
set_ttl: ["seconds"], set_grace: ["seconds"], hash_header: ["name"], disable_compression: [], stop: []
|
set_ttl: ["seconds"], set_grace: ["seconds"], hash_header: ["name"], disable_compression: [], stop: []
|
||||||
};
|
};
|
||||||
const clone = value => structuredClone(value);
|
const clone = value => structuredClone(value);
|
||||||
const label = (prefix, value) => t(`${prefix}${String(value).split("_").map(part => part[0].toUpperCase() + part.slice(1)).join("")}`);
|
const label = (prefix, value) => t(`${prefix}${String(value).split("_").filter(Boolean).map(part => part[0].toUpperCase() + part.slice(1)).join("")}`);
|
||||||
const text = (tag, key, cls) => { const node = el(tag, t(key), cls); node.dataset.i18n = key; return node; };
|
const text = (tag, key, cls) => { const node = el(tag, t(key), cls); node.dataset.i18n = key; return node; };
|
||||||
const button = (key, fn, cls = "quiet") => { const node = text("button", key, cls); node.type = "button"; node.addEventListener("click", fn); return node; };
|
const button = (key, fn, cls = "quiet") => { const node = text("button", key, cls); node.type = "button"; node.addEventListener("click", fn); return node; };
|
||||||
const object = value => value !== null && typeof value === "object" && !Array.isArray(value);
|
const object = value => value !== null && typeof value === "object" && !Array.isArray(value);
|
||||||
|
let editorSequence = 0;
|
||||||
function settings(value) {
|
function settings(value) {
|
||||||
if (!object(value) || (value.rules !== undefined && !Array.isArray(value.rules)) || (value.acls !== undefined && !object(value.acls)) || (value.maps !== undefined && !object(value.maps))) throw Error(t("policyInvalid"));
|
if (!object(value) || (value.rules !== undefined && !Array.isArray(value.rules)) || (value.acls !== undefined && !object(value.acls)) || (value.maps !== undefined && !object(value.maps))) throw Error(t("policyInvalid"));
|
||||||
const copy = clone(value);
|
const copy = clone(value);
|
||||||
copy.rules ??= []; copy.acls ??= {}; copy.maps ??= {};
|
copy.rules ??= []; copy.acls ??= {}; copy.maps ??= {};
|
||||||
if (copy.rules.length > 128 || copy.rules.some(rule => !object(rule) || !Array.isArray(rule.actions))) throw Error(t("policyInvalid"));
|
if (copy.rules.length > 128 || copy.rules.some(rule => !object(rule) || !Array.isArray(rule.actions)
|
||||||
|
|| rule.actions.some(action => !object(action) || typeof action.type !== "string")
|
||||||
|
|| (rule.when !== undefined && !object(rule.when))
|
||||||
|
|| ["id", "name", "stage"].some(key => rule[key] !== undefined && typeof rule[key] !== "string")
|
||||||
|
|| ["enabled", "stop"].some(key => rule[key] !== undefined && typeof rule[key] !== "boolean"))) throw Error(t("policyInvalid"));
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
function headers(source) {
|
function headers(source) {
|
||||||
@@ -35,7 +46,7 @@ window.rustProxyPolicy = (() => {
|
|||||||
const node = document.createElement(options.type === "textarea" ? "textarea" : options.values ? "select" : "input");
|
const node = document.createElement(options.type === "textarea" ? "textarea" : options.values ? "select" : "input");
|
||||||
if (options.values) for (const [v, name] of options.values) { const item = el("option", name); item.value = v; node.append(item); }
|
if (options.values) for (const [v, name] of options.values) { const item = el("option", name); item.value = v; node.append(item); }
|
||||||
else if (options.type !== "textarea") node.type = options.type || "text";
|
else if (options.type !== "textarea") node.type = options.type || "text";
|
||||||
if (options.type === "checkbox") node.checked = Boolean(value); else node.value = value ?? "";
|
if (options.type === "checkbox") { node.checked = Boolean(value); node.classList.add("switch"); } else node.value = value ?? "";
|
||||||
if (!options.values && options.type !== "checkbox") { node.spellcheck = false; node.autocomplete = "off"; }
|
if (!options.values && options.type !== "checkbox") { node.spellcheck = false; node.autocomplete = "off"; }
|
||||||
if (options.rows) node.rows = options.rows;
|
if (options.rows) node.rows = options.rows;
|
||||||
if (options.maxLength) node.maxLength = options.maxLength;
|
if (options.maxLength) node.maxLength = options.maxLength;
|
||||||
@@ -52,8 +63,9 @@ window.rustProxyPolicy = (() => {
|
|||||||
if (type === "normalize_header") action.name = "Vary";
|
if (type === "normalize_header") action.name = "Vary";
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
function limitTerminalActions(select, stage) {
|
function limitActions(select, stage) {
|
||||||
for (const option of select.options) option.disabled = ["return", "redirect"].includes(option.value) && stage !== "request";
|
for (const option of select.options) option.disabled = Object.hasOwn(ACTION_STAGES, option.value) && !ACTION_STAGES[option.value].includes(stage);
|
||||||
|
select.setCustomValidity(select.selectedOptions[0]?.disabled ? t("policyActionStage") : "");
|
||||||
}
|
}
|
||||||
function uniqueId(rules, prefix = "policy") { let n = 1; while (rules.some(rule => rule.id === `${prefix}-${n}`)) n++; return `${prefix}-${n}`; }
|
function uniqueId(rules, prefix = "policy") { let n = 1; while (rules.some(rule => rule.id === `${prefix}-${n}`)) n++; return `${prefix}-${n}`; }
|
||||||
function mergeImports(current, addition) {
|
function mergeImports(current, addition) {
|
||||||
@@ -70,29 +82,27 @@ window.rustProxyPolicy = (() => {
|
|||||||
return settings(next);
|
return settings(next);
|
||||||
}
|
}
|
||||||
function preset(kind, id) {
|
function preset(kind, id) {
|
||||||
const base = { id, name: t(kind === "vary" ? "policyPresetVary" : "policyPresetNormalize"), enabled: true, stage: kind === "vary" ? "backend_response" : "after_response", when: { all: [] }, actions: [], stop: false };
|
const template = window.rustProxyPolicyPresets.find(item => item.id === kind);
|
||||||
if (kind === "vary") {
|
if (!template) throw Error(t("policyInvalid"));
|
||||||
base.when.all = [
|
const { nameKey, ...rule } = clone(template.rules[0]);
|
||||||
{ fetch: "res.fhdr_cnt(Vary)", operator: "eq", values: ["2"] },
|
return { ...rule, id, name: t(nameKey || template.titleKey) };
|
||||||
{ fetch: "res.fhdr(Vary)", operator: "equals", values: ["Accept-Encoding"], ignore_case: true },
|
|
||||||
{ fetch: "res.fhdr(Vary)", operator: "equals", values: ["Accept,Accept-Encoding", "Accept, Accept-Encoding"], ignore_case: true }
|
|
||||||
];
|
|
||||||
base.actions = [{ type: "set_header", name: "Vary", value: "Accept, Accept-Encoding" }];
|
|
||||||
} else base.actions = [{ type: "normalize_header", name: "Vary" }];
|
|
||||||
return base;
|
|
||||||
}
|
}
|
||||||
function create({ value = {}, scope = "vhost", onChange = () => {} } = {}) {
|
function create({ value = {}, scope = "vhost", onChange = () => { } } = {}) {
|
||||||
let model = settings(value), mode = "visual", epoch = 0, importResult = null;
|
let model = settings(value), mode = "visual", epoch = 0, importResult = null;
|
||||||
const stagesForScope = STAGES.filter(stage => scope !== "location" || stage !== "pre_route");
|
const stagesForScope = STAGES.filter(stage => scope !== "location" || stage !== "pre_route");
|
||||||
const node = el("section", undefined, "http-policy-editor vh-wide"), message = el("p", undefined, "policy-message fine");
|
const node = el("section", undefined, "http-policy-editor vh-wide"), message = el("p", undefined, "policy-message fine");
|
||||||
message.setAttribute("role", "status"); message.setAttribute("aria-live", "polite"); message.hidden = true;
|
message.setAttribute("role", "status"); message.setAttribute("aria-live", "polite"); message.hidden = true;
|
||||||
const toolbar = el("div", undefined, "policy-toolbar"), visual = el("div", undefined, "policy-visual"), rawPane = el("div", undefined, "policy-raw"); rawPane.hidden = true;
|
const toolbar = el("div", undefined, "policy-toolbar"), visual = el("fieldset", undefined, "policy-visual"), rawPane = el("fieldset", undefined, "policy-raw"); rawPane.hidden = true; rawPane.disabled = true;
|
||||||
node.append(text("p", "policyIntro", "fine"), text("p", "policyCompatibility", "fine"), toolbar, message, visual, rawPane);
|
node.append(text("p", "policyIntro", "fine"), text("p", "policyCompatibility", "fine"), toolbar, message, visual, rawPane);
|
||||||
const raw = input(rawPane, "policyJson", JSON.stringify(model, null, 2), { type: "textarea", rows: 18, maxLength: 262144, wide: true });
|
const raw = input(rawPane, "policyJson", JSON.stringify(model, null, 2), { type: "textarea", rows: 18, maxLength: 262144, wide: true });
|
||||||
const fail = error => { message.textContent = error.message || String(error); message.classList.add("is-error"); message.hidden = false; };
|
const fail = error => { message.textContent = error.message || String(error); message.classList.add("is-error"); message.hidden = false; };
|
||||||
const clear = () => { message.hidden = true; message.classList.remove("is-error"); };
|
const clear = () => { message.hidden = true; message.classList.remove("is-error"); };
|
||||||
|
const notice = value => { message.textContent = value; message.classList.remove("is-error"); message.hidden = false; };
|
||||||
const change = () => { epoch++; clear(); onChange(); };
|
const change = () => { epoch++; clear(); onChange(); };
|
||||||
const safely = fn => (...args) => { try { return fn(...args); } catch (error) { fail(error); } };
|
const safely = fn => (...args) => { try { return fn(...args); } catch (error) { fail(error); } };
|
||||||
|
node.addEventListener("invalid", event => {
|
||||||
|
for (let parent = event.target.parentElement; parent && parent !== node; parent = parent.parentElement) if (parent.tagName === "DETAILS") parent.open = true;
|
||||||
|
}, true);
|
||||||
const parse = (control, check = value => value) => {
|
const parse = (control, check = value => value) => {
|
||||||
try { const value = check(JSON.parse(control.value)); control.setCustomValidity(""); return value; }
|
try { const value = check(JSON.parse(control.value)); control.setCustomValidity(""); return value; }
|
||||||
catch (error) { control.setCustomValidity(error.message || t("policyInvalid")); throw error; }
|
catch (error) { control.setCustomValidity(error.message || t("policyInvalid")); throw error; }
|
||||||
@@ -106,13 +116,14 @@ window.rustProxyPolicy = (() => {
|
|||||||
function setValue(value) { model = settings(value); raw.value = JSON.stringify(model, null, 2); raw.setCustomValidity(""); render(); }
|
function setValue(value) { model = settings(value); raw.value = JSON.stringify(model, null, 2); raw.setCustomValidity(""); render(); }
|
||||||
const setMode = safely(next => {
|
const setMode = safely(next => {
|
||||||
model = read(); mode = next; visual.hidden = mode !== "visual"; rawPane.hidden = mode !== "json";
|
model = read(); mode = next; visual.hidden = mode !== "visual"; rawPane.hidden = mode !== "json";
|
||||||
|
visual.disabled = mode !== "visual"; rawPane.disabled = mode !== "json";
|
||||||
if (mode === "json") raw.value = JSON.stringify(model, null, 2); else render();
|
if (mode === "json") raw.value = JSON.stringify(model, null, 2); else render();
|
||||||
visualButton.setAttribute("aria-pressed", String(mode === "visual")); jsonButton.setAttribute("aria-pressed", String(mode === "json")); clear();
|
visualButton.setAttribute("aria-pressed", String(mode === "visual")); jsonButton.setAttribute("aria-pressed", String(mode === "json")); clear();
|
||||||
});
|
});
|
||||||
const visualButton = button("policyVisual", () => setMode("visual")), jsonButton = button("policyJson", () => setMode("json"));
|
const visualButton = button("policyVisual", () => setMode("visual")), jsonButton = button("policyJson", () => setMode("json"));
|
||||||
visualButton.setAttribute("aria-pressed", "true"); jsonButton.setAttribute("aria-pressed", "false"); toolbar.append(visualButton, jsonButton);
|
visualButton.setAttribute("aria-pressed", "true"); jsonButton.setAttribute("aria-pressed", "false"); toolbar.append(visualButton, jsonButton);
|
||||||
raw.addEventListener("input", () => { raw.setCustomValidity(""); change(); });
|
raw.addEventListener("input", () => { raw.setCustomValidity(""); change(); });
|
||||||
const guide = el("a", t("documentation"), "policy-guide"); guide.href = "/docs#doc=docs%2FPOLICY.md"; guide.target = "_blank"; guide.rel = "noopener"; toolbar.append(guide);
|
const guide = text("a", "documentation", "outline policy-guide"); guide.href = "/docs#doc=docs%2FPOLICY.md"; guide.target = "_blank"; guide.rel = "noopener noreferrer"; toolbar.append(guide);
|
||||||
const editJson = (parent, key, current, apply, check = value => value, rows = 4) => {
|
const editJson = (parent, key, current, apply, check = value => value, rows = 4) => {
|
||||||
const area = input(parent, key, JSON.stringify(current, null, 2), { type: "textarea", rows, maxLength: 65536, wide: true }); area.classList.add("policy-config-json");
|
const area = input(parent, key, JSON.stringify(current, null, 2), { type: "textarea", rows, maxLength: 65536, wide: true }); area.classList.add("policy-config-json");
|
||||||
area._readJson = () => { const data = parse(area, check); apply(data); return data; };
|
area._readJson = () => { const data = parse(area, check); apply(data); return data; };
|
||||||
@@ -122,20 +133,91 @@ window.rustProxyPolicy = (() => {
|
|||||||
function renderAction(parent, rule, action, index, refresh) {
|
function renderAction(parent, rule, action, index, refresh) {
|
||||||
const row = el("div", undefined, "policy-action"); parent.append(row);
|
const row = el("div", undefined, "policy-action"); parent.append(row);
|
||||||
const known = Object.hasOwn(ACTION_FIELDS, action.type), choices = Object.keys(ACTION_FIELDS).map(type => [type, label("policyAction", type)]);
|
const known = Object.hasOwn(ACTION_FIELDS, action.type), choices = Object.keys(ACTION_FIELDS).map(type => [type, label("policyAction", type)]);
|
||||||
|
row.dataset.policyFields = String(known ? ACTION_FIELDS[action.type].length : 1);
|
||||||
if (!known) choices.unshift([action.type || "", action.type || t("policyAdvancedAction")]);
|
if (!known) choices.unshift([action.type || "", action.type || t("policyAdvancedAction")]);
|
||||||
const op = input(row, "policyAction", action.type, { values: choices });
|
const op = input(row, "policyAction", action.type, { values: choices });
|
||||||
op.dataset.policyAction = ""; limitTerminalActions(op, rule.stage || "request");
|
op.dataset.policyAction = ""; limitActions(op, rule.stage || "request");
|
||||||
op.addEventListener("change", safely(() => { read(); rule.actions[index] = defaultAction(op.value); refresh(); change(); }));
|
op.addEventListener("change", safely(() => { read(); rule.actions[index] = defaultAction(op.value); refresh(); change(); }));
|
||||||
if (!known) editJson(row, "policyAdvancedAction", action, value => { rule.actions[index] = value; }, requireObject);
|
if (!known) editJson(row, "policyAdvancedAction", action, value => { rule.actions[index] = value; }, requireObject);
|
||||||
else for (const key of ACTION_FIELDS[action.type]) {
|
else for (const key of ACTION_FIELDS[action.type]) {
|
||||||
const number = ["status", "seconds"].includes(key), field = input(row, `policyField${key[0].toUpperCase()}${key.slice(1)}`, action[key], { type: number ? "number" : key === "body" ? "textarea" : "text", rows: key === "body" ? 2 : undefined, maxLength: key === "body" ? 65536 : 8192, min: number ? 0 : undefined });
|
const number = ["status", "seconds"].includes(key), field = input(row, `policyField${key[0].toUpperCase()}${key.slice(1)}`, action[key], { type: number ? "number" : key === "body" ? "textarea" : "text", rows: key === "body" ? 2 : undefined, maxLength: key === "body" ? 65536 : 8192, min: key === "status" ? (action.type === "deny" ? 400 : 200) : number ? 0 : undefined, max: key === "status" ? 599 : key === "seconds" ? 31536000 : undefined });
|
||||||
field.addEventListener("input", () => { action[key] = number ? Number(field.value) : field.value; change(); });
|
field.addEventListener("input", () => { action[key] = number ? Number(field.value) : field.value; change(); });
|
||||||
}
|
}
|
||||||
const controls = el("div", undefined, "policy-row-controls"); row.append(controls);
|
const controls = el("div", undefined, "policy-row-controls"); row.append(controls);
|
||||||
const up = button("policyMoveUp", safely(() => { read(); [rule.actions[index - 1], rule.actions[index]] = [rule.actions[index], rule.actions[index - 1]]; refresh(); change(); })); up.disabled = index === 0;
|
const up = button("policyMoveUp", safely(() => { read();[rule.actions[index - 1], rule.actions[index]] = [rule.actions[index], rule.actions[index - 1]]; refresh(); change(); })); up.disabled = index === 0;
|
||||||
const down = button("policyMoveDown", safely(() => { read(); [rule.actions[index + 1], rule.actions[index]] = [rule.actions[index], rule.actions[index + 1]]; refresh(); change(); })); down.disabled = index === rule.actions.length - 1;
|
const down = button("policyMoveDown", safely(() => { read();[rule.actions[index + 1], rule.actions[index]] = [rule.actions[index], rule.actions[index + 1]]; refresh(); change(); })); down.disabled = index === rule.actions.length - 1;
|
||||||
controls.append(up, down, button("remove", safely(() => { read(); rule.actions.splice(index, 1); refresh(); change(); })));
|
controls.append(up, down, button("remove", safely(() => { read(); rule.actions.splice(index, 1); refresh(); change(); })));
|
||||||
}
|
}
|
||||||
|
function renderConditions(card, rule) {
|
||||||
|
const conditions = el("details", undefined, "policy-conditions"), summary = el("summary"), count = el("span", undefined, "policy-condition-count");
|
||||||
|
summary.append(text("span", "policyConditions"), count); conditions.append(summary); card.append(conditions);
|
||||||
|
const body = el("div", undefined, "policy-detail-body"), list = el("div", undefined, "policy-condition-list"); body.append(list); conditions.append(body);
|
||||||
|
const advanced = el("details", undefined, "policy-condition-advanced"); advanced.append(text("summary", "policyConditionAdvanced"));
|
||||||
|
const advancedBody = el("div", undefined, "policy-detail-body"); advanced.append(advancedBody); body.append(advanced);
|
||||||
|
const groupOf = value => Object.keys(value).length === 1 ? ["all", "any"].find(key => Array.isArray(value[key])) : undefined;
|
||||||
|
const describe = (value, depth = 0) => {
|
||||||
|
if (!object(value) || depth > 16) return JSON.stringify(value);
|
||||||
|
const group = groupOf(value);
|
||||||
|
if (group) return value[group].length ? `(${value[group].map(item => describe(item, depth + 1)).join(group === "all" ? " AND " : " OR ")})` : t(group === "all" ? "policyConditionAlways" : "policyConditionNever");
|
||||||
|
if (value.not) return `NOT (${describe(value.not, depth + 1)})`;
|
||||||
|
if (value.acl) return `ACL: ${value.acl}`;
|
||||||
|
if (typeof value.fetch === "string" && (value.values === undefined || Array.isArray(value.values))) return `${value.fetch} ${value.operator || ""}${value.operator === "exists" ? "" : ` ${(value.values || []).map(item => JSON.stringify(item)).join(" | ")}`}${value.ignore_case ? ` · ${t("policyIgnoreCase")}` : ""}`;
|
||||||
|
return JSON.stringify(value);
|
||||||
|
};
|
||||||
|
const refreshConditions = () => {
|
||||||
|
list.replaceChildren(); const value = rule.when || { all: [] }, group = groupOf(value), items = group ? value[group] : [value];
|
||||||
|
count.textContent = String(items.length); count.title = t("policyConditionsCount").replace("{count}", items.length);
|
||||||
|
count.setAttribute("aria-label", count.title);
|
||||||
|
if (!items.length) { list.append(text("p", group === "any" ? "policyConditionNever" : "policyConditionEmpty", "fine")); return; }
|
||||||
|
if (group) list.append(el("span", group === "all" ? "AND" : "OR", "policy-condition-join"));
|
||||||
|
items.forEach((item, index) => {
|
||||||
|
const row = el("div", undefined, "policy-condition-row"); row.append(el("code", describe(item)));
|
||||||
|
row.append(button("policyConditionRemove", safely(() => {
|
||||||
|
const current = parse(when, requireObject), currentGroup = groupOf(current);
|
||||||
|
if (currentGroup) {
|
||||||
|
const remaining = current[currentGroup].filter((_, at) => at !== index);
|
||||||
|
rule.when = remaining.length ? { [currentGroup]: remaining } : { all: [] };
|
||||||
|
} else rule.when = { all: [] };
|
||||||
|
when.value = JSON.stringify(rule.when, null, 2); when.setCustomValidity(""); refreshConditions(); change();
|
||||||
|
})));
|
||||||
|
list.append(row);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const when = editJson(advancedBody, "policyConditionJson", rule.when || { all: [] }, value => { rule.when = value; refreshConditions(); }, requireObject, 5);
|
||||||
|
const simple = el("div", undefined, "policy-grid policy-condition-builder");
|
||||||
|
const fetch = input(simple, "policyFetch", "path", { maxLength: 4096, placeholder: "path, method, req.fhdr(Host)…" });
|
||||||
|
const operator = input(simple, "policyOperator", "prefix", { values: OPERATORS.map(op => [op, op]) });
|
||||||
|
const modeSelect = input(simple, "policyCombine", groupOf(rule.when || {}) || "all", { values: [["all", "AND"], ["any", "OR"]] });
|
||||||
|
const values = input(simple, "policyValues", "", { type: "textarea", rows: 2, maxLength: 8192, wide: true, placeholder: "/api/" });
|
||||||
|
const controls = el("div", undefined, "policy-condition-controls policy-wide"), ignore = input(controls, "policyIgnoreCase", false, { type: "checkbox" });
|
||||||
|
const feedback = el("p", undefined, "policy-condition-feedback fine"); feedback.setAttribute("role", "status"); feedback.hidden = true;
|
||||||
|
const syncOperator = () => { values.disabled = operator.value === "exists"; ignore.disabled = !TEXT_OPERATORS.includes(operator.value); values.setCustomValidity(""); };
|
||||||
|
operator.addEventListener("change", syncOperator); syncOperator();
|
||||||
|
const invalid = (control, key) => { control.setCustomValidity(t(key)); control.focus(); control.reportValidity(); throw Error(t(key)); };
|
||||||
|
controls.append(button("policyAddCondition", safely(() => {
|
||||||
|
feedback.hidden = true; const before = parse(when, requireObject), sample = fetch.value.trim(), numeric = NUMBER_OPERATORS.includes(operator.value);
|
||||||
|
if (!sample) invalid(fetch, "policyConditionFetchRequired");
|
||||||
|
const operands = operator.value === "exists" ? [] : values.value.split(/\r?\n/).filter(value => value.length).map(value => numeric ? value.trim() : value);
|
||||||
|
if (operator.value !== "exists" && !operands.length) invalid(values, "policyConditionValuesRequired");
|
||||||
|
if (operands.length > 64) invalid(values, "policyConditionValueLimit");
|
||||||
|
if (numeric && operands.some(value => !/^[+-]?\d+$/.test(value) || BigInt(value) < -9223372036854775808n || BigInt(value) > 9223372036854775807n)) invalid(values, "policyConditionNumber");
|
||||||
|
if (numeric && operator.value !== "eq" && operands.length !== 1) invalid(values, "policyConditionSingleNumber");
|
||||||
|
const condition = { fetch: sample, operator: operator.value, values: operands, ignore_case: !ignore.disabled && ignore.checked };
|
||||||
|
const group = modeSelect.value, beforeGroup = groupOf(before), empty = beforeGroup && !before[beforeGroup].length;
|
||||||
|
if (beforeGroup === group && before[group].length >= 32) throw Error(t("policyConditionLimit"));
|
||||||
|
rule.when = empty ? { [group]: [condition] } : beforeGroup === group ? { [group]: [...before[group], condition] } : { [group]: [before, condition] };
|
||||||
|
when.value = JSON.stringify(rule.when, null, 2); when.setCustomValidity(""); refreshConditions(); change();
|
||||||
|
feedback.textContent = t("policyConditionAdded"); feedback.hidden = false;
|
||||||
|
}), "primary"));
|
||||||
|
simple.append(controls);
|
||||||
|
for (const control of simple.querySelectorAll("input, select, textarea")) {
|
||||||
|
control.setAttribute("form", "rustproxy-policy-tools");
|
||||||
|
control.addEventListener("input", () => { control.setCustomValidity(""); feedback.hidden = true; });
|
||||||
|
}
|
||||||
|
simple.addEventListener("input", event => event.stopPropagation()); simple.addEventListener("change", event => event.stopPropagation());
|
||||||
|
body.append(text("p", "policyConditionDraft", "fine"), simple, feedback, text("p", "policyConditionsHelp", "fine"));
|
||||||
|
refreshConditions();
|
||||||
|
}
|
||||||
function renderRule(parent, rule, index) {
|
function renderRule(parent, rule, index) {
|
||||||
const card = el("article", undefined, `policy-rule${rule.enabled === false ? " is-disabled" : ""}`); card.dataset.ruleId = rule.id || ""; parent.append(card);
|
const card = el("article", undefined, `policy-rule${rule.enabled === false ? " is-disabled" : ""}`); card.dataset.ruleId = rule.id || ""; parent.append(card);
|
||||||
const heading = el("div", undefined, "policy-rule-heading"), enabled = input(heading, "enabled", rule.enabled !== false, { type: "checkbox" });
|
const heading = el("div", undefined, "policy-rule-heading"), enabled = input(heading, "enabled", rule.enabled !== false, { type: "checkbox" });
|
||||||
@@ -145,48 +227,81 @@ window.rustProxyPolicy = (() => {
|
|||||||
enabled.addEventListener("change", () => { rule.enabled = enabled.checked; card.classList.toggle("is-disabled", !enabled.checked); change(); });
|
enabled.addEventListener("change", () => { rule.enabled = enabled.checked; card.classList.toggle("is-disabled", !enabled.checked); change(); });
|
||||||
title.addEventListener("input", () => { rule.name = title.value; change(); });
|
title.addEventListener("input", () => { rule.name = title.value; change(); });
|
||||||
const commands = el("div", undefined, "policy-row-controls"); heading.append(commands);
|
const commands = el("div", undefined, "policy-row-controls"); heading.append(commands);
|
||||||
const up = button("policyMoveUp", safely(() => { read(); [model.rules[index - 1], model.rules[index]] = [model.rules[index], model.rules[index - 1]]; render(); change(); })); up.disabled = index === 0;
|
const up = button("policyMoveUp", safely(() => { read();[model.rules[index - 1], model.rules[index]] = [model.rules[index], model.rules[index - 1]]; render(); change(); })); up.disabled = index === 0;
|
||||||
const down = button("policyMoveDown", safely(() => { read(); [model.rules[index + 1], model.rules[index]] = [model.rules[index], model.rules[index + 1]]; render(); change(); })); down.disabled = index === model.rules.length - 1;
|
const down = button("policyMoveDown", safely(() => { read();[model.rules[index + 1], model.rules[index]] = [model.rules[index], model.rules[index + 1]]; render(); change(); })); down.disabled = index === model.rules.length - 1;
|
||||||
commands.append(up, down, button("remove", safely(() => { read(); model.rules.splice(index, 1); render(); change(); })));
|
commands.append(up, down, button("remove", safely(() => { read(); model.rules.splice(index, 1); render(); change(); })));
|
||||||
const meta = el("div", undefined, "policy-grid"), id = input(meta, "policyRuleId", rule.id, { maxLength: 128 });
|
const meta = el("div", undefined, "policy-grid policy-rule-meta"), id = input(meta, "policyRuleId", rule.id, { maxLength: 128 });
|
||||||
const stages = [...stagesForScope]; if (rule.stage && !stages.includes(rule.stage)) stages.push(rule.stage);
|
const stages = [...stagesForScope]; if (rule.stage && !stages.includes(rule.stage)) stages.push(rule.stage);
|
||||||
const stage = input(meta, "policyStage", rule.stage || "request", { values: stages.map(stage => [stage, label("policyStage", stage)]) });
|
const stage = input(meta, "policyStage", rule.stage || "request", { values: stages.map(stage => [stage, label("policyStage", stage)]) });
|
||||||
const stop = input(meta, "policyStop", !!rule.stop, { type: "checkbox" });
|
|
||||||
id.addEventListener("input", () => { rule.id = id.value; change(); }); stop.addEventListener("change", () => { rule.stop = stop.checked; change(); });
|
|
||||||
const stageHint = el("p", label("policyStageHelp", stage.value), "policy-wide fine");
|
const stageHint = el("p", label("policyStageHelp", stage.value), "policy-wide fine");
|
||||||
stage.addEventListener("change", () => { rule.stage = stage.value; stageHint.textContent = label("policyStageHelp", stage.value); for (const op of card.querySelectorAll("select[data-policy-action]")) limitTerminalActions(op, stage.value); change(); });
|
stage.addEventListener("change", () => { rule.stage = stage.value; stageHint.textContent = label("policyStageHelp", stage.value); for (const op of card.querySelectorAll("select[data-policy-action]")) limitActions(op, stage.value); change(); });
|
||||||
meta.append(stageHint); card.append(meta);
|
meta.append(stageHint); card.append(meta);
|
||||||
const conditions = el("details", undefined, "policy-conditions"), conditionSummary = text("summary", "policyConditions"); conditions.append(conditionSummary); card.append(conditions);
|
const stopRow = el("div", undefined, "policy-stop"), stop = input(stopRow, "policyStop", !!rule.stop, { type: "checkbox" });
|
||||||
const conditionBody = el("div", undefined, "policy-detail-body"); conditions.append(conditionBody);
|
stopRow.append(text("p", "policyStopHelp", "fine")); card.append(stopRow);
|
||||||
const when = editJson(conditionBody, "policyConditionJson", rule.when || { all: [] }, value => { rule.when = value; }, requireObject, 5);
|
id.addEventListener("input", () => { rule.id = id.value; change(); }); stop.addEventListener("change", () => { rule.stop = stop.checked; change(); });
|
||||||
const simple = el("div", undefined, "policy-grid"), fetch = input(simple, "policyFetch", "res.fhdr(Vary)", { maxLength: 4096 });
|
renderConditions(card, rule);
|
||||||
const operator = input(simple, "policyOperator", "equals", { values: OPERATORS.map(op => [op, op]) });
|
|
||||||
const values = input(simple, "policyValues", "Accept-Encoding", { type: "textarea", rows: 2, maxLength: 8192 });
|
|
||||||
const ignore = input(simple, "policyIgnoreCase", true, { type: "checkbox" });
|
|
||||||
const modeSelect = input(simple, "policyCombine", "all", { values: [["all", "AND"], ["any", "OR"]] });
|
|
||||||
operator.addEventListener("change", () => { values.disabled = operator.value === "exists"; });
|
|
||||||
simple.append(button("policyAddCondition", safely(() => {
|
|
||||||
const before = parse(when, requireObject), condition = { fetch: fetch.value, operator: operator.value, values: operator.value === "exists" ? [] : values.value.split(/\r?\n/).filter(value => value.length), ignore_case: ignore.checked };
|
|
||||||
const group = modeSelect.value;
|
|
||||||
const empty = Object.keys(before).length === 1 && ((Array.isArray(before.all) && !before.all.length) || (Array.isArray(before.any) && !before.any.length));
|
|
||||||
rule.when = empty ? { [group]: [condition] } : Object.keys(before).length === 1 && Array.isArray(before[group]) ? { [group]: [...before[group], condition] } : { [group]: [before, condition] };
|
|
||||||
when.value = JSON.stringify(rule.when, null, 2); when.setCustomValidity(""); change();
|
|
||||||
})));
|
|
||||||
conditionBody.append(simple, text("p", "policyConditionsHelp", "fine"));
|
|
||||||
card.append(text("h4", "policyActions")); const actions = el("div", undefined, "policy-actions"); card.append(actions);
|
card.append(text("h4", "policyActions")); const actions = el("div", undefined, "policy-actions"); card.append(actions);
|
||||||
const refresh = () => { actions.replaceChildren(); rule.actions.forEach((action, index) => renderAction(actions, rule, action, index, refresh)); };
|
const refresh = () => { actions.replaceChildren(); rule.actions.forEach((action, index) => renderAction(actions, rule, action, index, refresh)); };
|
||||||
refresh(); const addAction = button("policyAddAction", safely(() => { read(); if (rule.actions.length >= 16) throw Error(t("policyActionLimit")); rule.actions.push(defaultAction("set_header")); refresh(); change(); })); card.append(addAction);
|
refresh(); const addAction = button("policyAddAction", safely(() => { read(); if (rule.actions.length >= 16) throw Error(t("policyActionLimit")); rule.actions.push(defaultAction("set_header")); refresh(); change(); })); card.append(addAction);
|
||||||
}
|
}
|
||||||
function render() {
|
function render() {
|
||||||
visual.replaceChildren();
|
visual.replaceChildren();
|
||||||
const bar = el("div", undefined, "policy-toolbar"); visual.append(bar);
|
const bar = el("div", undefined, "policy-toolbar policy-add-toolbar"); visual.append(bar);
|
||||||
const add = safely(kind => {
|
const focusRule = (id, expand = false) => {
|
||||||
|
const card = [...visual.querySelectorAll(".policy-rule")].find(item => item.dataset.ruleId === id);
|
||||||
|
if (expand && card) card.querySelector(".policy-conditions").open = true;
|
||||||
|
card?.scrollIntoView?.({ block: "nearest" }); card?.querySelector(".policy-rule-heading input[type=text]")?.focus({ preventScroll: true });
|
||||||
|
};
|
||||||
|
const add = safely(() => {
|
||||||
model = read(); if (model.rules.length >= 128) throw Error(t("policyRuleLimit"));
|
model = read(); if (model.rules.length >= 128) throw Error(t("policyRuleLimit"));
|
||||||
const id = uniqueId(model.rules);
|
const id = uniqueId(model.rules);
|
||||||
model.rules.push(kind ? preset(kind, id) : { id, name: t("policyNewRule"), enabled: true, stage: "after_response", when: { all: [] }, actions: [defaultAction("set_header")], stop: false });
|
model.rules.push({ id, name: t("policyNewRule"), enabled: true, stage: "after_response", when: { all: [] }, actions: [defaultAction("set_header")], stop: false });
|
||||||
render(); change();
|
render(); change(); focusRule(id, true);
|
||||||
});
|
});
|
||||||
bar.append(button("policyAddRule", () => add(), "primary"), button("policyPresetVary", () => add("vary")), button("policyPresetNormalize", () => add("normalize")));
|
const catalog = el("section", undefined, "policy-template-library"); catalog.hidden = true; catalog.id = `policy-presets-${++editorSequence}`; catalog.setAttribute("aria-label", t("policyTemplates"));
|
||||||
|
const templatesButton = button("policyTemplates", () => {
|
||||||
|
catalog.hidden = !catalog.hidden; templatesButton.setAttribute("aria-expanded", String(!catalog.hidden));
|
||||||
|
if (!catalog.hidden) search.focus();
|
||||||
|
});
|
||||||
|
templatesButton.setAttribute("aria-expanded", "false"); templatesButton.setAttribute("aria-controls", catalog.id);
|
||||||
|
bar.append(button("policyAddRule", add, "primary"), templatesButton); visual.append(catalog);
|
||||||
|
const catalogHeading = el("div", undefined, "policy-template-heading"), catalogCount = el("span", undefined, "policy-template-count");
|
||||||
|
catalogHeading.append(text("h4", "policyTemplates"), catalogCount, button("close", () => { catalog.hidden = true; templatesButton.setAttribute("aria-expanded", "false"); templatesButton.focus(); }));
|
||||||
|
const filters = el("div", undefined, "policy-template-filters"), search = input(filters, "policyTemplateSearch", "", { type: "search", maxLength: 128 });
|
||||||
|
const category = input(filters, "policyTemplateCategory", "all", { values: [["all", t("policyTemplateAll")], ...["headers", "cache", "security", "routing", "diagnostics"].map(key => [key, label("policyPresetCategory", key)])] });
|
||||||
|
const cards = el("div", undefined, "policy-template-cards"), noResults = text("p", "policyTemplateNone", "fine"); noResults.hidden = true;
|
||||||
|
catalog.append(catalogHeading, text("p", "policyTemplatesIntro", "fine"), filters, cards, noResults);
|
||||||
|
const normalizeSearch = value => value.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ł/g, "l");
|
||||||
|
const entries = window.rustProxyPolicyPresets.filter(template => template.rules.every(rule => stagesForScope.includes(rule.stage))).map(template => {
|
||||||
|
const card = el("article", undefined, "policy-template-card"); card.dataset.presetId = template.id;
|
||||||
|
const title = t(template.titleKey), badges = el("div", undefined, "policy-template-badges");
|
||||||
|
badges.append(el("span", label("policyPresetCategory", template.category)), el("span", t("policyTemplateCount").replace("{count}", template.rules.length)));
|
||||||
|
card.append(badges, el("h4", title), el("p", t(template.descriptionKey), "fine"));
|
||||||
|
if (template.noteKey) card.append(el("p", t(template.noteKey), "policy-template-note fine"));
|
||||||
|
const preview = el("details", undefined, "policy-template-preview"); preview.append(text("summary", "policyTemplatePreview"));
|
||||||
|
preview.append(el("pre", JSON.stringify(template.rules.map(({ nameKey, ...rule }) => ({ name: t(nameKey || template.titleKey), ...rule })), null, 2), "policy-result"));
|
||||||
|
card.append(preview, button("policyTemplateAdd", safely(() => {
|
||||||
|
const next = read(); if (next.rules.length + template.rules.length > 128) throw Error(t("policyRuleLimit"));
|
||||||
|
let firstId;
|
||||||
|
for (const item of template.rules) {
|
||||||
|
const { nameKey, ...rule } = clone(item), id = uniqueId(next.rules, template.id);
|
||||||
|
firstId ??= id; next.rules.push({ ...rule, id, name: t(nameKey || template.titleKey) });
|
||||||
|
}
|
||||||
|
model = settings(next); render(); change();
|
||||||
|
notice(t("policyTemplateAdded").replace("{name}", title).replace("{count}", template.rules.length)); focusRule(firstId);
|
||||||
|
}), "primary")); cards.append(card);
|
||||||
|
return { card, template, search: normalizeSearch([template.id, title, t(template.descriptionKey), template.noteKey ? t(template.noteKey) : "", label("policyPresetCategory", template.category), JSON.stringify(template.rules)].join(" ")) };
|
||||||
|
});
|
||||||
|
const filter = () => {
|
||||||
|
const query = normalizeSearch(search.value.trim()); let count = 0;
|
||||||
|
for (const item of entries) { item.card.hidden = (category.value !== "all" && item.template.category !== category.value) || !item.search.includes(query); if (!item.card.hidden) count++; }
|
||||||
|
noResults.hidden = count > 0; catalogCount.textContent = t("policyTemplateAvailable").replace("{count}", count);
|
||||||
|
};
|
||||||
|
for (const control of [search, category]) control.setAttribute("form", "rustproxy-policy-tools");
|
||||||
|
search.addEventListener("input", filter); category.addEventListener("change", filter);
|
||||||
|
filters.addEventListener("input", event => event.stopPropagation()); filters.addEventListener("change", event => event.stopPropagation());
|
||||||
|
catalog.addEventListener("keydown", event => { if (event.key === "Escape") { event.stopPropagation(); catalog.hidden = true; templatesButton.setAttribute("aria-expanded", "false"); templatesButton.focus(); } });
|
||||||
|
filter();
|
||||||
if (!model.rules.length) visual.append(text("p", "policyEmpty", "fine"));
|
if (!model.rules.length) visual.append(text("p", "policyEmpty", "fine"));
|
||||||
const rules = el("div", undefined, "policy-rules"); visual.append(rules); model.rules.forEach((rule, index) => renderRule(rules, rule, index));
|
const rules = el("div", undefined, "policy-rules"); visual.append(rules); model.rules.forEach((rule, index) => renderRule(rules, rule, index));
|
||||||
const definitions = el("details", undefined, "policy-definitions"); definitions.append(text("summary", "policyDefinitions"));
|
const definitions = el("details", undefined, "policy-definitions"); definitions.append(text("summary", "policyDefinitions"));
|
||||||
@@ -196,8 +311,7 @@ window.rustProxyPolicy = (() => {
|
|||||||
body.append(text("p", "policyDefinitionsHelp", "fine")); visual.append(definitions);
|
body.append(text("p", "policyDefinitionsHelp", "fine")); visual.append(definitions);
|
||||||
}
|
}
|
||||||
render();
|
render();
|
||||||
// Import is staged: server validation, visible preview, then an explicit add
|
|
||||||
// to the unsaved draft. Source changes invalidate a pending preview.
|
|
||||||
const importer = el("details", undefined, "policy-import"); importer.append(text("summary", "policyImport"));
|
const importer = el("details", undefined, "policy-import"); importer.append(text("summary", "policyImport"));
|
||||||
const importBody = el("div", undefined, "policy-detail-body"); importer.append(importBody);
|
const importBody = el("div", undefined, "policy-detail-body"); importer.append(importBody);
|
||||||
const source = input(importBody, "policyHaproxySource", "", { type: "textarea", rows: 7, maxLength: 262144, wide: true, placeholder: "acl vary_duplicate res.fhdr_cnt(Vary) eq 2\nacl vary_encoding res.fhdr(Vary) -i Accept-Encoding\nacl vary_combined res.fhdr(Vary) -i \"Accept,Accept-Encoding\" \"Accept, Accept-Encoding\"\nhttp-response set-header Vary \"Accept, Accept-Encoding\" if vary_duplicate vary_encoding vary_combined" });
|
const source = input(importBody, "policyHaproxySource", "", { type: "textarea", rows: 7, maxLength: 262144, wide: true, placeholder: "acl vary_duplicate res.fhdr_cnt(Vary) eq 2\nacl vary_encoding res.fhdr(Vary) -i Accept-Encoding\nacl vary_combined res.fhdr(Vary) -i \"Accept,Accept-Encoding\" \"Accept, Accept-Encoding\"\nhttp-response set-header Vary \"Accept, Accept-Encoding\" if vary_duplicate vary_encoding vary_combined" });
|
||||||
@@ -256,7 +370,7 @@ window.rustProxyPolicy = (() => {
|
|||||||
const details = el("details"); details.append(text("summary", "policyFullResult"), el("pre", JSON.stringify(result, null, 2), "policy-result")); resultBox.append(details);
|
const details = el("details"); details.append(text("summary", "policyFullResult"), el("pre", JSON.stringify(result, null, 2), "policy-result")); resultBox.append(details);
|
||||||
} catch (error) { fail(error); } finally { testButton.disabled = false; }
|
} catch (error) { fail(error); } finally { testButton.disabled = false; }
|
||||||
}, "primary");
|
}, "primary");
|
||||||
// Tester input changes invalidate an in-flight result without dirtying config.
|
|
||||||
for (const control of testGrid.querySelectorAll("input, select, textarea")) control.setAttribute("form", "rustproxy-policy-tools");
|
for (const control of testGrid.querySelectorAll("input, select, textarea")) control.setAttribute("form", "rustproxy-policy-tools");
|
||||||
testGrid.addEventListener("input", event => { event.stopPropagation(); epoch++; }); testGrid.addEventListener("change", event => { event.stopPropagation(); epoch++; });
|
testGrid.addEventListener("input", event => { event.stopPropagation(); epoch++; }); testGrid.addEventListener("change", event => { event.stopPropagation(); epoch++; });
|
||||||
testBody.append(testButton, resultBox); node.append(tester);
|
testBody.append(testButton, resultBox); node.append(tester);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
const status = select("redirectStatus", "status_code", [["301", "redirect301"], ["302", "redirect302"], ["303", "redirect303"], ["307", "redirect307"], ["308", "redirect308"]]); status.value = String(data.status_code);
|
const status = select("redirectStatus", "status_code", [["301", "redirect301"], ["302", "redirect302"], ["303", "redirect303"], ["307", "redirect307"], ["308", "redirect308"]]); status.value = String(data.status_code);
|
||||||
const cache = input("redirectCacheSeconds", "cache_seconds", "number"); cache.min = "0"; cache.max = "31536000"; cache.step = "1"; cache.value = String(data.cache_seconds || 0);
|
const cache = input("redirectCacheSeconds", "cache_seconds", "number"); cache.min = "0"; cache.max = "31536000"; cache.step = "1"; cache.value = String(data.cache_seconds || 0);
|
||||||
const remove = el("button", t("remove"), "quiet"); remove.type = "button"; remove.addEventListener("click", () => { box.remove(); renumber(); changed(); });
|
const remove = el("button", t("remove"), "quiet"); remove.type = "button"; remove.addEventListener("click", () => { box.remove(); renumber(); changed(); });
|
||||||
const actions = el("div", undefined, "form-actions"); actions.append(remove); grid.append(actions); box.append(grid); rules.append(box); syncRule(box); targetType.addEventListener("change", () => syncRule(box));
|
const actions = el("div", undefined, "vh-wide redirect-rule-actions"); actions.append(remove); grid.append(actions); box.append(grid); rules.append(box); syncRule(box); targetType.addEventListener("change", () => syncRule(box));
|
||||||
}
|
}
|
||||||
function syncRule(box) {
|
function syncRule(box) {
|
||||||
const kind = box.querySelector('[data-field="target_type"]').value;
|
const kind = box.querySelector('[data-field="target_type"]').value;
|
||||||
|
|||||||
@@ -1,190 +0,0 @@
|
|||||||
// Cache/VCL editor round-trip regressions. Requires Node.js and jsdom.
|
|
||||||
// Run: node src/admin/web/tests/cache-rules.dom.test.cjs
|
|
||||||
const assert = require('node:assert/strict');
|
|
||||||
const fs = require('node:fs');
|
|
||||||
const path = require('node:path');
|
|
||||||
const { JSDOM } = require('jsdom');
|
|
||||||
const root = path.resolve(__dirname, '../../../..');
|
|
||||||
const translations = JSON.parse(fs.readFileSync(path.join(root, 'langs/en_US.json'), 'utf8')).translations;
|
|
||||||
const dom = new JSDOM('<html><body><form id="fixture"><main id="root"></main></form></body></html>', { runScripts: 'outside-only', url: 'https://panel.example.test' });
|
|
||||||
const w = dom.window, d = w.document;
|
|
||||||
w.structuredClone = structuredClone;
|
|
||||||
w.t = key => translations[key] || key;
|
|
||||||
w.el = (tag, text, cls) => { const node = d.createElement(tag); if (text !== undefined) node.textContent = text; if (cls) node.className = cls; return node; };
|
|
||||||
w.envelope = { config: { cache: { rules: [] }, vhosts: [] } };
|
|
||||||
w.authenticated = false;
|
|
||||||
w.fmt = value => String(value);
|
|
||||||
w.rustProxyChoicePicker = { create: options => { const node = d.createElement('div'); node.className = options.className || ''; return node; } };
|
|
||||||
let notices = [], calls = [], reply = {}, dirty = 0, editor, checks = 0;
|
|
||||||
w.toast = (message, error) => notices.push({ message, error });
|
|
||||||
w.api = async (url, options) => { calls.push({ url, body: options?.body ? JSON.parse(options.body) : null }); return structuredClone(reply); };
|
|
||||||
w.eval(fs.readFileSync(path.join(root, 'src/admin/web/cache-rules.js'), 'utf8'));
|
|
||||||
const api = w.rustProxyCacheRules;
|
|
||||||
const plain = value => JSON.parse(JSON.stringify(value));
|
|
||||||
const flush = () => new Promise(resolve => setImmediate(resolve));
|
|
||||||
function mount(rules = [], scope = 'vhost') {
|
|
||||||
notices = []; calls = []; dirty = 0;
|
|
||||||
editor = api.create({ rules, scope, vhostId: 'site', autoLoadHits: false, onChange: () => dirty++ });
|
|
||||||
d.getElementById('root').replaceChildren(editor.node);
|
|
||||||
}
|
|
||||||
function button(key, within = editor.node) {
|
|
||||||
const found = [...within.querySelectorAll('button')].find(node => node.textContent === w.t(key) || node.getAttribute('aria-label') === w.t(key));
|
|
||||||
assert.ok(found, `button ${key}`); return found;
|
|
||||||
}
|
|
||||||
function card(index = 0) { return editor.node.querySelectorAll('.cache-rule')[index]; }
|
|
||||||
function open(index = 0) { card(index).querySelector('.cache-rule-title').click(); return card(index); }
|
|
||||||
function field(key, within) {
|
|
||||||
const found = [...within.querySelectorAll('.cache-rule-field')].find(node => node.firstElementChild?.textContent === w.t(key));
|
|
||||||
assert.ok(found, `field ${key}`); return found.querySelector('input, select, textarea');
|
|
||||||
}
|
|
||||||
function fill(node, value, event = 'input') { node.value = value; node.dispatchEvent(new w.Event(event, { bubbles: true })); }
|
|
||||||
function drop(from, to) { const event = new w.Event('drop', { bubbles: true, cancelable: true }); Object.defineProperty(event, 'dataTransfer', { value: { getData: () => String(from) } }); card(to).dispatchEvent(event); }
|
|
||||||
async function importRules(rules, warnings = []) {
|
|
||||||
reply = { rules, warnings }; button('cacheRulesImportVcl').click();
|
|
||||||
fill(editor.node.querySelector('.cache-rules-import textarea'), 'sub vcl_recv { if (req.http.X-Mode == "old") { set req.http.X-Mode = "new"; } else { return (pass); } }');
|
|
||||||
button('cacheRulesImportRun').click(); await flush();
|
|
||||||
}
|
|
||||||
async function check(name, fn) { await fn(); checks++; console.log(`ok ${checks} - ${name}`); }
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
const ordinary = { id: 'ordinary', name: 'Ordinary', enabled: true, stage: 'request', match: 'all', conditions: [{ field: 'path', operator: 'prefix', values: ['/assets'] }], actions: [{ type: 'set_request_header', name: 'X-Device', value: 'desktop' }], stop: false };
|
|
||||||
const hashing = { id: 'hash', name: 'Imported hash', enabled: true, stage: 'request', match: 'all', conditions: [], actions: [{ type: 'hash_header', name: 'X-Device' }], stop: false, hash_stage: true };
|
|
||||||
const flow = [
|
|
||||||
{ ...ordinary, id: 'vcl-if', name: 'If decision', conditions: [], actions: [], vcl_flow: { version: 1, group: 'vcl-fixture', index: 0, count: 3, branches: [{ any: [[{ field: 'header', name: 'X-Mode', operator: 'equals', values: ['old'] }]] }, { any: [[]] }] } },
|
|
||||||
{ ...ordinary, id: 'vcl-then', name: 'Selected branch', conditions: [], actions: [{ type: 'set_request_header', name: 'X-Mode', value: 'new' }], vcl_flow: { version: 1, group: 'vcl-fixture', index: 1, count: 3, guards: [{ entry: 0, branch: 0 }] } },
|
|
||||||
{ ...ordinary, id: 'vcl-else', name: 'Else branch', conditions: [], actions: [{ type: 'pass' }], stop: true, vcl_flow: { version: 1, group: 'vcl-fixture', index: 2, count: 3, guards: [{ entry: 0, branch: 1 }] } },
|
|
||||||
];
|
|
||||||
await check('existing request and imported hash rules survive opening and save', () => {
|
|
||||||
mount([ordinary, hashing]); open(); assert.deepEqual(plain(editor.read()), [ordinary, hashing]);
|
|
||||||
assert.equal(dirty, 0);
|
|
||||||
});
|
|
||||||
await check('ordinary reorder keeps hash phase and edited action values', () => {
|
|
||||||
const first = card(); const input = [...first.querySelectorAll('input')].find(node => node.placeholder === w.t('cacheRuleHeaderValue'));
|
|
||||||
fill(input, 'mobile'); button('cacheRulesMoveDown', first).click();
|
|
||||||
assert.deepEqual(plain(editor.read()), [hashing, { ...ordinary, actions: [{ ...ordinary.actions[0], value: 'mobile' }] }]);
|
|
||||||
assert.equal(ordinary.actions[0].value, 'desktop');
|
|
||||||
});
|
|
||||||
await check('tester sends the same saved-rule structure without configuration writes', async () => {
|
|
||||||
mount([ordinary, hashing]); reply = { request: { cacheable: true }, response: { stored: true, ttl: 60, grace: 0 } };
|
|
||||||
button('cacheRulesTesterRun').click(); await flush();
|
|
||||||
assert.equal(calls.length, 1); assert.equal(calls[0].url, '/api/cache/rules/test');
|
|
||||||
assert.deepEqual(calls[0].body.vhost_rules, [ordinary, hashing]); assert.equal(dirty, 0);
|
|
||||||
});
|
|
||||||
await check('opening a branch marker allows zero actions and preserves every condition and guard', () => {
|
|
||||||
mount(flow); open(); assert.deepEqual(plain(editor.read()), flow); assert.equal(dirty, 0);
|
|
||||||
const copy = editor.read(); copy[0].vcl_flow.branches[0].any[0][0].values[0] = 'tampered';
|
|
||||||
copy[1].vcl_flow.guards[0].branch = 1;
|
|
||||||
assert.deepEqual(plain(editor.read()), flow); assert.equal(flow[0].vcl_flow.branches[0].any[0][0].values[0], 'old');
|
|
||||||
});
|
|
||||||
await check('structural controls are disabled and reject synthetic changes without flattening', () => {
|
|
||||||
const marker = card();
|
|
||||||
assert.ok(field('cacheRuleStage', marker).disabled); assert.ok(field('cacheRuleMatch', marker).disabled);
|
|
||||||
assert.ok(marker.querySelector('.cache-rule-stop input').disabled);
|
|
||||||
assert.ok(button('cacheRuleAddCondition', marker).disabled); assert.ok(button('cacheRuleAddAction', marker).disabled);
|
|
||||||
fill(field('cacheRuleStage', marker), 'deliver', 'change');
|
|
||||||
fill(field('cacheRuleMatch', marker), 'any', 'change');
|
|
||||||
assert.deepEqual(plain(editor.read()), flow); assert.equal(dirty, 0); assert.equal(notices.length, 2);
|
|
||||||
});
|
|
||||||
await check('editing an action and renaming a rule preserve branch references', () => {
|
|
||||||
mount(flow); const row = open(1);
|
|
||||||
fill(row.querySelector('input[placeholder="' + w.t('cacheRuleHeaderValue') + '"]'), 'reviewed');
|
|
||||||
fill(field('cacheRuleId', row), 'renamed-action', 'change');
|
|
||||||
const saved = plain(editor.read());
|
|
||||||
assert.equal(saved[1].actions[0].value, 'reviewed'); assert.equal(saved[1].id, 'renamed-action');
|
|
||||||
assert.deepEqual(saved.map(rule => rule.vcl_flow), flow.map(rule => rule.vcl_flow));
|
|
||||||
assert.equal(flow[1].actions[0].value, 'new');
|
|
||||||
});
|
|
||||||
await check('moving any member or dropping a flat rule cannot split a VCL block', () => {
|
|
||||||
mount([ordinary, ...flow, hashing]);
|
|
||||||
button('cacheRulesMoveDown', card(2)).click();
|
|
||||||
assert.deepEqual(plain(editor.read()), [ordinary, hashing, ...flow]);
|
|
||||||
drop(0, 3); assert.deepEqual(plain(editor.read()), [hashing, ...flow, ordinary]);
|
|
||||||
button('cacheRulesMoveUp', card(3)).click();
|
|
||||||
assert.deepEqual(plain(editor.read()), [...flow, hashing, ordinary]);
|
|
||||||
const before = dirty; drop(0, 2); assert.equal(dirty, before); assert.deepEqual(plain(editor.read()), [...flow, hashing, ordinary]);
|
|
||||||
});
|
|
||||||
await check('enable controls change the complete block and leave unrelated rules alone', () => {
|
|
||||||
mount([ordinary, ...flow]);
|
|
||||||
const toggle = card(2).querySelector('.cache-rule-head input'); toggle.checked = false; toggle.dispatchEvent(new w.Event('change', { bubbles: true }));
|
|
||||||
assert.deepEqual(plain(editor.read()), [ordinary, ...flow.map(rule => ({ ...rule, enabled: false }))]);
|
|
||||||
assert.equal(dirty, 1);
|
|
||||||
});
|
|
||||||
await check('duplicate creates independent group and rule IDs; remove deletes the complete copy', () => {
|
|
||||||
mount([ordinary, ...flow]); button('cacheRulesFlowDuplicate', card(2)).click();
|
|
||||||
const saved = plain(editor.read()), copies = saved.slice(4);
|
|
||||||
assert.equal(saved.length, 7); assert.equal(new Set(saved.map(rule => rule.id)).size, 7);
|
|
||||||
assert.match(copies[0].vcl_flow.group, /^vcl-[a-f0-9]{32}$/); assert.notEqual(copies[0].vcl_flow.group, flow[0].vcl_flow.group);
|
|
||||||
assert.equal(new Set(copies.map(rule => rule.vcl_flow.group)).size, 1);
|
|
||||||
assert.deepEqual(copies.map(rule => ({ ...rule.vcl_flow, group: 'vcl-fixture' })), flow.map(rule => rule.vcl_flow));
|
|
||||||
button('cacheRulesFlowRemove', card(5)).click(); assert.deepEqual(plain(editor.read()), [ordinary, ...flow]);
|
|
||||||
});
|
|
||||||
await check('vhost targeting is updated atomically for the whole global VCL block', () => {
|
|
||||||
mount([ordinary, ...flow], 'global'); const row = open(2);
|
|
||||||
row.querySelector('.cache-rule-vhosts').dispatchEvent(new w.CustomEvent('choicechange', { detail: ['site-a', 'site-b'], bubbles: true }));
|
|
||||||
const saved = plain(editor.read()); assert.deepEqual(saved[0], ordinary);
|
|
||||||
assert.ok(saved.slice(1).every(rule => JSON.stringify(rule.vhosts) === '["site-a","site-b"]'));
|
|
||||||
const detached = editor.read(); detached[1].vhosts.push('tampered'); assert.equal(editor.read()[1].vhosts.length, 2);
|
|
||||||
});
|
|
||||||
await check('importing the same block again remaps IDs without changing its guards', async () => {
|
|
||||||
mount(flow); await importRules(flow);
|
|
||||||
const saved = plain(editor.read()), added = saved.slice(3);
|
|
||||||
assert.equal(saved.length, 6); assert.deepEqual(saved.slice(0, 3), flow);
|
|
||||||
assert.equal(new Set(saved.map(rule => rule.id)).size, 6); assert.notEqual(added[0].vcl_flow.group, flow[0].vcl_flow.group);
|
|
||||||
assert.deepEqual(added.map(rule => ({ ...rule.vcl_flow, group: 'vcl-fixture' })), flow.map(rule => rule.vcl_flow));
|
|
||||||
assert.equal(dirty, 1); assert.deepEqual(flow[1].vcl_flow.guards, [{ entry: 0, branch: 0 }]);
|
|
||||||
});
|
|
||||||
await check('partial import keeps the complete structure only after explicit acceptance', async () => {
|
|
||||||
mount([ordinary]); await importRules(flow, ['Unsupported log statement was omitted.']);
|
|
||||||
assert.deepEqual(plain(editor.read()), [ordinary]); assert.equal(dirty, 0);
|
|
||||||
button('cacheRulesImportApplyPartial').click();
|
|
||||||
assert.deepEqual(plain(editor.read()), [ordinary, ...flow]); assert.equal(dirty, 1);
|
|
||||||
});
|
|
||||||
await check('incomplete import is rejected atomically and preserves existing rules', async () => {
|
|
||||||
mount([ordinary]); await importRules(flow.slice(0, 2));
|
|
||||||
assert.deepEqual(plain(editor.read()), [ordinary]); assert.equal(dirty, 0);
|
|
||||||
assert.match(editor.node.querySelector('.cache-rules-import-result .is-error').textContent, /incomplete or structurally changed/);
|
|
||||||
});
|
|
||||||
await check('reordered or incomplete saved metadata cannot be saved or accidentally moved', () => {
|
|
||||||
mount([flow[0], flow[2], flow[1], ordinary]);
|
|
||||||
assert.throws(() => editor.read(), /incomplete or structurally changed/);
|
|
||||||
button('cacheRulesMoveUp', card(3)).click(); assert.equal(dirty, 0); assert.equal(notices.length, 1);
|
|
||||||
assert.equal(card(3).querySelector('.cache-rule-title b').textContent, ordinary.name);
|
|
||||||
editor.set(flow.slice(0, 2)); assert.throws(() => editor.read(), /incomplete or structurally changed/);
|
|
||||||
});
|
|
||||||
await check('tester and JSON export preserve the full imported program without executing in JavaScript', async () => {
|
|
||||||
mount(flow); reply = { request: { cacheable: false, reason: 'pass' } };
|
|
||||||
button('cacheRulesTesterRun').click(); await flush();
|
|
||||||
assert.equal(calls.length, 1); assert.equal(calls[0].url, '/api/cache/rules/test'); assert.deepEqual(calls[0].body.vhost_rules, flow);
|
|
||||||
assert.ok(button('cacheRulesExportJson')); assert.deepEqual(JSON.parse(editor.node.querySelector('.cache-rules-vcl').textContent), flow);
|
|
||||||
assert.throws(() => api.exportVcl(flow), /complete JSON export/); assert.equal(dirty, 0);
|
|
||||||
});
|
|
||||||
await check('a hash-stage imported action retains its phase when its action is edited', () => {
|
|
||||||
const hashFlow = { ...hashing, vcl_flow: { version: 1, group: 'vcl-hash', index: 0, count: 1 } };
|
|
||||||
mount([hashFlow]); const row = open();
|
|
||||||
const name = row.querySelector('input[placeholder="Accept-Language"]'); fill(name, 'X-Experiment');
|
|
||||||
assert.deepEqual(plain(editor.read()), [{ ...hashFlow, actions: [{ type: 'hash_header', name: 'X-Experiment' }] }]);
|
|
||||||
});
|
|
||||||
await check('nested guards and OR clauses survive editing and moving the complete program', () => {
|
|
||||||
const parent = { entry: 0, branch: 0 };
|
|
||||||
const nested = [
|
|
||||||
{ ...flow[0], vcl_flow: { ...flow[0].vcl_flow, group: 'vcl-nested', count: 5, branches: flow[0].vcl_flow.branches.slice(0, 1) } },
|
|
||||||
{ ...flow[0], id: 'nested-if', vcl_flow: { ...flow[0].vcl_flow, group: 'vcl-nested', index: 1, count: 5, guards: [parent], branches: [{ any: [[{ field: 'header', name: 'X-Inner', operator: 'exists' }], [{ field: 'path', operator: 'prefix', values: ['/public'] }]] }, { any: [[]] }] } },
|
|
||||||
{ ...flow[1], actions: [{ type: 'remove_request_header', name: 'X-Mode' }], vcl_flow: { ...flow[1].vcl_flow, group: 'vcl-nested', index: 2, count: 5, guards: [parent, { branch: 0, entry: 1 }] } },
|
|
||||||
{ ...flow[1], id: 'nested-else', vcl_flow: { ...flow[1].vcl_flow, group: 'vcl-nested', index: 3, count: 5, guards: [{ branch: 0, entry: 0 }, { entry: 1, branch: 1 }] } },
|
|
||||||
{ ...flow[2], vcl_flow: { ...flow[2].vcl_flow, group: 'vcl-nested', index: 4, count: 5, guards: [parent] } },
|
|
||||||
];
|
|
||||||
mount([...nested, ordinary]); open(2);
|
|
||||||
assert.deepEqual(plain(editor.read()), [...nested, ordinary]);
|
|
||||||
button('cacheRulesMoveDown', card(2)).click(); assert.deepEqual(plain(editor.read()), [ordinary, ...nested]);
|
|
||||||
const invalid = structuredClone(nested); invalid[4].vcl_flow.guards.push({ entry: 1, branch: 0 });
|
|
||||||
editor.set(invalid); assert.throws(() => editor.read(), /incomplete or structurally changed/);
|
|
||||||
});
|
|
||||||
await check('cross-phase guards and altered branch markers are rejected before save', () => {
|
|
||||||
const wrongPhase = structuredClone(flow); wrongPhase[1].hash_stage = true;
|
|
||||||
mount(wrongPhase); assert.throws(() => editor.read(), /incomplete or structurally changed/);
|
|
||||||
const wrongMarker = structuredClone(flow); wrongMarker[0].actions = [{ type: 'pass' }];
|
|
||||||
editor.set(wrongMarker); assert.throws(() => editor.read(), /incomplete or structurally changed/);
|
|
||||||
});
|
|
||||||
console.log(`PASS: ${checks} cache/VCL editor DOM regression checks`);
|
|
||||||
dom.window.close();
|
|
||||||
})().catch(error => { console.error(error); dom.window.close(); process.exitCode = 1; });
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
// Fast policy editor regressions using a DOM. Requires Node.js and jsdom.
|
|
||||||
// Run: node src/admin/web/tests/policy.dom.test.cjs
|
|
||||||
const assert = require('node:assert/strict');
|
|
||||||
const fs = require('node:fs');
|
|
||||||
const path = require('node:path');
|
|
||||||
const { JSDOM } = require('jsdom');
|
|
||||||
const root = path.resolve(__dirname, '../../../..');
|
|
||||||
const translations = JSON.parse(fs.readFileSync(path.join(root, 'langs/en_US.json'), 'utf8')).translations;
|
|
||||||
const dom = new JSDOM('<html><body><form id="fixture"><main id="root"></main><button type="submit">Save</button></form></body></html>', { runScripts: 'outside-only', url: 'https://panel.example.test' });
|
|
||||||
const w = dom.window, d = w.document;
|
|
||||||
w.structuredClone = structuredClone;
|
|
||||||
w.t = key => translations[key] || key;
|
|
||||||
w.el = (tag, text, cls) => { const n = d.createElement(tag); if (text !== undefined) n.textContent = text; if (cls) n.className = cls; return n; };
|
|
||||||
let dirty = 0, bubbled = 0, calls = [], response = {}, pending = false, resolver;
|
|
||||||
w.api = async (url, options) => { calls.push({ url, body: options?.body ? JSON.parse(options.body) : null }); if (pending) return new Promise(resolve => { resolver = resolve; }); return structuredClone(response); };
|
|
||||||
d.getElementById('fixture').addEventListener('input', () => bubbled++);
|
|
||||||
w.eval(fs.readFileSync(path.join(root, 'src/admin/web/policy.js'), 'utf8'));
|
|
||||||
const plain = value => JSON.parse(JSON.stringify(value));
|
|
||||||
const api = w.rustProxyPolicy;
|
|
||||||
let editor, checks = 0;
|
|
||||||
const flush = () => new Promise(resolve => setImmediate(resolve));
|
|
||||||
function mount(value = {}, scope = 'vhost') { dirty = 0; bubbled = 0; calls = []; pending = false; editor = api.create({ value, scope, onChange: () => dirty++ }); d.getElementById('root').replaceChildren(editor.node); }
|
|
||||||
function button(key, within = editor.node) { const found = [...within.querySelectorAll('button')].find(n => n.textContent === w.t(key)); assert.ok(found, `button ${key}`); return found; }
|
|
||||||
function control(key, within = editor.node) { const found = [...within.querySelectorAll('input, textarea, select')].find(n => n.getAttribute('aria-label') === w.t(key)); assert.ok(found, `control ${key}`); return found; }
|
|
||||||
function fill(node, value, event = 'input') { node.value = value; node.dispatchEvent(new w.Event(event, { bubbles: true })); }
|
|
||||||
async function check(name, fn) { await fn(); checks++; console.log(`ok ${checks} - ${name}`); }
|
|
||||||
(async () => {
|
|
||||||
const original = { acls: { mobile: { fetch: 'req.fhdr(User-Agent)', operator: 'contains', values: ['mobile'], ignore_case: true } }, maps: { devices: { kind: 'exact', entries: [{ key: 'a', value: 'b' }], default: 'fallback', ignore_case: false } }, rules: [
|
|
||||||
{ id: 'one', name: '<img src=x onerror=alert(1)>', enabled: false, stage: 'request', when: { any: [{ acl: 'mobile' }, { not: { fetch: 'req.fhdr(X-Test)', operator: 'exists', values: [] } }] }, actions: [{ type: 'set_var', name: 'txn.device', value: '%[req.fhdr(User-Agent),lower,map(devices)]' }], stop: true },
|
|
||||||
{ id: 'two', name: 'Response', enabled: true, stage: 'after_response', when: { all: [] }, actions: [{ type: 'normalize_header', name: 'Vary' }], stop: false }
|
|
||||||
] };
|
|
||||||
await check('duplicate and empty header fields are preserved', () => {
|
|
||||||
assert.deepEqual(plain(api.headers('Vary: Accept-Encoding\nVary: Accept,Accept-Encoding\nX-Empty:\nX-URL: https://example.test:8443/')), [{ name: 'Vary', value: 'Accept-Encoding' }, { name: 'Vary', value: 'Accept,Accept-Encoding' }, { name: 'X-Empty', value: '' }, { name: 'X-URL', value: 'https://example.test:8443/' }]);
|
|
||||||
assert.throws(() => api.headers('not a header'), /Invalid header/);
|
|
||||||
assert.throws(() => api.headers(' folded: header'), /Invalid header/);
|
|
||||||
});
|
|
||||||
await check('opening complex existing settings preserves all values', () => { mount(original); assert.deepEqual(plain(editor.read()), original); assert.equal(editor.node.querySelector('img'), null); });
|
|
||||||
await check('reordering rules preserves ACLs, maps, conditions and actions', () => {
|
|
||||||
button('policyMoveDown', editor.node.querySelector('.policy-rule-heading')).click();
|
|
||||||
assert.deepEqual(plain(editor.read()), { ...original, rules: [original.rules[1], original.rules[0]] });
|
|
||||||
});
|
|
||||||
await check('raw JSON round trip is lossless and malformed JSON prevents switching/save', () => {
|
|
||||||
mount(original); button('policyJson').click(); const raw = editor.node.querySelector('.policy-raw textarea');
|
|
||||||
assert.deepEqual(plain(editor.read()), original); fill(raw, '{broken'); assert.throws(() => editor.read());
|
|
||||||
button('policyVisual').click(); assert.equal(editor.node.querySelector('.policy-raw').hidden, false);
|
|
||||||
fill(raw, JSON.stringify(original)); button('policyVisual').click(); assert.deepEqual(plain(editor.read()), original);
|
|
||||||
});
|
|
||||||
await check('editing nested condition JSON is never discarded by reorder', () => {
|
|
||||||
mount(original); const condition = editor.node.querySelector('.policy-conditions textarea'); fill(condition, '{broken');
|
|
||||||
button('policyMoveDown', editor.node.querySelector('.policy-rule-heading')).click(); assert.throws(() => editor.read());
|
|
||||||
assert.equal(editor.node.querySelector('.policy-rule').dataset.ruleId, 'one');
|
|
||||||
fill(condition, JSON.stringify({ acl: 'mobile' })); button('policyMoveDown', editor.node.querySelector('.policy-rule-heading')).click();
|
|
||||||
assert.deepEqual(plain(editor.read().rules[1].when), { acl: 'mobile' });
|
|
||||||
});
|
|
||||||
await check('first OR condition replaces the empty default group', () => {
|
|
||||||
mount(); button('policyAddRule').click(); const conditions = editor.node.querySelector('.policy-conditions');
|
|
||||||
fill(control('policyCombine', conditions), 'any', 'change'); button('policyAddCondition', conditions).click();
|
|
||||||
const expression = plain(editor.read().rules[0].when); assert.equal(expression.any.length, 1); assert.equal(expression.any[0].fetch, 'res.fhdr(Vary)');
|
|
||||||
});
|
|
||||||
await check('presets encode full-field count and final Vary normalization', () => {
|
|
||||||
mount(); button('policyPresetVary').click(); button('policyPresetNormalize').click();
|
|
||||||
const rules = editor.read().rules; assert.equal(rules[0].stage, 'backend_response'); assert.equal(rules[0].when.all.length, 3);
|
|
||||||
assert.deepEqual(plain(rules[0].when.all[0]), { fetch: 'res.fhdr_cnt(Vary)', operator: 'eq', values: ['2'] });
|
|
||||||
assert.deepEqual(plain(rules[1].actions), [{ type: 'normalize_header', name: 'Vary' }]); assert.equal(rules[1].stage, 'after_response');
|
|
||||||
});
|
|
||||||
await check('import requires review and explicit add; existing rules are retained', async () => {
|
|
||||||
mount(original); response = { policy: { rules: [{ ...original.rules[1], id: 'one' }] }, warnings: [] };
|
|
||||||
fill(control('policyHaproxySource'), 'http-after-response normalize-header Vary'); button('policyImportPreview').click(); await flush();
|
|
||||||
assert.deepEqual(plain(editor.read()), original); assert.equal(dirty, 0);
|
|
||||||
button('policyImportAdd').click(); const result = editor.read(); assert.equal(result.rules.length, 3); assert.equal(result.rules[2].id, 'imported-1');
|
|
||||||
assert.deepEqual(plain(result.acls), original.acls); assert.deepEqual(calls.map(c => c.url), ['/api/policy/import-haproxy']);
|
|
||||||
});
|
|
||||||
await check('name collisions reject imports atomically and special keys remain data', () => {
|
|
||||||
assert.throws(() => api.mergeImports(original, { acls: { mobile: { all: [] } }, rules: [{ id: 'bad', actions: [] }] }), /mobile/);
|
|
||||||
const special = api.mergeImports({}, JSON.parse('{"acls":{"__proto__":{"all":[]}},"rules":[]}'));
|
|
||||||
assert.equal(Object.hasOwn(special.acls, '__proto__'), true); assert.equal(Object.getPrototypeOf(special.acls), Object.prototype);
|
|
||||||
assert.equal(editor.read().rules.length, 3);
|
|
||||||
});
|
|
||||||
await check('source edits invalidate a pending import preview', async () => {
|
|
||||||
mount(); response = { policy: { rules: [original.rules[1]] }, warnings: [] };
|
|
||||||
fill(control('policyHaproxySource'), 'source'); button('policyImportPreview').click(); await flush();
|
|
||||||
assert.equal(button('policyImportAdd').disabled, false); fill(control('policyHaproxySource'), 'modified'); assert.equal(button('policyImportAdd').disabled, true);
|
|
||||||
assert.equal(editor.read().rules.length, 0);
|
|
||||||
});
|
|
||||||
await check('server tester receives duplicate headers and renders trace as text', async () => {
|
|
||||||
mount({ rules: [original.rules[1]] });
|
|
||||||
response = { request: { headers: [{ name: 'X-Unsafe', value: '<script>throw Error(1)</script>' }] }, response: { status: 200, headers: [{ name: 'Vary', value: 'Accept-Encoding, Accept' }] }, trace: [{ rule: 'two', stage: 'after_response', matched: true, actions: ['normalize_header'], warnings: [] }], variables: {} };
|
|
||||||
button('policyRunTest').click(); await flush();
|
|
||||||
assert.equal(calls[0].url, '/api/policy/test'); assert.equal(calls[0].body.stage, 'after_response');
|
|
||||||
assert.deepEqual(calls[0].body.response.headers, [{ name: 'Vary', value: 'Accept-Encoding' }, { name: 'Vary', value: 'Accept,Accept-Encoding' }]);
|
|
||||||
assert.equal(editor.node.querySelectorAll('.policy-trace tbody tr').length, 1); assert.equal(editor.node.querySelector('.policy-test-output script'), null);
|
|
||||||
assert.match(editor.node.querySelector('.policy-test-output').textContent, /<script>/);
|
|
||||||
});
|
|
||||||
await check('tester inputs neither dirty nor invalidate the enclosing config form', async () => {
|
|
||||||
mount(); fill(control('policyVariables'), 'malformed'); button('policyRunTest').click(); await flush();
|
|
||||||
assert.equal(dirty, 0); assert.equal(bubbled, 0); assert.equal(control('policyVariables').form, null); assert.equal(d.getElementById('fixture').checkValidity(), true);
|
|
||||||
});
|
|
||||||
await check('pre_route is unavailable and rejected in a location draft', () => {
|
|
||||||
mount({}, 'location'); assert.equal(editor.node.querySelector('.policy-tester option[value="pre_route"]'), null);
|
|
||||||
button('policyJson').click(); fill(editor.node.querySelector('.policy-raw textarea'), JSON.stringify({ rules: [{ id: 'bad', stage: 'pre_route', actions: [] }] }));
|
|
||||||
assert.throws(() => editor.read(), /pre_route/);
|
|
||||||
});
|
|
||||||
await check('return and redirect are selectable only after request access checks', () => {
|
|
||||||
mount({ rules: [{ id: 'terminal', stage: 'pre_route', actions: [{ type: 'return', status: 200, body: 'existing draft' }] }] });
|
|
||||||
const action = control('policyAction', editor.node.querySelector('.policy-action'));
|
|
||||||
for (const type of ['return', 'redirect']) assert.equal(action.querySelector(`option[value="${type}"]`).disabled, true);
|
|
||||||
assert.equal(action.querySelector('option[value="deny"]').disabled, false);
|
|
||||||
assert.equal(editor.read().rules[0].actions[0].body, 'existing draft');
|
|
||||||
fill(control('policyStage', editor.node.querySelector('.policy-rule')), 'request', 'change');
|
|
||||||
for (const type of ['return', 'redirect']) assert.equal(action.querySelector(`option[value="${type}"]`).disabled, false);
|
|
||||||
assert.equal(editor.read().rules[0].actions[0].body, 'existing draft');
|
|
||||||
});
|
|
||||||
await check('in-flight test result is discarded when inputs change', async () => {
|
|
||||||
mount({ rules: [original.rules[1]] }); pending = true; button('policyRunTest').click(); await flush();
|
|
||||||
fill(control('policyHost'), 'changed.example'); resolver({ trace: [] }); await flush();
|
|
||||||
assert.match(editor.node.querySelector('.policy-test-output').textContent, /changed during evaluation/); pending = false;
|
|
||||||
});
|
|
||||||
await check('live counters use a read-only saved-config request and do not dirty drafts', async () => {
|
|
||||||
mount(); response = { revision: 7, scopes: [{ scope: 'vhost', vhost: 'site-a', rules: [{ id: 'vary', stage: 'after_response', matches: 32, errors: 1 }] }] };
|
|
||||||
button('policyRefreshCounters').click(); await flush();
|
|
||||||
assert.deepEqual(calls, [{ url: '/api/policy/stats', body: null }]); assert.equal(dirty, 0);
|
|
||||||
const output = editor.node.querySelector('.policy-counter-scroll').textContent; assert.match(output, /7/); assert.match(output, /site-a/); assert.match(output, /32/);
|
|
||||||
assert.equal(editor.read().rules.length, 0);
|
|
||||||
});
|
|
||||||
await check('separate editor instances keep separate drafts', () => {
|
|
||||||
const first = api.create({ value: original }), second = api.create({ value: { rules: [original.rules[1]] } });
|
|
||||||
button('policyAddRule', first.node).click(); assert.equal(first.read().rules.length, 3); assert.equal(second.read().rules.length, 1); assert.equal(original.rules.length, 2);
|
|
||||||
});
|
|
||||||
console.log(`PASS: ${checks} DOM policy editor regression checks`); dom.window.close();
|
|
||||||
})().catch(error => { console.error(error); dom.window.close(); process.exitCode = 1; });
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
// Component regression tests. Requires Node.js and Playwright Chromium.
|
|
||||||
// Run: node src/admin/web/tests/policy.test.cjs
|
|
||||||
const assert = require('node:assert/strict');
|
|
||||||
const fs = require('node:fs');
|
|
||||||
const path = require('node:path');
|
|
||||||
const { chromium } = require('playwright');
|
|
||||||
const root = path.resolve(__dirname, '../../../..');
|
|
||||||
const policyFile = path.join(root, 'src/admin/web/policy.js');
|
|
||||||
const translations = JSON.parse(fs.readFileSync(path.join(root, 'langs/en_US.json'), 'utf8')).translations;
|
|
||||||
let checks = 0;
|
|
||||||
async function check(name, fn) { await fn(); checks++; console.log(`ok ${checks} - ${name}`); }
|
|
||||||
(async () => {
|
|
||||||
const browser = await chromium.launch({ headless: true, ...(process.env.POLICY_TEST_CHROMIUM ? { executablePath: process.env.POLICY_TEST_CHROMIUM } : {}) });
|
|
||||||
try {
|
|
||||||
const page = await browser.newPage({ viewport: { width: 1180, height: 900 } });
|
|
||||||
const errors = [];
|
|
||||||
page.on('pageerror', error => errors.push(error.message));
|
|
||||||
await page.setContent('<html><body style="margin:20px"><form id="fixture"><div id="root"></div><button type="submit">Save</button></form></body></html>');
|
|
||||||
await page.evaluate(translations => {
|
|
||||||
window.translations = translations;
|
|
||||||
window.t = key => translations[key] || key;
|
|
||||||
window.el = (tag, text, cls) => { const node = document.createElement(tag); if (text !== undefined) node.textContent = text; if (cls) node.className = cls; return node; };
|
|
||||||
window.changed = 0; window.parentChanged = 0; window.calls = [];
|
|
||||||
document.getElementById('fixture').addEventListener('input', () => window.parentChanged++);
|
|
||||||
window.api = async (url, options) => { const body = options?.body ? JSON.parse(options.body) : null; window.calls.push({ url, body }); if (window.pendingApi) return new Promise(resolve => { window.resolveApi = resolve; }); return structuredClone(window.apiResult || {}); };
|
|
||||||
}, translations);
|
|
||||||
for (const file of ['00-tokens.css', '10-base.css', '55-policy.css']) await page.addStyleTag({ path: path.join(root, 'src/admin/web/css', file) });
|
|
||||||
await page.addScriptTag({ path: policyFile });
|
|
||||||
const mount = async (value = {}, scope = 'vhost') => page.evaluate(({ value, scope }) => {
|
|
||||||
window.changed = 0; window.parentChanged = 0; window.calls = [];
|
|
||||||
window.editor = window.rustProxyPolicy.create({ value, scope, onChange: () => window.changed++ });
|
|
||||||
document.getElementById('root').replaceChildren(window.editor.node);
|
|
||||||
}, { value, scope });
|
|
||||||
await check('header parser preserves repeated fields and empty values', async () => {
|
|
||||||
const values = await page.evaluate(() => window.rustProxyPolicy.headers('Vary: Accept-Encoding\nVary: Accept,Accept-Encoding\nX-Empty:\nX-URL: https://example.test:8443/'));
|
|
||||||
assert.deepEqual(values, [{ name: 'Vary', value: 'Accept-Encoding' }, { name: 'Vary', value: 'Accept,Accept-Encoding' }, { name: 'X-Empty', value: '' }, { name: 'X-URL', value: 'https://example.test:8443/' }]);
|
|
||||||
assert.equal(await page.evaluate(() => { try { window.rustProxyPolicy.headers('not a header'); return false; } catch { return true; } }), true);
|
|
||||||
});
|
|
||||||
const original = { acls: { mobile: { fetch: 'req.fhdr(User-Agent)', operator: 'contains', values: ['mobile'], ignore_case: true } }, maps: { devices: { kind: 'exact', entries: [{ key: 'a', value: 'b' }], default: 'fallback', ignore_case: false } }, rules: [
|
|
||||||
{ id: 'one', name: '<img src=x onerror=alert(1)>', enabled: false, stage: 'request', when: { any: [{ acl: 'mobile' }, { not: { fetch: 'req.fhdr(X-Test)', operator: 'exists', values: [] } }] }, actions: [{ type: 'set_var', name: 'txn.device', value: '%[req.fhdr(User-Agent),lower,map(devices)]' }], stop: true },
|
|
||||||
{ id: 'two', name: 'Response', enabled: true, stage: 'after_response', when: { all: [] }, actions: [{ type: 'normalize_header', name: 'Vary' }], stop: false }
|
|
||||||
] };
|
|
||||||
await check('complex rules, ACLs and maps survive opening and reading', async () => {
|
|
||||||
await mount(original); assert.deepEqual(await page.evaluate(() => window.editor.read()), original);
|
|
||||||
assert.equal(await page.locator('img').count(), 0);
|
|
||||||
});
|
|
||||||
await check('rule reorder preserves every condition, action and definition', async () => {
|
|
||||||
await page.locator('.policy-rule').first().locator('.policy-rule-heading').getByRole('button', { name: 'Move down', exact: true }).click();
|
|
||||||
const value = await page.evaluate(() => window.editor.read());
|
|
||||||
assert.deepEqual(value, { ...original, rules: [original.rules[1], original.rules[0]] });
|
|
||||||
});
|
|
||||||
await check('raw/visual round trip is lossless and invalid raw JSON blocks reading', async () => {
|
|
||||||
await mount(original); await page.getByRole('button', { name: 'Policy JSON', exact: true }).click();
|
|
||||||
assert.deepEqual(await page.evaluate(() => window.editor.read()), original);
|
|
||||||
await page.locator('.policy-raw textarea').fill('{broken');
|
|
||||||
assert.equal(await page.evaluate(() => { try { window.editor.read(); return false; } catch { return true; } }), true);
|
|
||||||
await page.getByRole('button', { name: 'Rule builder', exact: true }).click();
|
|
||||||
assert.equal(await page.locator('.policy-raw').isVisible(), true);
|
|
||||||
await page.locator('.policy-raw textarea').fill(JSON.stringify(original));
|
|
||||||
await page.getByRole('button', { name: 'Rule builder', exact: true }).click();
|
|
||||||
assert.deepEqual(await page.evaluate(() => window.editor.read()), original);
|
|
||||||
});
|
|
||||||
await check('Vary preset keeps field-count and separate full-field conditions', async () => {
|
|
||||||
await mount(); await page.getByRole('button', { name: 'Fix duplicate Vary (exact match)', exact: true }).click();
|
|
||||||
const rule = await page.evaluate(() => window.editor.read().rules[0]);
|
|
||||||
assert.equal(rule.stage, 'backend_response'); assert.equal(rule.when.all.length, 3);
|
|
||||||
assert.deepEqual(rule.when.all[0], { fetch: 'res.fhdr_cnt(Vary)', operator: 'eq', values: ['2'] });
|
|
||||||
assert.deepEqual(rule.actions, [{ type: 'set_header', name: 'Vary', value: 'Accept, Accept-Encoding' }]);
|
|
||||||
await page.getByRole('button', { name: 'Normalize Vary (preserve dimensions)', exact: true }).click();
|
|
||||||
assert.deepEqual(await page.evaluate(() => window.editor.read().rules[1].actions), [{ type: 'normalize_header', name: 'Vary' }]);
|
|
||||||
});
|
|
||||||
await check('import preview never silently activates or replaces existing rules', async () => {
|
|
||||||
await mount(original); await page.locator('.policy-import > summary').click();
|
|
||||||
const incoming = { acls: {}, maps: {}, rules: [{ ...original.rules[1], id: 'one' }] };
|
|
||||||
await page.evaluate(policy => { window.apiResult = { policy, warnings: [] }; }, incoming);
|
|
||||||
await page.getByLabel('HAProxy source', { exact: true }).fill('http-after-response normalize-header Vary');
|
|
||||||
await page.getByRole('button', { name: 'Validate and preview import', exact: true }).click();
|
|
||||||
assert.deepEqual(await page.evaluate(() => window.editor.read()), original);
|
|
||||||
await page.getByRole('button', { name: 'Add imported rules to draft', exact: true }).click();
|
|
||||||
const value = await page.evaluate(() => window.editor.read());
|
|
||||||
assert.equal(value.rules.length, 3); assert.equal(value.rules[2].id, 'imported-1'); assert.deepEqual(value.acls, original.acls);
|
|
||||||
assert.deepEqual(await page.evaluate(() => window.calls.map(call => call.url)), ['/api/policy/import-haproxy']);
|
|
||||||
});
|
|
||||||
await check('conflicting ACL imports are rejected atomically', async () => {
|
|
||||||
const value = await page.evaluate(original => {
|
|
||||||
try { window.rustProxyPolicy.mergeImports(original, { acls: { mobile: { all: [] } }, rules: [{ id: 'unsafe', actions: [] }] }); return null; }
|
|
||||||
catch (error) { return error.message; }
|
|
||||||
}, original);
|
|
||||||
assert.match(value, /mobile/);
|
|
||||||
assert.equal(await page.evaluate(() => window.editor.read().rules.length), 3);
|
|
||||||
});
|
|
||||||
await check('tester uses server API and preserves duplicate request/response fields', async () => {
|
|
||||||
await mount({ rules: [original.rules[1]] }); await page.locator('.policy-tester > summary').click();
|
|
||||||
const response = { request: { headers: [{ name: 'X-Unsafe', value: '<script>throw Error(1)</script>' }] }, response: { status: 200, headers: [{ name: 'Vary', value: 'Accept-Encoding, Accept' }] }, trace: [{ rule: 'two', stage: 'after_response', matched: true, actions: ['normalize_header'], warnings: [] }], variables: {}, cache: {} };
|
|
||||||
await page.evaluate(response => { window.apiResult = response; }, response);
|
|
||||||
await page.getByRole('button', { name: 'Run test', exact: true }).click();
|
|
||||||
const calls = await page.evaluate(() => window.calls); assert.equal(calls[0].url, '/api/policy/test');
|
|
||||||
assert.deepEqual(calls[0].body.response.headers, [{ name: 'Vary', value: 'Accept-Encoding' }, { name: 'Vary', value: 'Accept,Accept-Encoding' }]);
|
|
||||||
assert.equal(calls[0].body.stage, 'after_response'); assert.equal(await page.locator('.policy-trace tbody tr').count(), 1);
|
|
||||||
assert.match(await page.locator('.policy-test-output').innerText(), /<script>/); assert.equal(await page.locator('.policy-test-output script').count(), 0);
|
|
||||||
});
|
|
||||||
await check('tester inputs do not dirty or invalidate the configuration form', async () => {
|
|
||||||
await mount(); await page.locator('.policy-tester > summary').click();
|
|
||||||
await page.getByLabel('Transaction variables (JSON string values)', { exact: true }).fill('malformed');
|
|
||||||
await page.getByRole('button', { name: 'Run test', exact: true }).click();
|
|
||||||
assert.equal(await page.evaluate(() => window.changed), 0); assert.equal(await page.evaluate(() => window.parentChanged), 0);
|
|
||||||
assert.equal(await page.evaluate(() => document.getElementById('fixture').checkValidity()), true);
|
|
||||||
});
|
|
||||||
await check('location editor excludes pre_route and refuses raw configuration using it', async () => {
|
|
||||||
await mount({}, 'location');
|
|
||||||
assert.equal(await page.locator('.policy-tester option[value="pre_route"]').count(), 0);
|
|
||||||
await page.getByRole('button', { name: 'Policy JSON', exact: true }).click();
|
|
||||||
await page.locator('.policy-raw textarea').fill(JSON.stringify({ rules: [{ id: 'bad', stage: 'pre_route', actions: [] }] }));
|
|
||||||
assert.match(await page.evaluate(() => { try { window.editor.read(); return ''; } catch (error) { return error.message; } }), /pre_route/);
|
|
||||||
});
|
|
||||||
await check('asynchronous tester rejects stale results after input changes', async () => {
|
|
||||||
await mount({ rules: [original.rules[1]] }); await page.locator('.policy-tester > summary').click();
|
|
||||||
await page.evaluate(() => { window.pendingApi = true; });
|
|
||||||
await page.getByRole('button', { name: 'Run test', exact: true }).click();
|
|
||||||
await page.getByLabel('Host', { exact: true }).fill('different.example');
|
|
||||||
await page.evaluate(() => { window.pendingApi = false; window.resolveApi({ trace: [] }); });
|
|
||||||
await page.getByText('The draft or test input changed during evaluation. Run the test again.', { exact: true }).waitFor();
|
|
||||||
});
|
|
||||||
await check('responsive policy editor remains within the viewport', async () => {
|
|
||||||
await mount({ rules: [original.rules[1]] });
|
|
||||||
await page.setViewportSize({ width: 390, height: 850 });
|
|
||||||
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= 390), true);
|
|
||||||
if (process.env.POLICY_TEST_SCREENSHOT) await page.screenshot({ path: process.env.POLICY_TEST_SCREENSHOT, fullPage: true });
|
|
||||||
});
|
|
||||||
assert.deepEqual(errors, []); console.log(`PASS: ${checks} policy editor regression checks`);
|
|
||||||
} finally { await browser.close(); }
|
|
||||||
})().catch(error => { console.error(error); process.exitCode = 1; });
|
|
||||||
@@ -23,7 +23,7 @@ const field = (parent, name, key, value, type = "text", options = {}) => {
|
|||||||
};
|
};
|
||||||
const group = (key, advanced = false) => {
|
const group = (key, advanced = false) => {
|
||||||
const box = el(advanced ? "details" : "fieldset", undefined, "vh-group");
|
const box = el(advanced ? "details" : "fieldset", undefined, "vh-group");
|
||||||
box.dataset.tab = ({ vhEditor: "details", vhFrontends: "details", vhBackendPool: "backends", vhBackendDiagnostics: "headers", vhProxyTimeouts: "backends", vhBalancing: "backends", vhSticky: "backends", vhHealth: "health", vhPassiveHealth: "health", vhSecurity: "security", vhTrafficPolicy: "security", vhTinyauth: "auth", vhResponsePolicy: "headers", vhHeaders: "headers", policyTitle: "headers", vhHeadersPreview: "headers", vhAdvanced: "advanced", vhLocations: "locations", vhSsl: "ssl", vhSslSettings: "ssl", vhCache: "cache", vhCompression: "compression", vhTransform: "transform", vhPages: "pages" })[key] || "advanced"; box.append(text(advanced ? "summary" : "legend", key));
|
box.dataset.tab = ({ vhEditor: "details", vhFrontends: "details", vhBackendPool: "backends", vhBackendDiagnostics: "headers", vhProxyTimeouts: "backends", vhBalancing: "backends", vhSticky: "backends", vhHealth: "health", vhPassiveHealth: "health", vhSecurity: "security", vhTrafficPolicy: "security", vhTinyauth: "auth", vhResponsePolicy: "headers", vhHeaders: "headers", policyTitle: "headers", vhHeadersPreview: "headers", vhLocations: "locations", vhSsl: "ssl", vhSslSettings: "ssl", vhCache: "cache", vhCompression: "compression", vhTransform: "transform", vhPages: "pages" })[key] || "details"; box.append(text(advanced ? "summary" : "legend", key));
|
||||||
const body = el("div", undefined, "vh-grid"); box.append(body); container.append(box); return body;
|
const body = el("div", undefined, "vh-grid"); box.append(body); container.append(box); return body;
|
||||||
};
|
};
|
||||||
const note = (parent, key) => { const node = text("p", key, "fine vh-wide"); parent.append(node); return node; };
|
const note = (parent, key) => { const node = text("p", key, "fine vh-wide"); parent.append(node); return node; };
|
||||||
@@ -60,7 +60,53 @@ const defaults = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function activateTab(name) { document.querySelectorAll("#vhost-tabs button").forEach(b => { const active = b.dataset.tab === name; b.classList.toggle("active", active); b.setAttribute("aria-pressed", String(active)); b.setAttribute("aria-selected", String(active)); b.tabIndex = active ? 0 : -1; }); container.querySelectorAll(".vh-group").forEach(g => g.hidden = g.dataset.tab !== name); }
|
function activateTab(name) { document.querySelectorAll("#vhost-tabs button").forEach(b => { const active = b.dataset.tab === name; b.classList.toggle("active", active); b.setAttribute("aria-pressed", String(active)); b.setAttribute("aria-selected", String(active)); b.tabIndex = active ? 0 : -1; }); container.querySelectorAll(".vh-group").forEach(g => g.hidden = g.dataset.tab !== name); }
|
||||||
function initTabs() { const tabs = $("vhost-tabs"); tabs.replaceChildren(); tabs.setAttribute("role", "tablist"); for (const [name, key] of [["details", "vhDetailsTab"], ["backends", "vhBackendPool"], ["health", "vhHealth"], ["locations", "vhLocations"], ["auth", "vhTabAuth"], ["ssl", "vhSsl"], ["cache", "vhCache"], ["compression", "vhCompression"], ["transform", "vhTransform"], ["security", "vhSecurity"], ["headers", "vhTabHeaders"], ["pages", "vhPages"], ["advanced", "advanced"]]) { const b = button(key, () => activateTab(name)); b.dataset.tab = name; b.setAttribute("role", "tab"); b.addEventListener("keydown", event => { const buttons = [...tabs.querySelectorAll("button")], index = buttons.indexOf(b); let next; if (event.key === "ArrowRight" || event.key === "ArrowDown") next = (index + 1) % buttons.length; else if (event.key === "ArrowLeft" || event.key === "ArrowUp") next = (index + buttons.length - 1) % buttons.length; else if (event.key === "Home") next = 0; else if (event.key === "End") next = buttons.length - 1; else return; event.preventDefault(); activateTab(buttons[next].dataset.tab); buttons[next].focus(); }); tabs.append(b); } activateTab("details"); }
|
function initTabs() { const tabs = $("vhost-tabs"); tabs.replaceChildren(); tabs.setAttribute("role", "tablist"); for (const [name, key] of [["details", "vhDetailsTab"], ["backends", "vhBackendPool"], ["health", "vhHealth"], ["locations", "vhLocations"], ["auth", "vhTabAuth"], ["ssl", "vhSsl"], ["cache", "vhCache"], ["compression", "vhCompression"], ["transform", "vhTransform"], ["security", "vhSecurity"], ["headers", "vhTabHeaders"], ["pages", "vhPages"]]) { const b = button(key, () => activateTab(name)); b.dataset.tab = name; b.setAttribute("role", "tab"); b.addEventListener("keydown", event => { const buttons = [...tabs.querySelectorAll("button")], index = buttons.indexOf(b); let next; if (event.key === "ArrowRight" || event.key === "ArrowDown") next = (index + 1) % buttons.length; else if (event.key === "ArrowLeft" || event.key === "ArrowUp") next = (index + buttons.length - 1) % buttons.length; else if (event.key === "Home") next = 0; else if (event.key === "End") next = buttons.length - 1; else return; event.preventDefault(); activateTab(buttons[next].dataset.tab); buttons[next].focus(); }); tabs.append(b); } activateTab("details"); }
|
||||||
|
function jsonDrawer(parent, { name, titleKey, helpKey, value, maxLength, validate = value => value, apply }) {
|
||||||
|
const node = el("details", undefined, "vh-wide vh-json-editor"), summary = el("summary"), status = el("span", undefined, "vh-json-status");
|
||||||
|
node.dataset.jsonSection = name; summary.append(text("span", titleKey), status); node.append(summary);
|
||||||
|
const body = el("div", undefined, "vh-grid vh-json-body"); node.append(body); parent.append(node); note(body, helpKey);
|
||||||
|
const target = document.createElement("textarea"); target.name = name; target.hidden = true; target.value = JSON.stringify(value, null, 2); body.append(target);
|
||||||
|
const source = field(body, `${name}-json-draft`, titleKey, target.value, "textarea", { rows: 10, maxLength }); source.classList.add("vh-json-source"); source.setAttribute("aria-label", t(titleKey));
|
||||||
|
const toolbar = el("div", undefined, "vh-wide vh-json-toolbar"), message = el("p", undefined, "fine vh-wide vh-json-message"); message.hidden = true; message.setAttribute("role", "status");
|
||||||
|
let baseline = target.value, pending = false;
|
||||||
|
const parse = () => validate(JSON.parse(source.value));
|
||||||
|
const fail = error => { message.textContent = error.message || t("vhJsonInvalid"); message.hidden = false; message.classList.add("is-error"); source.setCustomValidity(message.textContent); };
|
||||||
|
const update = () => {
|
||||||
|
pending = source.value !== baseline; status.textContent = t(pending ? "vhJsonDraft" : "vhJsonSynced"); node.classList.toggle("has-json-draft", pending);
|
||||||
|
applyButton.disabled = !pending; source.setCustomValidity(pending ? t("vhJsonPending") : "");
|
||||||
|
};
|
||||||
|
const refresh = () => { if (pending) return; baseline = target.value; source.value = baseline; update(); };
|
||||||
|
const applyButton = button("vhJsonApply", () => {
|
||||||
|
try {
|
||||||
|
if (target.value !== baseline) throw Error(t("vhJsonConflict"));
|
||||||
|
const next = parse(); apply(next); target.value = JSON.stringify(next, null, 2);
|
||||||
|
pending = false; refresh(); message.classList.remove("is-error"); message.textContent = t("vhJsonApplied"); message.hidden = false;
|
||||||
|
target.dispatchEvent(new Event("change", { bubbles: true })); changed();
|
||||||
|
} catch (error) { fail(error); }
|
||||||
|
}, "primary");
|
||||||
|
const formatButton = button("vhJsonFormat", () => { try { const next = parse(); source.value = JSON.stringify(next, null, 2); message.hidden = true; update(); if (pending) changed(); } catch (error) { fail(error); } });
|
||||||
|
const reloadButton = button("vhJsonReload", async () => {
|
||||||
|
if (pending && !(await appConfirm(t("vhJsonReloadConfirm"), { danger: true, confirmLabel: t("discardAction") }))) return;
|
||||||
|
pending = false; refresh(); message.hidden = true;
|
||||||
|
});
|
||||||
|
toolbar.append(applyButton, formatButton, reloadButton); body.append(toolbar, message);
|
||||||
|
source.addEventListener("input", () => { message.hidden = true; update(); if (pending) { try { parse(); } catch (error) { fail(error); } } });
|
||||||
|
source.addEventListener("invalid", () => { node.open = true; activateTab(node.closest(".vh-group")?.dataset.tab || "details"); });
|
||||||
|
node.addEventListener("toggle", () => { if (node.open) refresh(); }); update();
|
||||||
|
return { node, target, refresh };
|
||||||
|
}
|
||||||
|
function validateInlineAcl(value) {
|
||||||
|
if (value === null) return value;
|
||||||
|
if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some(key => !["default", "rules"].includes(key))
|
||||||
|
|| (value.default !== undefined && !["allow", "deny"].includes(value.default))
|
||||||
|
|| (value.rules !== undefined && (!Array.isArray(value.rules) || value.rules.length > 128 || value.rules.some(rule => !rule || typeof rule !== "object" || Array.isArray(rule)
|
||||||
|
|| Object.keys(rule).some(key => !["network", "action"].includes(key)) || typeof rule.network !== "string" || !rule.network.trim() || rule.network.length > 254 || !["allow", "deny"].includes(rule.action))))) throw Error(t("vhJsonInvalidAcl"));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
function validateLocations(value) {
|
||||||
|
if (!Array.isArray(value) || value.length > 64 || value.some(route => !route || typeof route !== "object" || Array.isArray(route))) throw Error(t("vhJsonInvalidPaths"));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
function collectCache() { const tri = name => str(name) === "" ? null : str(name) === "on", number = (name, mul = 1) => { if (str(name) === "") return null; const value = Number(str(name)) * mul; if (!Number.isSafeInteger(value)) throw new Error(t("vhJsonInvalid")); return value; }; return { enabled: tri("vh-cache-enabled"), max_ttl_seconds: number("vh-cache-ttl"), default_ttl_seconds: number("vh-cache-default"), max_object_bytes: number("vh-cache-object", 1024), bypass_query: tri("vh-cache-query"), static_ignore_cookies: tri("vh-cache-static-cookie"), static_ignore_vary_cookie: tri("vh-cache-static-vary-cookie"), static_extensions: yes("vh-cache-static-custom") ? lines(str("vh-cache-static-extensions")).map(v => v.replace(/^\./, "").toLowerCase()) : null, expose_status: tri("vh-cache-status"), expose_hits: tri("vh-cache-hits"), expose_cache_status: tri("vh-cache-rfc"), expose_resident_age: tri("vh-cache-resident-age"), expose_only_hits: tri("vh-cache-only-hits"), expose_detailed_status: tri("vh-cache-detailed-status"), bypass_prefixes: yes("vh-cache-prefix-custom") ? lines(str("vh-cache-prefixes")) : null, unsafe_force: { enabled: yes("vh-cache-force-enabled"), targets: lines(str("vh-cache-force-targets")) }, rules: vhostCacheRulesEditor ? vhostCacheRulesEditor.read() : [], ignore_global_rules: vhostCacheRulesEditor ? vhostCacheRulesEditor.ignoreGlobal() : false }; }
|
function collectCache() { const tri = name => str(name) === "" ? null : str(name) === "on", number = (name, mul = 1) => { if (str(name) === "") return null; const value = Number(str(name)) * mul; if (!Number.isSafeInteger(value)) throw new Error(t("vhJsonInvalid")); return value; }; return { enabled: tri("vh-cache-enabled"), max_ttl_seconds: number("vh-cache-ttl"), default_ttl_seconds: number("vh-cache-default"), max_object_bytes: number("vh-cache-object", 1024), bypass_query: tri("vh-cache-query"), static_ignore_cookies: tri("vh-cache-static-cookie"), static_ignore_vary_cookie: tri("vh-cache-static-vary-cookie"), static_extensions: yes("vh-cache-static-custom") ? lines(str("vh-cache-static-extensions")).map(v => v.replace(/^\./, "").toLowerCase()) : null, expose_status: tri("vh-cache-status"), expose_hits: tri("vh-cache-hits"), expose_cache_status: tri("vh-cache-rfc"), expose_resident_age: tri("vh-cache-resident-age"), expose_only_hits: tri("vh-cache-only-hits"), expose_detailed_status: tri("vh-cache-detailed-status"), bypass_prefixes: yes("vh-cache-prefix-custom") ? lines(str("vh-cache-prefixes")) : null, unsafe_force: { enabled: yes("vh-cache-force-enabled"), targets: lines(str("vh-cache-force-targets")) }, rules: vhostCacheRulesEditor ? vhostCacheRulesEditor.read() : [], ignore_global_rules: vhostCacheRulesEditor ? vhostCacheRulesEditor.ignoreGlobal() : false }; }
|
||||||
function collectCompression() { const tri = name => str(name) === "" ? null : str(name) === "on"; return { enabled: tri("vh-compression-enabled"), zstd: tri("vh-compression-zstd"), br: tri("vh-compression-br"), gzip: tri("vh-compression-gzip"), deflate: tri("vh-compression-deflate") }; }
|
function collectCompression() { const tri = name => str(name) === "" ? null : str(name) === "on"; return { enabled: tri("vh-compression-enabled"), zstd: tri("vh-compression-zstd"), br: tri("vh-compression-br"), gzip: tri("vh-compression-gzip"), deflate: tri("vh-compression-deflate") }; }
|
||||||
function collectTransform() {
|
function collectTransform() {
|
||||||
@@ -80,14 +126,14 @@ function validateHeaders(value) {
|
|||||||
const fail = () => { throw new Error(t("headersInvalid")); };
|
const fail = () => { throw new Error(t("headersInvalid")); };
|
||||||
if (!value || Array.isArray(value) || typeof value !== "object" || Object.keys(value).some(k => !["request", "response"].includes(k))) fail();
|
if (!value || Array.isArray(value) || typeof value !== "object" || Object.keys(value).some(k => !["request", "response"].includes(k))) fail();
|
||||||
for (const direction of ["request", "response"]) {
|
for (const direction of ["request", "response"]) {
|
||||||
const rules = value[direction] || []; if (!Array.isArray(rules) || rules.length > 32) fail(); for (const rule of rules) {
|
const rules = Object.hasOwn(value, direction) ? value[direction] : []; if (!Array.isArray(rules) || rules.length > 32) fail(); for (const rule of rules) {
|
||||||
if (!rule || typeof rule !== "object" || Object.keys(rule).some(k => !["op", "name", "value"].includes(k)) || !["set", "append", "remove"].includes(rule.op) || typeof rule.name !== "string" || rule.name.length > 128 || !/^[-!#$%&'*+.^_`|~0-9A-Za-z]+$/.test(rule.name)) fail();
|
if (!rule || typeof rule !== "object" || Object.keys(rule).some(k => !["op", "name", "value"].includes(k)) || !["set", "append", "remove"].includes(rule.op) || typeof rule.name !== "string" || rule.name.length > 128 || !/^[-!#$%&'*+.^_`|~0-9A-Za-z]+$/.test(rule.name)) fail();
|
||||||
const name = rule.name.toLowerCase(); if (["host", "connection", "content-length", "transfer-encoding", "te", "trailer", "content-encoding", "content-range", "upgrade", "keep-alive", "proxy-connection", "proxy-authorization", "proxy-authenticate", "forwarded", "x-real-ip", "x-request-id", "x-rust-proxy-backend", "x-rust-proxy-backend-time", "x-rustproxy-backend-time"].includes(name) || name.startsWith("x-forwarded-") || name.startsWith("sec-websocket-")) throw new Error(t("headersProtected"));
|
const name = rule.name.toLowerCase(); if (["host", "connection", "content-length", "transfer-encoding", "te", "trailer", "content-encoding", "content-range", "upgrade", "keep-alive", "proxy-connection", "proxy-authorization", "proxy-authenticate", "forwarded", "x-real-ip", "x-request-id", "x-rust-proxy-backend", "x-rust-proxy-backend-time", "x-rustproxy-backend-time"].includes(name) || name.startsWith("x-forwarded-") || name.startsWith("sec-websocket-")) throw new Error(t("headersProtected"));
|
||||||
if (rule.op === "remove") { if (Object.hasOwn(rule, "value") && rule.value !== null) fail(); } else if (typeof rule.value !== "string" || rule.value.length > 8192 || /[\r\n\0]/.test(rule.value)) fail();
|
if (rule.op === "remove") { if (Object.hasOwn(rule, "value") && rule.value !== null) fail(); } else if (typeof rule.value !== "string" || rule.value.length > 8192 || /[\r\n\0]/.test(rule.value)) fail();
|
||||||
}
|
}
|
||||||
} return value;
|
} return value;
|
||||||
}
|
}
|
||||||
// Header value variables (src/headers/mod.rs Var::ALL); true = response rules only.
|
|
||||||
const HEADER_VARIABLES = [["srv_id", false], ["srv_url", false], ["location", false], ["vhost", false], ["lb_algorithm", false], ["hash_key", false], ["client_ip", false], ["country", false], ["req_id", false], ["method", false], ["host", false], ["path", false], ["cache_status", true], ["backend_time", true]];
|
const HEADER_VARIABLES = [["srv_id", false], ["srv_url", false], ["location", false], ["vhost", false], ["lb_algorithm", false], ["hash_key", false], ["client_ip", false], ["country", false], ["req_id", false], ["method", false], ["host", false], ["path", false], ["cache_status", true], ["backend_time", true]];
|
||||||
const DIAGNOSTIC_PRESETS = [
|
const DIAGNOSTIC_PRESETS = [
|
||||||
{ key: "hdrPresetServedBy", direction: "response", rule: { op: "set", name: "X-Served-By", value: "%[srv_id]" } },
|
{ key: "hdrPresetServedBy", direction: "response", rule: { op: "set", name: "X-Served-By", value: "%[srv_id]" } },
|
||||||
@@ -119,8 +165,6 @@ function headerEditors(parent, initial, target = read("headers"), onChange = cha
|
|||||||
const rows = el("div", undefined, "vh-header-rows"); holders[direction] = rows; block.append(rows); parent.append(block);
|
const rows = el("div", undefined, "vh-header-rows"); holders[direction] = rows; block.append(rows); parent.append(block);
|
||||||
const add = (value = { op: "set", name: "", value: "" }) => {
|
const add = (value = { op: "set", name: "", value: "" }) => {
|
||||||
if (rows.children.length >= 32) { toast(t("headerLimit"), true); return; }
|
if (rows.children.length >= 32) { toast(t("headerLimit"), true); return; }
|
||||||
// Compact one-line rule: operation · name · value · remove, with a live check of
|
|
||||||
// %[variables] (example value or error) underneath.
|
|
||||||
const row = el("article", undefined, "vh-header-row hdr-row");
|
const row = el("article", undefined, "vh-header-row hdr-row");
|
||||||
const fields = el("div", undefined, "vh-header-rule-fields hdr-row-fields");
|
const fields = el("div", undefined, "vh-header-rule-fields hdr-row-fields");
|
||||||
field(fields, "rule-op", "headerOperation", value.op, "select", { values: [["set", "header_set"], ["append", "header_append"], ["remove", "header_remove"]] });
|
field(fields, "rule-op", "headerOperation", value.op, "select", { values: [["set", "header_set"], ["append", "header_append"], ["remove", "header_remove"]] });
|
||||||
@@ -140,7 +184,6 @@ function headerEditors(parent, initial, target = read("headers"), onChange = cha
|
|||||||
};
|
};
|
||||||
adders[direction] = add; for (const rule of initial[direction] || []) add(rule); renumber(direction);
|
adders[direction] = add; for (const rule of initial[direction] || []) add(rule); renumber(direction);
|
||||||
block.append(button("addHeader", () => { add(); sync(); }, "quiet location-add-header"));
|
block.append(button("addHeader", () => { add(); sync(); }, "quiet location-add-header"));
|
||||||
// %[variable] chips insert into the last focused value field of this direction.
|
|
||||||
const chips = el("div", undefined, "hdr-vars"); chips.append(text("span", "hdrVariables", "hdr-vars-label"));
|
const chips = el("div", undefined, "hdr-vars"); chips.append(text("span", "hdrVariables", "hdr-vars-label"));
|
||||||
let lastValue = null; rows.addEventListener("focusin", event => { if (event.target.name === "rule-value") lastValue = event.target; });
|
let lastValue = null; rows.addEventListener("focusin", event => { if (event.target.name === "rule-value") lastValue = event.target; });
|
||||||
for (const [name, responseOnly] of HEADER_VARIABLES) {
|
for (const [name, responseOnly] of HEADER_VARIABLES) {
|
||||||
@@ -155,19 +198,25 @@ function headerEditors(parent, initial, target = read("headers"), onChange = cha
|
|||||||
}
|
}
|
||||||
block.append(chips);
|
block.append(chips);
|
||||||
}
|
}
|
||||||
|
const set = data => {
|
||||||
|
const value = validateHeaders(data);
|
||||||
|
for (const direction of ["request", "response"]) for (const rule of value[direction] || []) {
|
||||||
|
const result = rule.op === "remove" ? {} : headerValueCheck(rule.value, direction);
|
||||||
|
if (result.error) throw Error(result.error);
|
||||||
|
}
|
||||||
|
for (const direction of ["request", "response"]) {
|
||||||
|
holders[direction].replaceChildren();
|
||||||
|
for (const rule of value[direction] || []) adders[direction](rule);
|
||||||
|
renumber(direction);
|
||||||
|
}
|
||||||
|
target.value = JSON.stringify(value, null, 2); target.setCustomValidity(""); onChange();
|
||||||
|
};
|
||||||
target.addEventListener("input", () => {
|
target.addEventListener("input", () => {
|
||||||
try {
|
try { set(JSON.parse(target.value)); }
|
||||||
const value = validateHeaders(JSON.parse(target.value));
|
catch (error) { target.setCustomValidity(error.message || t("headersInvalid")); }
|
||||||
for (const direction of ["request", "response"]) {
|
|
||||||
holders[direction].replaceChildren();
|
|
||||||
for (const rule of value[direction] || []) adders[direction](rule);
|
|
||||||
renumber(direction);
|
|
||||||
}
|
|
||||||
target.setCustomValidity(""); onChange();
|
|
||||||
} catch (error) { target.setCustomValidity(error.message || t("headersInvalid")); }
|
|
||||||
});
|
});
|
||||||
note(parent, "locationHeadersHelp"); note(parent, "hdrVariablesHelp");
|
note(parent, "locationHeadersHelp"); note(parent, "hdrVariablesHelp");
|
||||||
return { read: () => validateHeaders(JSON.parse(target.value)), add: (direction, rule) => { adders[direction](rule); renumber(direction); sync(); } };
|
return { read: () => validateHeaders(JSON.parse(target.value)), set, add: (direction, rule) => { adders[direction](rule); renumber(direction); sync(); } };
|
||||||
}
|
}
|
||||||
function suspendDraft() {
|
function suspendDraft() {
|
||||||
const state = {
|
const state = {
|
||||||
@@ -185,7 +234,7 @@ function restoreDraft(state) {
|
|||||||
editing = state.editing; revision = state.revision; basicEditor = state.basicEditor; locationsReader = state.locationsReader; aclControl = state.aclControl;
|
editing = state.editing; revision = state.revision; basicEditor = state.basicEditor; locationsReader = state.locationsReader; aclControl = state.aclControl;
|
||||||
readBindings = state.readBindings; readHosts = state.readHosts; countryRatesReader = state.countryRatesReader; uaRatesReader = state.uaRatesReader || (() => []); pagesEditor = state.pagesEditor; backendHealthEditorControl = state.backendHealthEditorControl || null;
|
readBindings = state.readBindings; readHosts = state.readHosts; countryRatesReader = state.countryRatesReader; uaRatesReader = state.uaRatesReader || (() => []); pagesEditor = state.pagesEditor; backendHealthEditorControl = state.backendHealthEditorControl || null;
|
||||||
vhostPolicyEditor = state.vhostPolicyEditor || null; vhostCacheRulesEditor = state.vhostCacheRulesEditor || null;
|
vhostPolicyEditor = state.vhostPolicyEditor || null; vhostCacheRulesEditor = state.vhostCacheRulesEditor || null;
|
||||||
vhostHeadersControl = state.vhostHeadersControl || null; headersPreviewControl = state.headersPreviewControl || null; presetsRefresh = state.presetsRefresh || (() => {});
|
vhostHeadersControl = state.vhostHeadersControl || null; headersPreviewControl = state.headersPreviewControl || null; presetsRefresh = state.presetsRefresh || (() => { });
|
||||||
stagedCertificates = state.stagedCertificates || []; uploading = state.uploading === true; initialized = true; dirty = true; $("vhost-editing").textContent = state.label;
|
stagedCertificates = state.stagedCertificates || []; uploading = state.uploading === true; initialized = true; dirty = true; $("vhost-editing").textContent = state.label;
|
||||||
if (!dialog.open) dialog.showModal(); if (latestStatus) renderStatus(latestStatus);
|
if (!dialog.open) dialog.showModal(); if (latestStatus) renderStatus(latestStatus);
|
||||||
}
|
}
|
||||||
@@ -342,10 +391,13 @@ function debugOriginIssues(members) {
|
|||||||
function aclEditor(parent, initial, onChange = () => { }) {
|
function aclEditor(parent, initial, onChange = () => { }) {
|
||||||
const enabled = field(parent, "acl-use", "aclUse", !!initial, "checkbox", { switch: true }), body = el("div", undefined, "vh-wide vh-grid"); parent.append(body);
|
const enabled = field(parent, "acl-use", "aclUse", !!initial, "checkbox", { switch: true }), body = el("div", undefined, "vh-wide vh-grid"); parent.append(body);
|
||||||
const policy = field(body, "acl-default", "aclDefault", initial?.default || "deny", "select", { values: [["deny", "vhDeny"], ["allow", "aclAllow"]] }), rows = el("div", undefined, "vh-wide"); body.append(rows);
|
const policy = field(body, "acl-default", "aclDefault", initial?.default || "deny", "select", { values: [["deny", "vhDeny"], ["allow", "aclAllow"]] }), rows = el("div", undefined, "vh-wide"); body.append(rows);
|
||||||
function add(value = { network: "", action: "allow" }) { const row = el("div", undefined, "acl-rule"); field(row, "network", "aclNetwork", value.network, "text", { maxLength: 64 }); field(row, "action", "aclAction", value.action, "select", { values: [["allow", "aclAllow"], ["deny", "vhDeny"]] }); row.append(button("remove", () => { row.remove(); onChange(); })); rows.append(row); }
|
function add(value = { network: "", action: "allow" }) { const row = el("div", undefined, "acl-rule"); field(row, "network", "aclNetwork", value.network, "text", { maxLength: 254 }); field(row, "action", "aclAction", value.action, "select", { values: [["allow", "aclAllow"], ["deny", "vhDeny"]] }); row.append(button("remove", () => { row.remove(); onChange(); })); rows.append(row); }
|
||||||
body.append(button("aclAdd", () => { add(); onChange(); })); for (const rule of initial?.rules || []) add(rule);
|
body.append(button("aclAdd", () => { add(); onChange(); })); for (const rule of initial?.rules || []) add(rule);
|
||||||
const sync = () => { body.hidden = !enabled.checked; onChange(); }; enabled.addEventListener("change", sync); body.addEventListener("input", onChange); body.addEventListener("change", onChange); body.hidden = !enabled.checked;
|
const sync = () => { body.hidden = !enabled.checked; onChange(); }; enabled.addEventListener("change", sync); body.addEventListener("input", onChange); body.addEventListener("change", onChange); body.hidden = !enabled.checked;
|
||||||
note(parent, "aclHelp"); return { read: () => enabled.checked ? { default: policy.value, rules: [...rows.children].map(r => ({ network: str("network", r), action: str("action", r) })) } : null };
|
note(parent, "aclHelp"); return {
|
||||||
|
read: () => enabled.checked ? { default: policy.value, rules: [...rows.children].map(r => ({ network: str("network", r), action: str("action", r) })) } : null,
|
||||||
|
set: value => { validateInlineAcl(value); enabled.checked = value !== null; policy.value = value?.default || "deny"; rows.replaceChildren(); for (const rule of value?.rules || []) add(rule); body.hidden = !enabled.checked; onChange(); }
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function openLocationHelp(topic = "locations") {
|
function openLocationHelp(topic = "locations") {
|
||||||
const dialog = $("location-help-dialog"), title = $("location-help-title"), body = $("location-help-body");
|
const dialog = $("location-help-dialog"), title = $("location-help-title"), body = $("location-help-body");
|
||||||
@@ -375,7 +427,7 @@ function openLocationHelp(topic = "locations") {
|
|||||||
dialog.showModal();
|
dialog.showModal();
|
||||||
}
|
}
|
||||||
const LOCATION_GROUP = "__group__";
|
const LOCATION_GROUP = "__group__";
|
||||||
function locationsEditor(parent, values) {
|
function locationsEditor(parent, values, onChange = changed) {
|
||||||
const toolbar = el("div", undefined, "vh-wide location-toolbar"), rows = el("div", undefined, "vh-wide vh-locations");
|
const toolbar = el("div", undefined, "vh-wide location-toolbar"), rows = el("div", undefined, "vh-wide vh-locations");
|
||||||
const addTop = button("locationAdd", () => { add(); sync(); }, "primary");
|
const addTop = button("locationAdd", () => { add(); sync(); }, "primary");
|
||||||
const addHostRule = button("rtAddHostRule", () => { add({ id: nextId("host-rule"), match_type: "any", conditions: [{ source: "header", name: "", operator: "equals", values: [] }] }, true); sync(); });
|
const addHostRule = button("rtAddHostRule", () => { add({ id: nextId("host-rule"), match_type: "any", conditions: [{ source: "header", name: "", operator: "equals", values: [] }] }, true); sync(); });
|
||||||
@@ -412,7 +464,7 @@ function locationsEditor(parent, values) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function sync() { if (reloading) return; try { read("paths").value = JSON.stringify(readRows(), null, 2); changed(); } catch { } tester?.run(); }
|
function sync() { if (reloading) return; try { read("paths").value = JSON.stringify(readRows(), null, 2); onChange(); } catch { } tester?.run(); }
|
||||||
function memberOptions(select, chosen = select.value) { const base = text("option", "locationPool"); base.value = ""; const groupOption = text("option", "locationBackendGroup"); groupOption.value = LOCATION_GROUP; select.replaceChildren(base, groupOption, ...[...form.querySelectorAll(".vh-member")].map(m => { const id = str("member-id", m), o = el("option", `${id} / ${str("member-url", m)}`); o.value = id; return o; })); if (chosen && !Array.from(select.options).some(o => o.value === chosen)) { const o = el("option", `${chosen} / ${t("locationMissing")}`); o.value = chosen; select.append(o); } select.value = chosen; }
|
function memberOptions(select, chosen = select.value) { const base = text("option", "locationPool"); base.value = ""; const groupOption = text("option", "locationBackendGroup"); groupOption.value = LOCATION_GROUP; select.replaceChildren(base, groupOption, ...[...form.querySelectorAll(".vh-member")].map(m => { const id = str("member-id", m), o = el("option", `${id} / ${str("member-url", m)}`); o.value = id; return o; })); if (chosen && !Array.from(select.options).some(o => o.value === chosen)) { const o = el("option", `${chosen} / ${t("locationMissing")}`); o.value = chosen; select.append(o); } select.value = chosen; }
|
||||||
function add(value = {}, openConditions = false) {
|
function add(value = {}, openConditions = false) {
|
||||||
if (rows.children.length >= 64) { toast(t("locationLimit"), true); return; }
|
if (rows.children.length >= 64) { toast(t("locationLimit"), true); return; }
|
||||||
@@ -588,6 +640,11 @@ function locationsEditor(parent, values) {
|
|||||||
const bottom = el("div", undefined, "vh-wide location-toolbar location-toolbar-bottom"); bottom.append(button("locationAdd", () => { add(); sync(); }, "primary")); parent.append(bottom);
|
const bottom = el("div", undefined, "vh-wide location-toolbar location-toolbar-bottom"); bottom.append(button("locationAdd", () => { add(); sync(); }, "primary")); parent.append(bottom);
|
||||||
const refreshMembers = () => { for (const select of rows.querySelectorAll('[name="location-backend"]')) memberOptions(select); for (const row of rows.children) row.refreshBalancing?.(); };
|
const refreshMembers = () => { for (const select of rows.querySelectorAll('[name="location-backend"]')) memberOptions(select); for (const row of rows.children) row.refreshBalancing?.(); };
|
||||||
form.querySelector(".vh-members").addEventListener("input", refreshMembers); form.querySelector(".vh-members").addEventListener("change", refreshMembers);
|
form.querySelector(".vh-members").addEventListener("input", refreshMembers); form.querySelector(".vh-members").addEventListener("change", refreshMembers);
|
||||||
read("paths").addEventListener("change", () => { try { const data = JSON.parse(str("paths")); if (!Array.isArray(data) || data.length > 64) return; reloading = true; rows.replaceChildren(); for (const value of data) add(value); } catch { } finally { reloading = false; } });
|
readRows.set = data => {
|
||||||
|
validateLocations(data); const previous = [...rows.childNodes]; reloading = true;
|
||||||
|
try { rows.replaceChildren(); for (const value of data) add(value); readRows(); tester?.run(); }
|
||||||
|
catch (error) { rows.replaceChildren(...previous); throw error; }
|
||||||
|
finally { reloading = false; }
|
||||||
|
};
|
||||||
sync(); return readRows;
|
sync(); return readRows;
|
||||||
}
|
}
|
||||||
@@ -207,10 +207,12 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
|||||||
g = group("vhHeadersPreview"); headersPreviewControl = headersPreview(g);
|
g = group("vhHeadersPreview"); headersPreviewControl = headersPreview(g);
|
||||||
g = group("vhBackendDiagnostics");
|
g = group("vhBackendDiagnostics");
|
||||||
const diagnosticCards = el("div", undefined, "vh-wide hdr-cards"); g.append(diagnosticCards);
|
const diagnosticCards = el("div", undefined, "vh-wide hdr-cards"); g.append(diagnosticCards);
|
||||||
diagnosticCard(diagnosticCards, { name: "timing-headers", key: "vhTimingHeaders", checked: value.timing_headers === true, header: "Server-Timing", example: "proxy;dur=1.8, upstream;dur=12.4", help: "hdrCardTimingHelp", extra: body => {
|
diagnosticCard(diagnosticCards, {
|
||||||
field(body, "timing-header-names", "vhTimingHeaderNames", value.timing_header_names || "standard", "select", { values: [["standard", "vhTimingHeaderNamesStandard"], ["cdn", "vhTimingHeaderNamesCdn"], ["legacy", "vhTimingHeaderNamesLegacy"]] });
|
name: "timing-headers", key: "vhTimingHeaders", checked: value.timing_headers === true, header: "Server-Timing", example: "proxy;dur=1.8, upstream;dur=12.4", help: "hdrCardTimingHelp", extra: body => {
|
||||||
field(body, "timing-allow-origin", "vhTimingAllowOrigin", (value.timing_allow_origin || []).join(", "), "text", { maxLength: 2048 }).placeholder = "https://app.example.com";
|
field(body, "timing-header-names", "vhTimingHeaderNames", value.timing_header_names || "standard", "select", { values: [["standard", "vhTimingHeaderNamesStandard"], ["cdn", "vhTimingHeaderNamesCdn"], ["legacy", "vhTimingHeaderNamesLegacy"]] });
|
||||||
} });
|
field(body, "timing-allow-origin", "vhTimingAllowOrigin", (value.timing_allow_origin || []).join(", "), "text", { maxLength: 2048 }).placeholder = "https://app.example.com";
|
||||||
|
}
|
||||||
|
});
|
||||||
diagnosticCard(diagnosticCards, { name: "backend-header", key: "vhBackendHeader", checked: value.backend_header === true, header: "X-Rust-Proxy-Backend", example: `${value.id || "vhost"}/${(value.backends || [])[0]?.id || "origin-1"}`, help: "hdrCardBackendHelp" });
|
diagnosticCard(diagnosticCards, { name: "backend-header", key: "vhBackendHeader", checked: value.backend_header === true, header: "X-Rust-Proxy-Backend", example: `${value.id || "vhost"}/${(value.backends || [])[0]?.id || "origin-1"}`, help: "hdrCardBackendHelp" });
|
||||||
diagnosticCard(diagnosticCards, { name: "backend-timing-header", key: "vhBackendTimingHeader", checked: value.backend_timing_header === true, header: "X-RustProxy-Backend-Time", example: "12.40ms", help: "hdrCardBackendTimeHelp" });
|
diagnosticCard(diagnosticCards, { name: "backend-timing-header", key: "vhBackendTimingHeader", checked: value.backend_timing_header === true, header: "X-RustProxy-Backend-Time", example: "12.40ms", help: "hdrCardBackendTimeHelp" });
|
||||||
note(g, "vhBackendDiagnosticsHelp");
|
note(g, "vhBackendDiagnosticsHelp");
|
||||||
@@ -306,8 +308,10 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
|||||||
profileBox.append(multiWarning); aclFields.append(profileBox); note(aclFields, "vhAclProfileHelp");
|
profileBox.append(multiWarning); aclFields.append(profileBox); note(aclFields, "vhAclProfileHelp");
|
||||||
|
|
||||||
const inlineAclFields = subsection(g, "vhIpAccess");
|
const inlineAclFields = subsection(g, "vhIpAccess");
|
||||||
aclControl = aclEditor(inlineAclFields, value.acl, () => { if (aclControl) read("acl").value = JSON.stringify(aclControl.read(), null, 2); });
|
const aclJson = jsonDrawer(inlineAclFields, { name: "acl", titleKey: "vhAclJson", helpKey: "vhAclJsonHelp", value: value.acl ?? null, maxLength: 32768, validate: validateInlineAcl, apply: data => aclControl.set(data) });
|
||||||
|
aclControl = aclEditor(inlineAclFields, value.acl, () => { if (aclControl) { aclJson.target.value = JSON.stringify(aclControl.read(), null, 2); aclJson.refresh(); changed(); } });
|
||||||
note(inlineAclFields, "vhInlineAclHelp");
|
note(inlineAclFields, "vhInlineAclHelp");
|
||||||
|
inlineAclFields.append(aclJson.node);
|
||||||
|
|
||||||
const methodFields = subsection(g, "vhTrafficMethodsSection");
|
const methodFields = subsection(g, "vhTrafficMethodsSection");
|
||||||
field(methodFields, "method-mode", "vhMethodMode", methodPolicy.mode || "off", "select", { values: [["off", "vhOff"], ["allow", "locationMethodAllow"], ["block", "locationMethodBlock"]] });
|
field(methodFields, "method-mode", "vhMethodMode", methodPolicy.mode || "off", "select", { values: [["off", "vhOff"], ["allow", "locationMethodAllow"], ["block", "locationMethodBlock"]] });
|
||||||
@@ -360,14 +364,13 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
|||||||
field(uaBlockingFields, "ua-block-enabled", "vhUaBlockEnabled", uaBlock.enabled === true, "checkbox", { switch: true });
|
field(uaBlockingFields, "ua-block-enabled", "vhUaBlockEnabled", uaBlock.enabled === true, "checkbox", { switch: true });
|
||||||
field(uaBlockingFields, "ua-block-patterns", "vhUaBlockPatterns", (uaBlock.patterns || []).join("\n"), "textarea", { rows: 4, maxLength: 32768 });
|
field(uaBlockingFields, "ua-block-patterns", "vhUaBlockPatterns", (uaBlock.patterns || []).join("\n"), "textarea", { rows: 4, maxLength: 32768 });
|
||||||
note(uaBlockingFields, "vhUaBlockHelp");
|
note(uaBlockingFields, "vhUaBlockHelp");
|
||||||
g = group("vhAdvanced", true); field(g, "paths", "vhPaths", JSON.stringify(value.routes || [], null, 2), "textarea", { rows: 5, maxLength: 131072 });
|
|
||||||
field(g, "acl", "vhAcl", JSON.stringify(value.acl ?? null, null, 2), "textarea", { rows: 5, maxLength: 32768 });
|
|
||||||
field(g, "headers", "vhHeaders", JSON.stringify(value.headers || {}, null, 2), "textarea", { rows: 5, maxLength: 65536 });
|
|
||||||
g = group("vhLocations");
|
g = group("vhLocations");
|
||||||
field(g, "main-error-target", "vhErrorFallbackTarget", value.error_fallback?.target || "", "text", { maxLength: 64, pattern: "[A-Za-z0-9_\\-]{0,64}" });
|
field(g, "main-error-target", "vhErrorFallbackTarget", value.error_fallback?.target || "", "text", { maxLength: 64, pattern: "[A-Za-z0-9_\\-]{0,64}" });
|
||||||
field(g, "main-error-statuses", "vhErrorFallbackStatuses", (value.error_fallback?.statuses || [404]).join(", "), "text", { maxLength: 64 });
|
field(g, "main-error-statuses", "vhErrorFallbackStatuses", (value.error_fallback?.statuses || [404]).join(", "), "text", { maxLength: 64 });
|
||||||
note(g, "vhErrorFallbackHelp");
|
note(g, "vhErrorFallbackHelp");
|
||||||
locationsReader = locationsEditor(g, value.routes || []);
|
const pathsJson = jsonDrawer(g, { name: "paths", titleKey: "vhLocationsJson", helpKey: "vhLocationsJsonHelp", value: value.routes || [], maxLength: 131072, validate: validateLocations, apply: data => locationsReader.set(data) });
|
||||||
|
locationsReader = locationsEditor(g, value.routes || [], () => { changed(); pathsJson.refresh(); });
|
||||||
|
g.append(pathsJson.node);
|
||||||
g = group("vhSsl");
|
g = group("vhSsl");
|
||||||
const certificateRow = el("div", undefined, "vh-wide vh-certificate-select-row"); g.append(certificateRow);
|
const certificateRow = el("div", undefined, "vh-wide vh-certificate-select-row"); g.append(certificateRow);
|
||||||
const selector = field(certificateRow, "certificate-id", "vhCertificate", value.certificate_id || "", "select");
|
const selector = field(certificateRow, "certificate-id", "vhCertificate", value.certificate_id || "", "select");
|
||||||
@@ -578,7 +581,10 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
|||||||
};
|
};
|
||||||
transformEnabled.addEventListener("change", syncTransform); customTransformExtensions.addEventListener("change", syncTransform); syncTransform();
|
transformEnabled.addEventListener("change", syncTransform); customTransformExtensions.addEventListener("change", syncTransform); syncTransform();
|
||||||
note(transformOptions, "vhTransformHelp");
|
note(transformOptions, "vhTransformHelp");
|
||||||
g = group("vhHeaders"); g.parentElement.classList.add("hdr-rules-anchor"); vhostHeadersControl = headerEditors(g, value.headers || {});
|
g = group("vhHeaders"); g.parentElement.classList.add("hdr-rules-anchor");
|
||||||
|
const headersJson = jsonDrawer(g, { name: "headers", titleKey: "vhHeadersJson", helpKey: "vhHeadersJsonHelp", value: value.headers || {}, maxLength: 65536, validate: validateHeaders, apply: data => vhostHeadersControl.set(data) });
|
||||||
|
vhostHeadersControl = headerEditors(g, value.headers || {}, headersJson.target, () => { changed(); headersJson.refresh(); });
|
||||||
|
g.append(headersJson.node);
|
||||||
g = group("policyTitle"); vhostPolicyEditor = window.rustProxyPolicy.create({ value: value.policy || {}, scope: "vhost", onChange: changed }); g.append(vhostPolicyEditor.node);
|
g = group("policyTitle"); vhostPolicyEditor = window.rustProxyPolicy.create({ value: value.policy || {}, scope: "vhost", onChange: changed }); g.append(vhostPolicyEditor.node);
|
||||||
g = group("vhPages"); g.classList.add("vh-pages-grid"); pagesEditor = window.rustProxyPages.vhostEditor(g, value.pages || {});
|
g = group("vhPages"); g.classList.add("vh-pages-grid"); pagesEditor = window.rustProxyPages.vhostEditor(g, value.pages || {});
|
||||||
initTabs(); dirty = false; if (latestStatus) renderStatus(latestStatus); if (show && !dialog.open) dialog.showModal();
|
initTabs(); dirty = false; if (latestStatus) renderStatus(latestStatus); if (show && !dialog.open) dialog.showModal();
|
||||||
@@ -657,12 +663,14 @@ function collect() {
|
|||||||
authentication: selectedAuthentication().provider === "none" ? null : selectedAuthentication(),
|
authentication: selectedAuthentication().provider === "none" ? null : selectedAuthentication(),
|
||||||
tinyauth: { enabled: selectedAuthentication().provider === "tinyauth" && selectedAuthentication().method === "forward_auth", url: str("auth-url"), login_url: str("auth-login"), allow_private: yes("auth-private"), redirect_forbidden: yes("auth-redirect-forbidden"), connect_timeout_seconds: num("auth-connect"), timeout_seconds: num("auth-timeout"), request_headers: lines(str("auth-request-headers")), response_headers: lines(str("auth-response-headers")), address_allowlist: lines(str("auth-allowlist")), tls_ca_pem: nullable("auth-ca") },
|
tinyauth: { enabled: selectedAuthentication().provider === "tinyauth" && selectedAuthentication().method === "forward_auth", url: str("auth-url"), login_url: str("auth-login"), allow_private: yes("auth-private"), redirect_forbidden: yes("auth-redirect-forbidden"), connect_timeout_seconds: num("auth-connect"), timeout_seconds: num("auth-timeout"), request_headers: lines(str("auth-request-headers")), response_headers: lines(str("auth-response-headers")), address_allowlist: lines(str("auth-allowlist")), tls_ca_pem: nullable("auth-ca") },
|
||||||
authelia: readForwardProvider("authelia"), authentik: readForwardProvider("authentik"),
|
authelia: readForwardProvider("authelia"), authentik: readForwardProvider("authentik"),
|
||||||
oidc: { enabled: selectedAuthentication().method === "oidc", issuer_url: str("oidc-issuer"), backend_url: str("oidc-backend"),
|
oidc: {
|
||||||
|
enabled: selectedAuthentication().method === "oidc", issuer_url: str("oidc-issuer"), backend_url: str("oidc-backend"),
|
||||||
redirect_url: str("oidc-redirect"), client_id: str("oidc-client"),
|
redirect_url: str("oidc-redirect"), client_id: str("oidc-client"),
|
||||||
client_secret: str("oidc-secret"), session_secret: str("oidc-session"), scopes: str("oidc-scopes"),
|
client_secret: str("oidc-secret"), session_secret: str("oidc-session"), scopes: str("oidc-scopes"),
|
||||||
allow_private: yes("oidc-private"), address_allowlist: lines(str("oidc-allowlist")),
|
allow_private: yes("oidc-private"), address_allowlist: lines(str("oidc-allowlist")),
|
||||||
tls_ca_pem: nullable("oidc-ca"), connect_timeout_seconds: num("oidc-connect"),
|
tls_ca_pem: nullable("oidc-ca"), connect_timeout_seconds: num("oidc-connect"),
|
||||||
timeout_seconds: num("oidc-timeout"), session_ttl_seconds: num("oidc-ttl") },
|
timeout_seconds: num("oidc-timeout"), session_ttl_seconds: num("oidc-ttl")
|
||||||
|
},
|
||||||
backends: members, routes: paths, acl, headers, policy: vhostPolicyEditor ? vhostPolicyEditor.read() : {},
|
backends: members, routes: paths, acl, headers, policy: vhostPolicyEditor ? vhostPolicyEditor.read() : {},
|
||||||
load_balancing: {
|
load_balancing: {
|
||||||
algorithm: str("algorithm"), ...(vhostBalancingControl?.hash() ? { hash: vhostBalancingControl.hash() } : {}), slow_start_seconds: num("slow-start"), keepalive: { enabled: yes("keepalive"), idle_timeout_seconds: num("idle-timeout"), max_idle_per_host: num("max-idle"), tcp_keepalive_seconds: num("tcp-keepalive"), pool_recycle_requests: num("pool-recycle-requests"), pool_recycle_seconds: num("pool-recycle-seconds"), http1_max_buffer_bytes: num("http1-max-buffer") },
|
algorithm: str("algorithm"), ...(vhostBalancingControl?.hash() ? { hash: vhostBalancingControl.hash() } : {}), slow_start_seconds: num("slow-start"), keepalive: { enabled: yes("keepalive"), idle_timeout_seconds: num("idle-timeout"), max_idle_per_host: num("max-idle"), tcp_keepalive_seconds: num("tcp-keepalive"), pool_recycle_requests: num("pool-recycle-requests"), pool_recycle_seconds: num("pool-recycle-seconds"), http1_max_buffer_bytes: num("http1-max-buffer") },
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ function refreshVhostBackendPopup(status = latestStatus) {
|
|||||||
scheme = url.protocol.replace(":", "").toUpperCase();
|
scheme = url.protocol.replace(":", "").toUpperCase();
|
||||||
const port = url.port || (scheme === "HTTPS" ? "443" : scheme === "HTTP" ? "80" : "");
|
const port = url.port || (scheme === "HTTPS" ? "443" : scheme === "HTTP" ? "80" : "");
|
||||||
address = `${url.hostname}${port ? `:${port}` : ""}`;
|
address = `${url.hostname}${port ? `:${port}` : ""}`;
|
||||||
} catch { }
|
} catch { }
|
||||||
const upstream = upstreamProtocolBadgeText(backend, member);
|
const upstream = upstreamProtocolBadgeText(backend, member);
|
||||||
const protocol = `${scheme} · ${upstream.mode}${upstream.observed ? ` → ${upstream.observed}` : ""}`;
|
const protocol = `${scheme} · ${upstream.mode}${upstream.observed ? ` → ${upstream.observed}` : ""}`;
|
||||||
const statusCode = Number(member?.last_status);
|
const statusCode = Number(member?.last_status);
|
||||||
@@ -225,9 +225,7 @@ function syncPoolSortDirection() {
|
|||||||
control.setAttribute("aria-label", t(poolTablePrefs.descending ? "backendSortDescending" : "backendSortAscending"));
|
control.setAttribute("aria-label", t(poolTablePrefs.descending ? "backendSortDescending" : "backendSortAscending"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The backend pool and backend overview tables live on Overview. Rebuilding
|
|
||||||
// them on every live snapshot while another panel is shown cost tens of
|
|
||||||
// milliseconds per update; defer them until Overview is shown again.
|
|
||||||
let overviewViewsPending = false;
|
let overviewViewsPending = false;
|
||||||
const overviewViewsHidden = () => typeof currentPanel !== "undefined" && currentPanel !== "overview";
|
const overviewViewsHidden = () => typeof currentPanel !== "undefined" && currentPanel !== "overview";
|
||||||
function flushOverviewViews() { if (!overviewViewsPending) return; overviewViewsPending = false; if (latestStatus) renderStatus(latestStatus); else applyPoolTableView(); }
|
function flushOverviewViews() { if (!overviewViewsPending) return; overviewViewsPending = false; if (latestStatus) renderStatus(latestStatus); else applyPoolTableView(); }
|
||||||
@@ -913,7 +911,7 @@ form.addEventListener("submit", async event => {
|
|||||||
const healthPanel = invalid.closest(".vh-backend-health-panel");
|
const healthPanel = invalid.closest(".vh-backend-health-panel");
|
||||||
if (healthPanel) backendHealthEditorControl?.reveal([...form.querySelector(".vh-members").children].find(row => row.memberHealthPanel === healthPanel));
|
if (healthPanel) backendHealthEditorControl?.reveal([...form.querySelector(".vh-members").children].find(row => row.memberHealthPanel === healthPanel));
|
||||||
activateTab(invalid.closest(".vh-group")?.dataset.tab || "details");
|
activateTab(invalid.closest(".vh-group")?.dataset.tab || "details");
|
||||||
const details = invalid.closest("details"); if (details) details.open = true;
|
for (let parent = invalid.parentElement; parent && parent !== form; parent = parent.parentElement) if (parent.tagName === "DETAILS") parent.open = true;
|
||||||
invalid.reportValidity(); return;
|
invalid.reportValidity(); return;
|
||||||
}
|
}
|
||||||
if (revision !== envelope.revision) { toast(t("stale"), true); return; }
|
if (revision !== envelope.revision) { toast(t("stale"), true); return; }
|
||||||
|
|||||||
@@ -542,13 +542,22 @@ async fn run(
|
|||||||
println!(
|
println!(
|
||||||
" ACME: {} certificate(s){}, {} via {}; state in {}",
|
" ACME: {} certificate(s){}, {} via {}; state in {}",
|
||||||
acme.certificates.len(),
|
acme.certificates.len(),
|
||||||
if acme.auto { " + automatic for vhost hosts" } else { "" },
|
if acme.auto {
|
||||||
|
" + automatic for vhost hosts"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
},
|
||||||
acme.environment,
|
acme.environment,
|
||||||
acme.provider,
|
acme.provider,
|
||||||
data_dir.join("certs").join(rust_proxy::runtime::HEADLESS_ACME_STATE).display()
|
data_dir
|
||||||
|
.join("certs")
|
||||||
|
.join(rust_proxy::runtime::HEADLESS_ACME_STATE)
|
||||||
|
.display()
|
||||||
);
|
);
|
||||||
println!(" Renew: rust-proxy --headless tls renew [--force] [--id NAME]");
|
println!(" Renew: rust-proxy --headless tls renew [--force] [--id NAME]");
|
||||||
if acme.provider == "http01" && !state.active_listeners.iter().any(|listener| !listener.tls) {
|
if acme.provider == "http01"
|
||||||
|
&& !state.active_listeners.iter().any(|listener| !listener.tls)
|
||||||
|
{
|
||||||
tracing::warn!("ACME HTTP-01 needs a plain HTTP listener reachable on port 80");
|
tracing::warn!("ACME HTTP-01 needs a plain HTTP listener reachable on port 80");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -586,7 +595,7 @@ async fn run(
|
|||||||
println!(" Sign in with your administrator account.");
|
println!(" Sign in with your administrator account.");
|
||||||
}
|
}
|
||||||
println!(" Source: https://git.linuxiarz.pl/gru/RustProxy");
|
println!(" Source: https://git.linuxiarz.pl/gru/RustProxy");
|
||||||
println!(" Packages: https://rustproxy.linuxiarz.pl/");
|
println!(" Packages: https://repo.linuxiarz.pl/");
|
||||||
println!(" Data: {}\n Stop: Ctrl+C\n", data_dir.display());
|
println!(" Data: {}\n Stop: Ctrl+C\n", data_dir.display());
|
||||||
if state
|
if state
|
||||||
.active_listeners
|
.active_listeners
|
||||||
|
|||||||
Reference in new issue
Block a user