Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d7f152a0b | ||
|
|
da1fe0df55 | ||
|
|
4793af758f | ||
|
|
6f52ac3d00 | ||
|
|
672c84bc13 | ||
|
|
3a384baa6b | ||
|
|
e7b4991316 | ||
|
|
ff42a13dbf | ||
|
|
cd3c28d390 | ||
|
|
c038ad44b3 |
No files matched your search
@@ -10,3 +10,4 @@ problems.txt
|
||||
todo/
|
||||
scripts/routeros-oci-build/.env
|
||||
dist
|
||||
/*.*
|
||||
@@ -1,6 +1,6 @@
|
||||
# RustProxy source and documentation maintenance
|
||||
|
||||
Current source version: **0.35.3**. The Cargo package and binary are named `rust-proxy`.
|
||||
Current source version: **0.36.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.
|
||||
|
||||
|
||||
@@ -2,6 +2,45 @@
|
||||
|
||||
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.36.1 — interface icon polish and on-demand live logs
|
||||
|
||||
- **SVG icon polish:** HTTP/2 and HTTP/3 tabs now use the same protocol icon; listener HTTP/2/HTTP/3 limit links use the settings cog; **Apply preset** uses a preset/wand icon; the top **Logs** menu receives its missing icon. Compact Overview layout controls keep their native `+ / − / ← / → / ×` glyphs instead of receiving duplicate SVGs, and UI icon sizing is protected from chart SVG rules.
|
||||
- **WebSocket tunnels:** **Active tunnels** is now a compact clickable badge without an SVG icon.
|
||||
- **Overview metric cards:** removed the redundant **Recent samples / Ostatnie próbki** footer from the lower metric tiles; the footer is shown only when a metric has real detail text to present.
|
||||
- **Appearance copy:** removed the experimental/default-state sentence from the SVG icon option help text. The option remains account-scoped and off by default.
|
||||
- **On-demand live logs:** the panel status SSE uses `/api/events?...&logs=false`; `/api/logs` refreshes only while the Live Logs window is open or docked and actively following the bounded buffer. Closing, pausing or expanding the history view stops periodic log reads; reopening/resuming triggers an immediate refresh. Existing `/api/events` API consumers remain compatible because the new `logs` query parameter defaults to `true`.
|
||||
- **OPNsense certificate deploy:** the source release now includes the previously referenced `rustproxy-acme.conf.example` and `actions_rustproxy_cert.conf`; the integration guide explicitly requires certificate scope plus `allow_deploy` for the deployment credential.
|
||||
- **Preference persistence fix:** expanded the per-administrator UI preference document limit from 4 KiB to 64 KiB. Customized Overview layouts can exceed the old limit once widget widths are stored; affected saves previously surfaced as `auth.unavailable` even though authentication was healthy.
|
||||
- **Upgrade notes:** the SQLite schema is migrated automatically to expand administrator preference storage; proxy configuration is unchanged.
|
||||
|
||||
## 0.36.0 — leaner administration polling
|
||||
|
||||
- **Experimental interface icons:** **Settings → Appearance → Interface → Show SVG interface icons** adds semantic inline SVG icons to navigation, action buttons, tabs and dialogs. The account-scoped option is **off by default**, keeps text labels as the accessible source of meaning, follows the current theme via `currentColor`, and can be disabled without changing the original control layout or behavior.
|
||||
- **Polling API:** `GET /api/cache`, `GET /api/transform` and `GET /api/traffic` now accept `view=live` for lightweight periodic refreshes. The default response remains the complete backward-compatible payload. Live responses carry the configuration `revision`, and the panel automatically reloads static data when that revision changes.
|
||||
- **Panel network load:** Cache and Transform polling no longer retransmit static settings/Vhost configuration on every refresh; Traffic polling omits the static Vhost list. Certificate API credentials are fetched only when the corresponding Settings tab is opened.
|
||||
- **Refresh behavior:** configuration writes and operational actions refresh status without also forcing a full `/api/logs` snapshot. Initial load, explicit log refresh and the existing live-log/fallback path retain log coverage.
|
||||
- **API contract:** OpenAPI documents the polling views and revision fields; regression tests cover compatibility, invalid views and the panel refresh contract.
|
||||
- **Upgrade notes:** no configuration or database changes are required. Existing API clients that do not send `view=live` retain their previous response shapes, with the additive `revision` field on Cache, Transform and Traffic observations.
|
||||
|
||||
## 0.35.5 — Overview polish and cache build fix
|
||||
|
||||
- **Overview charts:** the cache-results heading now matches the other chart headings and its HIT/MISS/BYPASS legend stays on one line; system uptime is shown in the System load header; the backend count is aligned with Open connections; the redundant Requests per second footer was removed from the PHP requests tile.
|
||||
- **PL/EN status labels:** the sidebar healthy-state label is now **SYSTEM OK**, and the application self-check uses the shorter **API** label.
|
||||
**Upgrade notes:** no configuration or database changes are required.
|
||||
|
||||
## 0.35.4 — Dashboard status and control cleanup
|
||||
|
||||
- **Overview samples:** the history sample selector is right-aligned on desktop and mobile and now saves immediately in the browser; the separate Remember choice button is removed.
|
||||
- **Application self-check:** the old runtime/control-plane sidebar block is replaced by a color-coded application status indicator. Clicking it shows checks for the control API, listener restart state, backend readiness and logging pipeline issues.
|
||||
- **Dashboard footer:** removed the low-value dropped-log counter; API latency and update availability remain.
|
||||
- **Navigation cleanup:** removed the static `RUNTIME / Rust / Tokio / Hyper / Axum / Tower / SQLite` text from the sidebar.
|
||||
- **Dashboard layout editing:** blocks are now moved by dragging the ⠿ handle with a live drop placeholder (mouse, pen and touch), smooth movement of neighbouring blocks, edge auto-scroll and **Esc** to cancel; arrow keys on the handle move a block from the keyboard. Custom layouts no longer back-fill gaps automatically, so blocks stay where they were placed; the new **Fill gaps** action packs them on request. The edit toolbar is a single compact row, so the layout keeps its shape while unlocked.
|
||||
- **Interface fixes:** the WebSocket tunnels title no longer overlaps its **Active tunnels** button; summary tiles on the Cache, Traffic and Transform pages fill each row instead of leaving empty columns; identifier fields (username, certificate, Docker agent and redirect IDs) no longer trigger an invalid-pattern error in current browsers; several layout-editor tooltips showed raw translation keys.
|
||||
- **Cache under turnover:** returning freed memory to the operating system is now rate-limited (at most four times per second, plus the regular maintenance pass) instead of running after every eviction. With a full HOT cache and constant replacement this measured about 2.3× higher throughput with the default system allocator (2,900 → 7,000 req/s, one core) at about 7% higher resident memory.
|
||||
- **Cache hot path:** popular objects no longer re-link the LRU list on every hit, HOT/COLD index lookups use the already-uniform cache digest instead of a second SipHash pass, and the request-collapsing bypass marker for uncacheable URLs keeps working when its table is full.
|
||||
- **Per-response work:** configured `Server` and cache `Via` values are parsed once per worker instead of on every response, and cache diagnostic headers avoid temporary allocations.
|
||||
- **Upgrade notes:** no configuration or database changes are required.
|
||||
|
||||
## 0.35.3 — Overview layout fixes
|
||||
|
||||
- **Standard Overview layout restored:** the quick-health tiles added in 0.35.2 (healthy backends, error share, requests rejected by limits, nearest certificate expiry) are now hidden by default and placed at the end of the Overview, so they no longer shift the standard block layout. Enable them in the layout editor when needed.
|
||||
|
||||
Generated
+1
-1
@@ -1943,7 +1943,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rust-proxy"
|
||||
version = "0.35.3"
|
||||
version = "0.36.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rust-proxy"
|
||||
version = "0.35.3"
|
||||
version = "0.36.1"
|
||||
edition = "2021"
|
||||
rust-version = "1.99.1"
|
||||
description = "RustProxy - independent reverse proxy with local administration"
|
||||
|
||||
+71
-63
@@ -1,10 +1,10 @@
|
||||
61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore
|
||||
4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example
|
||||
ba8bc979322a494cfce59398085259d059142d6a789bbe73ed7992d143123f06 .gitignore
|
||||
5142c2151f434a42b925a6def77b726abf0c10e8404f8db08c999ca1cad43386 AGENTS.md
|
||||
c2c23ce76282075cc49bf1609fe693591c900a5a120ff3e209e00f86a97c0141 CHANGELOG.md
|
||||
77a69eb3906a27fa42d4bcb60e9595e86fc23ad74d72b96f2710527da49f5225 Cargo.lock
|
||||
5d49aef294682f80d98cc2cc50d3908a8e5684151d38ee5dfbd04cd6cd95f9e0 Cargo.toml
|
||||
e76e688874828e3743d03693b1d2872b9633b4db09909673786caf30f7cfe489 .gitignore
|
||||
fded6c62b3bbf31e80efa6a5411431625fb06a3be044eb03399de2e09d02c1d6 AGENTS.md
|
||||
9e2912307564ea75dafd974af97d681208ff1a6babeab1955f22cee958535cb0 CHANGELOG.md
|
||||
a9309ef711e6daa6ca9bf7f3d7d9bfffe2411a5557be90d7eceeea06e3f5bd1d Cargo.lock
|
||||
a27d4c4f02f92ef1d41a96800ec46a9c835d4fe5edc2184f0babfa28e6c053a6 Cargo.toml
|
||||
25c7f3c8162cbf5cc156439774118a81dae9fdc52b611ec7e40c230fc99a772c Dockerfile
|
||||
0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE
|
||||
82d1dee2fc68158f0ea73259151461e64c8b18d807cd1fecfb1ed99dc30cf5f4 README.md
|
||||
@@ -28,22 +28,22 @@ e52b31d0abf65ae3034f6cb367cca113633014ce8d1d799ad4dd5624d2c7b8bb docker-agent/n
|
||||
634790f35ff4627df2a78cec2ed371f6e9ec9df00afb386075595fc7f3ed72eb docker-agent/rustproxy-docker-agent.service
|
||||
5220d669171ec3ad65f50e0bc8de5178dadaa4904def8e1a4f61002aa9e9a55b docker-agent/server.go
|
||||
60d108fd168064e4d6980ed7499f3219017f9878c743697e77f2efc592e4d629 docs/ACCESS.md
|
||||
a1b6b8675d3b8321160406bc716f1355356e1e3dd056d4785be1d06a99313f31 docs/API.md
|
||||
19a4e028350f6ff786dd799a73fe7f3ec99cb5cf51cc291d359d35452df84862 docs/API.md
|
||||
728b15b9825f547f34c4121219784798dd046fbbdd72ece8906d0cd77e8efc64 docs/BACKUP.md
|
||||
4fb55a549535f37467f14536cbf0db7be027ca8a019c2919a384af4f23655300 docs/CACHE.md
|
||||
32599d67a11fd0ebbc612e82b9f602789f4ed4103cda482c6870d8741100c8b4 docs/CERTIFICATES.md
|
||||
02bb383b5c3bce22616c3cc3db30a9469806dc16decb509973e84c60aa30fc5b docs/CONFIGURATION.md
|
||||
fec29ce846d6705eb45819d85d382f28e28a146b265feab2e4c7cce2a35e5883 docs/CUSTOM_LOCATIONS.md
|
||||
6e05af7bf62a41a3a5a71e8f0c036dc611408d04f7130c07b585317aaf59ef0b docs/DASHBOARD.md
|
||||
91ce42f259e833b6b5bd351519d27727b81dacf7879516bd024bb11dc728d7bd docs/DASHBOARD.md
|
||||
11a08bf2110bbeabc924eb049a30177a216af5607ccdaf8be9178e751f78a2c4 docs/DOCKER_DISCOVERY.md
|
||||
cebf36532f7366acdcf8808d958b86b5f67246043677ee3dba9474a9b81970e0 docs/FEATURES.md
|
||||
3e7e63d1d8f5d5019d5e4fdbabfe44fb39c2b75e7141d9c94846d946f34849f2 docs/FEATURES.md
|
||||
3939c14e83ef6856a421f358a3f7fce3d50ea375bc1b9f0419f27a3eed658f6f docs/INSTALL.md
|
||||
694cb7b15c5bbdc94cecd15dc516c05dcb3467849322cdd125b872d36dee4699 docs/LOGS.md
|
||||
6e37859bf0dced99d4a7db93790cb38fcd90191932827946d5223eaa4c784fce docs/LOGS.md
|
||||
0e9ae9509a78d00951d2c7c3f13eaf518d1f3448a29b048f5933e1f5f8440275 docs/MIGRATION.md
|
||||
0972248b7062b37e61edcc34dab5fe73ee9bb50195a0aa475c72efa0dd311aa9 docs/MONITORING.md
|
||||
2a363d1e5dca0168ddbe58498641381e8281089f2e7b15ea5159e5b9eb6dae01 docs/PERFORMANCE.md
|
||||
e2e8fc307885bd02c177aea5740b2ac767fc7bdcfe7034dd75b8646f3014b39f docs/PERFORMANCE.md
|
||||
d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md
|
||||
9095d0df62a4548459ca739c97fcca37d8902cee1ae04b7f9da57aaea7749a9a docs/README.md
|
||||
954b1602c865e157c867f1c81dca615f2beaa33c34de0b0fa8a6069db2aae7d0 docs/README.md
|
||||
490a6dbe870f2b1fd4ec7816768dde6c86fa7957fc9de2d2f075e123c9222222 docs/RESPONSE_DELIVERY.md
|
||||
70e8c8f3352629f5600537058b1997739d9e465747cf3051da8a2cc779c3b728 docs/SCREENSHOTS.md
|
||||
3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md
|
||||
@@ -81,17 +81,19 @@ af2bdb1343a8141069e94ccd2c7f92574ad848437e2f9fdb5c7576a9a18ef4a5 examples/vhost
|
||||
1a041c505669625a7f0f8011484cf5b6d2ec69a7de859801312e4fcf4c8d3555 install-debian13.sh
|
||||
909e9ab94617ace74a425f15084bf85f3086cc52ba5b28f2b441ff800abc6ef9 install.sh
|
||||
42f9f1d18c021fc7734b5bd020844bf678725a0e539e2fcbe05ec676f6239eae integrations/README.md
|
||||
2d4c859aae5ba357a6d30024c8487ae8f59f01b192711f13f9c2f8fee0f48b50 integrations/opnsense-acme/README.md
|
||||
ba753f69557bd9fa990e56beabebccf39f93b5f6fb7e66a2e241c8c461dfd763 integrations/opnsense-acme/README.md
|
||||
3a1f8c326618a4613bb35f9e83428f6d1cf668b9e37b4731e5d38c3081fc94d8 integrations/opnsense-acme/actions_rustproxy_cert.conf
|
||||
de6550ab8f48d556d752c252212c38ba65491fd224f972c10fbe552f91ed7520 integrations/opnsense-acme/opnsense-rustproxy-cert-deploy.sh
|
||||
73784ac652708b04ca6c91aeed4524f51f50d63715bbeefe7f5590b353e78943 integrations/opnsense-acme/rustproxy-acme.conf.example
|
||||
45be151cd85fc2ef2f1fdc3003ace63381af262e73af8a685ab48cb697cc0de1 integrations/routeros-oci-build/.env.routeros.example
|
||||
11aa102de1089ecc375f20c4bd5420fcfd3b2ef23fe0c8bdf04953fcfaf40ef0 integrations/routeros-oci-build/Dockerfile.routeros
|
||||
7c7a3e51f43b43e1c962a4b0bb591f99c1f06977bf77f23719f7f867dfe7eb8e integrations/routeros-oci-build/Dockerfile.routeros.dockerignore
|
||||
4c7416b85ddbf66f8434735dfa6452c8b368f496a120861a2024c5775858ad0e integrations/routeros-oci-build/README.md
|
||||
e655bb17583e46f182226d7d2e1da45e6dffd0a8fd457e0cfb776778445e4358 integrations/routeros-oci-build/README.md
|
||||
3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh
|
||||
3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh
|
||||
13189fa546c3488dddd8efc80c47f6da5241e5fc28b79cbfe795414ea05c7a4f langs/README.md
|
||||
582dcbe08575602b83610e316ee3d856d391f87d23f6d91dca7361ed58c470f4 langs/en_US.json
|
||||
2bdd09e7734a65c828c268e89a85a1e6071be54cdf1b378a67406a1fa6dbf0b7 langs/pl_pl.json
|
||||
9aee5697423f618e2d913f071240d288134ad1e6d9aeedc37636a5185ae33fb2 langs/en_US.json
|
||||
1a0b5a24daf53fb04f92bb4fbd5dfa501e0a5a7c0bb0dad7f58668c3be1b5110 langs/pl_pl.json
|
||||
9664543e4d03422788a65e42f968c1f026c2235cb5be6fc3e0ad318997077538 make_zip.py
|
||||
e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql
|
||||
20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql
|
||||
@@ -101,8 +103,9 @@ faa7e50922bf180c363f7627fbcfe8079831e36282220d17481cf69bc64b57f1 migrations/000
|
||||
f093aef9639a959a2522946995a02d2e67c464e794c3ef665261a9a5b348c968 migrations/0007_secret_store.sql
|
||||
90f6dce865496e018c047133d3bc1721fc2a19b2f4ced22e2a3625d9e9ff18ac migrations/0008_config_history.sql
|
||||
fc7585fdcbe99fe3496f0e62f4c4e2161f4a0173222ba4950331aec6c44e50f8 migrations/0009_certificate_api_grants.sql
|
||||
a8b1e5ec3236a0c2681dfa1746c526eeef77e8bcb5ea8634d954ac398b4642bb migrations/0010_dashboard_presets.sql
|
||||
d58a464870895cbefcaa2b4adfd6fcd0d5182d19f2528eef6509e190046cc9fe migrations/0010_dashboard_presets.sql
|
||||
e56ac3718ea7d73fd9afb1c3b44ca95c9bea424c32166e37ce913bee0e67a277 migrations/0011_tokens.sql
|
||||
273ce62a518657853428ca44dfe4dd2a56abbbbba684e905a2d0147d08359888 migrations/0012_admin_preferences_size.sql
|
||||
478220552ffeea3de00e2866d427d9f87f4cfc4ae5232e5c3a774e62425b1e0c nagios/README.md
|
||||
91233910aa4dab07ae917fef93d018a7a0beaab697f9a0bb889ac613e595cca4 nagios/check_rustproxy.py
|
||||
a42e01b341725c9da0928edf40c8c3b9c814ef90592f208c52b1f2c56a2ad383 nagios/check_rustproxy_api
|
||||
@@ -123,7 +126,7 @@ a59587ce8ad41b1bbb431356b58398f9c8ff7cb96a613a91752e907a70e10c2e scripts/deploy
|
||||
2cc658faaa610b21b48942c59b955525539ad4503fd60f2a49c7e626a22faaff scripts/migration/migrate_npm.py
|
||||
a459d95bbb0076f33ade8b273b813308167f9d8d45242b309a2d18320ca0093c scripts/migration/migrate_npm_api.py
|
||||
4c905a387f210c30fbf12a7738676fd39819bc96bc4a272da1db5f18a2d3013e scripts/migration/migrate_npm_core.py
|
||||
2ae780e30c1212ffe134f1785b2767a4a6591d5f74baef6c2f47cc8df35afbdb scripts/preflight.py
|
||||
960fdf97ec899107a567405e9b9c2b70ee16951d5ea26c37d885a7920f7b3aa1 scripts/preflight.py
|
||||
3d6a0503afc25beab79ddc86864bcbb15248ded7368d33aa64321b8cdff59933 scripts/resolve_dependencies_0312.sh
|
||||
d759315babd9971b354d6f702d4c861eb1cd5c41b1e2e0f1a94ad4d2c2db49a3 scripts/runtime/acme_provider.py
|
||||
e69813fb1d3a4cdcfb7243964cc323fc21a603087bf2e84188fa42b9d3cee4b5 scripts/runtime/acme_rfc2136.py
|
||||
@@ -160,65 +163,66 @@ b9c2952e3fcfca540d0ad64f2d3acc5c1f5240e707f4f23ef4d452f46fcb520f src/admin/docu
|
||||
059218501907355b22bc84e7e0c41ec72565af283f5e97170ce7707ea5874009 src/admin/file_logs.rs
|
||||
d58a2ed83319176de4e66790ed292447c9497ae031464ec55cfe27174acb639a src/admin/file_logs_io.rs
|
||||
77b8c05645969834cc8a58e249a7b60a57d6c47ad1c5cd92ffa5e4a9b5a8e73c src/admin/file_logs_query.rs
|
||||
444d7715406ffd2305a72decf7fdf633aa4c2752cd881c8fa3b95ed971d79820 src/admin/logging_api.rs
|
||||
743bb7436f77e04015328a0e7e7d425e43ef8aa8d61467bde157e462c1dcdc2e src/admin/logging_api.rs
|
||||
243f4a9c3fa99781e19c3952354d2632c0ce65e1dafac729567cbe3c177f94cb src/admin/mod.rs
|
||||
61fd5eb6bb4f3cc19151ae96dc5c028e4845479ce1e2bb2691a41094dcd212c9 src/admin/openapi.json
|
||||
1f4ec45d146e00ef664fae37517f8fcb5455d47daec496c02b2fc15ddec49131 src/admin/operations.rs
|
||||
500e87bb88ccc45806c0967262e76e3ee77ec5c2fbd9881d8aa26ff043f3377d src/admin/openapi.json
|
||||
f7a356109786635dd58cba590c71c796dbf36b47f25845190c75ee5c6a9fcb86 src/admin/operations.rs
|
||||
257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs
|
||||
f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs
|
||||
b3c3c2d33c150eb42ce210c6074e5eff6a8af9391118012e413bc9323d3ae50c src/admin/preferences.rs
|
||||
9080babb5094d24c2cd4b8e6efb6a516142263ff9f45219a13857dfc55f33fa4 src/admin/preferences.rs
|
||||
35a7f99c7448c90b8637f4b3a7becca138f1f378fe5dc3f87122151525bb20f9 src/admin/preferences_columns.rs
|
||||
b31595d9522962ae16dff83dd8bc063d31fb027cbf357e9953285d2e622daa26 src/admin/preferences_tests.rs
|
||||
1a7b2c2ab9c9cb00f48be34640c4f430ec0a3bc4ee3202db63b804f64e32f7b6 src/admin/preferences_tests.rs
|
||||
62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs
|
||||
7a00e4ab943f74d2b1bdcbfab7f9cd3f584e9f59536b4aca6c4c31f5f5508d12 src/admin/public/tests.rs
|
||||
6930b4f4b45257772b321b20a9becdf9bc4610274852948ba38c2d0cdf02dfaf src/admin/refresh_preferences.rs
|
||||
c8454f3092145c5fefdc8d93951ae46f192a6eb8139dbe288284b3a1c803b192 src/admin/router.rs
|
||||
e399ff25c8f26aab429b329609beb9633a61ed6e32ca82d14cfa59978585dd35 src/admin/router.rs
|
||||
e135431cb078ddb483165581123c64af8f00ea67acb3a395ec3e53c85d0d0d45 src/admin/session.rs
|
||||
7aeb784a3ef58795c8fe26467bb4e1a00e61420911f798a584ab09c12f73a754 src/admin/status.rs
|
||||
2d5b4c28fd0bd48b06890fa8ec44a2296de948c1f88eb2909f4b495710d4e13e src/admin/status_live.rs
|
||||
8315c856cd50f1072593ecb30c274d42d82f078b5fb93e7c68a8857cd81b0841 src/admin/status_system.rs
|
||||
cadd7dca29b9aad8c77c7bc23dd249ea37a15adfa4d636a8ef00273a91ce35dc src/admin/tail.rs
|
||||
3bcd09729f3718d9ea88afae10c9e37b127d742babedd46e20ffd05eb31885e3 src/admin/tests.rs
|
||||
eafb1afb4bf3dd967c18313d4725cc69edf7ad9d351b89f4e1da545f08e7e941 src/admin/tests.rs
|
||||
c18c369124368f58524652565102817ed69fd25b222b0c5e737ef7632b45dcfb src/admin/web/acl-picker.js
|
||||
48fcd818c522fe80f2c7b2e218f87de6a7772ffd0a24e93502780b03ec78e335 src/admin/web/acme.js
|
||||
86abf50f39862d821cd2e43ca425671aa85289272915132c5a9a5dd1fc4182e2 src/admin/web/api-tokens.js
|
||||
5a9842a3f3ac5f6c769413496ea5ea1d019446d051cdde252784b1a1cc46996f src/admin/web/app/backend-dashboard.js
|
||||
faa9735c2a02746b2954bc4955eb609f94afebb685cd5521d2629640cea2777a src/admin/web/app/backend-dashboard.js
|
||||
aed3aea4eef0011c6b51d39736782e7d1ec52662e422f40e0c7b9ddfc19d0378 src/admin/web/app/certificate-inspection.js
|
||||
1a4d40a86067493e75b47f2d735d50fa4d161344ce145d4e502b0225144ed45a src/admin/web/app/chart-scales.js
|
||||
e5b39b5592ba81292571033f26934ac0cd42bcdca7395e91094973cecb3eeaf8 src/admin/web/app/config-history.js
|
||||
0248fee14bbab0b3d1f308f650061d7a348a8ffe00a46a56e297131f815aae10 src/admin/web/app/core.js
|
||||
622d34e1616fee9a480d208192fc5a84d62d84ef4233d6a7d95e2bfb8cef415b src/admin/web/app/dashboard-inline-layout.js
|
||||
fcce3b0204ca2c679f5d8049d020619664a3c0a45889975681258d82ae329988 src/admin/web/app/core.js
|
||||
d695ec90fb5c98c27d7ba1d2bebf54f9840985fc530efcec3fcaf48d74b36c6b src/admin/web/app/dashboard-inline-layout.js
|
||||
e4238322a985d3e8b7f2de94b7af31e1c718775590b2c7b3428b878cd43337b7 src/admin/web/app/dashboard-layout-editor.js
|
||||
a184c50e1ca6bb5a14954e31b15f09ff9978fb939064ca724851bbb4e661dc56 src/admin/web/app/dashboard-presets.js
|
||||
47eaf9486099468b3d686bdca5c6b8d59aa5f5661baa03b3698320cf618db4e2 src/admin/web/app/overview-extra-metrics.js
|
||||
2bfc071e4d50b01f39650ac74380b355daf847a9b3c015cb5b3f17d8771114c6 src/admin/web/app/icons.js
|
||||
32aa11f041eafdf16e66adef6f5847a67413785224da2c19ecbf825996622aff src/admin/web/app/overview-extra-metrics.js
|
||||
5e62cccf6a9507fe208e9f41bbd08453c3d8c6a6b83c56d93a2bb22550ea6e9a src/admin/web/app/overview-masonry.js
|
||||
561f750cacd4d4fcf7d1d1d9167ba296c0b43d7e81f2bff0ab1a070e1b8682d6 src/admin/web/app/overview-samples.js
|
||||
4d1d4760cdff44771c9d880a7c0da81d7233ef6e3a4868111a522703831a7a54 src/admin/web/app/overview-samples.js
|
||||
db9012546cae8c58fc2bcbee71c9a95956a13a6db9e6d126c6a3770d45a4e4d2 src/admin/web/app/overview-wide-metrics.js
|
||||
bfd9fafb3112197e8f875dbf87a9a66c81aef0fe83687601a84a66f5e13f69bc src/admin/web/app/path-permissions.js
|
||||
46c7cd36397375eb7e8c230c8aa97b1dbea0a63800beb977efe1ec67a14b237e src/admin/web/app/preferences.js
|
||||
be276b8c55dc2c48770de200ce3f6e669e4c4146bcd1b4d03c4af32f025c4709 src/admin/web/app/preferences.js
|
||||
9e2b12d34ab1fb29716645720577ad49b16c03b46c482a03695e8f645d170e79 src/admin/web/app/rate-sampling.js
|
||||
ac24300022bb98de2ad5c03a7859a2d80b14420e7a72db49ad649f52d92566a9 src/admin/web/app/refresh.js
|
||||
7888eaea26c5cecc097ad276b73ae6c63def1db896053def6852ddf9d6739906 src/admin/web/app/runtime.js
|
||||
3b8e566d81a5b94ef21c73e7805ae128454f085554de9358040de266bcbdb0e0 src/admin/web/app/refresh.js
|
||||
c6ae53c0e95e67b9165822813efc622001be5354c19bb221a52514221d1df23e src/admin/web/app/runtime.js
|
||||
31201586925e6f4792071d7d03fb05dcc4a69a03c02a4e85eb0746f45af68074 src/admin/web/app/session-resume.js
|
||||
c7a18238ac426de4d1cf84a395ee4dc66410d60a57a3822695dc10adc668d956 src/admin/web/app/settings.js
|
||||
b7ead49224a4ec67181d3f24f9d9634bd6d76756f826a4d5d993300637d1d8f3 src/admin/web/app/stream-dashboard.js
|
||||
7de070cc8cdde45d7e0932259299e341e25b32c9ffbd87e4fcce934d0f090de4 src/admin/web/app/web-overview.js
|
||||
596205feca534302699120b84848cb0f3e9ef2ad7ba24eac18d5751532a40194 src/admin/web/cache-panel.js
|
||||
e9788a9d1e0bce8775f612a5c842afea8a0dcf01301acdef4b69ff6a52d2ef45 src/admin/web/certificate-api.js
|
||||
f5855db3327f51170a28114e07d207745b4d6c8822d88d24c1a81eb92f345b14 src/admin/web/cache-panel.js
|
||||
9f323507649910561518b63cf6632e81b3ecc4b09501ae53b635705f34ea6587 src/admin/web/certificate-api.js
|
||||
a09f060b47771c56e9b9e57f1b896a32a2f87f1fb33401ac76932a91d247c67e src/admin/web/css/00-tokens.css
|
||||
77b8b748f31ef383c64ba5ca1740e9b6073f0de1e77c2c8c62d0f38bb52dd296 src/admin/web/css/10-base.css
|
||||
d3f19407ae97b3f6cca015877d369f4e3dc86d8ea7de08e430c85468fa033f5e src/admin/web/css/20-shell.css
|
||||
98133ee0b23288dc8d0ed2fa0a1375f9145acce108d215a63c76ea96bbdf8e11 src/admin/web/css/30-overview.css
|
||||
422a8c04d6499f806516be1694f316a4881d7cc191072218ea851445e2493506 src/admin/web/css/10-base.css
|
||||
6ed54b27a4a81b073f1d30cf61e366f3d5c1f6f8495f0d0a8af48e061937eb4e src/admin/web/css/20-shell.css
|
||||
feca0078ca889900a75d08a4a241e1a8ec787c8f4de25933d4883aac955e8023 src/admin/web/css/30-overview.css
|
||||
dd82b5e3ead91c20bb08cf8d71bbba31ea8e3d108c417913c63409f3e34da7e1 src/admin/web/css/40-editors.css
|
||||
6af9fcb439823ec63abe2c1dd86c9ecba17c233262fd8ab80d321d64ae2758ab src/admin/web/css/50-settings.css
|
||||
24defe4c76df881da43498e2fc9ebd2927178f4a6f4dc964dbbae03353634008 src/admin/web/css/50-settings.css
|
||||
f8b515c63080c71ee647cfd8c36628271e8357b31cd84f00cf591e9b752b44fe src/admin/web/css/60-monitoring.css
|
||||
c7c387e21e7bb148689e16f5fda6cd47c870043260dec059bbe66e09ac86fdd9 src/admin/web/css/70-responsive.css
|
||||
fb7cc4d733cb9a3e320a8cb95269ca047394dded8846120ffb50aaeaaab4d749 src/admin/web/css/70-responsive.css
|
||||
8009afdb04d5170687816730cc930a22fead1fe0248835ca7e8de81d6907395d src/admin/web/css/README.md
|
||||
8241bd9489dfed082863948829a44a49bf0a8e9cd63c55809655109e393e0918 src/admin/web/css/manifest.json
|
||||
ee51ab0912e0ade6a3e1c2ea6f533bb2f65a6d3e6ec9087e25b9f0df009c19b2 src/admin/web/dashboard-defaults.json
|
||||
20d65b22900d0de2f71dbafee2fe9a237e0a76515b386022b94c75d50bdfd926 src/admin/web/dashboard-widgets.json
|
||||
50d1ebcbaf4d0b2968da23bb943fc3f67131c5d32df3f61d23ff37aad9da5b81 src/admin/web/demo.html
|
||||
448a4e00e78ca368f9307cc84f87e893e5225dc87fdeadfbb227fd4b1faf1702 src/admin/web/docker.js
|
||||
3283eb1f0bc29a02590d150b41247bcfd881f88febc6c9df5bdf6086730b786d src/admin/web/docker.js
|
||||
fec062a5959450b1711948adf3189ceb37edca6fbead2e5bfc03b7ce397c70b1 src/admin/web/docs.css
|
||||
aeffd403fa1823df7d9fa4c48280b4033b2d15e4cb9f66608caff89290de0a52 src/admin/web/docs.html
|
||||
fd8506a91f769b57b62d9d8e389fb67764599354bf702958a913be79f779707b src/admin/web/docs.js
|
||||
@@ -239,21 +243,21 @@ e6c4d91d1542d0a5b47bb8736f9539d43a6713df5a473b635519d5b7eac2eb9c src/admin/web/
|
||||
0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg
|
||||
7cbdef9192a9dee1f8eac42b85f52b3190f7f6efae50004aa7ad116a910e4036 src/admin/web/file-logs.js
|
||||
3f0525ca1d4e088ccd4988b8a117b26a8cf8c12213b24c37081d41b68d2b0ff2 src/admin/web/host404.js
|
||||
64c9c8f4ce6821dbf84cd1aa0912d1b5f47421f592bebf2fdc2bff341e293dde src/admin/web/index.html
|
||||
7915a06cebb3dfa2c51833c326586920691ba4431b1f984429b039333f9c2a93 src/admin/web/integrations.js
|
||||
d9b226ebdd93b3e829f20e84dddb34f9bdba1ab01aefb33455102077ef0c94dd src/admin/web/index.html
|
||||
7979c490b7fcfcd8f5e52e99fcf7757d78509337a625341c98f62c6da50da374 src/admin/web/integrations.js
|
||||
7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json
|
||||
cbd41678eadd994dc5252628ee8ef9551fa9f7d8694ca5abd206240d9a96ad30 src/admin/web/login.html
|
||||
ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html
|
||||
c2e5f554810b8e34fb47361fb90a01073a2e332ee26d82e030956fad3ec1f83e src/admin/web/login.js
|
||||
734aeac4855f0913a84a82d7b5c17b37de4504b50a8701edeb775d6926929bce src/admin/web/management.js
|
||||
4481a592fcce9a2aa1db5e4a25619e19fd459c39039b86c0549dfc427eec1b45 src/admin/web/partials/overview-charts.html
|
||||
69296af507dbc8c211800f4841c3d7ad6a2490aad2e93ecb297246b7470e3be3 src/admin/web/partials/overview-metrics.html
|
||||
16d848a25f744e55d18757ce82cfd80e85bcc5b1777342c41e7bd732e13d8913 src/admin/web/management.js
|
||||
1f3d10e389c9c20e6eb019509fa6e82b50c6b43bbf988c1210a4d42bb73985d0 src/admin/web/partials/overview-charts.html
|
||||
95ba5fa72c04628f211ca216931a895ddf2059a791fa9d17c74812acd6c874d0 src/admin/web/partials/overview-metrics.html
|
||||
3928afce2ed6d5f2d3e29475dd29e4c3bd3c6df180ad5119beaff0c7a58e3b3b src/admin/web/prometheus-token.js
|
||||
90d9a0836662135b79fb6f183c4f3eff60f8a64392d6c5795ccf1d8ef6862263 src/admin/web/redirects.js
|
||||
2e891f34cad2a2950a47e529e15ed9dd41beedec71280b8035b19cfb91a5d317 src/admin/web/settings.js
|
||||
2d491fe9a547fe109dc5db6a74806d50b08c3daca15a6622c79c9fea33b10c63 src/admin/web/redirects.js
|
||||
76a01f590d49649dcb1f554c221290919b2a8438e6001737f3c096fa6daec74d src/admin/web/settings.js
|
||||
8eadbada619b15087783dcfa0e889a81f88e78034d084c5ab616f7912b835940 src/admin/web/status_200.html
|
||||
1ea78a6e5b5d813febf2359ecec7fde42dc1278531053e91428f4d72b8a1d62b src/admin/web/streams.js
|
||||
d290c048450655b3eeae7c6ec54a82d645d1965513694ab29fdf7eef796a1abd src/admin/web/traffic-panel.js
|
||||
c7e0ca45c19498d40ef6f4122de23f0e73094e905d39f798942f70d15b9cf86e src/admin/web/transform-panel.js
|
||||
ae0259cf32f53d69a22a640b1c34562018d4ffb3864494012de3a31c0bb4ac1e src/admin/web/traffic-panel.js
|
||||
59ffba513c543ce2dc0b7c33a3401474f8963874fa234a0a37e7e26344092508 src/admin/web/transform-panel.js
|
||||
87917b0388090f2b27ec6460be56fea96dc09b42735319e0a91330748848e288 src/admin/web/vhosts/core.js
|
||||
9bb38cdb8c0f49144d6058e007e375fb3b2e47359988029fe28addc6a900d0ca src/admin/web/vhosts/editor.js
|
||||
3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js
|
||||
@@ -265,7 +269,7 @@ dafce3a59a6007e59d7a4018fce96a14cd8e8cedb3ce77f02ee229a280c122d8 src/admin/web/
|
||||
2d40c2cb32d7365df0c9cd6c8cb6f0483c7a799786c648f4836a0d9740c6c5ef src/auth/files/mod.rs
|
||||
b2f948bcc3dbd24952c7b1b02d41d06757f49f0c38a78caf51f8f8a687d8480d src/auth/files/tests.rs
|
||||
50ef648351271d78310e00caa6d246e0009171ed036a3e4e1144737df8c064c2 src/auth/mod.rs
|
||||
25b9f78a7eee277902d375266bd0f023b79794bcdf646214fc161c5e6dab72d1 src/auth/store.rs
|
||||
cc4ddd57a264d12bffab131bf04b5cd22df75d38b61e21ce669f5a8a97b109ac src/auth/store.rs
|
||||
745226cabb007819370fc6aa680995a03a8a13fa057dacfab0fcc21d0c43bbe4 src/auth/tests.rs
|
||||
a4c14df927c22a7fa46023f25cfe48d3aa3c245bec97fce834999d9bcc8d75e1 src/auth_provider/choice.rs
|
||||
514e99e0d3da21abd633d53872234bc4d7d0178583ab291e53cf4b1802fd5337 src/auth_provider/errors.rs
|
||||
@@ -291,35 +295,35 @@ d789bf40cf9433e2fd16409d112210fe93154588b1ac9bddc9c7f78e1db14426 src/balance/po
|
||||
a361c341932ffd186c0b21356c91ab1fe8043f5020d40798266d15ae896a114e src/balance/tests.rs
|
||||
ae06d238b1451328c751a511476ef39c012f3a397393f939ca02f96ecd0119a6 src/basic_auth/mod.rs
|
||||
9a8858b7ff461a4d961ba701ca3ed6eaec15c3f7f05eef8e0e30edc63617605a src/basic_auth/tests.rs
|
||||
e35648537d5ac0bfb604997200d1be25652ee4e8c49bf8b720b68df087bd0249 src/cache/cache_regression_tests.rs
|
||||
90f26bcd36720076f874cd0a21230316b7303f68e23839e987cf51e13c23352b src/cache/cache_regression_tests.rs
|
||||
7def03ace07dc38a4806277d75b6ce673d33ddaaf1c4855fa0a3372be1cf9489 src/cache/cold.rs
|
||||
b75ff512a1c6344483e00d2c67578ceea6b5472c279da0246f3622daa68d7e16 src/cache/cold/cleanup.rs
|
||||
5fde9e9f77277d557372e4614264512804192bb51f3d2eae785988c17b2e7253 src/cache/cold/cold_tier_tests.rs
|
||||
3c3897980c31a69d96f9295689d1ae19f2190da758c69ee7a0541f4171288bb8 src/cache/cold/demotion.rs
|
||||
17b2a157b03f43f49ed05f1f3391aef025a453b748056c67229cb3ceaa53bb7a src/cache/cold/startup.rs
|
||||
83095bc93132f306c537b31ba929669fedac99af3c4f133d0533b5ed7ac4e6ed src/cache/cold/worker.rs
|
||||
237b535362af6fca4fc2a51decd1125243ce3068a840f95f9564fdfda8a187e0 src/cache/collapse.rs
|
||||
c6c54984cf3460e6227d40d8d6917d7ca5d809ac364c80effe354c64133c765d src/cache/collapse.rs
|
||||
346fdb40d85627b583a01fa17c65e45c822dc7216198cdeadbb3d07904286fa3 src/cache/dashboard.rs
|
||||
be3d80cd340edb47755190a668e2f2a2776940665f95ae7110893b706eb94faa src/cache/dashboard_tests.rs
|
||||
5b0a3dec613fa22a38237618ddaeeca9df5c79acb499bfd78a31d9e7ce104d61 src/cache/fill.rs
|
||||
847c660e6cb7d752f9dac2807c5045a000172c25b0e437cbade06ad7b101dcba src/cache/fill.rs
|
||||
675d18afb53f25c56cba49bbb431fa39ecd9d7bdd192c7b39b0698225de7a2a2 src/cache/invalidation.rs
|
||||
c1357a13658e1ed5158084d3a41ba9ea906512774a5863ce9c56cb508d3fa6c8 src/cache/invalidation/ban.rs
|
||||
bbd9f372648d89b5e14d5b58029582d37f66a89752caf2c14eb1cbf8f24bb7a0 src/cache/invalidation/http_invalidation_tests.rs
|
||||
6223eaea3f061b111330cc26b28d85b9b239bef30328025f2ef337291e22a445 src/cache/invalidation/invalidate.rs
|
||||
1f3c731b57e98b76654446068167f3f5d1aad88259633ea871efdf0d790a6ebc src/cache/lifecycle.rs
|
||||
c1ee3d13b373672c53b5c9ebfe5c4b66b89f2f2913c328defd5cf6502f96a654 src/cache/lifecycle.rs
|
||||
bd831807ca4720b3a41a6ea1d9a6c0ed2d935225e2dacbd9313be064f2e4a20e src/cache/lookup.rs
|
||||
9b9a9e82e162699437798ee016e6dd87673ba8157935ac22b7bf6f5df551f841 src/cache/lookup/hot.rs
|
||||
c2e258da25fbf6df7da3de5a80a04d74e85c03ab22c175d7c9a6340b8ea1f1b5 src/cache/lookup/hot.rs
|
||||
4148106b9baf70e41eeba24233b1edbe8dd6f927c11f2c7647e89fbbfb60555e src/cache/lookup/hot_hit_034_tests.rs
|
||||
e9c6ab0c2be9f96573f826e6a1b9e4c2b8b526f779e72e95a6463ae07e45ab55 src/cache/lookup/insert.rs
|
||||
18b9614fdeb7d9916c9f7b394bdc7f78737e5a7c0249763a47d8dd88bd4d52b8 src/cache/lookup/tiered.rs
|
||||
7f02dc8eeb6123cb22307b76985b606afda2d87b7f845894685cfe4a9aee8b2a src/cache/lookup/tiered.rs
|
||||
639d5be6258699ec7e9f260ec33bd2c366203b6655bf0e98f30517c2e12ceeeb src/cache/mod.rs
|
||||
0c8b0d550e94d4474dcdf991aa0340228dc5f2f904f39350e6e666a16f16fe87 src/cache/model.rs
|
||||
44b1da391c0ff51ffba6ae43ddfbadc171c240ec74c5bde630d3c5993b6ac15b src/cache/model/cache.rs
|
||||
b96e30ef2b12ad7647915457f087a4d11b6141847bc5e971a75c2739c88c3d8c src/cache/model/cache.rs
|
||||
0ec4f6d0adea1ed80a3ca17c68c9c85502491da2904d9d690b4169ab9b025b21 src/cache/model/cold_metadata.rs
|
||||
d4409e5137bf29bdbfc11f4ec3444e3ae408d6057304b29f50d885affb441d9b src/cache/model/entry.rs
|
||||
f52123b588205ae96c7cded93569e99a1b4db4b361e1f7a91fc703afa6b6f6e5 src/cache/model/entry.rs
|
||||
ff1c3a1a3bc0d26218dcc943ef951c2a212c180bbf6e4bf1c542ffbf12a9f150 src/cache/model/http_invalidation.rs
|
||||
ee9508498d420a726abee1d12ca21fd5117c1908ff53c2ce29f01de4380f26ac src/cache/model/maintenance.rs
|
||||
f3859df02872b6a99b7aee38c34d7b4c48966e4e32df827844507e44d68bd6bb src/cache/model/settings.rs
|
||||
723c6f0580db70b1ef40269b28a4aadc89f024b25be00afe73a971950663d252 src/cache/model/settings.rs
|
||||
14f3f8ae5252a2dc13fcf9556523ffb945b77ee92a5fb4939cd27e113fc61660 src/cache/model/views.rs
|
||||
e26dce02df9c043329ca164fed215d271781bce8fb03240f528331bf3df6b9d7 src/cache/policy.rs
|
||||
70c255e15f2b8c030988a2263b0e07b5c16e7e26770c72becbcec6da4550fcd9 src/cache/policy/request.rs
|
||||
@@ -343,7 +347,7 @@ cc75698be2828000e88f2c482bd26f2fa4050e3432bec1b5a581dca17fef4a37 src/config/mod
|
||||
dd9a6ad8f58e0cdd1ae74f3f972fee0ac14383cd8b8f518403b9a36c169f35bd src/config/snapshot.rs
|
||||
477cddaa1e1c0b9b605a2f550971a04cf30287519cba70cfbb2e1860e3a93ff2 src/config/tests.rs
|
||||
f35de0ee1516ece6bbfd2b2a7db7d1e0f5048b0ec47cf2a3765dffb799abfd93 src/config/transport_tests.rs
|
||||
e0f46d885ed81ce306a110560cdd2c217dadde054986d89fcec835ebf6939d65 src/db.rs
|
||||
a09f361d70510d6226f4dd6785e649c3dc01ccafc70a4c8b0dcd098e224129b7 src/db.rs
|
||||
c290d0cb02dfa5d2c60ecabac1cfb20c8884e3d14cca1944906c6d8e677f1784 src/db/api_tokens.rs
|
||||
892ec0e5985700cca399c861197f6c9d2f1c823d8d95b88abac9d27ae15a069a src/db/certificate_api.rs
|
||||
5491dd7bb9b3fceac97c4dea63aba6d5c7abcb0fbd06e36ae986e00c79bc07d0 src/db/dashboard_presets.rs
|
||||
@@ -473,7 +477,7 @@ b0c4a46b40b09794fd8a037afca380ee3b95941bf75a0e1102a4e520a4bd8be3 src/secret_sto
|
||||
5f6a59c6085c1250a93a70020661d1e8174d3b600b494d16f8eaf7941ee3bb99 src/server/serve/mod.rs
|
||||
048a05a46108f50bef7da50b0c03b752d76e586b411de8ca3f55313bbdb08aee src/server/serve/tests.rs
|
||||
669ea1041c103cb952f7a516363c8fe7baf51622f721aabdd57015e0e0279530 src/server/tls_runtime.rs
|
||||
c03472e8d937bb6f851593f4e0d347dec6b66e85e577c87a09eee0acd990bca1 src/settings.rs
|
||||
38abd50db3c5742ee6514654bcfa0b854fdf6e2a29e034ac2e5d36c4b95b00ae src/settings.rs
|
||||
b2e2924047019b1ada59c58a4060476151c99be12c0b4092f2cfd201c0756255 src/settings/public_origin.rs
|
||||
c599d1cdca84ac18da7e7cdf6e2d1556d4df770481a0607edb96f6068cc051e2 src/settings/tests.rs
|
||||
2ad7888b263e1dd9f0bd588dc35590c9eb232f8fbacd10ea7554cb55b4dbd25b src/stream.rs
|
||||
@@ -498,7 +502,7 @@ f02bb2775e662b2d75810f631ad3da4e0b56a64ae72b36c0edeae37e979b0fb5 src/tls/server
|
||||
ce51a3280331d67c8406d2c5bc156ac0b492afa58e1f328bcda76db0720a6a9d src/tls/types.rs
|
||||
a897c48e3528565fef8d4e32f0c3c078adfb68655c80e1af011f44a8bcfac6f6 src/traffic/mod.rs
|
||||
bd62b4ecdcf831d183c7720766a11703c8612d614e3abf38d2bff28df34710fd src/traffic/tests.rs
|
||||
e373c7d2630dd209c7a7b7c00c20f80030d83c9e388968656d7323dbd2a11b46 src/transform/apply.rs
|
||||
bfbbaa3b949ae946fa929bfbae3fd9a25f2ce792abbd0ed370ccf5683250bc4d src/transform/apply.rs
|
||||
ae30a984fa39d5c45a676effbc880c923078ba8120adff1bff10e108350b31b5 src/transform/compile.rs
|
||||
ffc0740462e5566a96912ab3089f18fc28f1c093ca65eec860fc6ea801fd907d src/transform/css.rs
|
||||
2b9d5c11d4c02b4a3ad3b9bb1a18c63693f245b854084f5eba16595df47b47f8 src/transform/html/mod.rs
|
||||
@@ -553,6 +557,10 @@ e5f5fbe702f66bfcbcbc1d1f3cd3d89bdbb929bb86aed94868a2a06a4b9e59e3 src/web_server
|
||||
b791762b4ab7a43c3be19df84e523faf3dfb4df055f66d02178f93edb60d2204 src/web_server/serve.rs
|
||||
714418c86ab241020a561fcf662a8fe324a6a70cc2fd3a313c56d7939c14b9e8 src/web_server/tests.rs
|
||||
f00743af2cf4a5952caef7a1dcf68e7817b5599a252a9973e1c22045517c0b0e tests/fixtures/argon2id.json
|
||||
2f7f0453c817dc9e3d4ab61296af5821ff3e0826ad70511714afd7486c6105bc tests/panel_icons_browser.py
|
||||
5db3215d2e43e9dc9348a42b2351b7c605991ed8757f598de539f8f84e3f9593 tests/panel_icons_contract.js
|
||||
01af3008be27fabb486c141c67099af104f2725cc56f4c656aea9741a3c150cd tests/panel_interface_contract.py
|
||||
24a815a280de87a7ccec6f4d212d1468022c844e9e7d0b113349ff26bde5fc52 tests/panel_refresh_contract.js
|
||||
e24a0f84f1bfc46964df865ac387d651f7b384d781cbc8f3a9a5b0b60f3d69ca tests/vhost_auth_selection.js
|
||||
eca68a07c2b1e45fdb8f512294f5a432db3ae5a6aec8fb200b47f155cd9a31d6 tools/README.md
|
||||
7c30c280d0b0a8bf855eeffab583ca34dc161255f7ef6124148aa979c17c26d3 tools/dev/memory_load.py
|
||||
|
||||
+6
-3
@@ -20,21 +20,24 @@ The current bundled `src/admin/openapi.json` declares these operations (among ot
|
||||
| `POST /api/config/geoip/update` | Run a GeoIP download/check/reload immediately using already-saved GeoIP settings; does not change revision. |
|
||||
| `GET /api/config/history` · `POST /api/config/history/restore` | Review/restore retained configuration snapshots. |
|
||||
| `GET /api/status` · `GET /api/backends` | Operational status and backend observations. |
|
||||
| `GET /api/cache` · `POST /api/cache/purge` · `POST /api/cache/invalidate` | Cache observations and authenticated invalidation. |
|
||||
| `GET /api/cache` · `POST /api/cache/purge` · `POST /api/cache/invalidate` | Cache observations and authenticated invalidation. `GET` supports the lightweight `view=live` polling view. |
|
||||
| `GET /api/transform` | Transform observations and resource usage. Supports the lightweight `view=live` polling view. |
|
||||
| `GET /api/logs` · `GET /api/live-logs` | Recent and streaming request logs. |
|
||||
| `GET /api/file-logs` · `GET /api/file-logs/query` | Stored-log exploration. |
|
||||
| `GET /api/traffic` · `GET /api/system-info` | Traffic and system observations. |
|
||||
| `GET /api/traffic` · `GET /api/system-info` | Traffic and system observations. Traffic supports the lightweight `view=live` polling view. |
|
||||
| `GET /api/metrics/json` · `GET /api/metrics/summary` | Full JSON snapshot (includes all Prometheus samples and `summary`) or compact computed `summary` only, both pull-only. [Monitoring](MONITORING.md). |
|
||||
| `GET /api/docker` · `POST /api/docker/refresh` | Docker-agent observation and refresh. |
|
||||
| `GET /api/certificates` · `POST /api/certificates/upload` | Certificate inventory/import. |
|
||||
| `POST /api/certificates/inspect` | Read DNS SAN coverage from a managed/external public PEM path for the editor; admin browser session only. |
|
||||
| `GET /api/acme` · `POST /api/acme/issue` · `POST /api/acme/renew` | Managed certificate jobs. |
|
||||
| `GET/PUT /api/preferences` | Personal UI settings. |
|
||||
| `GET/PUT /api/preferences` | Personal UI settings, including theme/layout and optional `interface_icons` (default `false`). |
|
||||
| `GET /api/dashboard-presets` and named preset operations | Saved Overview presets. |
|
||||
| `GET /docs/openapi.json` | Protected machine-readable API specification. |
|
||||
|
||||
Some paths have additional DELETE/PATCH operations, job-status resources, query parameters or restricted actions. Use OpenAPI for the **actual fields/methods**, not guesses based on a table. `GET /metrics` here is not a replacement for the separate Prometheus exporter.
|
||||
|
||||
For browser polling, `GET /api/cache?view=live`, `GET /api/transform?view=live` and `GET /api/traffic?view=live` omit static response members that do not need to be retransmitted on every interval. Their `revision` identifies the active configuration; when it changes, clients should fetch the corresponding endpoint without `view=live` and refresh their cached static fields. Requests without `view=live` remain the complete compatibility form. Cache live responses contain metrics/dashboard/bans, Transform live responses contain resources/metrics, and Traffic live responses retain current settings/GeoIP/analytics while omitting the static Vhost list. Unknown `view` values are rejected.
|
||||
|
||||
Certificate inspection accepts `{ "cert_file": "filename.pem" }` for a managed file or an absolute external path and returns `{ "cert_file": "...", "covered_hosts": ["example.com"] }`. It applies the existing certificate-file trust and size checks and reads no private key. It makes no configuration or permission changes. This POST requires the signed-in administrator's normal Origin, request-marker and CSRF checks; general RO/RW API tokens and certificate-only credentials cannot call it.
|
||||
|
||||
## Access and authentication
|
||||
|
||||
+17
-1
@@ -25,12 +25,28 @@ Optional quick-health tiles (since 0.35.2, hidden by default; enable them in the
|
||||
|
||||
Enabled tiles are added at the end of the Overview, so the standard block layout does not change.
|
||||
|
||||
The **Remember choice** control next to the history sample count shows a status only when the current choice is temporary (not saved) or briefly after saving.
|
||||
The Overview history sample count is saved in the browser immediately when the selection changes; no separate confirmation button is required.
|
||||
|
||||
The sidebar application-status indicator runs a lightweight self-check from the live status already used by the dashboard. Green means healthy, amber means attention is needed, and red means a problem was detected; click it to see API, listener, backend and logging details.
|
||||
|
||||
The unlocked Overview layout exposes a single **Save and lock** action (plus Cancel), removing the redundant lock-and-save button.
|
||||
|
||||
### Arranging blocks
|
||||
|
||||
After **Unlock layout**, every block shows a compact toolbar: the **⠿** handle, width **− / +**, and **×** to hide it (wider blocks also show **← / →**).
|
||||
|
||||
- **Drag:** grab the ⠿ handle (mouse, pen or touch). The block lifts and follows the pointer, and a dashed frame of the same width shows exactly where it will land; neighbouring blocks glide aside instead of jumping. Release to drop, or press **Esc** to return the block to its previous place. Dragging near the top or bottom edge of the window scrolls the page.
|
||||
- **Keyboard:** focus the ⠿ handle and use the arrow keys to move the block one position.
|
||||
- **Fill gaps:** a saved custom layout keeps blocks in exactly the order you arranged them, so a wide block that does not fit at the end of a row leaves a visible gap instead of other blocks silently moving into it. Use **Fill gaps** to pack blocks into empty space once; nothing is stored until **Save and lock**.
|
||||
|
||||
**Dashboard Presets** supports up to **16 named layouts per administrator**. Save, load, rename, overwrite and delete presets; a factory layout can be restored. Presets preserve the dashboard arrangement, not the live traffic values. Interface theme, scale and other display settings are also account-scoped and do not alter proxy routing or rewrite shared configuration.
|
||||
|
||||
### SVG interface icons
|
||||
|
||||
Under **Settings → Appearance → Interface**, enable **Show SVG interface icons** to add semantic line icons to the main navigation, action buttons, tabs and dialogs. The preference is stored per administrator as `interface_icons: true|false` in `/api/preferences` and is **off by default** for both new and upgraded accounts.
|
||||
|
||||
The icons are inline SVGs bundled with RustProxy; no web font, CDN or external icon library is loaded. They use `currentColor`, so the active theme, danger/primary states and disabled-state colors remain authoritative. Text labels and existing ARIA labels remain the source of accessible meaning; the SVGs are `aria-hidden`. Dynamic controls are reclassified when their state changes, so actions such as sort direction, save/loading, show/hide and refresh keep a matching icon. Turning the option off removes the injected icons and restores the original text-only presentation without restarting the panel.
|
||||
|
||||
## Editing configuration safely
|
||||
|
||||
1. Open the relevant workspace and inspect existing state before editing.
|
||||
|
||||
+3
-1
@@ -76,11 +76,12 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
|
||||
## Monitoring and logs
|
||||
|
||||
- Overview dashboard with requests per second, bandwidth, status codes, error share, cache hit ratio, protocol mix, system load, backend health, requests rejected by limits and nearest certificate expiry.
|
||||
- Customizable dashboard layouts and saved presets.
|
||||
- Customizable dashboard layouts (drag-and-drop with a live drop placeholder, keyboard moves, per-block width, explicit gap filling) and saved presets.
|
||||
- Per-Vhost, per-backend, per-Web-Service and per-Stream statistics.
|
||||
- Live request log in the browser and in the terminal (`--livelogs`).
|
||||
- Stored JSON access logs with search syntax, per-Vhost log files and an error log.
|
||||
- Prometheus exporter with token/CIDR protection, JSON metrics and a compact summary endpoint.
|
||||
- Lightweight revision-aware polling views for Cache, Traffic and Transform keep the administration panel responsive without repeatedly transferring static configuration.
|
||||
- Grafana dashboard and Nagios checks included.
|
||||
|
||||

|
||||
@@ -94,6 +95,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
|
||||
- Nginx Proxy Manager import with a dry-run plan.
|
||||
- Managed install/update scripts with rollback, DEB/RPM packages, Docker image and an OPNsense plugin.
|
||||
- Panel in English and Polish, light and dark themes, adjustable density and corner style.
|
||||
- Optional account-scoped semantic SVG icons for navigation, actions, tabs and dialogs; off by default.
|
||||
|
||||
## Administration and API
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ RustProxy has several independent logging paths. Choose the one matching the que
|
||||
|
||||
## Live Logs
|
||||
|
||||
The administration panel does not fetch `/api/logs` while Live Logs is closed. Opening or docking the Live Logs window starts the bounded live snapshot refresh; closing it stops that polling. Pausing or expanding the history buffer also suspends periodic `/api/logs` reads until live viewing resumes. The main `/api/events` status stream is kept independent by using `logs=false` in the panel.
|
||||
|
||||
Use **Logs → Live Logs** in the authenticated panel, or locally:
|
||||
|
||||
```bash
|
||||
|
||||
+10
-1
@@ -70,7 +70,16 @@ Choose mimalloc only when all of these apply:
|
||||
- throughput under that turnover matters more than memory;
|
||||
- the server has at least 30% RAM headroom above the configured HOT cache size.
|
||||
|
||||
Otherwise keep the default. The system allocator returns memory from evicted cache entries to the operating system right away, so process memory stays close to the configured cache size.
|
||||
Otherwise keep the default. The system allocator returns memory from evicted cache entries to the operating system shortly after eviction, so process memory stays close to the configured cache size.
|
||||
|
||||
**Since 0.35.4** the default build returns freed memory to the operating system at most four times per second (plus the regular cache maintenance pass) instead of after every eviction. Most of the system allocator's slowdown under turnover came from these repeated trims, so the gap to mimalloc is now much smaller. Measured on the same 2 vCPU machine, one core, 256 MiB HOT cache filled with 100 KiB objects and every request a new URL:
|
||||
|
||||
| Build | RSS after load | Throughput under cache turnover |
|
||||
|---|---:|---:|
|
||||
| 0.35.3, system allocator | 595 MiB | 2,900 req/s |
|
||||
| 0.35.4, system allocator | 639 MiB (+7%) | 7,000 req/s (2.4×) |
|
||||
|
||||
The mimalloc rows above were measured with 0.35.2 and a different object mix; re-measure on your own workload before choosing the optional build.
|
||||
|
||||
## Production tuning
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ Guides for operating RustProxy: installation, publishing services, security, cer
|
||||
- [Backup and recovery](BACKUP.md) — encrypted backups, restore and the Secret Store.
|
||||
- [Migration](MIGRATION.md) — upgrades and Nginx Proxy Manager import.
|
||||
- [Docker discovery](DOCKER_DISCOVERY.md) — Docker agent and generated Vhosts.
|
||||
- [Administration API](API.md) — authentication, tokens, endpoints and configuration sections.
|
||||
- [Administration API](API.md) — authentication, tokens, endpoints, lightweight polling views and configuration sections.
|
||||
|
||||
## Integrations
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ A simple mechanism for automatically sending a certificate generated by `os-acme
|
||||
## Files
|
||||
|
||||
- `opnsense-rustproxy-cert-deploy.sh` - sends the certificate and private key to RustProxy.
|
||||
- `rustproxy-acme.conf` - connection settings, API token, and certificate file paths.
|
||||
- `rustproxy-acme.conf.example` - example connection settings, API token, and certificate file paths.
|
||||
- `actions_rustproxy_cert.conf` - optional `configd` action that allows the script to be executed from Cron in OPNsense.
|
||||
|
||||
## 1. Installation
|
||||
@@ -50,13 +50,15 @@ KEY_FILE='/path/to/private.key'
|
||||
|
||||
## 3. RustProxy API
|
||||
|
||||
Create a certificate API key in RustProxy and enter its values in the configuration:
|
||||
Create a certificate API key in **Settings -> Certificate API** and enter its values in the configuration:
|
||||
|
||||
```text
|
||||
RUSTPROXY_KEY_ID
|
||||
RUSTPROXY_TOKEN
|
||||
```
|
||||
|
||||
The credential must explicitly allow `CERTIFICATE_ID` and **Also allow deploy** (`allow_deploy`) must be enabled. A reload-only credential will be rejected with HTTP 403.
|
||||
|
||||
The script sends the certificate to:
|
||||
|
||||
```text
|
||||
@@ -88,7 +90,7 @@ cp actions_rustproxy_cert.conf /usr/local/opnsense/service/conf/actions.d/
|
||||
service configd restart
|
||||
```
|
||||
|
||||
Then go to **System -> Settings -> Cron** and add a scheduled execution of the `Deploy ACME certificate to RustProxy` action.
|
||||
Verify the action first with `configctl rustproxy_cert deploy`. Then go to **System -> Settings -> Cron** and add a scheduled execution of the `Deploy ACME certificate to RustProxy` action.
|
||||
|
||||
The script deliberately reconciles on every run instead of trusting a local cache. The server is the source of truth: an identical RustProxy-owned certificate generation is a no-op, a missing id is created, and changed material is rotated atomically. This also repairs drift when a certificate entry or generation was removed outside OPNsense.
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
[deploy]
|
||||
command:/usr/local/sbin/opnsense-rustproxy-cert-deploy.sh
|
||||
parameters:
|
||||
type:script_output
|
||||
message:deploy ACME certificate to RustProxy
|
||||
description:Deploy ACME certificate to RustProxy
|
||||
@@ -0,0 +1,21 @@
|
||||
# RustProxy administration endpoint reachable from OPNsense.
|
||||
RUSTPROXY_URL='https://rustproxy.example.lan:9090'
|
||||
|
||||
# Certificate API credential created in RustProxy Settings -> Certificate API.
|
||||
# The credential must allow this CERTIFICATE_ID and have deploy permission enabled.
|
||||
RUSTPROXY_KEY_ID='opnsense-acme'
|
||||
RUSTPROXY_TOKEN='REPLACE_WITH_CERTIFICATE_API_TOKEN'
|
||||
|
||||
# Stable RustProxy certificate id to create/update.
|
||||
CERTIFICATE_ID='shared-cert'
|
||||
|
||||
# os-acme-client certificate material. Replace CERT_UUID with the actual UUID.
|
||||
CERT_FILE='/var/etc/acme-client/certs/CERT_UUID/fullchain.pem'
|
||||
KEY_FILE='/var/etc/acme-client/keys/CERT_UUID/private.key'
|
||||
|
||||
# Optional: trust a private CA used by the RustProxy administration listener.
|
||||
# RUSTPROXY_CACERT='/usr/local/etc/ssl/rustproxy-ca.pem'
|
||||
|
||||
# Optional: connect to a fixed address while keeping TLS verification for the URL hostname.
|
||||
# Format: hostname:port:address
|
||||
# RUSTPROXY_RESOLVE='rustproxy.example.lan:9090:192.0.2.20'
|
||||
@@ -77,10 +77,10 @@ ENV_FILE=integrations/routeros-oci-build/.env \
|
||||
bash integrations/routeros-oci-build/build-routeros-oci.sh push
|
||||
```
|
||||
|
||||
For example, with RustProxy version `0.35.3` and the defaults this publishes:
|
||||
For example, with RustProxy version `0.36.1` and the defaults this publishes:
|
||||
|
||||
```text
|
||||
zot.example.net/network/rustproxy:0.35.3
|
||||
zot.example.net/network/rustproxy:0.36.1
|
||||
zot.example.net/network/rustproxy:latest
|
||||
zot.example.net/network/rustproxy:routeros
|
||||
```
|
||||
|
||||
+41
-13
@@ -2402,6 +2402,8 @@
|
||||
"buttonStyleNormal": "Normal",
|
||||
"buttonStyleCompact": "Compact",
|
||||
"buttonStyleHelp": "Normal uses the refreshed controls; Compact restores the smaller source-style buttons across all actions and dialog tabs.",
|
||||
"interfaceIcons": "Show SVG interface icons",
|
||||
"interfaceIconsHelp": "Adds semantic SVG icons to navigation, actions, tabs and dialogs.",
|
||||
"entityEnableHint": "Controls whether this item is active.",
|
||||
"setupCommandExample": "Standard service installation example:",
|
||||
"certificateRuntimeTitle": "ACME runtime",
|
||||
@@ -2641,7 +2643,7 @@
|
||||
"backendWidgetInFlight": "In flight",
|
||||
"backendWidgetErrorsRate": "Recent errors/s",
|
||||
"backendWidgetErrorPercent": "Recent failed requests",
|
||||
"backendWidgetProbeCount": "Probed healthy origins",
|
||||
"backendWidgetProbeCount": "Health Origins",
|
||||
"backendWidgetH2c": "H2C origins",
|
||||
"backendWidgetModeUnknown": "Unknown",
|
||||
"vhProtocolCompatibilityWarning": "Compatibility mode: saved HTTP/2 HTTPS origins retain the previous H2/H1 TLS fallback. Choose H2 only if HTTP/1.1 must be rejected.",
|
||||
@@ -2749,7 +2751,7 @@
|
||||
"overviewLayoutTypeFilter": "Filter blocks by type",
|
||||
"overviewLayoutUnlock": "Unlock layout",
|
||||
"overviewLayoutLock": "Lock and save",
|
||||
"overviewLayoutInlineHint": "Layout unlocked: reorder blocks within groups of similar size, hide with ×, then save or cancel. The grid aligns card heights automatically.",
|
||||
"overviewLayoutInlineHint": "Layout unlocked: grab a block by its ⠿ handle and drag it — the dashed frame shows where it will land (Esc cancels). Resize with − / +; arrow keys on the handle move a block from the keyboard. “Fill gaps” packs blocks into empty space once.",
|
||||
"overviewLayoutInlineDrag": "Drag to move",
|
||||
"overviewLayoutInlineSave": "Save and lock",
|
||||
"overviewLayoutInlineCancel": "Cancel changes",
|
||||
@@ -2840,11 +2842,35 @@
|
||||
"overviewTransformErrors": "Errors",
|
||||
"overviewMeterNoLimit": "No configured limit",
|
||||
"overviewCacheHitsMisses": "HIT {hits}, MISS {misses}",
|
||||
"overviewSamplesRemember": "Remember choice",
|
||||
"overviewSamplesSaved": "Saved default",
|
||||
"overviewSamplesTemporary": "For this visit only",
|
||||
"overviewSamplesStorageUnavailable": "Could not save in this browser",
|
||||
"overviewSamplesTitle": "Overview chart samples",
|
||||
"appHealthTitle": "Application status",
|
||||
"appHealthSelfCheck": "SELF-CHECK",
|
||||
"appHealthChecking": "Checking application status",
|
||||
"appHealthOk": "All systems operational",
|
||||
"appHealthWarning": "Attention required",
|
||||
"appHealthError": "Problem detected",
|
||||
"appHealthSidebarChecking": "CHECKING",
|
||||
"appHealthSidebarOk": "APPLICATION OK",
|
||||
"appHealthSidebarWarning": "APPLICATION WARNING",
|
||||
"appHealthSidebarError": "APPLICATION ERROR",
|
||||
"appHealthUpdated": "Updated {time}",
|
||||
"appHealthNoStatus": "No current status",
|
||||
"appHealthApi": "API",
|
||||
"appHealthApiOk": "Live application status is responding.",
|
||||
"appHealthApiError": "No current status from the application.",
|
||||
"appHealthListeners": "Listeners",
|
||||
"appHealthListenersOk": "Active listeners match the desired configuration.",
|
||||
"appHealthListenersRestart": "Listener changes are pending; restart RustProxy to apply them.",
|
||||
"appHealthBackends": "Backends",
|
||||
"appHealthBackendsNone": "No backend pools are configured.",
|
||||
"appHealthBackendsOk": "All active backend pools are ready.",
|
||||
"appHealthBackendsWarning": "{down} down, {checking} checking: {members}.",
|
||||
"appHealthBackendsError": "Unavailable pools: {pools}.",
|
||||
"appHealthBackendsAffected": "Affected backends: {members}.",
|
||||
"appHealthLogging": "Logging",
|
||||
"appHealthLoggingOk": "Logging pipeline reports no queue drops or write/send errors.",
|
||||
"appHealthLoggingWarning": "{dropped} queued entries dropped, {errors} write/send errors since start.",
|
||||
"webMetricStatus": "WWW HTTP status",
|
||||
"webMetricStatusHelp": "Completed Web Server status classes, all-time since reload.",
|
||||
"webMetricKind": "Static vs PHP",
|
||||
@@ -2964,11 +2990,13 @@
|
||||
"certificateInspectKept": "Certificate read; your SNI names were preserved.",
|
||||
"certificateInspectNoNames": "Certificate contains no DNS SAN names.",
|
||||
"certificateInspectFailed": "Cannot read certificate. Check the file and its permissions, then read again.",
|
||||
"pathPermissionsOptions": "Options and help"
|
||||
},
|
||||
"overviewLayoutNarrow": "Decrease card width",
|
||||
"overviewLayoutWiden": "Increase card width",
|
||||
"overviewLayoutWidth": "Card width in 12-column grid",
|
||||
"overviewLayoutInlineHint": "Layout unlocked: move any card anywhere; use − / + to resize (2, 3, 4, 6 or 12 columns). Save and lock or cancel to revert.",
|
||||
"dashboardPresetsConflict": "Preset already exists or was removed. Refresh and try again."
|
||||
}
|
||||
"pathPermissionsOptions": "Options and help",
|
||||
"overviewLayoutNarrow": "Decrease card width",
|
||||
"overviewLayoutWiden": "Increase card width",
|
||||
"overviewLayoutWidth": "Card width in 12-column grid",
|
||||
"dashboardPresetsConflict": "Preset already exists or was removed. Refresh and try again.",
|
||||
"overviewLayoutInlineDragging": "Dragging: drop the block on the dashed frame. Esc restores its previous position.",
|
||||
"overviewLayoutInlineCompact": "Fill gaps",
|
||||
"overviewLayoutInlineCompactHint": "Move blocks into empty grid space once (you can still cancel before saving)"
|
||||
}
|
||||
}
|
||||
+40
-12
@@ -2402,6 +2402,8 @@
|
||||
"buttonStyleNormal": "Normalny",
|
||||
"buttonStyleCompact": "Kompaktowy",
|
||||
"buttonStyleHelp": "Normalny używa odświeżonych przycisków; Kompaktowy przywraca mniejsze przyciski ze źródłowego interfejsu we wszystkich akcjach i zakładkach modali.",
|
||||
"interfaceIcons": "Pokaż ikony SVG interfejsu",
|
||||
"interfaceIconsHelp": "Dodaje semantyczne ikony SVG do nawigacji, akcji, zakładek i okien dialogowych.",
|
||||
"entityEnableHint": "Określa, czy ten element jest aktywny.",
|
||||
"setupCommandExample": "Przykład dla standardowej instalacji usługi:",
|
||||
"certificateRuntimeTitle": "Środowisko ACME",
|
||||
@@ -2641,7 +2643,7 @@
|
||||
"backendWidgetInFlight": "W toku",
|
||||
"backendWidgetErrorsRate": "Błędy/s",
|
||||
"backendWidgetErrorPercent": "Błędne żądania w ostatnim okresie",
|
||||
"backendWidgetProbeCount": "Zdrowe backendy z sondami",
|
||||
"backendWidgetProbeCount": "Zdrowe źródła",
|
||||
"backendWidgetH2c": "Backendy h2c",
|
||||
"backendWidgetModeUnknown": "Nieznane",
|
||||
"vhProtocolCompatibilityWarning": "Tryb zgodności: zapisane wcześniej backendy HTTPS HTTP/2 zachowują fallback TLS H2/H1. Wybierz „Tylko H2”, jeżeli HTTP/1.1 ma być odrzucony.",
|
||||
@@ -2749,7 +2751,7 @@
|
||||
"overviewLayoutTypeFilter": "Filtruj bloki według typu",
|
||||
"overviewLayoutUnlock": "Odblokuj układ",
|
||||
"overviewLayoutLock": "Zablokuj i zapisz",
|
||||
"overviewLayoutInlineHint": "Układ odblokowany: przesuwaj bloki w obrębie grup podobnych rozmiarów, ukrywaj przyciskiem ×, a potem zapisz lub anuluj. Siatka automatycznie wyrównuje wysokości.",
|
||||
"overviewLayoutInlineHint": "Układ odblokowany: chwyć blok za uchwyt ⠿ i przeciągnij — przerywana ramka pokazuje, gdzie wyląduje (Esc anuluje). Szerokość zmieniasz przyciskami − / +, strzałki na uchwycie przesuwają blok z klawiatury. „Uzupełnij luki” jednorazowo dosuwa bloki w puste miejsca.",
|
||||
"overviewLayoutInlineDrag": "Przeciągnij, aby przesunąć",
|
||||
"overviewLayoutInlineSave": "Zapisz i zablokuj",
|
||||
"overviewLayoutInlineCancel": "Anuluj zmiany",
|
||||
@@ -2840,11 +2842,35 @@
|
||||
"overviewTransformErrors": "Błędy",
|
||||
"overviewMeterNoLimit": "Brak skonfigurowanego limitu",
|
||||
"overviewCacheHitsMisses": "HIT {hits}, MISS {misses}",
|
||||
"overviewSamplesRemember": "Zapamiętaj wybór",
|
||||
"overviewSamplesSaved": "Ustawienie zapisane",
|
||||
"overviewSamplesTemporary": "Tylko do odświeżenia strony",
|
||||
"overviewSamplesStorageUnavailable": "Nie można zapisać w przeglądarce",
|
||||
"overviewSamplesTitle": "Próbki wykresów na stronie głównej",
|
||||
"appHealthTitle": "Status aplikacji",
|
||||
"appHealthSelfCheck": "SELF-CHECK",
|
||||
"appHealthChecking": "Sprawdzanie statusu aplikacji",
|
||||
"appHealthOk": "Wszystkie systemy działają",
|
||||
"appHealthWarning": "Wymaga uwagi",
|
||||
"appHealthError": "Wykryto problem",
|
||||
"appHealthSidebarChecking": "SPRAWDZANIE",
|
||||
"appHealthSidebarOk": "SYSTEM OK",
|
||||
"appHealthSidebarWarning": "APLIKACJA: UWAGA",
|
||||
"appHealthSidebarError": "APLIKACJA: BŁĄD",
|
||||
"appHealthUpdated": "Aktualizacja: {time}",
|
||||
"appHealthNoStatus": "Brak aktualnego statusu",
|
||||
"appHealthApi": "API",
|
||||
"appHealthApiOk": "Status live aplikacji odpowiada.",
|
||||
"appHealthApiError": "Brak aktualnego statusu aplikacji.",
|
||||
"appHealthListeners": "Listenery",
|
||||
"appHealthListenersOk": "Aktywne listenery są zgodne z żądaną konfiguracją.",
|
||||
"appHealthListenersRestart": "Zmiany listenerów czekają na zastosowanie; uruchom RustProxy ponownie.",
|
||||
"appHealthBackends": "Backendy",
|
||||
"appHealthBackendsNone": "Brak skonfigurowanych pul backendów.",
|
||||
"appHealthBackendsOk": "Wszystkie aktywne pule backendów są gotowe.",
|
||||
"appHealthBackendsWarning": "Niedostępne: {down}, sprawdzane: {checking}: {members}.",
|
||||
"appHealthBackendsError": "Niedostępne pule: {pools}.",
|
||||
"appHealthBackendsAffected": "Dotyczy backendów: {members}.",
|
||||
"appHealthLogging": "Logowanie",
|
||||
"appHealthLoggingOk": "Kolejki logowania bez odrzuceń i błędów zapisu/wysyłki.",
|
||||
"appHealthLoggingWarning": "Odrzucone wpisy kolejki: {dropped}, błędy zapisu/wysyłki od startu: {errors}.",
|
||||
"webMetricStatus": "Statusy HTTP WWW",
|
||||
"webMetricStatusHelp": "Klasy odpowiedzi serwera WWW od ostatniego resetu.",
|
||||
"webMetricKind": "Static / PHP",
|
||||
@@ -2964,11 +2990,13 @@
|
||||
"certificateInspectKept": "Odczytano certyfikat; zachowano wpisane nazwy SNI.",
|
||||
"certificateInspectNoNames": "Certyfikat nie zawiera nazw DNS w SAN.",
|
||||
"certificateInspectFailed": "Nie można odczytać certyfikatu. Sprawdź plik i jego uprawnienia, a następnie ponów odczyt.",
|
||||
"pathPermissionsOptions": "Opcje i pomoc"
|
||||
},
|
||||
"overviewLayoutNarrow": "Zmniejsz szerokość karty",
|
||||
"overviewLayoutWiden": "Zwiększ szerokość karty",
|
||||
"overviewLayoutWidth": "Szerokość karty w siatce 12 kolumn",
|
||||
"overviewLayoutInlineHint": "Układ odblokowany: przenoś dowolne karty i zmieniaj ich szerokość przyciskami − / + (2, 3, 4, 6 lub 12 kolumn). Zapisz lub anuluj zmiany.",
|
||||
"dashboardPresetsConflict": "Preset już istnieje lub został usunięty. Odśwież listę i spróbuj ponownie."
|
||||
"pathPermissionsOptions": "Opcje i pomoc",
|
||||
"overviewLayoutNarrow": "Zmniejsz szerokość karty",
|
||||
"overviewLayoutWiden": "Zwiększ szerokość karty",
|
||||
"overviewLayoutWidth": "Szerokość karty w siatce 12 kolumn",
|
||||
"dashboardPresetsConflict": "Preset już istnieje lub został usunięty. Odśwież listę i spróbuj ponownie.",
|
||||
"overviewLayoutInlineDragging": "Przeciąganie: upuść blok w miejscu ramki. Esc przywraca poprzednią pozycję.",
|
||||
"overviewLayoutInlineCompact": "Uzupełnij luki",
|
||||
"overviewLayoutInlineCompactHint": "Dosuń bloki w puste miejsca siatki (jednorazowo, przed zapisaniem możesz to anulować)"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
-- Named, administrator-scoped Overview presets. Keep this separate from the
|
||||
-- existing 4096-byte appearance preferences document and proxy configuration.
|
||||
-- appearance preferences document and proxy configuration.
|
||||
CREATE TABLE IF NOT EXISTS dashboard_presets (
|
||||
administrator_id INTEGER NOT NULL CHECK (administrator_id = 1),
|
||||
name TEXT NOT NULL CHECK (length(name) BETWEEN 1 AND 64),
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
-- Expand administrator UI preference storage. Current dashboard layouts can exceed
|
||||
-- the original 4096-byte limit once per-widget widths are persisted.
|
||||
CREATE TABLE admin_preferences_v2 (
|
||||
administrator_id INTEGER PRIMARY KEY CHECK (administrator_id = 1),
|
||||
document TEXT NOT NULL CHECK (length(document) BETWEEN 2 AND 65536),
|
||||
FOREIGN KEY (administrator_id) REFERENCES administrator(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
INSERT INTO admin_preferences_v2(administrator_id, document)
|
||||
SELECT administrator_id, document FROM admin_preferences;
|
||||
|
||||
DROP TABLE admin_preferences;
|
||||
ALTER TABLE admin_preferences_v2 RENAME TO admin_preferences;
|
||||
@@ -132,7 +132,7 @@ def check(root: Path, repair_known: bool = False) -> list[str]:
|
||||
flat = module.parent.with_suffix(".rs")
|
||||
if flat.is_file():
|
||||
raise ValueError(f"Conflicting Rust modules: {flat.relative_to(root)} and {module.relative_to(root)}")
|
||||
for path in ["src/auth/mod.rs", "src/auth/store.rs", "src/backup/snapshot.rs", "src/upstream.rs", "src/tls.rs", "src/config/internal_routing.rs", "src/proxy/websocket.rs", "src/proxy/error_fallback.rs", "src/cache/mod.rs", "src/cache/model.rs", "src/cache/lifecycle.rs", "src/cache/cold.rs", "src/cache/dashboard.rs", "src/cache/tickets.rs", "src/cache/lookup.rs", "src/cache/policy.rs", "src/cache/fill.rs", "src/cache/tests.rs", "src/settings.rs", "src/compression/mod.rs", "src/diagnostics.rs", "src/traffic/mod.rs", "src/system_stats/mod.rs", "src/system_stats/linux/mod.rs", "src/vhost.rs", "src/vhost/error_fallback.rs", "src/web_server/mod.rs", "src/web_server/config.rs", "src/web_server/filesystem.rs", "src/web_server/security.rs", "src/web_server/response.rs", "src/web_server/request.rs", "src/web_server/routing.rs", "src/web_server/fastcgi.rs", "src/web_server/htaccess.rs", "src/web_server/serve.rs", "src/web_server/tests.rs", "src/balance.rs", "src/security/mod.rs", "src/admin/web/vhosts/core.js", "src/admin/web/vhosts/rates.js", "src/admin/web/vhosts/health.js", "src/admin/web/vhosts/editor.js", "src/admin/web/vhosts/render.js", "src/admin/web/web-server.js", "src/admin/web/streams.js", "src/admin/web/host404.js", "src/admin/web/app/core.js", "src/admin/web/app/session-resume.js", "src/admin/web/app/preferences.js", "src/admin/web/app/config-history.js", "src/admin/web/app/runtime.js", "src/admin/web/app/settings.js", "src/admin/web/management.js", "src/admin/web/drafts.js", "src/pages/mod.rs", "tools/dev/mock_server.py", "tools/dev/mock_auth.py", "src/forwarding.rs", "src/tinyauth/mod.rs", "src/http3.rs", "src/stream.rs", "src/admin/web/integrations.js", "src/admin/web/traffic-panel.js", "src/prometheus.rs", "src/admin/web/settings.js", "src/admin/web/docker.js", "src/docker.rs", "docker-agent/main.go", "docker-agent/model.go", "docker-agent/docker.go", "docker-agent/network.go", "docker-agent/certificate.go", "docker-agent/server.go", "docker-agent/main_test.go", "docker-agent/rustproxy-docker-agent.service", "docker-agent/install.sh", "docs/DOCKER_DISCOVERY.md", "docs/WEB_SERVER.md", "docs/PHP_FPM.md", "docs/README.md", "CHANGELOG.md", "LICENSE", "docs/FEATURES.md", "docs/PERFORMANCE.md", "scripts/runtime/acme_provider.py", "src/basic_auth/mod.rs", "scripts/deploy/deploy.py", "scripts/deploy/deploy_core.py", "scripts/deploy/deploy_runtime.py", "scripts/migration/migrate_npm.py", "scripts/migration/migrate_npm_core.py", "scripts/migration/migrate_npm_api.py", "docs/MIGRATION.md", "docs/STREAMS.md", "install.sh", "install-debian13.sh", "update.sh", "build.rs", "scripts/build/swagger_assets.py", "src/admin/documentation.rs", "src/admin/openapi.json", "langs/en_US.json", "langs/pl_pl.json", "Dockerfile", ".dockerignore", "docs/INSTALL.md", "docs/MONITORING.md", "docs/CUSTOM_LOCATIONS.md", "grafana/rustproxy-overview.json"]:
|
||||
for path in ["src/auth/mod.rs", "src/auth/store.rs", "src/backup/snapshot.rs", "src/upstream.rs", "src/tls.rs", "src/config/internal_routing.rs", "src/proxy/websocket.rs", "src/proxy/error_fallback.rs", "src/cache/mod.rs", "src/cache/model.rs", "src/cache/lifecycle.rs", "src/cache/cold.rs", "src/cache/dashboard.rs", "src/cache/tickets.rs", "src/cache/lookup.rs", "src/cache/policy.rs", "src/cache/fill.rs", "src/cache/tests.rs", "src/settings.rs", "src/compression/mod.rs", "src/diagnostics.rs", "src/traffic/mod.rs", "src/system_stats/mod.rs", "src/system_stats/linux/mod.rs", "src/vhost.rs", "src/vhost/error_fallback.rs", "src/web_server/mod.rs", "src/web_server/config.rs", "src/web_server/filesystem.rs", "src/web_server/security.rs", "src/web_server/response.rs", "src/web_server/request.rs", "src/web_server/routing.rs", "src/web_server/fastcgi.rs", "src/web_server/htaccess.rs", "src/web_server/serve.rs", "src/web_server/tests.rs", "src/balance.rs", "src/security/mod.rs", "src/admin/web/vhosts/core.js", "src/admin/web/vhosts/rates.js", "src/admin/web/vhosts/health.js", "src/admin/web/vhosts/editor.js", "src/admin/web/vhosts/render.js", "src/admin/web/web-server.js", "src/admin/web/streams.js", "src/admin/web/host404.js", "src/admin/web/app/core.js", "src/admin/web/app/icons.js", "src/admin/web/app/session-resume.js", "src/admin/web/app/preferences.js", "src/admin/web/app/config-history.js", "src/admin/web/app/runtime.js", "src/admin/web/app/settings.js", "src/admin/web/management.js", "src/admin/web/drafts.js", "src/pages/mod.rs", "tools/dev/mock_server.py", "tools/dev/mock_auth.py", "src/forwarding.rs", "src/tinyauth/mod.rs", "src/http3.rs", "src/stream.rs", "src/admin/web/integrations.js", "src/admin/web/traffic-panel.js", "src/prometheus.rs", "src/admin/web/settings.js", "src/admin/web/docker.js", "src/docker.rs", "docker-agent/main.go", "docker-agent/model.go", "docker-agent/docker.go", "docker-agent/network.go", "docker-agent/certificate.go", "docker-agent/server.go", "docker-agent/main_test.go", "docker-agent/rustproxy-docker-agent.service", "docker-agent/install.sh", "docs/DOCKER_DISCOVERY.md", "docs/WEB_SERVER.md", "docs/PHP_FPM.md", "docs/README.md", "CHANGELOG.md", "LICENSE", "docs/FEATURES.md", "docs/PERFORMANCE.md", "scripts/runtime/acme_provider.py", "src/basic_auth/mod.rs", "scripts/deploy/deploy.py", "scripts/deploy/deploy_core.py", "scripts/deploy/deploy_runtime.py", "scripts/migration/migrate_npm.py", "scripts/migration/migrate_npm_core.py", "scripts/migration/migrate_npm_api.py", "docs/MIGRATION.md", "docs/STREAMS.md", "install.sh", "install-debian13.sh", "update.sh", "build.rs", "scripts/build/swagger_assets.py", "src/admin/documentation.rs", "src/admin/openapi.json", "langs/en_US.json", "langs/pl_pl.json", "Dockerfile", ".dockerignore", "docs/INSTALL.md", "docs/MONITORING.md", "docs/CUSTOM_LOCATIONS.md", "grafana/rustproxy-overview.json"]:
|
||||
if not (root / path).is_file():
|
||||
raise ValueError(f"Incomplete RustProxy 0.34.2 source tree: missing {path}")
|
||||
for path in ("scripts/__init__.py", "scripts/build/__init__.py", "scripts/build/panel_css.py", "src/admin/web/css/manifest.json"):
|
||||
|
||||
+62
-23
@@ -171,6 +171,7 @@ async fn metrics_summary(State(state): State<Arc<App>>) -> Response {
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
struct EventsQuery {
|
||||
interval: Option<u64>,
|
||||
logs: Option<bool>,
|
||||
}
|
||||
|
||||
async fn events(
|
||||
@@ -179,6 +180,7 @@ async fn events(
|
||||
Query(query): Query<EventsQuery>,
|
||||
) -> Result<Response, ApiError> {
|
||||
let interval = query.interval.unwrap_or(3);
|
||||
let include_logs = query.logs.unwrap_or(true);
|
||||
if ![1, 2, 3, 5, 10].contains(&interval) {
|
||||
return Err(ApiError(
|
||||
StatusCode::UNPROCESSABLE_ENTITY,
|
||||
@@ -198,8 +200,8 @@ async fn events(
|
||||
)
|
||||
})?;
|
||||
let stream = futures_util::stream::unfold(
|
||||
(state, secret, permit, false, interval),
|
||||
|(state, secret, permit, delayed, interval)| async move {
|
||||
(state, secret, permit, false, interval, include_logs),
|
||||
|(state, secret, permit, delayed, interval, include_logs)| async move {
|
||||
if delayed {
|
||||
tokio::time::sleep(Duration::from_secs(interval)).await;
|
||||
}
|
||||
@@ -218,13 +220,16 @@ async fn events(
|
||||
Ok(Some(_)) => {}
|
||||
_ => return None,
|
||||
}
|
||||
let payload =
|
||||
let payload = if include_logs {
|
||||
json!({"status":live_status_payload(&state), "logs":logs_payload(&state)})
|
||||
.to_string();
|
||||
} else {
|
||||
json!({"status":live_status_payload(&state)})
|
||||
}
|
||||
.to_string();
|
||||
let event = Event::default().event("snapshot").data(payload);
|
||||
Some((
|
||||
Ok::<Event, Infallible>(event),
|
||||
(state, secret, permit, true, interval),
|
||||
(state, secret, permit, true, interval, include_logs),
|
||||
))
|
||||
},
|
||||
);
|
||||
@@ -237,11 +242,22 @@ async fn events(
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
struct TrafficQuery {
|
||||
vhost: Option<String>,
|
||||
view: Option<String>,
|
||||
}
|
||||
async fn traffic_status(
|
||||
State(state): State<Arc<App>>,
|
||||
Query(query): Query<TrafficQuery>,
|
||||
) -> Result<Json<Value>, ApiError> {
|
||||
let live = match query.view.as_deref() {
|
||||
None => false,
|
||||
Some("live") => true,
|
||||
_ => {
|
||||
return Err(ApiError(
|
||||
StatusCode::BAD_REQUEST,
|
||||
"invalid traffic view".into(),
|
||||
));
|
||||
}
|
||||
};
|
||||
let snapshot = state.config.load_full();
|
||||
if query.vhost.as_ref().is_some_and(|id| {
|
||||
id != "*"
|
||||
@@ -258,14 +274,8 @@ async fn traffic_status(
|
||||
));
|
||||
}
|
||||
let scope = query.vhost.as_deref().unwrap_or("*");
|
||||
let vhosts = snapshot
|
||||
.envelope
|
||||
.config
|
||||
.vhosts
|
||||
.iter()
|
||||
.map(|vhost| json!({"id": vhost.id, "hosts": vhost.frontend.hosts}))
|
||||
.collect::<Vec<_>>();
|
||||
Ok(Json(json!({
|
||||
let mut payload = json!({
|
||||
"revision": snapshot.envelope.revision,
|
||||
"scope": scope,
|
||||
"since": "process_start",
|
||||
"settings": {
|
||||
@@ -273,9 +283,19 @@ async fn traffic_status(
|
||||
"capture_country": snapshot.envelope.config.logging.capture_country
|
||||
},
|
||||
"geoip": state.geoip.load().view(),
|
||||
"analytics": state.traffic.view(Some(scope)),
|
||||
"vhosts": vhosts
|
||||
})))
|
||||
"analytics": state.traffic.view(Some(scope))
|
||||
});
|
||||
if live {
|
||||
return Ok(Json(payload));
|
||||
}
|
||||
payload["vhosts"] = json!(snapshot
|
||||
.envelope
|
||||
.config
|
||||
.vhosts
|
||||
.iter()
|
||||
.map(|vhost| json!({"id": vhost.id, "hosts": vhost.frontend.hosts}))
|
||||
.collect::<Vec<_>>());
|
||||
Ok(Json(payload))
|
||||
}
|
||||
|
||||
#[derive(Default, Deserialize)]
|
||||
@@ -284,11 +304,22 @@ struct CacheQuery {
|
||||
vhost: Option<String>,
|
||||
offset: Option<usize>,
|
||||
limit: Option<usize>,
|
||||
view: Option<String>,
|
||||
}
|
||||
async fn cache_status(
|
||||
State(state): State<Arc<App>>,
|
||||
Query(query): Query<CacheQuery>,
|
||||
) -> Result<Json<Value>, ApiError> {
|
||||
let live = match query.view.as_deref() {
|
||||
None => false,
|
||||
Some("live") => true,
|
||||
_ => {
|
||||
return Err(ApiError(
|
||||
StatusCode::BAD_REQUEST,
|
||||
"invalid cache view".into(),
|
||||
));
|
||||
}
|
||||
};
|
||||
let snapshot = state.config.load_full();
|
||||
if query
|
||||
.vhost
|
||||
@@ -300,16 +331,24 @@ async fn cache_status(
|
||||
"unknown vhost cache scope".into(),
|
||||
));
|
||||
}
|
||||
let scopes: Vec<_> = snapshot.envelope.config.vhosts.iter().map(|vhost| {
|
||||
json!({"id":vhost.id, "hosts":vhost.frontend.hosts, "metrics":state.cache.scope_view(&vhost.id),
|
||||
"settings":vhost.cache.resolve(&snapshot.envelope.config.cache).ok()})
|
||||
}).collect();
|
||||
let dashboard = state.cache.dashboard(
|
||||
query.vhost.as_deref(),
|
||||
query.offset.unwrap_or(0).min(16384),
|
||||
query.limit.unwrap_or(50),
|
||||
);
|
||||
Ok(Json(
|
||||
json!({"settings":snapshot.envelope.config.cache, "metrics":state.cache.view(), "vhosts":scopes, "dashboard":dashboard, "bans":state.cache.bans()}),
|
||||
))
|
||||
let mut payload = json!({
|
||||
"revision": snapshot.envelope.revision,
|
||||
"metrics": state.cache.view(),
|
||||
"dashboard": dashboard,
|
||||
"bans": state.cache.bans()
|
||||
});
|
||||
if live {
|
||||
return Ok(Json(payload));
|
||||
}
|
||||
payload["settings"] = json!(snapshot.envelope.config.cache);
|
||||
payload["vhosts"] = json!(snapshot.envelope.config.vhosts.iter().map(|vhost| {
|
||||
json!({"id":vhost.id, "hosts":vhost.frontend.hosts, "metrics":state.cache.scope_view(&vhost.id),
|
||||
"settings":vhost.cache.resolve(&snapshot.envelope.config.cache).ok()})
|
||||
}).collect::<Vec<_>>());
|
||||
Ok(Json(payload))
|
||||
}
|
||||
+243
-40
@@ -2,7 +2,7 @@
|
||||
"openapi": "3.0.3",
|
||||
"info": {
|
||||
"title": "RustProxy Administration API",
|
||||
"version": "0.35.3",
|
||||
"version": "0.36.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."
|
||||
},
|
||||
"servers": [
|
||||
@@ -443,10 +443,31 @@
|
||||
"type": "object",
|
||||
"description": "Optional explicit provider and integration method. Absent means infer the existing active Basic/Tinyauth/Authelia/authentik/OIDC configuration for backward compatibility. The selected method must match the one enabled legacy settings object; unknown, inconsistent or unsupported pairs are rejected.",
|
||||
"additionalProperties": false,
|
||||
"required": ["provider", "method"],
|
||||
"required": [
|
||||
"provider",
|
||||
"method"
|
||||
],
|
||||
"properties": {
|
||||
"provider": {"type": "string", "enum": ["basic", "tinyauth", "authelia", "authentik", "pocket_id", "custom"]},
|
||||
"method": {"type": "string", "enum": ["basic", "forward_auth", "oidc"], "description": "Basic supports basic only; Tinyauth/Authelia/authentik support forward_auth or oidc; Pocket ID/custom support oidc only."}
|
||||
"provider": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"basic",
|
||||
"tinyauth",
|
||||
"authelia",
|
||||
"authentik",
|
||||
"pocket_id",
|
||||
"custom"
|
||||
]
|
||||
},
|
||||
"method": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"basic",
|
||||
"forward_auth",
|
||||
"oidc"
|
||||
],
|
||||
"description": "Basic supports basic only; Tinyauth/Authelia/authentik support forward_auth or oidc; Pocket ID/custom support oidc only."
|
||||
}
|
||||
}
|
||||
},
|
||||
"OidcConfig": {
|
||||
@@ -454,20 +475,76 @@
|
||||
"description": "Opt-in OpenID Connect Authorization Code integration method for an identity provider selected by authentication.provider. Uses issuer discovery, S256 PKCE, nonce/state cookies, JWKS RS256/ES256 ID token verification and encrypted host-only application sessions. Existing standalone oidc.enabled configurations remain supported.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean", "default": false},
|
||||
"issuer_url": {"type": "string", "format": "uri", "description": "Exact HTTPS OIDC issuer; /.well-known/openid-configuration is discovered at this URL"},
|
||||
"backend_url": {"type": "string", "format": "uri", "description": "Optional internal HTTP(S) origin for server-side discovery/token/JWKS/UserInfo requests; public issuer and JWT validation remain unchanged"},
|
||||
"redirect_url": {"type": "string", "format": "uri", "description": "HTTPS URL for an exact hostname in this Vhost and path /_rustproxy/oidc/callback"},
|
||||
"client_id": {"type": "string", "maxLength": 256},
|
||||
"client_secret": {"type": "string", "maxLength": 2048, "description": "Confidential OIDC client secret; stored in Vhost configuration"},
|
||||
"session_secret": {"type": "string", "minLength": 32, "maxLength": 4096, "description": "High-entropy secret for encrypted session and temporary state cookies"},
|
||||
"scopes": {"type": "string", "default": "openid profile email"},
|
||||
"allow_private": {"type": "boolean", "default": false},
|
||||
"address_allowlist": {"type": "array", "items": {"type": "string"}},
|
||||
"tls_ca_pem": {"type": "string", "nullable": true},
|
||||
"connect_timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 30, "default": 5},
|
||||
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 60, "default": 10},
|
||||
"session_ttl_seconds": {"type": "integer", "minimum": 60, "maximum": 86400, "default": 3600}
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"issuer_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"description": "Exact HTTPS OIDC issuer; /.well-known/openid-configuration is discovered at this URL"
|
||||
},
|
||||
"backend_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"description": "Optional internal HTTP(S) origin for server-side discovery/token/JWKS/UserInfo requests; public issuer and JWT validation remain unchanged"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"description": "HTTPS URL for an exact hostname in this Vhost and path /_rustproxy/oidc/callback"
|
||||
},
|
||||
"client_id": {
|
||||
"type": "string",
|
||||
"maxLength": 256
|
||||
},
|
||||
"client_secret": {
|
||||
"type": "string",
|
||||
"maxLength": 2048,
|
||||
"description": "Confidential OIDC client secret; stored in Vhost configuration"
|
||||
},
|
||||
"session_secret": {
|
||||
"type": "string",
|
||||
"minLength": 32,
|
||||
"maxLength": 4096,
|
||||
"description": "High-entropy secret for encrypted session and temporary state cookies"
|
||||
},
|
||||
"scopes": {
|
||||
"type": "string",
|
||||
"default": "openid profile email"
|
||||
},
|
||||
"allow_private": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"address_allowlist": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"tls_ca_pem": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"connect_timeout_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 30,
|
||||
"default": 5
|
||||
},
|
||||
"timeout_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 60,
|
||||
"default": 10
|
||||
},
|
||||
"session_ttl_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 60,
|
||||
"maximum": 86400,
|
||||
"default": 3600
|
||||
}
|
||||
}
|
||||
},
|
||||
"ForwardAuthConfig": {
|
||||
@@ -475,17 +552,70 @@
|
||||
"description": "Per-Vhost Authelia or authentik verification. Disabled by default. All other settings are optional and use RustProxy defaults; when enabled, url must identify an internal HTTP(S) origin (or expected verifier path). Authelia additionally requires a public HTTPS login_url. External addresses retain normal safe upstream validation, with TLS verification always enabled for HTTPS.",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {"type": "boolean", "default": false},
|
||||
"url": {"type": "string", "maxLength": 2048, "description": "Internal service/outpost origin or the provider's verifier endpoint"},
|
||||
"login_url": {"type": "string", "maxLength": 2048, "description": "Required public HTTPS portal URL for Authelia; ignored for authentik"},
|
||||
"allow_private": {"type": "boolean", "default": false},
|
||||
"address_allowlist": {"type": "array", "maxItems": 32, "items": {"type": "string"}},
|
||||
"tls_ca_pem": {"type": "string", "nullable": true},
|
||||
"connect_timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 30, "default": 5},
|
||||
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 60, "default": 10},
|
||||
"request_headers": {"type": "array", "maxItems": 32, "items": {"type": "string", "maxLength": 128}, "description": "Only cookie, authorization, user-agent, accept, accept-language and x-api-key are allowed"},
|
||||
"response_headers": {"type": "array", "maxItems": 32, "items": {"type": "string", "maxLength": 128}, "description": "Allowed Remote-*, X-Auth-Request-* and X-Authentik-* identity headers; total injected identity data capped at 8 KiB"},
|
||||
"redirect_forbidden": {"type": "boolean", "default": false, "description": "Authelia only: accept trusted portal Location on explicit 403 if provided"}
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"maxLength": 2048,
|
||||
"description": "Internal service/outpost origin or the provider's verifier endpoint"
|
||||
},
|
||||
"login_url": {
|
||||
"type": "string",
|
||||
"maxLength": 2048,
|
||||
"description": "Required public HTTPS portal URL for Authelia; ignored for authentik"
|
||||
},
|
||||
"allow_private": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"address_allowlist": {
|
||||
"type": "array",
|
||||
"maxItems": 32,
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"tls_ca_pem": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"connect_timeout_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 30,
|
||||
"default": 5
|
||||
},
|
||||
"timeout_seconds": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 60,
|
||||
"default": 10
|
||||
},
|
||||
"request_headers": {
|
||||
"type": "array",
|
||||
"maxItems": 32,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"maxLength": 128
|
||||
},
|
||||
"description": "Only cookie, authorization, user-agent, accept, accept-language and x-api-key are allowed"
|
||||
},
|
||||
"response_headers": {
|
||||
"type": "array",
|
||||
"maxItems": 32,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"maxLength": 128
|
||||
},
|
||||
"description": "Allowed Remote-*, X-Auth-Request-* and X-Authentik-* identity headers; total injected identity data capped at 8 KiB"
|
||||
},
|
||||
"redirect_forbidden": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Authelia only: accept trusted portal Location on explicit 403 if provided"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Vhost": {
|
||||
@@ -591,8 +721,13 @@
|
||||
"$ref": "#/components/schemas/ForwardAuthConfig",
|
||||
"description": "authentik single-application forward auth. The URL is the internal outpost origin; RustProxy proxies its reserved path on the protected host. Disabled by default; mutually exclusive with basic_auth, tinyauth and authelia."
|
||||
},
|
||||
"oidc": {"$ref": "#/components/schemas/OidcConfig"},
|
||||
"authentication": {"$ref": "#/components/schemas/AuthenticationChoice", "description": "Optional provider/method selector. Set to null or omit for legacy Vhost data. It does not replace the existing provider-specific settings objects."},
|
||||
"oidc": {
|
||||
"$ref": "#/components/schemas/OidcConfig"
|
||||
},
|
||||
"authentication": {
|
||||
"$ref": "#/components/schemas/AuthenticationChoice",
|
||||
"description": "Optional provider/method selector. Set to null or omit for legacy Vhost data. It does not replace the existing provider-specific settings objects."
|
||||
},
|
||||
"cache": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -1618,6 +1753,11 @@
|
||||
"Cache": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"revision": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"description": "Configuration revision used for this snapshot."
|
||||
},
|
||||
"settings": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
@@ -3682,6 +3822,11 @@
|
||||
"default": false,
|
||||
"description": "Account-scoped optional X/Y scales on sampled time-series charts. Shows the same Y range used to draw each SVG and X sample indices rather than inferred elapsed time; does not change adaptive scaling."
|
||||
},
|
||||
"interface_icons": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Account-scoped administration UI preference. When enabled, semantic inline SVG icons are added to navigation, actions, tabs and dialogs while preserving text labels and accessibility."
|
||||
},
|
||||
"button_style": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4790,6 +4935,11 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"revision": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"description": "Configuration revision used for this snapshot."
|
||||
},
|
||||
"settings": {
|
||||
"$ref": "#/components/schemas/TransformSettings"
|
||||
},
|
||||
@@ -6194,6 +6344,11 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"revision": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"description": "Configuration revision used for this snapshot."
|
||||
},
|
||||
"scope": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -9872,14 +10027,14 @@
|
||||
},
|
||||
"/api/cache": {
|
||||
"get": {
|
||||
"summary": "Cache metrics, domains and paginated objects",
|
||||
"summary": "Cache metrics, domains and paginated objects; optional lightweight live view",
|
||||
"tags": [
|
||||
"Cache"
|
||||
],
|
||||
"operationId": "get_api_cache",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"description": "Full response by default. view=live omits static settings/vhost configuration while retaining revision, live metrics, dashboard objects/domains and BAN rules.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -9960,6 +10115,18 @@
|
||||
"minimum": 1,
|
||||
"default": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "view",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"description": "Set to live for polling. Omits static settings and vhost configuration; refetch the full view when revision changes.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"live"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"security": [
|
||||
@@ -9974,14 +10141,14 @@
|
||||
},
|
||||
"/api/transform": {
|
||||
"get": {
|
||||
"summary": "Transformation runtime metrics and per-vhost effectiveness",
|
||||
"summary": "Transformation runtime metrics and per-vhost effectiveness; optional lightweight live view",
|
||||
"tags": [
|
||||
"Transform"
|
||||
],
|
||||
"operationId": "get_api_transform",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"description": "Full response by default. view=live omits static settings/vhost configuration while retaining revision, resources and live metrics.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -10031,6 +10198,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "view",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"description": "Set to live for polling. Omits static settings and vhost configuration; refetch the full view when revision changes.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"live"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"AdminSession": []
|
||||
@@ -10373,7 +10554,7 @@
|
||||
},
|
||||
"/api/events": {
|
||||
"get": {
|
||||
"summary": "Live SSE status and log snapshots",
|
||||
"summary": "Live SSE status snapshots with optional logs",
|
||||
"tags": [
|
||||
"Monitoring"
|
||||
],
|
||||
@@ -10430,7 +10611,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "SSE snapshot events contain compact volatile status and bounded logs. Session validity is checked before each event. Native reconnect and keepalive apply. Each viewer selects 1/2/3/5/10 second pacing; invalid values return 422.",
|
||||
"description": "SSE snapshot events always contain compact volatile status. Bounded recent logs are included by default for backward compatibility and can be disabled per viewer with logs=false; the administration panel disables them until Live Logs is open/docked and polls /api/logs only while that view is active. Session validity is checked before each event. Native reconnect and keepalive apply. Each viewer selects 1/2/3/5/10 second pacing; invalid values return 422.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "interval",
|
||||
@@ -10448,6 +10629,16 @@
|
||||
],
|
||||
"default": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "logs",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"description": "Include the bounded live log snapshot in each SSE event. Defaults to true for API compatibility; the panel uses false and fetches logs only while Live Logs is active.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12884,7 +13075,7 @@
|
||||
},
|
||||
"/api/traffic": {
|
||||
"get": {
|
||||
"summary": "Bounded per-vhost traffic analytics",
|
||||
"summary": "Bounded per-vhost traffic analytics; optional lightweight live view",
|
||||
"tags": [
|
||||
"Traffic"
|
||||
],
|
||||
@@ -12899,11 +13090,23 @@
|
||||
"type": "string",
|
||||
"default": "*"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "view",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"description": "Set to live for polling. Omits the static vhost list; refetch the full view when revision changes.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"live"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"description": "Full response by default. view=live omits the static vhost list while retaining revision, current settings, GeoIP state and analytics.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -14393,4 +14596,4 @@
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
+34
-5
@@ -1,6 +1,34 @@
|
||||
async fn transform_status(State(state): State<Arc<App>>) -> Json<Value> {
|
||||
#[derive(Default, Deserialize)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
struct TransformQuery {
|
||||
view: Option<String>,
|
||||
}
|
||||
|
||||
async fn transform_status(
|
||||
State(state): State<Arc<App>>,
|
||||
Query(query): Query<TransformQuery>,
|
||||
) -> Result<Json<Value>, ApiError> {
|
||||
let live = match query.view.as_deref() {
|
||||
None => false,
|
||||
Some("live") => true,
|
||||
_ => {
|
||||
return Err(ApiError(
|
||||
StatusCode::BAD_REQUEST,
|
||||
"invalid transform view".into(),
|
||||
));
|
||||
}
|
||||
};
|
||||
let snapshot = state.config.load_full();
|
||||
let global = &snapshot.envelope.config.transform;
|
||||
let resources = crate::transform::resource_usage(global);
|
||||
let metrics = state.transform_metrics.view();
|
||||
if live {
|
||||
return Ok(Json(json!({
|
||||
"revision": snapshot.envelope.revision,
|
||||
"resources": resources,
|
||||
"metrics": metrics
|
||||
})));
|
||||
}
|
||||
let vhosts: Vec<_> = snapshot
|
||||
.envelope
|
||||
.config
|
||||
@@ -14,12 +42,13 @@ async fn transform_status(State(state): State<Arc<App>>) -> Json<Value> {
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
Json(json!({
|
||||
Ok(Json(json!({
|
||||
"revision": snapshot.envelope.revision,
|
||||
"settings": global,
|
||||
"resources": crate::transform::resource_usage(global),
|
||||
"metrics": state.transform_metrics.view(),
|
||||
"resources": resources,
|
||||
"metrics": metrics,
|
||||
"vhosts": vhosts
|
||||
}))
|
||||
})))
|
||||
}
|
||||
|
||||
#[derive(Default, Deserialize)]
|
||||
|
||||
@@ -118,6 +118,8 @@ struct AdminPreferences {
|
||||
chart_style: String,
|
||||
#[serde(default)]
|
||||
chart_axes: bool,
|
||||
#[serde(default)]
|
||||
interface_icons: bool,
|
||||
#[serde(default = "default_admin_button_style")]
|
||||
button_style: String,
|
||||
#[serde(default = "default_admin_corner_style")]
|
||||
@@ -180,6 +182,7 @@ impl Default for AdminPreferences {
|
||||
time_format: default_admin_time_format(),
|
||||
chart_style: default_admin_chart_style(),
|
||||
chart_axes: false,
|
||||
interface_icons: false,
|
||||
button_style: default_admin_button_style(),
|
||||
corner_style: default_admin_corner_style(),
|
||||
table_density: default_admin_table_density(),
|
||||
|
||||
@@ -41,6 +41,20 @@ fn overview_factory_preset_matches_registry_and_operator_visibility() {
|
||||
assert!(hidden.iter().all(|id| order.contains(id)));
|
||||
assert!(validate_admin_preferences(&AdminPreferences::default()).is_ok());
|
||||
assert!(!AdminPreferences::default().chart_axes);
|
||||
assert!(!AdminPreferences::default().interface_icons);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optional_interface_icons_preference_is_backward_compatible_and_off_by_default() {
|
||||
let legacy: AdminPreferences = serde_json::from_str(r#"{"theme":"light"}"#).unwrap();
|
||||
assert!(!legacy.interface_icons);
|
||||
let mut enabled = legacy.clone();
|
||||
enabled.interface_icons = true;
|
||||
assert!(validate_admin_preferences(&enabled).is_ok());
|
||||
let stored = serde_json::to_string(&enabled).unwrap();
|
||||
assert!(stored.contains("\"interface_icons\":true"));
|
||||
let recovered: AdminPreferences = serde_json::from_str(&stored).unwrap();
|
||||
assert!(recovered.interface_icons);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -278,3 +292,22 @@ fn dashboard_width_preferences_preserve_legacy_and_allow_custom_grids() {
|
||||
.contains_key("not_a_card"));
|
||||
assert!(validate_admin_preferences(&prefs).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn customized_dashboard_preferences_fit_persistent_storage_limit() {
|
||||
let mut prefs = AdminPreferences {
|
||||
dashboard_widget_sizes: Some(std::collections::BTreeMap::new()),
|
||||
..Default::default()
|
||||
};
|
||||
for widget in DASHBOARD_WIDGETS.iter() {
|
||||
prefs
|
||||
.dashboard_widget_sizes
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.insert(widget.id.clone(), 12);
|
||||
}
|
||||
assert!(validate_admin_preferences(&prefs).is_ok());
|
||||
let document = serde_json::to_string(&prefs).unwrap();
|
||||
assert!(document.len() > 4096);
|
||||
assert!(document.len() <= crate::db::ADMIN_PREFERENCES_MAX_BYTES);
|
||||
}
|
||||
@@ -57,6 +57,7 @@ fn admin_app_javascript() -> &'static str {
|
||||
");",
|
||||
include_str!("web/app/overview-samples.js"),
|
||||
include_str!("web/app/core.js"),
|
||||
include_str!("web/app/icons.js"),
|
||||
include_str!("web/app/path-permissions.js"),
|
||||
include_str!("web/app/session-resume.js"),
|
||||
include_str!("web/app/refresh.js"),
|
||||
|
||||
@@ -2146,6 +2146,7 @@ mod tests {
|
||||
assert_eq!(initial["time_format"], "24h");
|
||||
assert_eq!(initial["chart_style"], "default");
|
||||
assert_eq!(initial["chart_axes"], false);
|
||||
assert_eq!(initial["interface_icons"], false);
|
||||
assert_eq!(initial["button_style"], "normal");
|
||||
assert_eq!(initial["corner_style"], "default");
|
||||
assert_eq!(
|
||||
@@ -2183,6 +2184,7 @@ mod tests {
|
||||
assert_eq!(legacy["time_format"], "24h");
|
||||
assert_eq!(legacy["chart_style"], "default");
|
||||
assert_eq!(legacy["chart_axes"], false);
|
||||
assert_eq!(legacy["interface_icons"], false);
|
||||
assert_eq!(legacy["button_style"], "normal");
|
||||
assert_eq!(legacy["corner_style"], "default");
|
||||
assert_eq!(
|
||||
@@ -2205,6 +2207,7 @@ mod tests {
|
||||
"time_format":"12h",
|
||||
"chart_style":"neon",
|
||||
"chart_axes":true,
|
||||
"interface_icons":true,
|
||||
"button_style":"compact",
|
||||
"corner_style":"rounded",
|
||||
"table_density":"ultra",
|
||||
@@ -3515,6 +3518,7 @@ mod tests {
|
||||
.unwrap();
|
||||
assert_eq!(invalid.status(), StatusCode::BAD_REQUEST);
|
||||
let bad_sse = router
|
||||
.clone()
|
||||
.oneshot(
|
||||
request("/api/events?interval=4")
|
||||
.header("cookie", &cookie)
|
||||
@@ -3524,6 +3528,104 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(bad_sse.status(), StatusCode::UNPROCESSABLE_ENTITY);
|
||||
let bad_sse_logs = router
|
||||
.oneshot(
|
||||
request("/api/events?logs=maybe")
|
||||
.header("cookie", &cookie)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(bad_sse_logs.status(), StatusCode::BAD_REQUEST);
|
||||
store.close().await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn polling_views_omit_static_configuration_and_reject_unknown_modes() {
|
||||
let (router, store, _dir, secret, _) = fixture().await;
|
||||
let cookie = format!("{}={secret}", auth::COOKIE_NAME);
|
||||
|
||||
for (path, omitted, retained) in [
|
||||
(
|
||||
"/api/cache?view=live",
|
||||
&["settings", "vhosts"][..],
|
||||
&["revision", "metrics", "dashboard", "bans"][..],
|
||||
),
|
||||
(
|
||||
"/api/transform?view=live",
|
||||
&["settings", "vhosts"][..],
|
||||
&["revision", "resources", "metrics"][..],
|
||||
),
|
||||
(
|
||||
"/api/traffic?view=live",
|
||||
&["vhosts"][..],
|
||||
&["revision", "settings", "geoip", "analytics"][..],
|
||||
),
|
||||
] {
|
||||
let response = router
|
||||
.clone()
|
||||
.oneshot(
|
||||
request(path)
|
||||
.header("cookie", &cookie)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status(), StatusCode::OK, "GET {path}");
|
||||
let value = json_body(response).await;
|
||||
for &field in omitted {
|
||||
assert!(
|
||||
value.get(field).is_none(),
|
||||
"{path} unexpectedly contains {field}"
|
||||
);
|
||||
}
|
||||
for &field in retained {
|
||||
assert!(value.get(field).is_some(), "{path} is missing {field}");
|
||||
}
|
||||
}
|
||||
|
||||
for (path, required) in [
|
||||
("/api/cache", &["settings", "vhosts"][..]),
|
||||
("/api/transform", &["settings", "vhosts"][..]),
|
||||
("/api/traffic", &["vhosts"][..]),
|
||||
] {
|
||||
let response = router
|
||||
.clone()
|
||||
.oneshot(
|
||||
request(path)
|
||||
.header("cookie", &cookie)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status(), StatusCode::OK, "GET {path}");
|
||||
let value = json_body(response).await;
|
||||
assert!(value.get("revision").is_some());
|
||||
for &field in required {
|
||||
assert!(value.get(field).is_some(), "{path} is missing {field}");
|
||||
}
|
||||
}
|
||||
|
||||
for path in [
|
||||
"/api/cache?view=unknown",
|
||||
"/api/transform?view=unknown",
|
||||
"/api/traffic?view=unknown",
|
||||
] {
|
||||
let response = router
|
||||
.clone()
|
||||
.oneshot(
|
||||
request(path)
|
||||
.header("cookie", &cookie)
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status(), StatusCode::BAD_REQUEST, "GET {path}");
|
||||
}
|
||||
store.close().await;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ window.rustProxyBackendDashboard = (() => {
|
||||
for (const id of ids) {
|
||||
if (!visible(id)) continue;
|
||||
set(`backend-dashboard-${id.slice("backend_".length)}`, "-");
|
||||
set(`backend-dashboard-${id.slice("backend_".length)}-detail`, t("backendWidgetUnavailable"));
|
||||
set(`backend-dashboard-${id.slice("backend_".length)}-detail`, id === "backend_latency" ? `${t("backendWidgetProbeCount")} -` : t("backendWidgetUnavailable"));
|
||||
}
|
||||
for (const id of ["backend-dashboard-in-rate", "backend-dashboard-out-rate"]) set(id, "-");
|
||||
for (const id of ["backend-dashboard-active-line", "backend-dashboard-error-line", "backend-dashboard-latency-line", "backend-dashboard-in-line", "backend-dashboard-out-line", "backend-dashboard-request-line", "backend-dashboard-capacity-line", "backend-dashboard-5xx-line", "backend-dashboard-timeout-line", "backend-dashboard-network-line", "backend-dashboard-retry-line", "backend-dashboard-queue-line"])
|
||||
@@ -191,7 +191,7 @@ window.rustProxyBackendDashboard = (() => {
|
||||
}
|
||||
if (visible("backend_latency")) {
|
||||
set("backend-dashboard-latency", latency === null ? "-" : `${fmt(latency, 1)} ms`);
|
||||
set("backend-dashboard-latency-detail", `${t("backendWidgetProbeCount")}: ${probes.length}`);
|
||||
set("backend-dashboard-latency-detail", `${t("backendWidgetProbeCount")} ${probes.length}`);
|
||||
paintSeries("latency", "backend-dashboard-latency-line", Math.max(1, ...samples.latency));
|
||||
}
|
||||
if (visible("backend_traffic")) {
|
||||
|
||||
@@ -44,7 +44,7 @@ async function loadLanguages() {
|
||||
$("language").replaceChildren(automatic, ...packs.map(pack => { const option = el("option", pack.meta.native_name); option.value = pack.id; return option; }));
|
||||
$("language").value = languagePreference === "auto" ? "auto" : language;
|
||||
}
|
||||
let latestStatus = null, certificateInventory = new Map();
|
||||
let latestStatus = null, certificateInventory = new Map(), appHealthUpdatedAt = null;
|
||||
let selectedCacheMemoryPreset = null, selectedCacheColdPreset = null, selectedTransformPreset = null;
|
||||
function translate() {
|
||||
clearTimeout(toastTimer); hideToast();
|
||||
@@ -59,6 +59,7 @@ function translate() {
|
||||
$("connection-label").textContent = t(connected ? "connected" : "disconnected");
|
||||
if (envelope) renderConfig(); renderConfigStorage(); if (latestStatus) { renderFooter(latestStatus); renderDiagnostics(latestStatus, false); window.rustProxyVhosts?.renderStatus(latestStatus); window.rustProxyDocker?.renderStatus(latestStatus); window.rustProxyStreams?.renderStatus(latestStatus); window.rustProxyStreamDashboard?.render(latestStatus); window.rustProxyBackendDashboard?.render(latestStatus, null, false); window.rustProxyExtraOverview?.render(latestStatus, false); window.rustProxyWideOverview?.render(latestStatus, false); window.rustProxyWebOverview?.render(latestStatus, false); } if (lastLogs) renderLogs(lastLogs);
|
||||
syncSettingsDirtyIndicators();
|
||||
window.rustProxyIcons?.refresh?.();
|
||||
}
|
||||
function hideToast() { const node = $("toast"); if (typeof node.hidePopover === "function" && node.matches(":popover-open")) node.hidePopover(); node.hidden = true; }
|
||||
function raiseToast() {
|
||||
@@ -179,6 +180,68 @@ function uptime(value) {
|
||||
}
|
||||
function rateBytes(value) { value = Math.max(0, Number(value) || 0); if (value === 0) return "0.0 KiB"; value /= 1024; for (const unit of ["KiB", "MiB", "GiB", "TiB"]) { if (value < 1024 || unit === "TiB") { if (unit === "KiB" && value < 0.1) return "<0.1 KiB"; const digits = value < 10 ? 1 : 0; return `${Number(value.toFixed(digits))} ${unit}`; } value /= 1024; } }
|
||||
function el(tag, text, cls) { const e = document.createElement(tag); if (text !== undefined) e.textContent = text; if (cls) e.className = cls; return e; }
|
||||
function appHealthChecks(status) {
|
||||
if (!connected || !status) return [{ level: "error", label: t("appHealthApi"), detail: t("appHealthApiError") }];
|
||||
const checks = [{ level: "ok", label: t("appHealthApi"), detail: t("appHealthApiOk") }];
|
||||
if (status.listeners?.restart_required) {
|
||||
checks.push({ level: "warning", label: t("appHealthListeners"), detail: t("appHealthListenersRestart") });
|
||||
} else {
|
||||
checks.push({ level: "ok", label: t("appHealthListeners"), detail: t("appHealthListenersOk") });
|
||||
}
|
||||
|
||||
const pools = Array.isArray(status.backend_pools) ? status.backend_pools : [];
|
||||
const members = pools.flatMap(pool => (pool.members || []).map(member => ({ pool: pool.id, ...member })));
|
||||
const down = members.filter(member => member.status === "down");
|
||||
const checking = members.filter(member => member.status === "checking");
|
||||
const unavailablePools = pools.filter(pool => pool.ready === false && (pool.members || []).some(member => ["up", "down", "checking"].includes(member.status))).map(pool => pool.id).filter(Boolean);
|
||||
const affected = [...down, ...checking].slice(0, 5).map(member => `${member.pool}/${member.id}`).join(", ");
|
||||
if (unavailablePools.length) {
|
||||
let detail = t("appHealthBackendsError").replace("{pools}", unavailablePools.slice(0, 5).join(", ") + (unavailablePools.length > 5 ? " …" : ""));
|
||||
if (affected) detail += ` ${t("appHealthBackendsAffected").replace("{members}", affected + (down.length + checking.length > 5 ? " …" : ""))}`;
|
||||
checks.push({ level: "error", label: t("appHealthBackends"), detail });
|
||||
} else if (down.length || checking.length) {
|
||||
checks.push({ level: "warning", label: t("appHealthBackends"), detail: t("appHealthBackendsWarning").replace("{down}", String(down.length)).replace("{checking}", String(checking.length)).replace("{members}", affected + (down.length + checking.length > 5 ? " …" : "")) });
|
||||
} else {
|
||||
checks.push({ level: "ok", label: t("appHealthBackends"), detail: pools.length ? t("appHealthBackendsOk") : t("appHealthBackendsNone") });
|
||||
}
|
||||
|
||||
const sink = status.logging?.sinks || {}, errorFile = status.logging?.error_file || {};
|
||||
const loggingDropped = (Number(sink.queue_dropped) || 0) + (Number(errorFile.queue_dropped) || 0);
|
||||
const loggingErrors = (Number(sink.errors) || 0) + (Number(errorFile.errors) || 0);
|
||||
if (loggingDropped || loggingErrors) {
|
||||
checks.push({ level: "warning", label: t("appHealthLogging"), detail: t("appHealthLoggingWarning").replace("{dropped}", String(loggingDropped)).replace("{errors}", String(loggingErrors)) });
|
||||
} else {
|
||||
checks.push({ level: "ok", label: t("appHealthLogging"), detail: t("appHealthLoggingOk") });
|
||||
}
|
||||
return checks;
|
||||
}
|
||||
function appHealthLevel(checks) {
|
||||
if (!checks.length) return "checking";
|
||||
if (checks.some(check => check.level === "error")) return "error";
|
||||
if (checks.some(check => check.level === "warning")) return "warning";
|
||||
return "ok";
|
||||
}
|
||||
function setAppHealthClass(node, level) {
|
||||
if (!node) return;
|
||||
node.classList.remove("is-checking", "is-ok", "is-warning", "is-error");
|
||||
node.classList.add(`is-${level}`);
|
||||
}
|
||||
function renderAppHealth(status = latestStatus) {
|
||||
const checks = appHealthChecks(status), level = appHealthLevel(checks);
|
||||
const labelKeys = { checking: "appHealthSidebarChecking", ok: "appHealthSidebarOk", warning: "appHealthSidebarWarning", error: "appHealthSidebarError" };
|
||||
const summaryKeys = { checking: "appHealthChecking", ok: "appHealthOk", warning: "appHealthWarning", error: "appHealthError" };
|
||||
const button = $("app-health-open"), label = $("app-health-label"), summaryRow = $("app-health-summary-row"), summary = $("app-health-summary");
|
||||
setAppHealthClass(button, level); setAppHealthClass(summaryRow, level);
|
||||
if (label) { label.dataset.i18n = labelKeys[level]; label.textContent = t(labelKeys[level]); }
|
||||
if (summary) { summary.dataset.i18n = summaryKeys[level]; summary.textContent = t(summaryKeys[level]); }
|
||||
const updated = $("app-health-updated");
|
||||
if (updated) updated.textContent = appHealthUpdatedAt ? t("appHealthUpdated").replace("{time}", appHealthUpdatedAt.toLocaleTimeString(locale())) : t("appHealthNoStatus");
|
||||
const list = $("app-health-checks");
|
||||
if (list) list.replaceChildren(...checks.map(check => {
|
||||
const row = el("div", undefined, `app-health-check is-${check.level}`), dot = el("i"), copy = el("div");
|
||||
dot.setAttribute("aria-hidden", "true"); copy.append(el("strong", check.label), el("p", check.detail, "fine")); row.append(dot, copy); return row;
|
||||
}));
|
||||
}
|
||||
function enhanceEnabledControl(input, hintKey = "entityEnableHint") {
|
||||
const label = input?.closest("label"); if (!label) return () => { };
|
||||
label.classList.add("vh-enable-control", "vh-wide");
|
||||
@@ -257,7 +320,7 @@ function renderStatusNow(s, systemSample = false) {
|
||||
logging: s.logging ? { ...(latestStatus?.logging || {}), ...s.logging } : latestStatus?.logging
|
||||
};
|
||||
s = latestStatus; window.rustProxySettings?.render(); if (firstStatus) renderSettings();
|
||||
connected = true; $("connection-label").textContent = t("connected"); $("signal").classList.remove("status-error"); const m = s.metrics;
|
||||
connected = true; $("connection-label").textContent = t("connected"); $("signal").classList.remove("status-error"); $("app-health-slot").hidden = false; appHealthUpdatedAt = new Date(); renderAppHealth(s); const m = s.metrics;
|
||||
$("metric-ws").textContent = m.websocket_active || 0;
|
||||
$("metric-ws-h1").textContent = m.websocket_h1_active || 0;
|
||||
$("metric-ws-h2").textContent = m.websocket_h2_active || 0;
|
||||
@@ -299,7 +362,7 @@ function renderStatusNow(s, systemSample = false) {
|
||||
function renderFooter(s) {
|
||||
const apiLatency = lastApiLatencyMs == null ? "API -" : `API ${lastApiLatencyMs.toFixed(lastApiLatencyMs < 10 ? 1 : 0)} ms`;
|
||||
const footer = $("footer-status");
|
||||
footer.replaceChildren(document.createTextNode(`${apiLatency} / ${t("logsDropped")}: ${s.logs_dropped}`));
|
||||
footer.replaceChildren(document.createTextNode(apiLatency));
|
||||
const update = s.software_update;
|
||||
if (update?.update_available && update.latest_version) {
|
||||
footer.append(document.createTextNode(" / "));
|
||||
@@ -319,7 +382,7 @@ let lastLogs = null;
|
||||
function renderLogs(data) { lastLogs = data; window.rustProxyLogs?.render(data); }
|
||||
async function refresh(force = false) {
|
||||
if (!authenticated) return;
|
||||
if (force) return Promise.all([rustProxyRefresh.manual("status-full"), rustProxyRefresh.manual("logs-fallback")]);
|
||||
if (force) return rustProxyRefresh.manual("status-full");
|
||||
return rustProxyRefresh.manual("status-fallback");
|
||||
}
|
||||
function renderLiveStatus(value) { renderStatus(value); }
|
||||
@@ -333,15 +396,16 @@ function startLive() {
|
||||
if (liveEvents && liveInterval === seconds) return;
|
||||
stopLive();
|
||||
liveInterval = seconds;
|
||||
const epoch = authEpoch, stream = new EventSource(`/api/events?interval=${seconds}`);
|
||||
const epoch = authEpoch, stream = new EventSource(`/api/events?interval=${seconds}&logs=false`);
|
||||
liveEvents = stream;
|
||||
stream.addEventListener("snapshot", event => {
|
||||
if (!authenticated || epoch !== authEpoch || stream !== liveEvents) return;
|
||||
try {
|
||||
const payload = JSON.parse(event.data);
|
||||
if (!payload.status || !payload.logs) throw new Error("Invalid SSE payload");
|
||||
if (!payload.status) throw new Error("Invalid SSE payload");
|
||||
liveConnected = true; liveFallback = false;
|
||||
renderLiveStatus(payload.status); renderLogs(payload.logs);
|
||||
renderLiveStatus(payload.status);
|
||||
if (payload.logs) renderLogs(payload.logs);
|
||||
window.rustProxyRefresh?.sync();
|
||||
} catch (error) { liveConnected = false; liveFallback = true; window.rustProxyRefresh?.sync(); }
|
||||
});
|
||||
@@ -421,12 +485,12 @@ function lock(notify = true) {
|
||||
window.rustProxyInlineLayout?.cancel?.();
|
||||
window.rustProxyRefresh?.stop();
|
||||
const destination = pendingAuthDestination || authReturnDestination(), navigating = typeof location !== "undefined" && (location.protocol === "http:" || location.protocol === "https:");
|
||||
pendingAuthDestination = destination; if (notify) adminAuthChannel?.postMessage("locked"); $("api-docs").hidden = true; $("logs-menu").hidden = true; resetAdminPreferences(); window.rustProxyCertificates?.reset(); window.rustProxySettings?.reset(); window.rustProxyTrafficPanel?.reset(); window.rustProxyCachePanel?.reset(); window.rustProxyTransformPanel?.reset(); window.rustProxyAcme?.reset(); window.rustProxyIntegrations?.reset(); window.rustProxyLogs?.reset(); window.rustProxyFileLogs?.reset(); window.rustProxyDrafts?.reset(); $("logs-open").hidden = true; $("file-logs-open").hidden = true; window.rustProxyAclProfiles?.reset(); window.rustProxyVhosts?.reset(); window.rustProxyWebServer?.reset(); window.rustProxyDocker?.reset(); window.rustProxyRedirects?.reset(); window.rustProxyNotFound?.reset(); window.rustProxyStreams?.reset(); window.rustProxyStreamDashboard?.reset(); window.rustProxyBackendDashboard?.reset(); window.rustProxyExtraOverview?.reset(); window.rustProxyWideOverview?.reset(); window.rustProxyWebOverview?.reset(); authEpoch++; stopLive(); csrf = ""; authenticated = false; sessionInfo = null; envelope = null; configStorage = null; certificateInventory = new Map(); previous = null; samples = []; protocolSamples = { h1: [], h2: [], h3: [] }; websocketProtocolSamples = { h1: [], h2: [], h3: [] }; transformSamples = []; systemSamples = []; connectionOpenSamples = []; connectionExchangeSamples = []; networkInterfaceSamples.clear(); lastLogs = null; latestStatus = null; clearSettingsDirty(); connected = false; busy = false; $("workspace").hidden = true; $("login").hidden = navigating; $("logout").hidden = true; $("password").value = ""; $("password-confirm").value = ""; $("setup-token").value = ""; $("password-form").reset(); $("config-editor").value = ""; $("logs").replaceChildren(); $("audit-rows").replaceChildren(); authMessage("");
|
||||
pendingAuthDestination = destination; if (notify) adminAuthChannel?.postMessage("locked"); $("api-docs").hidden = true; $("logs-menu").hidden = true; $("app-health-slot").hidden = true; resetAdminPreferences(); window.rustProxyCertificates?.reset(); window.rustProxySettings?.reset(); window.rustProxyTrafficPanel?.reset(); window.rustProxyCachePanel?.reset(); window.rustProxyTransformPanel?.reset(); window.rustProxyAcme?.reset(); window.rustProxyIntegrations?.reset(); window.rustProxyLogs?.reset(); window.rustProxyFileLogs?.reset(); window.rustProxyDrafts?.reset(); $("logs-open").hidden = true; $("file-logs-open").hidden = true; window.rustProxyAclProfiles?.reset(); window.rustProxyVhosts?.reset(); window.rustProxyWebServer?.reset(); window.rustProxyDocker?.reset(); window.rustProxyRedirects?.reset(); window.rustProxyNotFound?.reset(); window.rustProxyStreams?.reset(); window.rustProxyStreamDashboard?.reset(); window.rustProxyBackendDashboard?.reset(); window.rustProxyExtraOverview?.reset(); window.rustProxyWideOverview?.reset(); window.rustProxyWebOverview?.reset(); authEpoch++; stopLive(); csrf = ""; authenticated = false; sessionInfo = null; envelope = null; configStorage = null; certificateInventory = new Map(); previous = null; samples = []; protocolSamples = { h1: [], h2: [], h3: [] }; websocketProtocolSamples = { h1: [], h2: [], h3: [] }; transformSamples = []; systemSamples = []; connectionOpenSamples = []; connectionExchangeSamples = []; networkInterfaceSamples.clear(); lastLogs = null; latestStatus = null; clearSettingsDirty(); connected = false; busy = false; $("workspace").hidden = true; $("login").hidden = navigating; $("logout").hidden = true; $("password").value = ""; $("password-confirm").value = ""; $("setup-token").value = ""; $("password-form").reset(); $("config-editor").value = ""; $("logs").replaceChildren(); $("audit-rows").replaceChildren(); authMessage("");
|
||||
for (const id of ["certificate-list", "host-policy-list"]) { $(id)?.replaceChildren(); }
|
||||
$("workspace").querySelectorAll("form").forEach(form => form.reset());
|
||||
$("workspace").querySelectorAll("input:not([type=checkbox]):not([type=radio]),textarea").forEach(input => { input.value = ""; });
|
||||
document.querySelectorAll("dialog").forEach(dialog => { dialog.close(); dialog.querySelectorAll("input:not([type=checkbox]):not([type=radio]),textarea").forEach(input => input.value = ""); });
|
||||
renderSession(); syncAuthForm();
|
||||
appHealthUpdatedAt = null; renderAppHealth(null); renderSession(); syncAuthForm();
|
||||
if (navigating) { document.documentElement.classList.add("app-loading"); location.replace(destination); }
|
||||
}
|
||||
|
||||
@@ -506,6 +570,8 @@ function stopTunnelRefresh() { window.rustProxyRefresh?.sync(); }
|
||||
function startTunnelRefresh() { window.rustProxyRefresh?.sync(); }
|
||||
$("login-form").addEventListener("submit", async event => { event.preventDefault(); const form = event.currentTarget; authMessage(""); try { await withFormSubmitState(form, event.submitter, async () => { const username = $("username").value.trim(); const password = $("password").value; if (setupRequired) { if (password !== $("password-confirm").value) throw fieldError("password-confirm", t("passwordMismatch")); await api("/api/auth/setup", { method: "POST", body: JSON.stringify({ token: $("setup-token").value.trim(), username, password }) }); setupRequired = false; syncAuthForm(); } const info = await api("/api/auth/login", { method: "POST", body: JSON.stringify({ username, password }) }); await activate(info); clearTimeout(toastTimer); hideToast(); }); } catch (e) { if (e.code === "auth.already_initialized") { setupRequired = false; syncAuthForm(); } $("password").value = ""; $("password-confirm").value = ""; authMessage(e.message); } });
|
||||
$("logout").addEventListener("click", async () => { try { await api("/api/auth/logout", { method: "POST" }); lock(); toast(t("locked")); } catch (e) { if (e.status === 401) lock(); toast(e.message, true); } });
|
||||
$("app-health-open")?.addEventListener("click", () => { renderAppHealth(connected ? latestStatus : null); const dialog = $("app-health-dialog"); if (!dialog.open) dialog.showModal(); });
|
||||
$("app-health-close")?.addEventListener("click", () => $("app-health-dialog").close());
|
||||
$("about-open").addEventListener("click", () => { const dialog = $("about-dialog"); if (!dialog.open) dialog.showModal(); });
|
||||
$("about-close").addEventListener("click", () => $("about-dialog").close());
|
||||
const mobileMenuToggle = $("mobile-menu-toggle"), dashboardSidebar = document.querySelector(".sidebar");
|
||||
|
||||
@@ -9,9 +9,9 @@ window.rustProxyInlineLayout = (() => {
|
||||
const hiddenList = $("overview-inline-hidden-list");
|
||||
const hiddenCount = $("overview-inline-hidden-count");
|
||||
const modalButton = $("overview-layout-open");
|
||||
const compactButton = $("overview-inline-compact");
|
||||
let draft = null;
|
||||
let original = null;
|
||||
let dragging = null;
|
||||
let opening = false;
|
||||
let saving = false;
|
||||
|
||||
@@ -72,10 +72,7 @@ window.rustProxyInlineLayout = (() => {
|
||||
if (widen) widen.disabled = at === widths.length - 1;
|
||||
}
|
||||
}
|
||||
function clearDrag() {
|
||||
dragging = null;
|
||||
for (const node of nodes()) node.classList.remove("is-overview-dragging", "is-overview-drop-before", "is-overview-drop-after");
|
||||
}
|
||||
function clearDrag() { if (pointerDrag) settle(false); }
|
||||
function move(id, target, after = false) {
|
||||
if (!draft || id === target) return;
|
||||
if (!visibleIds().includes(id) || !visibleIds().includes(target)) return;
|
||||
@@ -118,7 +115,7 @@ window.rustProxyInlineLayout = (() => {
|
||||
const title = label(id);
|
||||
const bar = el("div", undefined, "overview-inline-toolbar");
|
||||
const grip = control("⠿", `${t("overviewLayoutInlineDrag")}: ${title}`, "overview-inline-grip", () => { });
|
||||
grip.draggable = true;
|
||||
grip.setAttribute("aria-describedby", "overview-inline-hint");
|
||||
grip.dataset.overviewDragHandle = id;
|
||||
const sizeControls = el("span", undefined, "overview-inline-width");
|
||||
const widthValue = el("span", "", "overview-inline-width-value");
|
||||
@@ -142,6 +139,7 @@ window.rustProxyInlineLayout = (() => {
|
||||
actions.hidden = false;
|
||||
hint.hidden = false;
|
||||
hint.textContent = t("overviewLayoutInlineHint");
|
||||
if (compactButton) compactButton.title = t("overviewLayoutInlineCompactHint");
|
||||
if (hiddenShelf) { hiddenShelf.hidden = false; hiddenShelf.open = false; }
|
||||
if (modalButton) modalButton.disabled = true;
|
||||
for (const node of nodes()) toolbar(node);
|
||||
@@ -195,40 +193,185 @@ window.rustProxyInlineLayout = (() => {
|
||||
finally { saving = false; saveButton.disabled = cancelButton.disabled = unlock.disabled = false; }
|
||||
}
|
||||
function cancel() { if (draft && !saving) finish(false); }
|
||||
function dropTarget(event) {
|
||||
const widget = event.target?.closest?.("[data-dashboard-widget]");
|
||||
return widget && grid.contains(widget) && !widget.hidden && visibleIds().includes(widget.dataset.dashboardWidget) ? widget : null;
|
||||
// Pointer-driven sorting with a live placeholder. The grid never back-fills
|
||||
// holes while a block is lifted, so the placeholder shows exactly where the
|
||||
// block lands; neighbours glide (FLIP) instead of jumping.
|
||||
const DRAG_THRESHOLD = 5, EDGE = 64, MOVE_COOLDOWN_MS = 90;
|
||||
const reducedMotion = () => window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;
|
||||
let pointerDrag = null;
|
||||
function flip(mutate) {
|
||||
const before = new Map(nodes().filter(node => !node.hidden && node !== pointerDrag?.node)
|
||||
.map(node => [node, node.getBoundingClientRect()]));
|
||||
mutate();
|
||||
if (reducedMotion()) return;
|
||||
for (const [node, rect] of before) {
|
||||
const after = node.getBoundingClientRect();
|
||||
const dx = rect.left - after.left, dy = rect.top - after.top;
|
||||
if (!dx && !dy) continue;
|
||||
node.animate?.([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: "translate(0, 0)" }],
|
||||
{ duration: 160, easing: "cubic-bezier(.2, .7, .3, 1)" });
|
||||
}
|
||||
}
|
||||
function positionAfter(widget, event) {
|
||||
const rect = widget.getBoundingClientRect();
|
||||
return event.clientX >= rect.left + rect.width / 2;
|
||||
function placeholderTarget(x, y) {
|
||||
const drag = pointerDrag;
|
||||
const hit = document.elementFromPoint(x, y);
|
||||
const widget = hit?.closest?.("[data-dashboard-widget]");
|
||||
if (widget && grid.contains(widget) && widget !== drag.node && !widget.hidden) return { node: widget };
|
||||
if (hit === drag.placeholder || drag.placeholder.contains(hit)) return null;
|
||||
if (hit !== grid) return null;
|
||||
// Empty grid area (gap or hole at a row end): attach to the nearest block in that row.
|
||||
const candidates = nodes().filter(node => node !== drag.node && !node.hidden);
|
||||
let best = null, bestDistance = Infinity;
|
||||
for (const node of candidates) {
|
||||
const rect = node.getBoundingClientRect();
|
||||
if (y < rect.top - 8 || y > rect.bottom + 8) continue;
|
||||
const distance = x < rect.left ? rect.left - x : x > rect.right ? x - rect.right : 0;
|
||||
if (distance < bestDistance) { bestDistance = distance; best = { node, after: x > rect.left + rect.width / 2 }; }
|
||||
}
|
||||
if (best) return best;
|
||||
const last = candidates.at(-1);
|
||||
if (last && y > last.getBoundingClientRect().bottom) return { node: last, after: true };
|
||||
return null;
|
||||
}
|
||||
grid?.addEventListener("dragstart", event => {
|
||||
function updatePlaceholder(x, y) {
|
||||
const drag = pointerDrag;
|
||||
if (performance.now() < drag.cooldownUntil) return;
|
||||
const target = placeholderTarget(x, y);
|
||||
if (!target) return;
|
||||
const children = [...grid.children];
|
||||
const placeholderIndex = children.indexOf(drag.placeholder), targetIndex = children.indexOf(target.node);
|
||||
// Entering a block swaps the placeholder past it; this is stable and never oscillates.
|
||||
const after = target.after ?? placeholderIndex < targetIndex;
|
||||
const reference = after ? target.node.nextSibling : target.node;
|
||||
if (reference === drag.placeholder || (after ? target.node.nextSibling === drag.placeholder : target.node.previousSibling === drag.placeholder)) return;
|
||||
flip(() => grid.insertBefore(drag.placeholder, reference));
|
||||
drag.cooldownUntil = performance.now() + MOVE_COOLDOWN_MS;
|
||||
}
|
||||
function autoScroll() {
|
||||
const drag = pointerDrag;
|
||||
if (!drag?.active) return;
|
||||
const height = window.innerHeight;
|
||||
let speed = 0;
|
||||
if (drag.y < EDGE) speed = -Math.ceil((EDGE - drag.y) / 4);
|
||||
else if (drag.y > height - EDGE) speed = Math.ceil((drag.y - (height - EDGE)) / 4);
|
||||
if (speed) {
|
||||
const scroller = document.scrollingElement || document.documentElement;
|
||||
const previous = scroller.scrollTop;
|
||||
scroller.scrollTop += speed;
|
||||
if (scroller.scrollTop !== previous) updatePlaceholder(drag.x, drag.y);
|
||||
}
|
||||
drag.frame = requestAnimationFrame(autoScroll);
|
||||
}
|
||||
function liftBlock() {
|
||||
const drag = pointerDrag;
|
||||
enterFreeLayout();
|
||||
paint();
|
||||
const rect = drag.node.getBoundingClientRect();
|
||||
const placeholder = el("div", undefined, "overview-drop-placeholder");
|
||||
placeholder.dataset.dashboardSpan = drag.node.dataset.dashboardSpan || "2";
|
||||
placeholder.style.minHeight = `${Math.round(rect.height)}px`;
|
||||
placeholder.setAttribute("aria-hidden", "true");
|
||||
drag.origin = drag.node.nextSibling;
|
||||
drag.placeholder = placeholder;
|
||||
drag.offsetX = drag.startX - rect.left;
|
||||
drag.offsetY = drag.startY - rect.top;
|
||||
drag.width = rect.width;
|
||||
drag.height = rect.height;
|
||||
drag.active = true;
|
||||
drag.cooldownUntil = 0;
|
||||
grid.insertBefore(placeholder, drag.node);
|
||||
grid.classList.add("is-overview-sorting");
|
||||
drag.node.classList.add("is-overview-lifted");
|
||||
Object.assign(drag.node.style, {
|
||||
position: "fixed", left: "0px", top: "0px", width: `${rect.width}px`, height: `${rect.height}px`,
|
||||
zIndex: "60", pointerEvents: "none", margin: "0",
|
||||
});
|
||||
moveLifted();
|
||||
hint.textContent = t("overviewLayoutInlineDragging");
|
||||
drag.frame = requestAnimationFrame(autoScroll);
|
||||
}
|
||||
function moveLifted() {
|
||||
const drag = pointerDrag;
|
||||
drag.node.style.transform = `translate(${drag.x - drag.offsetX}px, ${drag.y - drag.offsetY}px) rotate(.6deg) scale(1.015)`;
|
||||
}
|
||||
function settle(commit) {
|
||||
const drag = pointerDrag;
|
||||
pointerDrag = null;
|
||||
if (!drag) return;
|
||||
window.removeEventListener("pointermove", onPointerMove);
|
||||
window.removeEventListener("pointerup", onPointerUp);
|
||||
window.removeEventListener("pointercancel", onPointerCancel);
|
||||
window.removeEventListener("keydown", onDragKey, true);
|
||||
if (!drag.active) return;
|
||||
cancelAnimationFrame(drag.frame);
|
||||
for (const key of ["position", "left", "top", "width", "height", "zIndex", "pointerEvents", "margin", "transform"]) drag.node.style[key] = "";
|
||||
drag.node.classList.remove("is-overview-lifted");
|
||||
grid.classList.remove("is-overview-sorting");
|
||||
if (commit) drag.placeholder.replaceWith(drag.node);
|
||||
else { drag.placeholder.remove(); grid.insertBefore(drag.node, drag.origin?.parentNode === grid ? drag.origin : null); }
|
||||
hint.textContent = t("overviewLayoutInlineHint");
|
||||
if (commit) {
|
||||
const domOrder = nodes().map(node => node.dataset.dashboardWidget).filter(id => !draft.hidden.has(id));
|
||||
const iter = domOrder.values();
|
||||
draft.order = draft.order.map(item => draft.hidden.has(item) ? item : iter.next().value);
|
||||
}
|
||||
paint();
|
||||
drag.node.querySelector(".overview-inline-grip")?.focus({ preventScroll: true });
|
||||
drag.node.animate?.([{ boxShadow: "0 0 0 3px var(--accent)" }, { boxShadow: "0 0 0 0 transparent" }], { duration: 450 });
|
||||
}
|
||||
function onPointerMove(event) {
|
||||
const drag = pointerDrag;
|
||||
if (!drag || event.pointerId !== drag.pointerId) return;
|
||||
drag.x = event.clientX; drag.y = event.clientY;
|
||||
if (!drag.active) {
|
||||
if (Math.hypot(drag.x - drag.startX, drag.y - drag.startY) < DRAG_THRESHOLD) return;
|
||||
liftBlock();
|
||||
}
|
||||
event.preventDefault();
|
||||
moveLifted();
|
||||
updatePlaceholder(drag.x, drag.y);
|
||||
}
|
||||
function onPointerUp(event) { if (pointerDrag && event.pointerId === pointerDrag.pointerId) settle(true); }
|
||||
function onPointerCancel(event) { if (pointerDrag && event.pointerId === pointerDrag.pointerId) settle(false); }
|
||||
function onDragKey(event) { if (event.key === "Escape" && pointerDrag) { event.preventDefault(); event.stopPropagation(); settle(false); } }
|
||||
grid?.addEventListener("pointerdown", event => {
|
||||
const handle = event.target?.closest?.("[data-overview-drag-handle]");
|
||||
if (!draft || !handle || !grid.contains(handle)) { event.preventDefault(); return; }
|
||||
dragging = handle.dataset.overviewDragHandle;
|
||||
event.dataTransfer?.setData("text/plain", dragging);
|
||||
if (event.dataTransfer) event.dataTransfer.effectAllowed = "move";
|
||||
nodeFor(dragging)?.classList.add("is-overview-dragging");
|
||||
});
|
||||
grid?.addEventListener("dragover", event => {
|
||||
if (!draft || !dragging) return;
|
||||
const target = dropTarget(event);
|
||||
if (!target || target.dataset.dashboardWidget === dragging) return;
|
||||
if (!draft || saving || pointerDrag || !handle || !grid.contains(handle) || event.button !== 0) return;
|
||||
const node = nodeFor(handle.dataset.overviewDragHandle);
|
||||
if (!node) return;
|
||||
event.preventDefault();
|
||||
for (const node of nodes()) node.classList.remove("is-overview-drop-before", "is-overview-drop-after");
|
||||
target.classList.add(positionAfter(target, event) ? "is-overview-drop-after" : "is-overview-drop-before");
|
||||
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
||||
pointerDrag = { node, pointerId: event.pointerId, startX: event.clientX, startY: event.clientY, x: event.clientX, y: event.clientY, active: false };
|
||||
window.addEventListener("pointermove", onPointerMove, { passive: false });
|
||||
window.addEventListener("pointerup", onPointerUp);
|
||||
window.addEventListener("pointercancel", onPointerCancel);
|
||||
window.addEventListener("keydown", onDragKey, true);
|
||||
});
|
||||
grid?.addEventListener("drop", event => {
|
||||
if (!draft || !dragging) return;
|
||||
grid?.addEventListener("keydown", event => {
|
||||
const handle = event.target?.closest?.("[data-overview-drag-handle]");
|
||||
if (!draft || !handle) return;
|
||||
const delta = { ArrowLeft: -1, ArrowUp: -1, ArrowRight: 1, ArrowDown: 1 }[event.key];
|
||||
if (!delta) return;
|
||||
event.preventDefault();
|
||||
const target = dropTarget(event), from = dragging;
|
||||
clearDrag();
|
||||
if (target && target.dataset.dashboardWidget !== from)
|
||||
move(from, target.dataset.dashboardWidget, positionAfter(target, event));
|
||||
nudge(handle.dataset.overviewDragHandle, delta);
|
||||
nodeFor(handle.dataset.overviewDragHandle)?.querySelector(".overview-inline-grip")?.focus();
|
||||
});
|
||||
grid?.addEventListener("dragend", clearDrag);
|
||||
function compact() {
|
||||
// Explicit, one-off gap filling: reads the dense packing the browser would
|
||||
// produce and adopts it as the new order, so nothing moves unexpectedly later.
|
||||
if (!draft) return;
|
||||
enterFreeLayout();
|
||||
paint();
|
||||
flip(() => {
|
||||
grid.style.gridAutoFlow = "row dense";
|
||||
const placed = nodes().filter(node => !node.hidden).map(node => ({ id: node.dataset.dashboardWidget, rect: node.getBoundingClientRect() }));
|
||||
grid.style.gridAutoFlow = "";
|
||||
placed.sort((a, b) => Math.round(a.rect.top) - Math.round(b.rect.top) || a.rect.left - b.rect.left);
|
||||
const iter = placed.map(item => item.id).values();
|
||||
draft.order = draft.order.map(item => draft.hidden.has(item) ? item : iter.next().value);
|
||||
paint();
|
||||
});
|
||||
}
|
||||
compactButton?.addEventListener("click", compact);
|
||||
unlock?.addEventListener("click", () => { if (draft) void save(); else void begin(); });
|
||||
saveButton?.addEventListener("click", () => { void save(); });
|
||||
cancelButton?.addEventListener("click", cancel);
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
const UI_ICON_NS = "http://www.w3.org/2000/svg";
|
||||
const UI_ICON_SHAPES = Object.freeze({
|
||||
activity: [["path", { d: "M3 12h4l2-6 4 12 2-6h6" }]],
|
||||
alert: [["path", { d: "M12 3 2.8 20h18.4L12 3Z" }], ["path", { d: "M12 9v4" }], ["circle", { cx: "12", cy: "17", r: ".7", fill: "currentColor", stroke: "none" }]],
|
||||
archive: [["rect", { x: "3", y: "5", width: "18", height: "4", rx: "1" }], ["path", { d: "M5 9v10h14V9M9 13h6" }]],
|
||||
book: [["path", { d: "M4 4.5h5.5A2.5 2.5 0 0 1 12 7v13a3 3 0 0 0-3-3H4V4.5ZM20 4.5h-5.5A2.5 2.5 0 0 0 12 7v13a3 3 0 0 1 3-3h5V4.5Z" }]],
|
||||
box: [["path", { d: "m12 3 8 4.5v9L12 21l-8-4.5v-9L12 3Z" }], ["path", { d: "m4 7.5 8 4.5 8-4.5M12 12v9" }]],
|
||||
certificate: [["rect", { x: "4", y: "3", width: "16", height: "14", rx: "2" }], ["path", { d: "M8 7h8M8 10h5M9 17l-1 4 4-2 4 2-1-4" }]],
|
||||
check: [["path", { d: "m5 12 4 4L19 6" }]],
|
||||
chevronDown: [["path", { d: "m6 9 6 6 6-6" }]],
|
||||
chevronLeft: [["path", { d: "m15 6-6 6 6 6" }]],
|
||||
chevronRight: [["path", { d: "m9 6 6 6-6 6" }]],
|
||||
chevronUp: [["path", { d: "m6 15 6-6 6 6" }]],
|
||||
code: [["path", { d: "m9 7-5 5 5 5M15 7l5 5-5 5M13 5l-2 14" }]],
|
||||
command: [["rect", { x: "4", y: "4", width: "16", height: "16", rx: "4" }], ["path", { d: "M8 12h8M12 8v8" }]],
|
||||
copy: [["rect", { x: "8", y: "8", width: "11", height: "11", rx: "2" }], ["path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" }]],
|
||||
cpu: [["rect", { x: "7", y: "7", width: "10", height: "10", rx: "2" }], ["path", { d: "M9 1v4M15 1v4M9 19v4M15 19v4M1 9h4M1 15h4M19 9h4M19 15h4M10 10h4v4h-4z" }]],
|
||||
database: [["ellipse", { cx: "12", cy: "5", rx: "7", ry: "3" }], ["path", { d: "M5 5v7c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 12v7c0 1.7 3.1 3 7 3s7-1.3 7-3v-7" }]],
|
||||
download: [["path", { d: "M12 3v12m0 0-4-4m4 4 4-4M4 19h16" }]],
|
||||
edit: [["path", { d: "M4 20h4l11-11-4-4L4 16v4ZM13.5 6.5l4 4" }]],
|
||||
external: [["path", { d: "M14 4h6v6M20 4l-9 9" }], ["path", { d: "M18 13v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6" }]],
|
||||
eye: [["path", { d: "M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6S2.5 12 2.5 12Z" }], ["circle", { cx: "12", cy: "12", r: "2.5" }]],
|
||||
eyeOff: [["path", { d: "M3 3l18 18M10.6 6.2A10 10 0 0 1 12 6c6 0 9.5 6 9.5 6a15 15 0 0 1-3 3.6M6.1 6.2C3.8 8 2.5 12 2.5 12s3.5 6 9.5 6a10 10 0 0 0 3.2-.5M9.9 9.9a3 3 0 0 0 4.2 4.2" }]],
|
||||
file: [["path", { d: "M6 3h8l4 4v14H6V3Z" }], ["path", { d: "M14 3v5h5" }]],
|
||||
fileX: [["path", { d: "M6 3h8l4 4v14H6V3ZM14 3v5h5M9 13l6 6M15 13l-6 6" }]],
|
||||
filter: [["path", { d: "M3 5h18l-7 8v6l-4 2v-8L3 5Z" }]],
|
||||
globe: [["circle", { cx: "12", cy: "12", r: "9" }], ["path", { d: "M3 12h18M12 3c2.5 2.7 3.5 5.7 3.5 9S14.5 18.3 12 21M12 3C9.5 5.7 8.5 8.7 8.5 12S9.5 18.3 12 21" }]],
|
||||
grid: [["rect", { x: "4", y: "4", width: "6", height: "6", rx: "1" }], ["rect", { x: "14", y: "4", width: "6", height: "6", rx: "1" }], ["rect", { x: "4", y: "14", width: "6", height: "6", rx: "1" }], ["rect", { x: "14", y: "14", width: "6", height: "6", rx: "1" }]],
|
||||
history: [["path", { d: "M4 8V4m0 0h4M4 4l3 3a8 8 0 1 1-2.2 7" }], ["path", { d: "M12 8v5l3 2" }]],
|
||||
key: [["circle", { cx: "8", cy: "12", r: "4" }], ["path", { d: "M12 12h9M18 12v3M15 12v2" }]],
|
||||
list: [["path", { d: "M9 6h11M9 12h11M9 18h11" }], ["circle", { cx: "4.5", cy: "6", r: ".8", fill: "currentColor", stroke: "none" }], ["circle", { cx: "4.5", cy: "12", r: ".8", fill: "currentColor", stroke: "none" }], ["circle", { cx: "4.5", cy: "18", r: ".8", fill: "currentColor", stroke: "none" }]],
|
||||
loader: [["path", { d: "M20 12a8 8 0 1 1-2.3-5.7" }]],
|
||||
lock: [["rect", { x: "5", y: "10", width: "14", height: "10", rx: "2" }], ["path", { d: "M8 10V7a4 4 0 0 1 8 0v3" }]],
|
||||
login: [["path", { d: "M10 5H5v14h5M14 8l4 4-4 4M8 12h10" }]],
|
||||
logout: [["path", { d: "M14 5h5v14h-5M10 8l-4 4 4 4M16 12H6" }]],
|
||||
menu: [["path", { d: "M4 7h16M4 12h16M4 17h16" }]],
|
||||
network: [["rect", { x: "9", y: "3", width: "6", height: "5", rx: "1" }], ["rect", { x: "3", y: "16", width: "6", height: "5", rx: "1" }], ["rect", { x: "15", y: "16", width: "6", height: "5", rx: "1" }], ["path", { d: "M12 8v4M6 16v-4h12v4" }]],
|
||||
palette: [["path", { d: "M12 3a9 9 0 1 0 0 18h1.5a2 2 0 0 0 0-4H12a2 2 0 0 1 0-4h4a5 5 0 0 0 0-10h-4Z" }], ["circle", { cx: "7", cy: "10", r: "1", fill: "currentColor", stroke: "none" }], ["circle", { cx: "9", cy: "6.5", r: "1", fill: "currentColor", stroke: "none" }], ["circle", { cx: "14", cy: "6", r: "1", fill: "currentColor", stroke: "none" }]],
|
||||
pause: [["path", { d: "M8 5v14M16 5v14" }]],
|
||||
pin: [["path", { d: "m9 3 6 6-2 2 4 4-2 2-4-4-2 2-6-6 2-2 4 4 2-2-4-4 2-2ZM5 19l4-4" }]],
|
||||
play: [["path", { d: "m8 5 11 7-11 7V5Z" }]],
|
||||
plus: [["path", { d: "M12 5v14M5 12h14" }]],
|
||||
refresh: [["path", { d: "M20 7v5h-5M4 17v-5h5" }], ["path", { d: "M18.5 9A7 7 0 0 0 6.2 6.2L4 8M5.5 15A7 7 0 0 0 17.8 17.8L20 16" }]],
|
||||
route: [["circle", { cx: "6", cy: "6", r: "2" }], ["circle", { cx: "18", cy: "18", r: "2" }], ["path", { d: "M8 6h4a4 4 0 0 1 4 4v0a4 4 0 0 1-4 4H8a2 2 0 0 0-2 2v0" }]],
|
||||
save: [["path", { d: "M5 4h12l2 2v14H5V4Z" }], ["path", { d: "M8 4v6h8V4M8 20v-6h8v6" }]],
|
||||
search: [["circle", { cx: "10.5", cy: "10.5", r: "6.5" }], ["path", { d: "m15.5 15.5 5 5" }]],
|
||||
settings: [["circle", { cx: "12", cy: "12", r: "3" }], ["path", { d: "M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6 7 7M17 17l1.4 1.4M18.4 5.6 17 7M7 17l-1.4 1.4" }]],
|
||||
shield: [["path", { d: "M12 3 20 6v6c0 5-3.3 8-8 9-4.7-1-8-4-8-9V6l8-3Z" }], ["path", { d: "m8.5 12 2.2 2.2 4.8-5" }]],
|
||||
sliders: [["path", { d: "M4 7h6M14 7h6M4 17h10M18 17h2M10 4v6M14 14v6" }]],
|
||||
sortDown: [["path", { d: "M8 5v14M5 16l3 3 3-3M14 8h5M14 12h4M14 16h3" }]],
|
||||
sortUp: [["path", { d: "M8 19V5M5 8l3-3 3 3M14 8h3M14 12h4M14 16h5" }]],
|
||||
trash: [["path", { d: "M4 7h16M9 3h6l1 4H8l1-4ZM7 7l1 14h8l1-14M10 11v6M14 11v6" }]],
|
||||
toggleOff: [["rect", { x: "3", y: "7", width: "18", height: "10", rx: "5" }], ["circle", { cx: "8", cy: "12", r: "3", fill: "currentColor", stroke: "none" }]],
|
||||
toggleOn: [["rect", { x: "3", y: "7", width: "18", height: "10", rx: "5" }], ["circle", { cx: "16", cy: "12", r: "3", fill: "currentColor", stroke: "none" }]],
|
||||
undo: [["path", { d: "M9 7H4v-5M4 7l4-4M4.5 8A8 8 0 1 1 5 17" }]],
|
||||
upload: [["path", { d: "M12 16V4m0 0-4 4m4-4 4 4M4 20h16" }]],
|
||||
users: [["circle", { cx: "9", cy: "9", r: "3" }], ["path", { d: "M3 20v-2a5 5 0 0 1 10 0v2M16 8a3 3 0 0 1 0 6M16 15a5 5 0 0 1 5 5" }]],
|
||||
wand: [["path", { d: "m4 20 12-12 3 3L7 23 4 20ZM14 4l1-3 1 3 3 1-3 1-1 3-1-3-3-1 3-1ZM19 14l.7-2 .8 2 2 .8-2 .7-.8 2-.7-2-2-.7 2-.8Z" }]],
|
||||
x: [["path", { d: "M6 6l12 12M18 6 6 18" }]],
|
||||
});
|
||||
|
||||
const UI_PANEL_ICONS = Object.freeze({
|
||||
overview: "grid", vhosts: "network", "web-server": "globe", "docker-vhosts": "box",
|
||||
redirects: "route", notfound: "fileX", streams: "network", "acl-profiles": "shield",
|
||||
tls: "certificate", traffic: "activity", cache: "database", transform: "wand", settings: "settings",
|
||||
});
|
||||
const UI_SETTINGS_TAB_ICONS = Object.freeze({
|
||||
appearance: "palette", listeners: "network", connections: "globe", "docker-agents": "box",
|
||||
policies: "shield", cache: "database", transform: "wand", forwarding: "route", pages: "file",
|
||||
logging: "list", geoip: "globe", prometheus: "activity", administration: "settings",
|
||||
"system-info": "cpu", "certificate-api": "key", "tls-policy": "lock", "manual-config": "code", security: "shield",
|
||||
});
|
||||
const UI_VHOST_TAB_ICONS = Object.freeze({
|
||||
details: "sliders", backends: "network", health: "activity", locations: "route", auth: "key", ssl: "lock",
|
||||
cache: "database", compression: "archive", transform: "wand", security: "shield", pages: "file", advanced: "code",
|
||||
});
|
||||
const UI_TRANSLATED_ICON_KEYS = Object.freeze([
|
||||
["trash", ["remove", "delete", "draftDiscard", "cacheRemoveBan", "certificateApiRevokeAll", "revokeAll"]],
|
||||
["x", ["close", "cancelAction", "overviewLayoutInlineCancel"]],
|
||||
["save", ["saveCertificate", "savePassword", "dashboardPresetsSave", "overviewLayoutInlineSave"]],
|
||||
["check", ["apply", "applyFilters", "savePolicy", "continueAction", "webServicePresetApply", "dockerApplyService"]],
|
||||
["plus", ["addCertificate", "vhNew", "webServiceNew", "redirectNew", "notfoundNew", "streamNew", "aclProfileNew", "phpProfileAdd", "redirectAddRule", "streamAddListener", "aclProfileAddIpException", "apiTokenCreate"]],
|
||||
["refresh", ["refresh", "refreshNow", "reload", "reloadAudit", "reloadCertificates", "tunnelsReload", "dockerRefresh", "cacheRefresh", "sessionRetry"]],
|
||||
["undo", ["configHistoryRestoreAction", "dashboardPresetsFactory", "draftRestore"]],
|
||||
["edit", ["edit"]],
|
||||
["download", ["export"]],
|
||||
["upload", ["acmeImport", "aclProfileImportRules"]],
|
||||
["eye", ["certificateReadNames", "dockerShowHidden", "dashboardWidgetsShowAll"]],
|
||||
["settings", ["settings", "vhManage", "dockerAgentsSettings"]],
|
||||
["book", ["webServiceHtaccessDocs", "webServicePhpDocsButton"]],
|
||||
["pause", ["logPause"]],
|
||||
["pin", ["logPin"]],
|
||||
["history", ["configHistory"]],
|
||||
["chevronLeft", ["previous"]],
|
||||
["chevronRight", ["next"]],
|
||||
]);
|
||||
|
||||
function uiIconSvg(name) {
|
||||
const definition = UI_ICON_SHAPES[name] || UI_ICON_SHAPES.command;
|
||||
const svg = document.createElementNS(UI_ICON_NS, "svg");
|
||||
svg.classList.add("ui-icon"); svg.dataset.uiIcon = name; svg.setAttribute("viewBox", "0 0 24 24");
|
||||
svg.setAttribute("aria-hidden", "true"); svg.setAttribute("focusable", "false");
|
||||
svg.setAttribute("fill", "none"); svg.setAttribute("stroke", "currentColor"); svg.setAttribute("stroke-width", "1.8");
|
||||
svg.setAttribute("stroke-linecap", "round"); svg.setAttribute("stroke-linejoin", "round");
|
||||
for (const [tag, attrs] of definition) {
|
||||
const node = document.createElementNS(UI_ICON_NS, tag);
|
||||
for (const [key, value] of Object.entries(attrs)) node.setAttribute(key, value);
|
||||
svg.append(node);
|
||||
}
|
||||
return svg;
|
||||
}
|
||||
function uiIconStrings(target) {
|
||||
return [target.textContent, target.getAttribute("aria-label"), target.title].filter(Boolean).map(value => String(value).trim().toLocaleLowerCase());
|
||||
}
|
||||
function uiIconMatchesTranslation(target, keys) {
|
||||
if (typeof t !== "function") return false;
|
||||
const strings = uiIconStrings(target); if (!strings.length) return false;
|
||||
for (const key of keys) {
|
||||
const translated = String(t(key) || "").trim().toLocaleLowerCase();
|
||||
if (!translated || translated === key.toLocaleLowerCase()) continue;
|
||||
if (strings.some(value => value === translated || value.startsWith(`${translated} `) || value.startsWith(`${translated}:`))) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function uiIconForTarget(target) {
|
||||
const manual = target.dataset.uiIconName;
|
||||
if (manual === "none") return null;
|
||||
if (manual && UI_ICON_SHAPES[manual]) return manual;
|
||||
if (target.matches(".chart-style-choice")) return null;
|
||||
if (target.matches(".overview-inline-grip, .overview-inline-narrow, .overview-inline-widen, .overview-inline-up, .overview-inline-down, .overview-inline-hide, .overview-layout-narrow, .overview-layout-widen, .overview-layout-up, .overview-layout-down, .overview-layout-hide")) return null;
|
||||
if (target.matches("#tunnels-open")) return null;
|
||||
if (target.matches("#web-service-preset-apply")) return "wand";
|
||||
if (target.matches(".vhost-quick-toggle.is-enable")) return "toggleOn";
|
||||
if (target.matches(".vhost-quick-toggle.is-disable")) return "toggleOff";
|
||||
if (target.matches(".listener-h2-settings-link, .listener-h3-settings-link")) return "settings";
|
||||
if (target.dataset.panel && UI_PANEL_ICONS[target.dataset.panel]) return UI_PANEL_ICONS[target.dataset.panel];
|
||||
if (target.dataset.settingsTab && UI_SETTINGS_TAB_ICONS[target.dataset.settingsTab]) return UI_SETTINGS_TAB_ICONS[target.dataset.settingsTab];
|
||||
if (target.dataset.tab && UI_VHOST_TAB_ICONS[target.dataset.tab]) return UI_VHOST_TAB_ICONS[target.dataset.tab];
|
||||
if (target.dataset.certificateTab) return ({ installed: "certificate", renewal: "refresh", generate: "plus" })[target.dataset.certificateTab] || "certificate";
|
||||
if (target.dataset.trafficTab) return ({ overview: "grid", clients: "users", requests: "list", delivery: "activity" })[target.dataset.trafficTab] || "activity";
|
||||
if (target.dataset.httpSettingsTab) return "network";
|
||||
if (target.dataset.policySettingsTab) return target.dataset.policySettingsTab === "headers" || target.dataset.policySettingsTab === "response" ? "list" : "shield";
|
||||
if (target.dataset.cacheSettingsTab) return ({ general: "database", resilience: "shield", cold: "archive", diagnostics: "activity" })[target.dataset.cacheSettingsTab] || "database";
|
||||
if (target.dataset.loggingSettingsTab) return ({ outputs: "list", format: "code", errors: "alert" })[target.dataset.loggingSettingsTab] || "list";
|
||||
if (target.dataset.dashboardWidgetAction === "toggle") return target.classList.contains("is-hidden") ? "eyeOff" : "eye";
|
||||
if (target.dataset.dashboardWidgetAction === "up") return "chevronLeft";
|
||||
if (target.dataset.dashboardWidgetAction === "down") return "chevronRight";
|
||||
|
||||
const signature = [target.id, target.dataset.i18n, target.dataset.i18nAria, target.dataset.action, target.className]
|
||||
.filter(Boolean).join(" ").toLocaleLowerCase();
|
||||
const aria = String(target.getAttribute("aria-label") || "").toLocaleLowerCase();
|
||||
if (/mobile-menu|menu-toggle/.test(signature)) return "menu";
|
||||
if (/is-saving|saving/.test(signature)) return "loader";
|
||||
if (/sort-direction|sort-button/.test(signature)) return /descending|desc/.test(aria) ? "sortDown" : "sortUp";
|
||||
if (/scroll-prev|move-earlier|layout-up/.test(signature)) return "chevronLeft";
|
||||
if (/scroll-next|move-later|layout-down/.test(signature)) return "chevronRight";
|
||||
if (/collapse|narrow/.test(signature)) return "chevronDown";
|
||||
if (/expand|widen/.test(signature)) return "chevronUp";
|
||||
if (/health/.test(signature) && !/certificate/.test(signature)) return "activity";
|
||||
if (/copy/.test(signature)) return "copy";
|
||||
if (/export|download/.test(signature)) return "download";
|
||||
if (/import|upload/.test(signature)) return "upload";
|
||||
if (/search|find/.test(signature)) return "search";
|
||||
if (/filter/.test(signature)) return "filter";
|
||||
if (/inspect|preview|read-names|readnames|show-hidden|visibility|view-toggle/.test(signature)) return "eye";
|
||||
if (/history|revision/.test(signature)) return "history";
|
||||
if (/restore|factory/.test(signature)) return "undo";
|
||||
if (/refresh|reload|retry|renew|update-now|updatenow/.test(signature)) return "refresh";
|
||||
if (/reset/.test(signature)) return "undo";
|
||||
if (/revoke|remove|delete|discard|purge|kill/.test(signature)) return "trash";
|
||||
if (/close|cancel/.test(signature)) return "x";
|
||||
if (/new|add|create|generate|issue/.test(signature)) return "plus";
|
||||
if (/save/.test(signature)) return "save";
|
||||
if (/apply|submit|continue/.test(signature)) return "check";
|
||||
if (/edit/.test(signature)) return "edit";
|
||||
if (/pause/.test(signature)) return "pause";
|
||||
if (/pin|dock/.test(signature)) return "pin";
|
||||
if (/start|run-operation|cleanup-start/.test(signature)) return "play";
|
||||
if (/logout|sign-out|lock/.test(signature)) return "logout";
|
||||
if (/login|sign-in/.test(signature)) return "login";
|
||||
if (/certificate-api|api-token|token|secret|key/.test(signature)) return "key";
|
||||
if (/certificate|acme|tls/.test(signature)) return "certificate";
|
||||
if (/security|acl|policy|audit/.test(signature)) return "shield";
|
||||
if (/settings|manage|configuration/.test(signature)) return "settings";
|
||||
if (/docker/.test(signature)) return "box";
|
||||
if (/vhost|backend|stream|tunnel|listener/.test(signature)) return "network";
|
||||
if (/redirect|forward/.test(signature)) return "route";
|
||||
if (/notfound|404/.test(signature)) return "fileX";
|
||||
if (/cache|cold/.test(signature)) return "database";
|
||||
if (/transform|minif/.test(signature)) return "wand";
|
||||
if (/traffic|metric|prometheus/.test(signature)) return "activity";
|
||||
if (/log/.test(signature)) return "list";
|
||||
if (/docs|help|documentation/.test(signature)) return "book";
|
||||
if (/php|json|advanced|code/.test(signature)) return "code";
|
||||
if (/layout|preset|dashboard|overview/.test(signature)) return "grid";
|
||||
if (/about|info/.test(signature)) return "book";
|
||||
if (target.matches("a[href]")) return target.href?.startsWith(location.origin) ? "file" : "external";
|
||||
for (const [icon, keys] of UI_TRANSLATED_ICON_KEYS) if (uiIconMatchesTranslation(target, keys)) return icon;
|
||||
if (aria && typeof t === "function") {
|
||||
if (aria.startsWith(String(t("remove")).toLocaleLowerCase())) return "trash";
|
||||
if (aria.startsWith(String(t("copyValue")).toLocaleLowerCase())) return "copy";
|
||||
if (aria === String(t("dashboardWidgetsMoveEarlier")).toLocaleLowerCase()) return "chevronLeft";
|
||||
if (aria === String(t("dashboardWidgetsMoveLater")).toLocaleLowerCase()) return "chevronRight";
|
||||
}
|
||||
return "command";
|
||||
}
|
||||
const UI_ICON_TARGET_SELECTOR = "button, a.primary, a.outline, a.quiet, #logs-menu > summary";
|
||||
function uiIconTargetIsEligible(target) {
|
||||
return target instanceof Element && target.matches(UI_ICON_TARGET_SELECTOR);
|
||||
}
|
||||
function uiDecorateIconTarget(target) {
|
||||
if (!uiIconTargetIsEligible(target)) return;
|
||||
const existing = target.querySelector(":scope > svg.ui-icon");
|
||||
if (document.documentElement.dataset.interfaceIcons !== "true") { existing?.remove(); return; }
|
||||
const name = uiIconForTarget(target);
|
||||
if (!name) { existing?.remove(); return; }
|
||||
if (existing?.dataset.uiIcon === name) return;
|
||||
existing?.remove(); target.prepend(uiIconSvg(name));
|
||||
}
|
||||
function refreshUiIcons(root = document) {
|
||||
if (root instanceof Element && uiIconTargetIsEligible(root)) uiDecorateIconTarget(root);
|
||||
root.querySelectorAll?.(UI_ICON_TARGET_SELECTOR).forEach(uiDecorateIconTarget);
|
||||
}
|
||||
let uiIconObserverActive = false;
|
||||
function setUiIconsEnabled(value) {
|
||||
const enabled = value === true;
|
||||
document.documentElement.dataset.interfaceIcons = String(enabled);
|
||||
if (enabled) {
|
||||
if (!uiIconObserverActive) {
|
||||
uiIconObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "aria-label", "aria-expanded", "aria-pressed", "data-i18n", "data-action"] });
|
||||
uiIconObserverActive = true;
|
||||
}
|
||||
refreshUiIcons();
|
||||
} else {
|
||||
if (uiIconObserverActive) { uiIconObserver.disconnect(); uiIconObserverActive = false; }
|
||||
document.querySelectorAll("svg.ui-icon").forEach(node => node.remove());
|
||||
}
|
||||
const input = $("ui-interface-icons"); if (input) input.checked = enabled;
|
||||
return enabled;
|
||||
}
|
||||
const uiIconObserver = new MutationObserver(records => {
|
||||
if (document.documentElement.dataset.interfaceIcons !== "true") return;
|
||||
const targets = new Set();
|
||||
for (const record of records) {
|
||||
const element = record.target instanceof Element ? record.target : record.target.parentElement;
|
||||
const action = element?.closest?.(UI_ICON_TARGET_SELECTOR); if (action) targets.add(action);
|
||||
for (const node of record.addedNodes) {
|
||||
if (!(node instanceof Element)) continue;
|
||||
if (uiIconTargetIsEligible(node)) targets.add(node);
|
||||
node.querySelectorAll?.(UI_ICON_TARGET_SELECTOR).forEach(item => targets.add(item));
|
||||
}
|
||||
}
|
||||
targets.forEach(uiDecorateIconTarget);
|
||||
});
|
||||
window.rustProxyIcons = { refresh: refreshUiIcons, setEnabled: setUiIconsEnabled, iconFor: uiIconForTarget };
|
||||
@@ -219,7 +219,11 @@ window.rustProxyExtraOverview = (() => {
|
||||
donut("extra-cache-ratio", slices?.[0], slices?.[1]);
|
||||
}
|
||||
const detail = $(`overview-extra-${id}-detail`);
|
||||
if (detail && id !== "extra_cache_hit_rate") detail.textContent = metric.detail || t("overviewExtraRecentSamples");
|
||||
if (detail && id !== "extra_cache_hit_rate") {
|
||||
const detailText = metric.detail || "";
|
||||
detail.textContent = detailText;
|
||||
detail.hidden = !detailText;
|
||||
}
|
||||
}
|
||||
}
|
||||
function reset() { histories.clear(); lastCounter.clear(); lastValue.clear(); lastUnits.clear(); lastSegments.clear(); window.rustProxyChartScale.reset("extra:"); }
|
||||
|
||||
@@ -2,64 +2,40 @@ window.rustProxyOverviewSamples = (() => {
|
||||
const allowed = new Set([60, 120, 300, 600]);
|
||||
const storageKey = "rustproxy.overview.liveChartSamples";
|
||||
const factory = typeof ADMIN_DASHBOARD_DEFAULTS === "object" ? Number(ADMIN_DASHBOARD_DEFAULTS.overview_samples) : 60;
|
||||
let saved = allowed.has(factory) ? factory : 60;
|
||||
let limit = allowed.has(factory) ? factory : 60;
|
||||
try {
|
||||
const stored = Number(localStorage.getItem(storageKey));
|
||||
if (allowed.has(stored)) saved = stored;
|
||||
} catch { /* Private browsing or storage policy: temporary selection still works. */ }
|
||||
let limit = saved;
|
||||
if (allowed.has(stored)) limit = stored;
|
||||
} catch { /* Private browsing or storage policy: selection still works for this visit. */ }
|
||||
const callbacks = new Set();
|
||||
let confirmationTimer = null;
|
||||
const getLimit = () => limit;
|
||||
const trim = array => {
|
||||
if (Array.isArray(array) && array.length > limit) array.splice(0, array.length - limit);
|
||||
return array;
|
||||
};
|
||||
// The status is shown only for a temporary choice, a storage problem or briefly after saving.
|
||||
function sync(messageKey = limit === saved ? null : "overviewSamplesTemporary", confirmation = false) {
|
||||
function sync() {
|
||||
const select = document.getElementById("overview-live-samples");
|
||||
if (select) select.value = String(limit);
|
||||
const state = document.getElementById("overview-samples-state");
|
||||
if (state) {
|
||||
clearTimeout(confirmationTimer);
|
||||
if (messageKey) {
|
||||
state.dataset.i18n = messageKey;
|
||||
state.textContent = t(messageKey);
|
||||
state.style.visibility = "visible";
|
||||
} else {
|
||||
state.style.visibility = "hidden";
|
||||
}
|
||||
if (confirmation) confirmationTimer = setTimeout(() => { state.style.visibility = "hidden"; }, 2500);
|
||||
}
|
||||
const save = document.getElementById("overview-samples-save");
|
||||
if (save) save.disabled = limit === saved;
|
||||
}
|
||||
function setLimit(value, persist = false) {
|
||||
const count = Number(value);
|
||||
if (!allowed.has(count)) return false;
|
||||
const changed = count !== limit;
|
||||
limit = count;
|
||||
if (persist) {
|
||||
try {
|
||||
localStorage.setItem(storageKey, String(count));
|
||||
saved = count;
|
||||
} catch {
|
||||
const changed = count !== limit;
|
||||
limit = count;
|
||||
if (changed) for (const callback of callbacks) callback(limit);
|
||||
sync("overviewSamplesStorageUnavailable");
|
||||
return false;
|
||||
if (typeof toast === "function") toast(t("overviewSamplesStorageUnavailable"), true);
|
||||
}
|
||||
}
|
||||
const changed = count !== limit;
|
||||
limit = count;
|
||||
if (changed) for (const callback of callbacks) callback(limit);
|
||||
if (persist) sync("overviewSamplesSaved", true); else sync();
|
||||
sync();
|
||||
return true;
|
||||
}
|
||||
function init() {
|
||||
const select = document.getElementById("overview-live-samples");
|
||||
const save = document.getElementById("overview-samples-save");
|
||||
select?.addEventListener("change", () => setLimit(select.value));
|
||||
save?.addEventListener("click", () => setLimit(select.value, true));
|
||||
select?.addEventListener("change", () => setLimit(select.value, true));
|
||||
sync();
|
||||
}
|
||||
if (document.readyState !== "complete") document.addEventListener("DOMContentLoaded", init, { once: true });
|
||||
|
||||
@@ -13,7 +13,7 @@ const ADMIN_DEFAULT_HIDDEN_WIDGETS = Object.freeze([...new Set([
|
||||
])]);
|
||||
const ADMIN_APPEARANCE_DEFAULTS = Object.freeze({
|
||||
theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", chart_style: "default",
|
||||
chart_axes: false,
|
||||
chart_axes: false, interface_icons: false,
|
||||
button_style: "normal", corner_style: "default", table_density: "normal", dashboard_density: ADMIN_DASHBOARD_DEFAULTS.dashboard_density, dashboard_widgets: [...ADMIN_DASHBOARD_WIDGETS], dashboard_hidden_widgets: [...ADMIN_DEFAULT_HIDDEN_WIDGETS], dashboard_widget_sizes: null,
|
||||
});
|
||||
const CHART_STYLE_KEYS = Object.freeze({ default: "chartStyleDefault", soft: "chartStyleSoft", technical: "chartStyleTechnical", high_contrast: "chartStyleHighContrast", neon: "chartStyleNeon", monochrome: "chartStyleMonochrome", warm: "chartStyleWarm", cool: "chartStyleCool" });
|
||||
@@ -123,6 +123,7 @@ function applyAdminChartAxes(value) {
|
||||
window.rustProxyChartScale?.refreshAxes?.();
|
||||
return enabled;
|
||||
}
|
||||
function applyAdminInterfaceIcons(value) { return window.rustProxyIcons?.setEnabled?.(value === true) ?? false; }
|
||||
function applyAdminButtonStyle(value) {
|
||||
const style = normalizeAdminButtonStyle(value); document.documentElement.dataset.buttonStyle = style;
|
||||
const select = $("ui-button-style"); if (select) select.value = style; return style;
|
||||
@@ -287,7 +288,7 @@ function applyAdminPreferences(value, cache = true) {
|
||||
...value,
|
||||
refresh: normalizeRefreshPreferences(value.refresh),
|
||||
theme: applyAdminTheme(value.theme, cache), language: applyAdminLanguage(value.language, cache, false), ui_scale: applyAdminUiScale(value.ui_scale, cache),
|
||||
time_format: applyAdminTimeFormat(value.time_format), chart_style: applyAdminChartStyle(value.chart_style), chart_axes: applyAdminChartAxes(value.chart_axes), button_style: applyAdminButtonStyle(value.button_style), corner_style: applyAdminCornerStyle(value.corner_style, cache), table_density: applyAdminTableDensity(value.table_density),
|
||||
time_format: applyAdminTimeFormat(value.time_format), chart_style: applyAdminChartStyle(value.chart_style), chart_axes: applyAdminChartAxes(value.chart_axes), interface_icons: applyAdminInterfaceIcons(value.interface_icons), button_style: applyAdminButtonStyle(value.button_style), corner_style: applyAdminCornerStyle(value.corner_style, cache), table_density: applyAdminTableDensity(value.table_density),
|
||||
dashboard_density: applyAdminDashboardDensity(value.dashboard_density), dashboard_widgets: savedOrder, dashboard_hidden_widgets: savedHidden, dashboard_widget_sizes: savedSizes,
|
||||
};
|
||||
adminPreferences = normalized;
|
||||
@@ -335,7 +336,7 @@ function updateAdminPreferences(patch) {
|
||||
const next = { ...current, ...patch };
|
||||
next.refresh = normalizeRefreshPreferences(next.refresh);
|
||||
next.theme = normalizeAdminTheme(next.theme); next.language = normalizeAdminLanguage(next.language); next.ui_scale = normalizeAdminUiScale(next.ui_scale);
|
||||
next.time_format = normalizeAdminTimeFormat(next.time_format); next.chart_style = normalizeAdminChartStyle(next.chart_style); next.chart_axes = next.chart_axes === true; next.button_style = normalizeAdminButtonStyle(next.button_style); next.corner_style = normalizeAdminCornerStyle(next.corner_style); next.table_density = normalizeAdminDensity(next.table_density);
|
||||
next.time_format = normalizeAdminTimeFormat(next.time_format); next.chart_style = normalizeAdminChartStyle(next.chart_style); next.chart_axes = next.chart_axes === true; next.interface_icons = next.interface_icons === true; next.button_style = normalizeAdminButtonStyle(next.button_style); next.corner_style = normalizeAdminCornerStyle(next.corner_style); next.table_density = normalizeAdminDensity(next.table_density);
|
||||
next.dashboard_density = normalizeAdminDensity(next.dashboard_density, "compact"); next.dashboard_widgets = normalizeDashboardWidgets(next.dashboard_widgets); next.dashboard_hidden_widgets = normalizeHiddenDashboardWidgets(next.dashboard_hidden_widgets); next.dashboard_widget_sizes = normalizeDashboardWidgetSizes(next.dashboard_widget_sizes);
|
||||
const saved = await api("/api/preferences", { method: "PUT", body: JSON.stringify(next) });
|
||||
if (!authenticated || epoch !== authEpoch) return adminPreferences;
|
||||
@@ -343,7 +344,7 @@ function updateAdminPreferences(patch) {
|
||||
});
|
||||
adminPreferencesWrite = task.catch(() => undefined); return task;
|
||||
}
|
||||
function resetAdminPreferences() { adminPreferences = null; adminPreferencesLoading = null; adminPreferencesUnavailable = false; adminPreferencesWrite = Promise.resolve(); window.rustProxyRefresh?.update(REFRESH_DEFAULTS); }
|
||||
function resetAdminPreferences() { adminPreferences = null; adminPreferencesLoading = null; adminPreferencesUnavailable = false; adminPreferencesWrite = Promise.resolve(); applyAdminInterfaceIcons(false); window.rustProxyRefresh?.update(REFRESH_DEFAULTS); }
|
||||
function renderRefreshPreferences(value = REFRESH_DEFAULTS) {
|
||||
const refresh = normalizeRefreshPreferences(value);
|
||||
const switcher = $("refresh-live-enabled"); if (switcher) switcher.checked = refresh.live_enabled;
|
||||
@@ -419,6 +420,14 @@ $("ui-chart-axes")?.addEventListener("change", () => {
|
||||
applyAdminChartAxes(previous);
|
||||
});
|
||||
});
|
||||
$("ui-interface-icons")?.addEventListener("change", () => {
|
||||
const control = $("ui-interface-icons"), previous = adminPreferences?.interface_icons === true, next = control.checked;
|
||||
applyAdminInterfaceIcons(next); if (adminPreferences) adminPreferences.interface_icons = next;
|
||||
void saveAppearancePreference({ interface_icons: next }, control, () => {
|
||||
if (adminPreferences) adminPreferences.interface_icons = previous;
|
||||
applyAdminInterfaceIcons(previous);
|
||||
});
|
||||
});
|
||||
$("ui-button-style")?.addEventListener("change", () => {
|
||||
const control = $("ui-button-style"), previous = adminPreferences?.button_style || "normal", next = normalizeAdminButtonStyle(control.value);
|
||||
applyAdminButtonStyle(next); if (adminPreferences) adminPreferences.button_style = next; void saveAppearancePreference({ button_style: next }, control, () => { if (adminPreferences) adminPreferences.button_style = previous; applyAdminButtonStyle(previous); });
|
||||
@@ -450,7 +459,7 @@ async function resetAppearancePatch(patch, control, messageKey = "appearanceSect
|
||||
}
|
||||
document.querySelectorAll("[data-appearance-reset]").forEach(control => control.addEventListener("click", () => {
|
||||
const patches = {
|
||||
interface: { theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", button_style: "normal", corner_style: "default" }, charts: { chart_style: "default", chart_axes: false }, tables: { table_density: "normal" },
|
||||
interface: { theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", interface_icons: false, button_style: "normal", corner_style: "default" }, charts: { chart_style: "default", chart_axes: false }, tables: { table_density: "normal" },
|
||||
dashboard: { dashboard_density: ADMIN_DASHBOARD_DEFAULTS.dashboard_density, dashboard_widgets: [...ADMIN_DASHBOARD_WIDGETS], dashboard_hidden_widgets: [...ADMIN_APPEARANCE_DEFAULTS.dashboard_hidden_widgets], dashboard_widget_sizes: null },
|
||||
};
|
||||
void resetAppearancePatch(patches[control.dataset.appearanceReset] || {}, control);
|
||||
|
||||
@@ -167,10 +167,10 @@ const rustProxyRefresh = (() => {
|
||||
interval: () => options.overview_seconds, active: () => !liveConnected && (liveFallback || typeof EventSource === "undefined"), run: async ({ signal, isCurrent }) => {
|
||||
const value = await api("/api/status?view=live", { signal });
|
||||
if (isCurrent()) renderLiveStatus(value);
|
||||
}, onError: error => { if (error?.status !== 401) $("connection-label").textContent = t("disconnected"); }
|
||||
}, onError: error => { if (error?.status !== 401) { connected = false; $("connection-label").textContent = t("disconnected"); $("signal").classList.add("status-error"); $("app-health-slot").hidden = false; renderAppHealth(null); } }
|
||||
});
|
||||
register("logs-fallback", {
|
||||
interval: () => options.overview_seconds, active: () => !liveConnected && (liveFallback || typeof EventSource === "undefined"), run: async ({ signal, isCurrent }) => {
|
||||
interval: () => options.overview_seconds, active: () => !!window.rustProxyLogs?.active?.(), run: async ({ signal, isCurrent }) => {
|
||||
const value = await api("/api/logs", { signal });
|
||||
if (isCurrent()) renderLogs(value);
|
||||
}
|
||||
@@ -199,6 +199,6 @@ const rustProxyRefresh = (() => {
|
||||
window.rustProxyRefresh = rustProxyRefresh;
|
||||
|
||||
$("overview-refresh")?.addEventListener("click", () => {
|
||||
void Promise.all([rustProxyRefresh.manual("status-full"), rustProxyRefresh.manual("logs-fallback"), rustProxyRefresh.manual("system-info")]);
|
||||
void Promise.all([rustProxyRefresh.manual("status-full"), rustProxyRefresh.manual("system-info")]);
|
||||
});
|
||||
$("system-info-refresh")?.addEventListener("click", () => void rustProxyRefresh.manual("system-info"));
|
||||
@@ -48,7 +48,7 @@ function syncCertificateFileSource() {
|
||||
for (const input of [cert, key]) {
|
||||
input.maxLength = external ? 4096 : 96;
|
||||
if (external) input.removeAttribute("pattern");
|
||||
else input.pattern = "[A-Za-z0-9_.-]+";
|
||||
else input.pattern = "[A-Za-z0-9_.\\-]+";
|
||||
}
|
||||
cert.placeholder = external ? "/etc/letsencrypt/live/example.com/fullchain.pem" : "app.pem";
|
||||
key.placeholder = external ? "/etc/letsencrypt/live/example.com/privkey.pem" : "app.key";
|
||||
@@ -435,8 +435,6 @@ function renderDiagnostics(status, appendSample = true, systemSample = appendSam
|
||||
$("process-summary").hidden = d.process_threads == null;
|
||||
if (d.process_threads != null) $("process-summary").textContent = `${fmt(d.process_threads)} ${t("threads")}`;
|
||||
setOptionalMetric("system-cpu", d.cpu_percent != null, `${fmt(d.cpu_percent, 1)}%`);
|
||||
const sourceSupported = !!d.source && d.source !== "unsupported";
|
||||
$("system-source").hidden = !sourceSupported; if (sourceSupported) $("system-source").textContent = t("realSample");
|
||||
const systemMemory = knownPair(d.memory_used_bytes, d.memory_total_bytes, value => fmtBytes(value));
|
||||
setOptionalMetric("system-memory", systemMemory != null, systemMemory);
|
||||
const ramMeter = $("memory-meter"), ramFill = $("memory-meter-fill");
|
||||
@@ -457,7 +455,9 @@ function renderDiagnostics(status, appendSample = true, systemSample = appendSam
|
||||
setOptionalMetric("system-swap", systemSwap != null, systemSwap);
|
||||
const loadSupported = Array.isArray(d.load_average) && d.load_average.length > 0;
|
||||
setOptionalMetric("system-load", loadSupported, loadSupported ? d.load_average.map(n => fmt(n, 2)).join(" / ") : "");
|
||||
setOptionalMetric("system-uptime", d.system_uptime_seconds != null, d.system_uptime_seconds == null ? "" : uptime(d.system_uptime_seconds));
|
||||
const systemUptime = $("system-uptime"), systemUptimeMeta = systemUptime?.closest(".system-uptime-meta");
|
||||
if (systemUptimeMeta) systemUptimeMeta.hidden = d.system_uptime_seconds == null;
|
||||
if (systemUptime && d.system_uptime_seconds != null) systemUptime.textContent = uptime(d.system_uptime_seconds);
|
||||
}
|
||||
$("system-chart").hidden = live.cpu_percent == null; if (appendSample && live.cpu_percent != null) { systemSamples.push(Number(live.cpu_percent)); systemSamples = systemSamples.slice(-window.rustProxyOverviewSamples.getLimit()); }
|
||||
$("system-sparkline").setAttribute("points", systemSamples.map((n, i) => `${i * 300 / Math.max(1, systemSamples.length - 1)},${95 - Math.max(0, Math.min(100, n)) * .9}`).join(" "));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
(() => {
|
||||
let loading = false, offset = 0, generation = 0;
|
||||
let loading = false, offset = 0, generation = 0, staticData = null, staticRevision = null;
|
||||
let liveChartScope = "", liveChartPrevious = null, liveChartPreviousAt = null, liveChartGeneration = null;
|
||||
const liveChartSamples = { hits: [], misses: [], bypasses: [] };
|
||||
const LIVE_CHART_LIMITS = new Set([60, 120, 300, 600]);
|
||||
@@ -229,7 +229,16 @@
|
||||
const query = new URLSearchParams({ offset: String(offset), limit: "50" });
|
||||
if (scope() !== "*") query.set("vhost", scope());
|
||||
try {
|
||||
const data = await api(`/api/cache?${query}`, { signal });
|
||||
const base = `/api/cache?${query}`;
|
||||
if (staticData) query.set("view", "live");
|
||||
let data = await api(`/api/cache?${query}`, { signal });
|
||||
if (staticData && data.revision !== staticRevision) data = await api(base, { signal });
|
||||
if (data.settings && Array.isArray(data.vhosts)) {
|
||||
staticData = { settings: data.settings, vhosts: data.vhosts };
|
||||
staticRevision = data.revision;
|
||||
} else if (staticData) {
|
||||
data = { ...staticData, ...data };
|
||||
}
|
||||
if (isCurrent() && token === generation) render(data);
|
||||
} catch (error) {
|
||||
if (error?.name !== "AbortError" && epoch === authEpoch && isCurrent()) {
|
||||
@@ -343,7 +352,7 @@
|
||||
$("cache-live")?.addEventListener("change", () => rustProxyRefresh.sync());
|
||||
window.rustProxyCachePanel = {
|
||||
refresh, configure, reason, reset() {
|
||||
generation++; offset = 0; resetLiveChart(); closeInvalidation(); closeBans();
|
||||
generation++; offset = 0; staticData = null; staticRevision = null; resetLiveChart(); closeInvalidation(); closeBans();
|
||||
$("cache-domain-rows").replaceChildren(); $("cache-object-rows").replaceChildren(); $("cache-ban-rows").replaceChildren();
|
||||
$("cache-panel-state").textContent = ""; operationMessage("cache-invalidation-status"); operationMessage("cache-bans-status"); operationMessage("cache-toolbar-operation-status");
|
||||
}
|
||||
|
||||
@@ -243,5 +243,4 @@ curl --fail --show-error --request POST \
|
||||
}
|
||||
};
|
||||
renderCertificateApi();
|
||||
loadCertificateApi();
|
||||
})();
|
||||
@@ -87,6 +87,53 @@ button:disabled {
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
.ui-icon {
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-inline-end: 6px;
|
||||
vertical-align: -2px;
|
||||
flex: 0 0 auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
html[data-interface-icons="true"] svg.ui-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.nav>.ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
html[data-interface-icons="true"] .nav>svg.ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.backend-sort-direction>.ui-icon,
|
||||
.dashboard-widget-scroll-button>.ui-icon,
|
||||
.host-chip button>.ui-icon,
|
||||
.acl-picker-remove>.ui-icon,
|
||||
.draft-dock-remove>.ui-icon,
|
||||
.vhost-backend-popup-close>.ui-icon,
|
||||
.dashboard-widget-toggle>.ui-icon {
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
button.is-saving>.ui-icon[data-ui-icon="loader"] {
|
||||
animation: ui-icon-spin .8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes ui-icon-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
html[data-interface-icons="true"] .nav>span:first-of-type,
|
||||
[hidden],
|
||||
#file-log-view-counts[hidden],
|
||||
#file-log-view-entries[hidden],
|
||||
@@ -1409,9 +1456,16 @@ body[data-density=compact] .page-footer {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.about-repository span:first-child {
|
||||
margin-right: auto;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.about-repository span:last-child {
|
||||
margin-left: auto;
|
||||
color: var(--muted);
|
||||
font: 10px var(--mono);
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -175,6 +175,37 @@ nav {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.app-health-button {
|
||||
width: 100%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
padding: 6px 0;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.app-health-button i {
|
||||
flex: 0 0 auto;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.app-health-button.is-checking,
|
||||
.app-health-summary.is-checking { color: var(--muted); }
|
||||
.app-health-button.is-ok,
|
||||
.app-health-summary.is-ok,
|
||||
.app-health-check.is-ok { color: var(--green); }
|
||||
.app-health-button.is-warning,
|
||||
.app-health-summary.is-warning,
|
||||
.app-health-check.is-warning { color: var(--notice-text); }
|
||||
.app-health-button.is-error,
|
||||
.app-health-summary.is-error,
|
||||
.app-health-check.is-error { color: var(--red); }
|
||||
|
||||
.app-health-button:hover { opacity: .82; }
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -216,11 +247,71 @@ nav {
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
.sidebar-bottom p {
|
||||
font-size: 11px;
|
||||
line-height: 1.9;
|
||||
color: var(--text-subtle);
|
||||
margin: 13px 0 26px;
|
||||
.app-health-dialog {
|
||||
width: min(620px, calc(100vw - 24px));
|
||||
}
|
||||
|
||||
.app-health-card {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.app-health-summary {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.app-health-summary>i {
|
||||
flex: 0 0 auto;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin-top: 6px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.app-health-summary strong {
|
||||
color: currentColor;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.app-health-summary .fine {
|
||||
margin: 3px 0 0;
|
||||
}
|
||||
|
||||
.app-health-checks {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.app-health-check {
|
||||
display: grid;
|
||||
grid-template-columns: 9px minmax(0, 1fr);
|
||||
gap: 10px;
|
||||
align-items: start;
|
||||
padding: 9px 10px;
|
||||
border: 1px solid var(--line);
|
||||
background: var(--neutral-soft);
|
||||
}
|
||||
|
||||
.app-health-check>i {
|
||||
flex: 0 0 auto;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin-top: 5px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.app-health-check strong {
|
||||
color: var(--text);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.app-health-check .fine {
|
||||
margin: 2px 0 0;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
main {
|
||||
|
||||
@@ -15,6 +15,16 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
margin-bottom: var(--ui-gap);
|
||||
}
|
||||
|
||||
.stats-grid.cache-stats {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.stats-grid.cache-stats>.stat {
|
||||
flex: 1 1 190px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.stat {
|
||||
border: 1px solid var(--line);
|
||||
background: var(--panel);
|
||||
@@ -74,7 +84,6 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
stroke-dasharray: var(--chart-grid-dash, 2 5);
|
||||
}
|
||||
|
||||
/* Axis labels are HTML overlays, not stretched SVG text. */
|
||||
.rp-chart-axis-host {
|
||||
position: relative;
|
||||
display: flow-root;
|
||||
@@ -82,7 +91,10 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.rp-chart-axis-host>svg { display: block; vertical-align: top; }
|
||||
.rp-chart-axis-host>svg {
|
||||
display: block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.rp-chart-axis-y {
|
||||
position: absolute;
|
||||
@@ -103,9 +115,20 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
background: color-mix(in srgb, var(--panel) 82%, transparent);
|
||||
}
|
||||
|
||||
.rp-chart-axis-top { top: var(--rp-axis-top, 8%); transform: translateY(-30%); }
|
||||
.rp-chart-axis-middle { top: 50%; transform: translateY(-50%); }
|
||||
.rp-chart-axis-bottom { top: var(--rp-axis-bottom, 92%); transform: translateY(-70%); }
|
||||
.rp-chart-axis-top {
|
||||
top: var(--rp-axis-top, 8%);
|
||||
transform: translateY(-30%);
|
||||
}
|
||||
|
||||
.rp-chart-axis-middle {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.rp-chart-axis-bottom {
|
||||
top: var(--rp-axis-bottom, 92%);
|
||||
transform: translateY(-70%);
|
||||
}
|
||||
|
||||
.rp-chart-axis-x {
|
||||
display: grid;
|
||||
@@ -121,12 +144,29 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.rp-chart-axis-x .rp-chart-axis-start { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
||||
.rp-chart-axis-x .rp-chart-axis-end { min-width: 0; text-align: right; }
|
||||
.rp-chart-axis-x .rp-chart-axis-start {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.rp-chart-axis-x .rp-chart-axis-end {
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rp-chart-axis-compact .rp-chart-axis-y,
|
||||
.rp-chart-axis-multiple .rp-chart-axis-y,
|
||||
.rp-chart-axis-series[hidden] { display: none; visibility: hidden; }
|
||||
.rp-chart-axis-compact .rp-chart-axis-x { font-size: 8px; gap: 2px; }
|
||||
.rp-chart-axis-series[hidden] {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.rp-chart-axis-compact .rp-chart-axis-x {
|
||||
font-size: 8px;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.rp-chart-axis-series {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -138,8 +178,13 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.rp-chart-axis-y .rp-chart-axis-middle { display: none; }
|
||||
.rp-chart-axis-x { font-size: 8px; }
|
||||
.rp-chart-axis-y .rp-chart-axis-middle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rp-chart-axis-x {
|
||||
font-size: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.chart-footer {
|
||||
@@ -279,13 +324,19 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
min-width: 640px;
|
||||
}
|
||||
|
||||
.pool-table td:nth-child(n/**/+4) {
|
||||
.pool-table td:nth-child(n
|
||||
|
||||
/**/
|
||||
+4) {
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
[dir=rtl] table,
|
||||
.pool-table th:nth-child(n/**/+4),
|
||||
.pool-table th:nth-child(n
|
||||
|
||||
/**/
|
||||
+4),
|
||||
.logging-builder-action .small-label {
|
||||
text-align: right;
|
||||
}
|
||||
@@ -549,6 +600,66 @@ body[data-density=compact] .pool-card .table-scroll {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#panel-overview .stat-with-action>span:first-child {
|
||||
display: block;
|
||||
padding-right: 104px;
|
||||
}
|
||||
|
||||
#panel-overview .stat-with-action .stat-corner-action {
|
||||
max-width: 96px;
|
||||
padding: 3px 7px;
|
||||
font-size: 11px;
|
||||
line-height: 1.25;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#panel-overview .stat-with-action .stat-corner-badge {
|
||||
min-height: 0;
|
||||
border-radius: 999px;
|
||||
border-color: var(--line);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-size: 9px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0;
|
||||
cursor: pointer;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
#panel-overview .stat-with-action .stat-corner-badge:hover,
|
||||
#panel-overview .stat-with-action .stat-corner-badge:focus-visible {
|
||||
border-color: var(--line);
|
||||
background: var(--panel2);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked .stat-with-action .stat-corner-action {
|
||||
top: 44px;
|
||||
}
|
||||
|
||||
#panel-overview .backend-latency-stat>span:first-child {
|
||||
display: block;
|
||||
padding-right: 104px;
|
||||
}
|
||||
|
||||
#panel-overview .backend-latency-stat .backend-health-origins {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
margin: 0;
|
||||
max-width: 100px;
|
||||
color: var(--muted);
|
||||
font: 9px var(--mono);
|
||||
line-height: 1.25;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked .backend-latency-stat .backend-health-origins {
|
||||
top: 44px;
|
||||
}
|
||||
|
||||
.stat-chart strong {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
@@ -973,6 +1084,10 @@ html[data-dashboard-density=compact] #panel-overview .stat>span {
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
html[data-dashboard-density=compact] #panel-overview .stat-cache-outcomes .cache-mix-header>span {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
html[data-dashboard-density=compact] #panel-overview .stat strong {
|
||||
font-size: 22px;
|
||||
margin: 3px 0 2px;
|
||||
@@ -997,6 +1112,10 @@ html[data-dashboard-density=ultra] #panel-overview .stat>span {
|
||||
line-height: 1.08;
|
||||
}
|
||||
|
||||
html[data-dashboard-density=ultra] #panel-overview .stat-cache-outcomes .cache-mix-header>span {
|
||||
line-height: 1.08;
|
||||
}
|
||||
|
||||
html[data-dashboard-density=ultra] #panel-overview .stat strong {
|
||||
font-size: 18px;
|
||||
margin: 2px 0 1px;
|
||||
@@ -1154,44 +1273,92 @@ html[data-chart-style] :is(#workspace, dialog) svg polyline {
|
||||
position: relative;
|
||||
outline: 1px dashed var(--accent);
|
||||
outline-offset: -2px;
|
||||
padding-top: 101px;
|
||||
padding-top: 40px !important;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>.is-overview-dragging {
|
||||
opacity: .45;
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>[data-dashboard-widget]:hover,
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>[data-dashboard-widget]:focus-within {
|
||||
outline-style: solid;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>.is-overview-drop-before {
|
||||
box-shadow: inset 4px 0 var(--accent);
|
||||
#panel-overview .dashboard-overview-grid.is-overview-sorting {
|
||||
grid-auto-flow: row !important;
|
||||
user-select: none;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>.is-overview-drop-after {
|
||||
box-shadow: inset -4px 0 var(--accent);
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder {
|
||||
grid-column: auto/span 2;
|
||||
box-sizing: border-box;
|
||||
border: 2px dashed var(--accent);
|
||||
border-radius: var(--rp-radius-surface, 9px);
|
||||
background: color-mix(in srgb, var(--accent) 10%, transparent);
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder[data-dashboard-span="3"] {
|
||||
grid-column: auto/span 3;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder[data-dashboard-span="4"] {
|
||||
grid-column: auto/span 4;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder[data-dashboard-span="6"] {
|
||||
grid-column: auto/span 6;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder[data-dashboard-span="12"] {
|
||||
grid-column: 1/-1;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.is-overview-lifted,
|
||||
#panel-overview .dashboard-overview-grid>.is-overview-lifted * {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.is-overview-lifted {
|
||||
box-shadow: 0 18px 40px rgb(0 0 0 / .28), 0 0 0 2px var(--accent);
|
||||
opacity: .94;
|
||||
transition: none;
|
||||
will-change: transform;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.overview-inline-toolbar {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 4px;
|
||||
right: 4px;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
z-index: 4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
gap: 3px;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
#panel-overview .overview-inline-toolbar button {
|
||||
min-width: 28px;
|
||||
min-height: 27px;
|
||||
padding: 2px 7px;
|
||||
min-width: 26px;
|
||||
min-height: 26px;
|
||||
padding: 2px 6px;
|
||||
font-size: 12px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>[data-dashboard-span="2"] .overview-inline-toolbar :is(.overview-widget-type, .overview-inline-up, .overview-inline-down),
|
||||
#panel-overview .dashboard-overview-grid>[data-dashboard-span="3"] .overview-inline-toolbar :is(.overview-inline-up, .overview-inline-down) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>[data-dashboard-span="2"] .overview-inline-toolbar .overview-inline-hide {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
#panel-overview .overview-inline-toolbar .overview-inline-grip {
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
#panel-overview .overview-inline-toolbar .overview-inline-grip:active {
|
||||
@@ -1690,26 +1857,13 @@ html:is([data-corner-style=square], [data-corner-style=subtle], [data-corner-sty
|
||||
flex-wrap: wrap;
|
||||
max-width: 100%;
|
||||
margin: 0 0 0 auto;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.page-intro .overview-samples-toolbar .function-live-chart-samples select {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.page-intro .overview-samples-toolbar button {
|
||||
width: auto;
|
||||
flex: none;
|
||||
min-height: 28px;
|
||||
padding: 5px 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.page-intro .overview-samples-toolbar .fine {
|
||||
font-size: 10px;
|
||||
color: var(--muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#panel-overview .stat-donut .overview-donut-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1822,7 +1976,7 @@ html:is([data-corner-style=square], [data-corner-style=subtle], [data-corner-sty
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-aligned[data-overview-layout-mode=custom] {
|
||||
grid-auto-flow: row dense;
|
||||
grid-auto-flow: row;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-aligned>[data-dashboard-widget][data-dashboard-span="2"] {
|
||||
@@ -2038,7 +2192,12 @@ html[data-dashboard-density] #panel-overview .stat :is(.stat-chart-legend, .over
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
font-family: var(--sans);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
#panel-overview .stat-cache-outcomes .cache-mix-caption {
|
||||
@@ -2073,16 +2232,18 @@ html[data-dashboard-density] #panel-overview .stat :is(.stat-chart-legend, .over
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 5px 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 7px;
|
||||
line-height: 1.25;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend>span {
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -2105,22 +2266,51 @@ html[data-dashboard-density] #panel-overview .stat :is(.stat-chart-legend, .over
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend b {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
margin-left: auto;
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 2px;
|
||||
margin-left: 1px;
|
||||
color: var(--text);
|
||||
font: 500 10px var(--mono);
|
||||
overflow-wrap: anywhere;
|
||||
text-align: right;
|
||||
font: 500 9px var(--mono);
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend .cache-mix-percent {
|
||||
color: var(--muted);
|
||||
font: 400 10px var(--mono);
|
||||
font: 400 8px var(--mono);
|
||||
}
|
||||
|
||||
#panel-overview .cache-mix-legend .cache-mix-percent::before {
|
||||
content: "· ";
|
||||
}
|
||||
|
||||
#panel-overview .system-card .system-uptime-meta,
|
||||
#panel-overview .connection-card .connection-backends-meta {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#panel-overview .system-card .system-uptime-meta b,
|
||||
#panel-overview .connection-card .connection-backends-meta b {
|
||||
color: var(--text);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
#panel-overview .connection-card .connection-heading-main {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#panel-overview .connection-card .connection-current-main {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#panel-overview .connection-card .connection-backends-meta {
|
||||
margin-left: auto;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* Live values stay on one line so refreshes do not change card heights. */
|
||||
.mini-live-chart-head> :last-child,
|
||||
.network-interface-row-head .network-interface-head-actions {
|
||||
flex: 0 0 auto;
|
||||
@@ -2132,4 +2322,4 @@ html[data-dashboard-density] #panel-overview .stat :is(.stat-chart-legend, .over
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
@@ -81,11 +81,13 @@
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.appearance-interface-icons-setting,
|
||||
.appearance-chart-axes-setting {
|
||||
align-self: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.appearance-interface-icons-setting>span,
|
||||
.appearance-chart-axes-setting>span {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
@@ -1203,6 +1205,7 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Global security policy forms */
|
||||
.global-policy-form .global-policy-section {
|
||||
display: grid;
|
||||
@@ -1212,18 +1215,81 @@ html[data-dashboard-density=normal] #panel-overview .stat>span,
|
||||
padding-top: 17px;
|
||||
min-width: 0;
|
||||
}
|
||||
.global-policy-form .global-policy-section h3 { margin: 0; font-size: 14px; }
|
||||
.global-policy-heading { display: grid; gap: 5px; }
|
||||
.global-policy-heading p { margin: 0; max-width: 85ch; }
|
||||
.global-policy-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 2fr); gap: 14px; align-items: start; }
|
||||
.global-rate-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
|
||||
.global-policy-fields label, .global-rate-fields label, .global-policy-section > label:not(.check) { display: grid; gap: 6px; min-width: 0; }
|
||||
.global-policy-section textarea { width: 100%; box-sizing: border-box; }
|
||||
.global-policy-form .form-actions { margin-top: 20px; }
|
||||
.cache-static-guidance { margin: 9px 0 0; max-width: 88ch; }
|
||||
.cache-header-settings-heading { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; margin-bottom: 13px; }
|
||||
.transform-operations-title { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; margin-bottom: 14px; }
|
||||
.transform-operations-grid { margin-top: 3px; row-gap: 12px; }
|
||||
@media (max-width: 760px) {
|
||||
.global-policy-fields, .global-rate-fields { grid-template-columns: 1fr; }
|
||||
|
||||
.global-policy-form .global-policy-section h3 {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.global-policy-heading {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.global-policy-heading p {
|
||||
margin: 0;
|
||||
max-width: 85ch;
|
||||
}
|
||||
|
||||
.global-policy-fields {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(180px, 1fr) minmax(260px, 2fr);
|
||||
gap: 14px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.global-rate-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.global-policy-fields label,
|
||||
.global-rate-fields label,
|
||||
.global-policy-section>label:not(.check) {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.global-policy-section textarea {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.global-policy-form .form-actions {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.cache-static-guidance {
|
||||
margin: 9px 0 0;
|
||||
max-width: 88ch;
|
||||
}
|
||||
|
||||
.cache-header-settings-heading {
|
||||
border-top: 1px solid var(--line);
|
||||
padding-top: 18px;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
|
||||
.transform-operations-title {
|
||||
border-top: 1px solid var(--line);
|
||||
padding-top: 18px;
|
||||
margin-top: 22px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.transform-operations-grid {
|
||||
margin-top: 3px;
|
||||
row-gap: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
|
||||
.global-policy-fields,
|
||||
.global-rate-fields {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -286,6 +286,14 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar.mobile-nav-open .sidebar-bottom {
|
||||
grid-column: 1/-1;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.topbar {
|
||||
height: 46px;
|
||||
}
|
||||
@@ -702,8 +710,8 @@
|
||||
}
|
||||
|
||||
.page-intro .overview-samples-toolbar {
|
||||
margin-left: 0;
|
||||
justify-content: flex-start;
|
||||
margin-left: auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -889,8 +897,7 @@
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.logs-card>.card-heading,
|
||||
.about-repository {
|
||||
.logs-card>.card-heading {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -1457,6 +1464,10 @@
|
||||
}
|
||||
|
||||
@media (max-width:550px) {
|
||||
.stats-grid.cache-stats>.stat {
|
||||
flex-basis: 140px;
|
||||
}
|
||||
|
||||
.overview-layout-footer {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@@ -1474,7 +1485,19 @@
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked>[data-dashboard-widget] {
|
||||
padding-top: 135px;
|
||||
padding-top: 40px !important;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-unlocked .overview-inline-toolbar :is(.overview-widget-type, .overview-inline-up, .overview-inline-down) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder:is([data-dashboard-span="2"], [data-dashboard-span="3"]) {
|
||||
grid-column: auto/span 1;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid>.overview-drop-placeholder:is([data-dashboard-span="4"], [data-dashboard-span="6"], [data-dashboard-span="12"]) {
|
||||
grid-column: 1/-1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1623,6 +1646,10 @@
|
||||
padding-right: 11px;
|
||||
}
|
||||
|
||||
#panel-overview .stat-with-action>span:first-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
#panel-overview .dashboard-overview-grid.is-aligned .stat-with-action .stat-corner-action {
|
||||
position: static;
|
||||
display: block;
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
const enabledLabel = el("label", undefined, "check"); enabledLabel.append(enabled, el("span", t("enabled")));
|
||||
const state = agent ? obs(agent.id) : null, stateBadge = el("span", state?.ok ? t("dockerConnected") : state ? t("dockerError") : t("dockerWaiting"), `pill docker-agent-status-badge ${state?.ok ? "live" : ""}`.trim());
|
||||
const remove = action(t("remove"), () => { row.remove(); setSettingsDirty("docker-agents-form"); }), actions = el("div", undefined, "entity-actions docker-agent-heading-actions"); actions.append(enabledLabel, stateBadge, remove); head.append(title, actions);
|
||||
const id = input(value.id, "text", "docker-agent-id"); id.maxLength = 64; id.required = true; id.pattern = "[A-Za-z0-9_-]{1,64}"; if (agent) id.readOnly = true;
|
||||
const id = input(value.id, "text", "docker-agent-id"); id.maxLength = 64; id.required = true; id.pattern = "[A-Za-z0-9_\\-]{1,64}"; if (agent) id.readOnly = true;
|
||||
const name = input(value.name, "text", "docker-agent-name"); name.maxLength = 96; name.required = true;
|
||||
const endpoint = input(value.endpoint, "url", "docker-agent-endpoint"); endpoint.required = true; endpoint.placeholder = "https://10.0.0.20:9876";
|
||||
const token = input(value.token, "password", "docker-agent-token"); token.minLength = 24; token.maxLength = 512; token.required = true; token.autocomplete = "new-password";
|
||||
|
||||
+205
-72
@@ -58,9 +58,12 @@
|
||||
data-i18n="transform">Transform</b></button>
|
||||
<button class="nav" data-panel="settings"><span>13</span><b data-i18n="settings">Settings</b></button>
|
||||
</nav>
|
||||
<div class="sidebar-bottom"><span class="small-label" data-i18n="runtime">RUNTIME</span>
|
||||
<p>Rust / Tokio / Hyper<br />Axum / Tower / SQLite</p>
|
||||
<div class="local-tag"><i></i><span data-i18n="controlPlane">CONTROL PLANE</span></div>
|
||||
<div class="sidebar-bottom" id="app-health-slot" hidden>
|
||||
<button class="local-tag app-health-button is-checking" id="app-health-open" type="button"
|
||||
aria-haspopup="dialog" aria-controls="app-health-dialog">
|
||||
<i aria-hidden="true"></i><span id="app-health-label"
|
||||
data-i18n="appHealthSidebarChecking">CHECKING</span>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
<main>
|
||||
@@ -97,7 +100,7 @@
|
||||
</div>
|
||||
<label data-i18n="username" for="username">Username</label><input autocapitalize="none"
|
||||
autocomplete="username" id="username" maxlength="64" minlength="3"
|
||||
pattern="[A-Za-z0-9_.-]{3,64}" required="" spellcheck="false" />
|
||||
pattern="[A-Za-z0-9_.\-]{3,64}" required="" spellcheck="false" />
|
||||
<label data-i18n="password" for="password">Password</label><input autocomplete="current-password"
|
||||
id="password" maxlength="128" required="" type="password" />
|
||||
<div hidden="" id="confirm-field"><label data-i18n="confirmPassword" for="password-confirm">Confirm
|
||||
@@ -121,17 +124,13 @@
|
||||
aria-label="Overview chart samples" data-i18n-aria="overviewSamplesTitle">
|
||||
<label class="function-live-chart-samples" for="overview-live-samples"><span
|
||||
data-i18n="liveChartSamples">Samples</span>
|
||||
<select id="overview-live-samples" aria-describedby="overview-samples-state">
|
||||
<select id="overview-live-samples">
|
||||
<option value="60">60</option>
|
||||
<option value="120">120</option>
|
||||
<option value="300">300</option>
|
||||
<option value="600">600</option>
|
||||
</select>
|
||||
</label>
|
||||
<button class="quiet" id="overview-samples-save" type="button"
|
||||
data-i18n="overviewSamplesRemember">Remember choice</button>
|
||||
<small class="fine" id="overview-samples-state" role="status" aria-live="polite"
|
||||
data-i18n="overviewSamplesSaved">Saved default</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-intro-title-row">
|
||||
@@ -145,6 +144,9 @@
|
||||
<div class="overview-inline-actions" id="overview-inline-actions" hidden>
|
||||
<button class="primary" id="overview-inline-save" type="button"
|
||||
data-i18n="overviewLayoutInlineSave">Save and lock</button>
|
||||
<button class="quiet" id="overview-inline-compact" type="button"
|
||||
data-i18n="overviewLayoutInlineCompact"
|
||||
title="Move blocks into empty grid space once">Fill gaps</button>
|
||||
<button class="quiet" id="overview-inline-cancel" type="button"
|
||||
data-i18n="overviewLayoutInlineCancel">Cancel changes</button>
|
||||
</div>
|
||||
@@ -771,7 +773,7 @@
|
||||
</div>
|
||||
<div class="field-grid">
|
||||
<label><span data-i18n="aclProfileId">Profile ID</span><input id="acl-profile-id"
|
||||
maxlength="64" pattern="[A-Za-z0-9_-]{1,64}" required /></label>
|
||||
maxlength="64" pattern="[A-Za-z0-9_\-]{1,64}" required /></label>
|
||||
<label><span data-i18n="aclProfileName">Display name</span><input id="acl-profile-name"
|
||||
maxlength="96" required /></label>
|
||||
</div>
|
||||
@@ -982,7 +984,7 @@
|
||||
<div class="vh-grid">
|
||||
<label><span data-i18n="certificateId">Certificate ID</span><input
|
||||
autocomplete="off" id="acme-name" maxlength="64"
|
||||
pattern="[A-Za-z0-9_-]{1,64}" required="" /></label>
|
||||
pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label><span data-i18n="acmeEmail">ACME contact email</span><input
|
||||
autocomplete="off" id="acme-email" maxlength="254" required=""
|
||||
type="email" /></label>
|
||||
@@ -1063,7 +1065,7 @@
|
||||
<h3 data-i18n="certImport"></h3>
|
||||
<p class="fine" data-i18n="certLibraryHint"></p>
|
||||
<label data-i18n="certificateId" for="cert-import-name"></label><input
|
||||
id="cert-import-name" maxlength="64" pattern="[A-Za-z0-9_-]{1,64}"
|
||||
id="cert-import-name" maxlength="64" pattern="[A-Za-z0-9_\-]{1,64}"
|
||||
required="" />
|
||||
<label data-i18n="certCheckDomains" for="cert-import-domains"></label><input
|
||||
id="cert-import-domains" placeholder="app.example.com" required="" />
|
||||
@@ -1081,7 +1083,7 @@
|
||||
<form class="edit-form" id="certificate-form">
|
||||
<h3 data-i18n="addCertificate"></h3>
|
||||
<label data-i18n="certificateId" for="certificate-id"></label><input
|
||||
id="certificate-id" maxlength="64" pattern="[A-Za-z0-9_.-]+"
|
||||
id="certificate-id" maxlength="64" pattern="[A-Za-z0-9_.\-]+"
|
||||
placeholder="app" required="" />
|
||||
<label data-i18n="certLegacyNames" for="certificate-hosts"></label><input
|
||||
id="certificate-hosts" placeholder="app.localhost" />
|
||||
@@ -1094,10 +1096,10 @@
|
||||
<p class="fine" id="certificate-file-source-help"
|
||||
data-i18n="certificateSourceManagedHelp"></p>
|
||||
<label data-i18n="certificateFile" for="certificate-file"></label><input
|
||||
id="certificate-file" maxlength="96" pattern="[A-Za-z0-9_.-]+"
|
||||
id="certificate-file" maxlength="96" pattern="[A-Za-z0-9_.\-]+"
|
||||
placeholder="app.pem" required="" />
|
||||
<label data-i18n="privateKeyFile" for="certificate-key"></label><input
|
||||
id="certificate-key" maxlength="96" pattern="[A-Za-z0-9_.-]+"
|
||||
id="certificate-key" maxlength="96" pattern="[A-Za-z0-9_.\-]+"
|
||||
placeholder="app.key" required="" />
|
||||
<div hidden id="certificate-external-acl-example"></div>
|
||||
<div class="form-actions"><button type="button" class="quiet"
|
||||
@@ -1791,6 +1793,12 @@
|
||||
</select><small class="fine" data-i18n="buttonStyleHelp">Normal uses the
|
||||
refreshed controls; Compact restores the smaller source-style buttons
|
||||
across all actions and dialog tabs.</small></label>
|
||||
<label class="check appearance-interface-icons-setting"><input
|
||||
id="ui-interface-icons" type="checkbox" /><span><b
|
||||
data-i18n="interfaceIcons">Show SVG interface icons</b><small
|
||||
data-i18n="interfaceIconsHelp">Adds semantic SVG icons to
|
||||
navigation,
|
||||
actions, tabs and dialogs.</small></span></label>
|
||||
<label><span data-i18n="cornerStyle">Corner rounding</span><select
|
||||
id="ui-corner-style">
|
||||
<option data-i18n="cornerStyleDefault" value="default">Original
|
||||
@@ -2101,79 +2109,184 @@
|
||||
<div data-policy-settings-page="block-allow">
|
||||
<form class="card edit-form global-policy-form" id="global-security-form">
|
||||
<div class="card-heading">
|
||||
<div><span class="small-label" data-i18n="globalPolicyScope">PUBLIC HTTP LISTENERS</span>
|
||||
<div><span class="small-label" data-i18n="globalPolicyScope">PUBLIC HTTP
|
||||
LISTENERS</span>
|
||||
<h2 data-i18n="globalBlockAllow">Global block / allow</h2>
|
||||
</div><span class="pill live" data-i18n="hotApply">LIVE APPLY</span>
|
||||
</div>
|
||||
<p class="fine" data-i18n="globalPolicyHelp">These rules apply before routing to the backend on all public HTTP vhosts, redirects and 404 hosts. Per-vhost restrictions remain active; a local allow cannot bypass a global block. Administration and TCP/UDP Streams are excluded.</p>
|
||||
<p class="fine" data-i18n="globalPolicyHelp">These rules apply before routing to the
|
||||
backend on all public HTTP vhosts, redirects and 404 hosts. Per-vhost
|
||||
restrictions remain active; a local allow cannot bypass a global block.
|
||||
Administration and TCP/UDP Streams are excluded.</p>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalCountryTitle">Country access</h3><p class="fine" data-i18n="globalCountryHelp">Uses the verified client IP and GeoIP database. Unknown countries are denied in allow mode, but allowed in block mode.</p></div>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalCountryTitle">Country access</h3>
|
||||
<p class="fine" data-i18n="globalCountryHelp">Uses the verified client IP
|
||||
and GeoIP database. Unknown countries are denied in allow mode, but
|
||||
allowed in block mode.</p>
|
||||
</div>
|
||||
<div class="global-policy-fields">
|
||||
<label><span data-i18n="globalCountryMode">Country policy</span><select id="global-country-mode">
|
||||
<option value="off" data-i18n="vhOff">Off</option>
|
||||
<option value="block" data-i18n="vhCountryBlock">Block listed</option>
|
||||
<option value="allow" data-i18n="vhCountryAllow">Allow listed only</option>
|
||||
</select></label>
|
||||
<label><span data-i18n="globalCountryList">ISO country codes (one per line)</span><textarea id="global-country-list" rows="3" maxlength="1024" spellcheck="false" placeholder="RU CN"></textarea></label>
|
||||
<label><span data-i18n="globalCountryMode">Country policy</span><select
|
||||
id="global-country-mode">
|
||||
<option value="off" data-i18n="vhOff">Off</option>
|
||||
<option value="block" data-i18n="vhCountryBlock">Block listed
|
||||
</option>
|
||||
<option value="allow" data-i18n="vhCountryAllow">Allow listed only
|
||||
</option>
|
||||
</select></label>
|
||||
<label><span data-i18n="globalCountryList">ISO country codes (one per
|
||||
line)</span><textarea id="global-country-list" rows="3"
|
||||
maxlength="1024" spellcheck="false"
|
||||
placeholder="RU CN"></textarea></label>
|
||||
</div>
|
||||
</section>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalUaTitle">User-Agent blocklist</h3><p class="fine" data-i18n="uaBlockPatternHelp">Case-insensitive substring matching; * is a wildcard. A missing User-Agent is not blocked.</p></div>
|
||||
<label class="check"><input id="global-ua-block-enabled" type="checkbox"/><span data-i18n="globalUaEnabled">Block matching User-Agents</span></label>
|
||||
<label><span data-i18n="uaBlockPatterns">Blocked patterns, one per line</span><textarea id="global-ua-block-patterns" rows="4" maxlength="32768" spellcheck="false" placeholder="BadBot curl/* *scanner*"></textarea></label>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalUaTitle">User-Agent blocklist</h3>
|
||||
<p class="fine" data-i18n="uaBlockPatternHelp">Case-insensitive substring
|
||||
matching; * is a wildcard. A missing User-Agent is not blocked.</p>
|
||||
</div>
|
||||
<label class="check"><input id="global-ua-block-enabled" type="checkbox" /><span
|
||||
data-i18n="globalUaEnabled">Block matching User-Agents</span></label>
|
||||
<label><span data-i18n="uaBlockPatterns">Blocked patterns, one per
|
||||
line</span><textarea id="global-ua-block-patterns" rows="4"
|
||||
maxlength="32768" spellcheck="false"
|
||||
placeholder="BadBot curl/* *scanner*"></textarea></label>
|
||||
</section>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalIpTitle">IP / CIDR access</h3><p class="fine" data-i18n="globalIpHelp">Each line: allow or deny followed by IPv4/IPv6 address, CIDR or allow-only DNS name. Default allow with no rules leaves access unrestricted.</p></div>
|
||||
<label class="check"><input id="global-ip-enabled" type="checkbox"/><span data-i18n="globalIpEnabled">Enable global IP rules</span></label>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalIpTitle">IP / CIDR access</h3>
|
||||
<p class="fine" data-i18n="globalIpHelp">Each line: allow or deny followed
|
||||
by IPv4/IPv6 address, CIDR or allow-only DNS name. Default allow with no
|
||||
rules leaves access unrestricted.</p>
|
||||
</div>
|
||||
<label class="check"><input id="global-ip-enabled" type="checkbox" /><span
|
||||
data-i18n="globalIpEnabled">Enable global IP rules</span></label>
|
||||
<div class="global-policy-fields">
|
||||
<label><span data-i18n="aclDefault">Default action</span><select id="global-ip-default"><option value="allow" data-i18n="allow">Allow</option><option value="deny" data-i18n="deny">Deny</option></select></label>
|
||||
<label><span data-i18n="globalIpRules">Rules (one per line)</span><textarea id="global-ip-rules" rows="3" maxlength="32768" placeholder="deny 192.0.2.0/24 allow 10.0.0.0/8" spellcheck="false"></textarea></label>
|
||||
<label><span data-i18n="aclDefault">Default action</span><select
|
||||
id="global-ip-default">
|
||||
<option value="allow" data-i18n="allow">Allow</option>
|
||||
<option value="deny" data-i18n="deny">Deny</option>
|
||||
</select></label>
|
||||
<label><span data-i18n="globalIpRules">Rules (one per line)</span><textarea
|
||||
id="global-ip-rules" rows="3" maxlength="32768"
|
||||
placeholder="deny 192.0.2.0/24 allow 10.0.0.0/8"
|
||||
spellcheck="false"></textarea></label>
|
||||
</div>
|
||||
</section>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalMethodTitle">HTTP methods</h3><p class="fine" data-i18n="globalMethodHelp">Block selected methods or allow only those listed. Applies before redirects and cache invalidation; denied requests receive 405.</p></div>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalMethodTitle">HTTP methods</h3>
|
||||
<p class="fine" data-i18n="globalMethodHelp">Block selected methods or allow
|
||||
only those listed. Applies before redirects and cache invalidation;
|
||||
denied requests receive 405.</p>
|
||||
</div>
|
||||
<div class="global-policy-fields">
|
||||
<label><span data-i18n="globalMethodMode">Method policy</span><select id="global-method-mode"><option value="off" data-i18n="vhOff">Off</option><option value="block" data-i18n="locationMethodBlock">Block listed</option><option value="allow" data-i18n="locationMethodAllow">Allow listed only</option></select></label>
|
||||
<label><span data-i18n="globalMethodList">Methods (comma, space or newline separated)</span><textarea id="global-method-list" rows="2" maxlength="1024" spellcheck="false" placeholder="TRACE, TRACK"></textarea></label>
|
||||
<label><span data-i18n="globalMethodMode">Method policy</span><select
|
||||
id="global-method-mode">
|
||||
<option value="off" data-i18n="vhOff">Off</option>
|
||||
<option value="block" data-i18n="locationMethodBlock">Block listed
|
||||
</option>
|
||||
<option value="allow" data-i18n="locationMethodAllow">Allow listed
|
||||
only</option>
|
||||
</select></label>
|
||||
<label><span data-i18n="globalMethodList">Methods (comma, space or newline
|
||||
separated)</span><textarea id="global-method-list" rows="2"
|
||||
maxlength="1024" spellcheck="false"
|
||||
placeholder="TRACE, TRACK"></textarea></label>
|
||||
</div>
|
||||
</section>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalContentTypeTitle">Request Content-Type</h3><p class="fine" data-i18n="globalContentTypeHelp">Reject declared MIME types (exact or type/*) with 403. This is a header rule, not body inspection.</p></div>
|
||||
<label class="check"><input id="global-content-type-enabled" type="checkbox"/><span data-i18n="globalContentTypeEnabled">Enable Content-Type denylist</span></label>
|
||||
<label><span data-i18n="globalContentTypeList">Blocked MIME types, one per line</span><textarea id="global-content-type-list" rows="3" maxlength="16384" spellcheck="false" placeholder="application/x-msdownload application/x-sh"></textarea></label>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalContentTypeTitle">Request Content-Type</h3>
|
||||
<p class="fine" data-i18n="globalContentTypeHelp">Reject declared MIME types
|
||||
(exact or type/*) with 403. This is a header rule, not body inspection.
|
||||
</p>
|
||||
</div>
|
||||
<label class="check"><input id="global-content-type-enabled"
|
||||
type="checkbox" /><span data-i18n="globalContentTypeEnabled">Enable
|
||||
Content-Type denylist</span></label>
|
||||
<label><span data-i18n="globalContentTypeList">Blocked MIME types, one per
|
||||
line</span><textarea id="global-content-type-list" rows="3"
|
||||
maxlength="16384" spellcheck="false"
|
||||
placeholder="application/x-msdownload application/x-sh"></textarea></label>
|
||||
</section>
|
||||
<section class="global-policy-section">
|
||||
<div class="global-policy-heading"><h3 data-i18n="globalRateTitle">Shared rate limit</h3><p class="fine" data-i18n="globalRateHelp">Optional per-client-IP limit shared by all public vhosts. Runs in addition to per-vhost limits; use conservative values to avoid blocking legitimate shared clients.</p></div>
|
||||
<label class="check"><input id="global-rate-enabled" type="checkbox"/><span data-i18n="globalRateEnabled">Enable global request rate limit</span></label>
|
||||
<div class="global-policy-heading">
|
||||
<h3 data-i18n="globalRateTitle">Shared rate limit</h3>
|
||||
<p class="fine" data-i18n="globalRateHelp">Optional per-client-IP limit
|
||||
shared by all public vhosts. Runs in addition to per-vhost limits; use
|
||||
conservative values to avoid blocking legitimate shared clients.</p>
|
||||
</div>
|
||||
<label class="check"><input id="global-rate-enabled" type="checkbox" /><span
|
||||
data-i18n="globalRateEnabled">Enable global request rate
|
||||
limit</span></label>
|
||||
<div class="global-rate-fields">
|
||||
<label><span data-i18n="globalRateRequests">Requests per window</span><input id="global-rate-requests" type="number" min="1" max="1000000" required value="120"/></label>
|
||||
<label><span data-i18n="globalRateWindow">Window (seconds)</span><input id="global-rate-window" type="number" min="1" max="3600" required value="60"/></label>
|
||||
<label><span data-i18n="globalRateBurst">Burst allowance</span><input id="global-rate-burst" type="number" min="0" max="1000000" required value="30"/></label>
|
||||
<label><span data-i18n="globalRateRequests">Requests per window</span><input
|
||||
id="global-rate-requests" type="number" min="1" max="1000000"
|
||||
required value="120" /></label>
|
||||
<label><span data-i18n="globalRateWindow">Window (seconds)</span><input
|
||||
id="global-rate-window" type="number" min="1" max="3600" required
|
||||
value="60" /></label>
|
||||
<label><span data-i18n="globalRateBurst">Burst allowance</span><input
|
||||
id="global-rate-burst" type="number" min="0" max="1000000" required
|
||||
value="30" /></label>
|
||||
</div>
|
||||
</section>
|
||||
<div class="form-actions"><button class="primary" data-i18n="globalPolicySave" type="submit">Apply global block / allow rules</button></div>
|
||||
<div class="form-actions"><button class="primary" data-i18n="globalPolicySave"
|
||||
type="submit">Apply global block / allow rules</button></div>
|
||||
</form>
|
||||
</div>
|
||||
<div data-policy-settings-page="security-headers" hidden="">
|
||||
<form class="card edit-form global-policy-form" id="global-security-headers-form">
|
||||
<div class="card-heading"><div><span class="small-label" data-i18n="globalPolicyScope">PUBLIC HTTP LISTENERS</span><h2 data-i18n="globalSecurityHeaders">Security headers</h2></div><span class="pill live" data-i18n="hotApply">LIVE APPLY</span></div>
|
||||
<p class="fine" data-i18n="globalHeadersSecurityHelp">Global response-header baseline for public HTTP vhosts, redirects and 404 hosts. Explicit per-vhost values override matching global headers. HSTS is sent only over HTTPS; test CSP carefully before rollout.</p>
|
||||
<section class="global-policy-section"><h3 data-i18n="vhSecurityHstsSection">HTTP Strict Transport Security (HSTS)</h3>
|
||||
<label class="check"><input id="global-hsts-enabled" type="checkbox"/><span data-i18n="vhHsts">Enable HSTS</span></label>
|
||||
<div class="card-heading">
|
||||
<div><span class="small-label" data-i18n="globalPolicyScope">PUBLIC HTTP
|
||||
LISTENERS</span>
|
||||
<h2 data-i18n="globalSecurityHeaders">Security headers</h2>
|
||||
</div><span class="pill live" data-i18n="hotApply">LIVE APPLY</span>
|
||||
</div>
|
||||
<p class="fine" data-i18n="globalHeadersSecurityHelp">Global response-header
|
||||
baseline for public HTTP vhosts, redirects and 404 hosts. Explicit per-vhost
|
||||
values override matching global headers. HSTS is sent only over HTTPS; test CSP
|
||||
carefully before rollout.</p>
|
||||
<section class="global-policy-section">
|
||||
<h3 data-i18n="vhSecurityHstsSection">HTTP Strict Transport Security (HSTS)</h3>
|
||||
<label class="check"><input id="global-hsts-enabled" type="checkbox" /><span
|
||||
data-i18n="vhHsts">Enable HSTS</span></label>
|
||||
<div class="global-rate-fields">
|
||||
<label><span data-i18n="vhHstsAge">Max age (seconds)</span><input id="global-hsts-age" type="number" min="0" max="63072000" required value="31536000"/></label>
|
||||
<label class="check"><input id="global-hsts-sub" type="checkbox"/><span data-i18n="vhHstsSub">Include subdomains</span></label>
|
||||
<label class="check"><input id="global-hsts-preload" type="checkbox"/><span data-i18n="vhHstsPreload">Preload</span></label>
|
||||
<label><span data-i18n="vhHstsAge">Max age (seconds)</span><input
|
||||
id="global-hsts-age" type="number" min="0" max="63072000" required
|
||||
value="31536000" /></label>
|
||||
<label class="check"><input id="global-hsts-sub" type="checkbox" /><span
|
||||
data-i18n="vhHstsSub">Include subdomains</span></label>
|
||||
<label class="check"><input id="global-hsts-preload" type="checkbox" /><span
|
||||
data-i18n="vhHstsPreload">Preload</span></label>
|
||||
</div>
|
||||
</section>
|
||||
<section class="global-policy-section"><h3 data-i18n="vhSecurityHeadersSection">Response security headers</h3>
|
||||
<label class="check"><input id="global-nosniff" type="checkbox"/><span data-i18n="vhNosniff">X-Content-Type-Options: nosniff</span></label>
|
||||
<label><span data-i18n="vhFrame">X-Frame-Options</span><select id="global-frame"><option value="preserve" data-i18n="vhPreserve">Preserve origin value</option><option value="deny" data-i18n="vhDeny">DENY</option><option value="sameorigin" data-i18n="vhSameorigin">SAMEORIGIN</option></select></label>
|
||||
<label><span data-i18n="vhReferrer">Referrer-Policy</span><input id="global-referrer" maxlength="8192" spellcheck="false" placeholder="strict-origin-when-cross-origin"/></label>
|
||||
<label><span data-i18n="vhCsp">Content-Security-Policy</span><textarea id="global-csp" rows="3" maxlength="8192" spellcheck="false" placeholder="default-src 'self'"></textarea></label>
|
||||
<label><span data-i18n="vhPermissions">Permissions-Policy</span><input id="global-permissions" maxlength="8192" spellcheck="false" placeholder="camera=(), microphone=()"/></label>
|
||||
<section class="global-policy-section">
|
||||
<h3 data-i18n="vhSecurityHeadersSection">Response security headers</h3>
|
||||
<label class="check"><input id="global-nosniff" type="checkbox" /><span
|
||||
data-i18n="vhNosniff">X-Content-Type-Options: nosniff</span></label>
|
||||
<label><span data-i18n="vhFrame">X-Frame-Options</span><select
|
||||
id="global-frame">
|
||||
<option value="preserve" data-i18n="vhPreserve">Preserve origin value
|
||||
</option>
|
||||
<option value="deny" data-i18n="vhDeny">DENY</option>
|
||||
<option value="sameorigin" data-i18n="vhSameorigin">SAMEORIGIN</option>
|
||||
</select></label>
|
||||
<label><span data-i18n="vhReferrer">Referrer-Policy</span><input
|
||||
id="global-referrer" maxlength="8192" spellcheck="false"
|
||||
placeholder="strict-origin-when-cross-origin" /></label>
|
||||
<label><span data-i18n="vhCsp">Content-Security-Policy</span><textarea
|
||||
id="global-csp" rows="3" maxlength="8192" spellcheck="false"
|
||||
placeholder="default-src 'self'"></textarea></label>
|
||||
<label><span data-i18n="vhPermissions">Permissions-Policy</span><input
|
||||
id="global-permissions" maxlength="8192" spellcheck="false"
|
||||
placeholder="camera=(), microphone=()" /></label>
|
||||
</section>
|
||||
<div class="form-actions"><button class="primary" data-i18n="globalSecurityHeadersSave" type="submit">Apply security headers</button></div>
|
||||
<div class="form-actions"><button class="primary"
|
||||
data-i18n="globalSecurityHeadersSave" type="submit">Apply security
|
||||
headers</button></div>
|
||||
</form>
|
||||
</div>
|
||||
<div data-policy-settings-page="headers" hidden="">
|
||||
@@ -2500,9 +2613,11 @@
|
||||
<label data-i18n="cacheStaticExtensions" for="cache-static-extensions">Global static
|
||||
extensions</label><textarea id="cache-static-extensions" rows="5"
|
||||
spellcheck="false"></textarea>
|
||||
<p class="fine cache-static-guidance" data-i18n="cacheStaticHelp">Cookie bypass is limited to these file
|
||||
<p class="fine cache-static-guidance" data-i18n="cacheStaticHelp">Cookie bypass is
|
||||
limited to these file
|
||||
extensions. Response privacy rules still apply.</p>
|
||||
<h3 class="subheading cache-header-settings-heading" data-i18n="cacheHeadersSection">Cache response headers</h3>
|
||||
<h3 class="subheading cache-header-settings-heading"
|
||||
data-i18n="cacheHeadersSection">Cache response headers</h3>
|
||||
<div class="switch-grid"><label class="check"><input id="cache-status-header"
|
||||
type="checkbox" /><span>X-Cache: HIT / MISS /
|
||||
BYPASS</span></label><label class="check"><input id="cache-hits-header"
|
||||
@@ -2608,7 +2723,8 @@
|
||||
concurrent transformations</label><input id="transform-max-inflight" min="1"
|
||||
max="1024" required="" type="number" /></div>
|
||||
</div>
|
||||
<h3 class="subheading transform-operations-title" data-i18n="transformOperationsTitle">Content transformations</h3>
|
||||
<h3 class="subheading transform-operations-title" data-i18n="transformOperationsTitle">
|
||||
Content transformations</h3>
|
||||
<div class="switch-grid transform-operations-grid">
|
||||
<label class="check"><input id="transform-javascript" type="checkbox" /><span
|
||||
data-i18n="transformJavascript">JavaScript minification</span></label>
|
||||
@@ -3143,8 +3259,8 @@
|
||||
<p class="fine" data-i18n="tlsPqcHelp">TLS 1.3 only: prioritize hybrid
|
||||
X25519MLKEM768 with classic key exchanges as fallback. This is a key exchange
|
||||
group, not a cipher suite. Disabled by default.</p>
|
||||
<a href="/docs#doc=docs%2FTRANSPORT.md" target="_blank"
|
||||
rel="noopener noreferrer" data-i18n="tlsPqcDocs">Learn about PQC, compatibility
|
||||
<a href="/docs#doc=docs%2FTRANSPORT.md" target="_blank" rel="noopener noreferrer"
|
||||
data-i18n="tlsPqcDocs">Learn about PQC, compatibility
|
||||
and testing (documentation)</a>
|
||||
</div>
|
||||
<p class="fine" id="tls-policy-key-exchange"></p>
|
||||
@@ -3298,8 +3414,7 @@
|
||||
</div>
|
||||
</section>
|
||||
<footer class="page-footer"><span>RustProxy <b>__RUSTPROXY_VERSION__</b></span><span
|
||||
id="footer-status">API - /
|
||||
dropped: 0</span></footer>
|
||||
id="footer-status">API -</span></footer>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
@@ -3668,7 +3783,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
<label><span data-i18n="webServiceId">Service ID</span><input id="web-service-id" maxlength="64"
|
||||
pattern="[A-Za-z0-9_-]{1,64}" required="" /></label>
|
||||
pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label><span data-i18n="webServiceName">Name</span><input id="web-service-name" maxlength="96"
|
||||
required="" /></label>
|
||||
<label class="vh-wide"><span data-i18n="webServiceRoot">Document root</span><input
|
||||
@@ -4158,7 +4273,7 @@ log_errors = On</code></pre>
|
||||
<legend data-i18n="hostIdentitySection">Host and domains</legend>
|
||||
<div class="vh-grid">
|
||||
<label><span data-i18n="redirectId">Redirect ID</span><input id="redirect-id" maxlength="64"
|
||||
pattern="[A-Za-z0-9_-]{1,64}" required="" /></label>
|
||||
pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label><span data-i18n="redirectName">Display name</span><input id="redirect-name"
|
||||
maxlength="96" /></label>
|
||||
<label class="check"><input id="redirect-enabled" type="checkbox" /><span
|
||||
@@ -4216,7 +4331,7 @@ log_errors = On</code></pre>
|
||||
<legend data-i18n="hostIdentitySection">Host and domains</legend>
|
||||
<div class="vh-grid">
|
||||
<label><span data-i18n="notfoundId">Host ID</span><input id="notfound-id" maxlength="64"
|
||||
pattern="[A-Za-z0-9_-]{1,64}" required="" /></label>
|
||||
pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label><span data-i18n="notfoundName">Display name</span><input id="notfound-name"
|
||||
maxlength="96" /></label>
|
||||
<label class="check"><input id="notfound-enabled" type="checkbox" /><span
|
||||
@@ -4290,6 +4405,23 @@ log_errors = On</code></pre>
|
||||
<p class="fine" data-i18n="streamRestartHelp">Changing a stream listener requires a RustProxy restart.</p>
|
||||
</form>
|
||||
</dialog>
|
||||
<dialog aria-labelledby="app-health-title" class="vhost-dialog app-health-dialog" id="app-health-dialog">
|
||||
<div class="window-heading">
|
||||
<div><span class="small-label" data-i18n="appHealthSelfCheck">SELF-CHECK</span>
|
||||
<h2 data-i18n="appHealthTitle" id="app-health-title">Application status</h2>
|
||||
</div>
|
||||
<button class="outline" data-i18n="close" id="app-health-close" type="button">Close</button>
|
||||
</div>
|
||||
<article class="card app-health-card">
|
||||
<div class="app-health-summary" id="app-health-summary-row">
|
||||
<i aria-hidden="true"></i>
|
||||
<div><strong id="app-health-summary" data-i18n="appHealthChecking">Checking application status</strong>
|
||||
<p class="fine" id="app-health-updated"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="app-health-checks" id="app-health-checks"></div>
|
||||
</article>
|
||||
</dialog>
|
||||
<dialog aria-labelledby="about-title" class="vhost-dialog about-dialog" id="about-dialog">
|
||||
<div class="window-heading">
|
||||
<h2 data-i18n="aboutTitle" id="about-title">About RustProxy</h2>
|
||||
@@ -4335,15 +4467,16 @@ log_errors = On</code></pre>
|
||||
</ul>
|
||||
</section>
|
||||
<div class="about-links">
|
||||
<a class="outline about-repository" href="https://rustproxy.linuxiarz.pl/" rel="noopener noreferrer"
|
||||
target="_blank"><span data-i18n="aboutPackagesRepository">Website and packages</span><span>rustproxy.linuxiarz.pl</span></a>
|
||||
<a class="outline about-repository" href="https://git.linuxiarz.pl/gru/RustProxy"
|
||||
<a class="outline about-repository" data-ui-icon-name="none" href="https://rustproxy.linuxiarz.pl/" rel="noopener noreferrer"
|
||||
target="_blank"><span data-i18n="aboutPackagesRepository">Website and
|
||||
packages</span><span>rustproxy.linuxiarz.pl</span></a>
|
||||
<a class="outline about-repository" data-ui-icon-name="none" href="https://git.linuxiarz.pl/gru/RustProxy"
|
||||
rel="noopener noreferrer" target="_blank"><span data-i18n="aboutRepository">Source
|
||||
code</span><span>git.linuxiarz.pl/gru/RustProxy</span></a>
|
||||
<a class="outline about-repository" href="/docs#doc=docs%2FREADME.md" rel="noopener"
|
||||
<a class="outline about-repository" data-ui-icon-name="none" href="/docs#doc=docs%2FREADME.md" rel="noopener"
|
||||
target="_blank"><span data-i18n="aboutDocumentation">Documentation and API
|
||||
reference</span><span>/docs</span></a>
|
||||
<a class="outline about-repository" href="/docs#doc=LICENSE" rel="noopener" target="_blank"><span
|
||||
<a class="outline about-repository" data-ui-icon-name="none" href="/docs#doc=LICENSE" rel="noopener" target="_blank"><span
|
||||
data-i18n="aboutLicenseText">Full license text</span><span>LICENSE</span></a>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
window.rustProxySettings?.selectHttpTab?.("http2");
|
||||
document.querySelector('[data-http-settings-page="http2"]')?.scrollIntoView({ block: "start" });
|
||||
});
|
||||
h2Settings.classList.add("listener-h2-settings-link");
|
||||
h2Settings.classList.add("listener-h2-settings-link"); h2Settings.dataset.uiIconName = "settings";
|
||||
const preservedHttp3 = Object.hasOwn(b, "http3") ? b.http3 : (b.tls ? { ...h3Defaults } : null);
|
||||
const h3 = field(grid, "listener-h3", "h3Enable", b.tls && !!preservedHttp3, "checkbox");
|
||||
const h3Settings = button(protocolActions, "h3Configure", () => {
|
||||
@@ -141,7 +141,7 @@
|
||||
window.rustProxySettings?.selectHttpTab?.("http3");
|
||||
document.querySelector('[data-http-settings-page="http3"]')?.scrollIntoView({ block: "start" });
|
||||
});
|
||||
h3Settings.classList.add("listener-h3-settings-link");
|
||||
h3Settings.classList.add("listener-h3-settings-link"); h3Settings.dataset.uiIconName = "settings";
|
||||
const sync = () => {
|
||||
h2.disabled = !tls.checked; h2c.disabled = tls.checked; h3.disabled = !tls.checked;
|
||||
h2Settings.hidden = !((tls.checked && h2.checked) || (!tls.checked && h2c.checked));
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
type="password" />
|
||||
</div>
|
||||
<label data-i18n="username" for="username">Username</label><input autocapitalize="none"
|
||||
autocomplete="username" id="username" maxlength="64" minlength="3" pattern="[A-Za-z0-9_.-]{3,64}"
|
||||
autocomplete="username" id="username" maxlength="64" minlength="3" pattern="[A-Za-z0-9_.\-]{3,64}"
|
||||
required="" spellcheck="false" />
|
||||
<label data-i18n="password" for="password">Password</label><input autocomplete="current-password"
|
||||
id="password" maxlength="128" required="" type="password" />
|
||||
|
||||
@@ -85,6 +85,11 @@
|
||||
];
|
||||
const defaultColumns = () => new Set(columns.map(column => column.id));
|
||||
let visibleColumns = defaultColumns();
|
||||
function active() { return dialog.open && !paused && !expanded; }
|
||||
function syncLivePolling(fetchNow = false) {
|
||||
window.rustProxyRefresh?.sync?.();
|
||||
if (fetchNow && active()) void window.rustProxyRefresh?.manual?.("logs-fallback");
|
||||
}
|
||||
function source() { return paused || expanded || lastLogs || { entries: [] }; }
|
||||
function mergeExpanded(data) {
|
||||
if (!expanded || paused || !data?.entries) return;
|
||||
@@ -189,7 +194,7 @@
|
||||
if (!preferencesLoaded) void loadPreferences();
|
||||
if (vhost) { const opt = el("option", vhost); opt.value = vhost; $("log-vhost").append(opt); $("log-vhost").value = vhost; }
|
||||
if (!dialog.open) { if (docked) dialog.show(); else dialog.showModal(); }
|
||||
render();
|
||||
render(); syncLivePolling(true);
|
||||
}
|
||||
syncColumnPicker(); syncHeaders();
|
||||
$("logs-open").addEventListener("click", () => { $("logs-menu").open = false; open(); }); $("logs-close").addEventListener("click", () => dialog.close());
|
||||
@@ -200,14 +205,14 @@
|
||||
expanded = { ...snapshot, capacity: 4096, window: 4096 }; render();
|
||||
toast(t("logBufferExpanded").replace("{count}", String(snapshot.entries?.length || 0)));
|
||||
} catch (error) { toast(error.message, true); }
|
||||
finally { button.disabled = Boolean(expanded); }
|
||||
finally { button.disabled = Boolean(expanded); syncLivePolling(); }
|
||||
});
|
||||
$("logs-pause").addEventListener("click", () => { paused = paused ? null : structuredClone(source()); render(); });
|
||||
$("logs-pin").addEventListener("click", () => { pinning = true; dialog.close(); docked = !docked; dialog.classList.toggle("docked", docked); if (docked) dialog.show(); else dialog.showModal(); pinning = false; render(); });
|
||||
dialog.addEventListener("close", () => { if (pinning) return; expanded = null; paused = null; syncExpandedButton(); });
|
||||
$("logs-pause").addEventListener("click", () => { paused = paused ? null : structuredClone(source()); render(); syncLivePolling(!paused); });
|
||||
$("logs-pin").addEventListener("click", () => { pinning = true; dialog.close(); docked = !docked; dialog.classList.toggle("docked", docked); if (docked) dialog.show(); else dialog.showModal(); pinning = false; render(); syncLivePolling(true); });
|
||||
dialog.addEventListener("close", () => { if (pinning) return; expanded = null; paused = null; syncExpandedButton(); syncLivePolling(); });
|
||||
for (const id of filters) $(id).addEventListener(id === "log-filter" ? "input" : "change", render);
|
||||
$("export-logs").addEventListener("click", () => { const url = URL.createObjectURL(new Blob([JSON.stringify({ entries: filtered(), capacity: source().capacity, filtered: true }, null, 2) + "\n"], { type: "application/json" })); const a = el("a"); a.href = url; a.download = "RustProxy-access-log.json"; a.click(); setTimeout(() => URL.revokeObjectURL(url), 1000); });
|
||||
window.rustProxyLogs = { render, open, loadPreferences, applyPreferences, reset() { dialog.close(); paused = null; expanded = null; preferencesLoaded = false; preferencesLoading = null; preferenceSaveQueued = false; visibleColumns = defaultColumns(); syncColumnPicker(); syncHeaders(); for (const id of filters) $(id).value = id === "log-outcome" ? "all" : ""; syncExpandedButton(); } };
|
||||
window.rustProxyLogs = { render, open, active, loadPreferences, applyPreferences, reset() { dialog.close(); paused = null; expanded = null; preferencesLoaded = false; preferencesLoading = null; preferenceSaveQueued = false; visibleColumns = defaultColumns(); syncColumnPicker(); syncHeaders(); for (const id of filters) $(id).value = id === "log-outcome" ? "all" : ""; syncExpandedButton(); syncLivePolling(); } };
|
||||
})();
|
||||
|
||||
(() => {
|
||||
|
||||
@@ -334,7 +334,8 @@
|
||||
<div>
|
||||
<h3 class="overview-chart-heading" data-i18n="systemLoad">System load</h3>
|
||||
<h2><span id="system-cpu">-</span> <small>CPU</small></h2>
|
||||
</div><span class="meta" id="system-source">-</span>
|
||||
</div><span class="meta system-uptime-meta"><span data-i18n="systemUptime">System uptime</span>: <b
|
||||
id="system-uptime">-</b></span>
|
||||
</div><svg preserveAspectRatio="none" aria-label="System CPU history" data-i18n-aria="systemChart" id="system-chart"
|
||||
role="img" viewbox="0 0 300 100">
|
||||
<path class="chart-grid" d="M0 25H300 M0 50H300 M0 75H300"></path>
|
||||
@@ -348,14 +349,15 @@
|
||||
<div class="memory-line"><span data-i18n="systemSwap">System swap</span><b id="system-swap">-</b></div>
|
||||
<div class="chart-footer"><span data-i18n="loadAverage">Load 1 / 5 / 15 min</span><span id="system-load">-</span>
|
||||
</div>
|
||||
<div class="chart-footer"><span data-i18n="systemUptime">System uptime</span><span id="system-uptime">-</span></div>
|
||||
</article>
|
||||
<article class="card connection-card" data-dashboard-widget="connection_chart">
|
||||
<div class="card-heading">
|
||||
<div>
|
||||
<div class="connection-heading-main">
|
||||
<h3 class="overview-chart-heading" data-i18n="connectionActivity">Connection activity</h3>
|
||||
<h2><span id="connection-current">0</span> <small data-i18n="connections">Open
|
||||
connections</small></h2>
|
||||
<h2><span class="connection-current-main"><span id="connection-current">0</span> <small
|
||||
data-i18n="connections">Open connections</small></span><small
|
||||
class="meta connection-backends-meta"><span data-i18n="backends">Backends</span>: <b
|
||||
id="connection-backends">0</b></small></h2>
|
||||
</div>
|
||||
</div>
|
||||
<svg preserveAspectRatio="none" aria-label="Connection activity history" data-i18n-aria="connectionActivity"
|
||||
@@ -368,6 +370,4 @@
|
||||
connections</span> <b id="connection-open-value">0</b></span><span
|
||||
class="connection-exchange-key"><i></i><span data-i18n="activeExchanges">Active
|
||||
exchanges</span> <b id="connection-exchange-value">0</b></span></div>
|
||||
<div class="chart-footer"><span><span data-i18n="backends">Backends</span>: <b id="connection-backends">0</b></span>
|
||||
</div>
|
||||
</article>
|
||||
@@ -34,30 +34,37 @@
|
||||
<article class="stat stat-cache-outcomes" data-dashboard-widget="cache_outcomes">
|
||||
<div class="cache-mix-header">
|
||||
<span data-i18n="cacheMixTitle">Cache outcomes</span>
|
||||
<small class="cache-mix-caption" id="cache-mix-caption" aria-label="HTTP requests since service start" title="HTTP requests since service start">-</small>
|
||||
<small class="cache-mix-caption" id="cache-mix-caption" aria-label="HTTP requests since service start"
|
||||
title="HTTP requests since service start">-</small>
|
||||
</div>
|
||||
<strong id="cache-mix-headline">-</strong>
|
||||
<div class="cache-mix-bar" id="cache-mix-bar" role="img" aria-label="Cumulative HTTP cache outcomes since service start">
|
||||
<div class="cache-mix-bar" id="cache-mix-bar" role="img"
|
||||
aria-label="Cumulative HTTP cache outcomes since service start">
|
||||
<span class="cache-mix-hit" id="cache-mix-hit" style="width:0%"></span>
|
||||
<span class="cache-mix-miss" id="cache-mix-miss" style="width:0%"></span>
|
||||
<span class="cache-mix-bypass" id="cache-mix-bypass" style="width:0%"></span>
|
||||
<span class="cache-mix-other" id="cache-mix-other" style="width:0%"></span>
|
||||
</div>
|
||||
<small class="cache-mix-legend">
|
||||
<span class="cache-mix-hit-key"><i></i>HIT <b><span id="cache-mix-hit-count">-</span><span class="cache-mix-percent" id="cache-mix-hit-percent">-</span></b></span>
|
||||
<span class="cache-mix-miss-key"><i></i>MISS <b><span id="cache-mix-miss-count">-</span><span class="cache-mix-percent" id="cache-mix-miss-percent">-</span></b></span>
|
||||
<span class="cache-mix-bypass-key"><i></i>BYPASS <b><span id="cache-mix-bypass-count">-</span><span class="cache-mix-percent" id="cache-mix-bypass-percent">-</span></b></span>
|
||||
<span class="cache-mix-other-key"><i></i><span data-i18n="cacheMixOther">OTHER</span> <b><span id="cache-mix-other-count">-</span><span class="cache-mix-percent"
|
||||
id="cache-mix-other-percent">-</span></b></span>
|
||||
<span class="cache-mix-hit-key"><i></i>HIT <b><span id="cache-mix-hit-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-hit-percent">-</span></b></span>
|
||||
<span class="cache-mix-miss-key"><i></i>MISS <b><span id="cache-mix-miss-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-miss-percent">-</span></b></span>
|
||||
<span class="cache-mix-bypass-key"><i></i>BYPASS <b><span id="cache-mix-bypass-count">-</span><span
|
||||
class="cache-mix-percent" id="cache-mix-bypass-percent">-</span></b></span>
|
||||
<span class="cache-mix-other-key"><i></i><span data-i18n="cacheMixOther">OTHER</span> <b><span
|
||||
id="cache-mix-other-count">-</span><span class="cache-mix-percent"
|
||||
id="cache-mix-other-percent">-</span></b></span>
|
||||
</small>
|
||||
</article>
|
||||
<article class="stat" data-dashboard-widget="memory"><span data-i18n="processMemory">Process
|
||||
memory</span><strong id="metric-rss">-</strong><small id="process-summary">-</small>
|
||||
</article>
|
||||
<article class="stat stat-with-action" data-dashboard-widget="websocket"><span data-i18n="wsActive">WebSocket
|
||||
tunnels</span><button class="quiet stat-corner-action" data-i18n="tunnelsOpen" id="tunnels-open"
|
||||
type="button">Active tunnels</button><strong id="metric-ws">0</strong><small
|
||||
aria-label="Active WebSocket tunnels by frontend protocol"><span data-i18n="wsH1">H1
|
||||
tunnels</span><button class="pill stat-corner-action stat-corner-badge" data-i18n="tunnelsOpen"
|
||||
data-ui-icon-name="none" id="tunnels-open" type="button">Active tunnels</button><strong
|
||||
id="metric-ws">0</strong><small aria-label="Active WebSocket tunnels by frontend protocol"><span
|
||||
data-i18n="wsH1">H1
|
||||
Upgrade</span> <span id="metric-ws-h1">0</span> · <span data-i18n="wsH2Rfc8441">H2
|
||||
RFC 8441</span> <span id="metric-ws-h2">0</span> · <span data-i18n="wsH3Rfc9220">H3
|
||||
RFC 9220</span> <span id="metric-ws-h3">0</span><br><span data-i18n="wsEstablished">Established</span>:
|
||||
@@ -142,13 +149,14 @@
|
||||
</polyline>
|
||||
</svg><small id="backend-dashboard-errors-detail">-</small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="backend_latency" hidden>
|
||||
<span data-i18n="backendWidgetLatency">Health probe RTT</span><strong id="backend-dashboard-latency">-</strong>
|
||||
<article class="stat stat-chart backend-latency-stat" data-dashboard-widget="backend_latency" hidden>
|
||||
<span data-i18n="backendWidgetLatency">Health probe RTT</span><small class="backend-health-origins"
|
||||
id="backend-dashboard-latency-detail">Health Origins -</small><strong id="backend-dashboard-latency">-</strong>
|
||||
<svg preserveAspectRatio="none" data-i18n-aria="backendWidgetLatency" role="img" viewBox="0 0 300 60">
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line proto-h2-line" id="backend-dashboard-latency-line" points="0,55 300,55">
|
||||
</polyline>
|
||||
</svg><small id="backend-dashboard-latency-detail">-</small>
|
||||
</svg>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="backend_traffic" hidden>
|
||||
<span data-i18n="backendWidgetTraffic">Backend traffic</span><strong id="backend-dashboard-traffic">-</strong>
|
||||
@@ -366,14 +374,16 @@
|
||||
</svg><small id="overview-extra-extra_backend_unhealthy-detail">-</small>
|
||||
</article>
|
||||
<article class="stat stat-meter" data-dashboard-widget="extra_backends_healthy" hidden>
|
||||
<span data-i18n="overviewExtraBackendsHealthy">overviewExtraBackendsHealthy</span><strong id="overview-extra-extra_backends_healthy">-</strong>
|
||||
<span data-i18n="overviewExtraBackendsHealthy">overviewExtraBackendsHealthy</span><strong
|
||||
id="overview-extra-extra_backends_healthy">-</strong>
|
||||
<div class="overview-meter" id="overview-extra-extra_backends_healthy-meter" role="progressbar"
|
||||
data-i18n-aria="overviewExtraBackendsHealthy" aria-valuemin="0" aria-valuemax="100" aria-valuetext="-">
|
||||
<span class="overview-meter-fill" id="overview-extra-extra_backends_healthy-meter-fill"></span>
|
||||
</div><small id="overview-extra-extra_backends_healthy-detail">-</small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="extra_error_share" hidden>
|
||||
<span data-i18n="overviewExtraErrorShare">overviewExtraErrorShare</span><strong id="overview-extra-extra_error_share">-</strong>
|
||||
<span data-i18n="overviewExtraErrorShare">overviewExtraErrorShare</span><strong
|
||||
id="overview-extra-extra_error_share">-</strong>
|
||||
<svg preserveAspectRatio="none" data-i18n-aria="overviewExtraErrorShare" role="img" viewBox="0 0 300 60">
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_error_share-line" points="0,55 300,55">
|
||||
@@ -381,7 +391,8 @@
|
||||
</svg><small id="overview-extra-extra_error_share-detail">-</small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="extra_rejected_rate" hidden>
|
||||
<span data-i18n="overviewExtraRejectedRate">overviewExtraRejectedRate</span><strong id="overview-extra-extra_rejected_rate">-</strong>
|
||||
<span data-i18n="overviewExtraRejectedRate">overviewExtraRejectedRate</span><strong
|
||||
id="overview-extra-extra_rejected_rate">-</strong>
|
||||
<svg preserveAspectRatio="none" data-i18n-aria="overviewExtraRejectedRate" role="img" viewBox="0 0 300 60">
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_rejected_rate-line" points="0,55 300,55">
|
||||
@@ -389,7 +400,8 @@
|
||||
</svg><small id="overview-extra-extra_rejected_rate-detail">-</small>
|
||||
</article>
|
||||
<article class="stat stat-meter" data-dashboard-widget="extra_cert_expiry" hidden>
|
||||
<span data-i18n="overviewExtraCertExpiry">overviewExtraCertExpiry</span><strong id="overview-extra-extra_cert_expiry">-</strong>
|
||||
<span data-i18n="overviewExtraCertExpiry">overviewExtraCertExpiry</span><strong
|
||||
id="overview-extra-extra_cert_expiry">-</strong>
|
||||
<div class="overview-meter" id="overview-extra-extra_cert_expiry-meter" role="progressbar"
|
||||
data-i18n-aria="overviewExtraCertExpiry" aria-valuemin="0" aria-valuemax="100" aria-valuetext="-">
|
||||
<span class="overview-meter-fill" id="overview-extra-extra_cert_expiry-meter-fill"></span>
|
||||
@@ -401,7 +413,7 @@
|
||||
<svg preserveAspectRatio="none" viewBox="0 0 300 60" role="img" aria-label="HTTP requests / s">
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_total_rps-line" points="0,55 300,55"></polyline>
|
||||
</svg><small id="overview-extra-extra_total_rps-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</svg><small id="overview-extra-extra_total_rps-detail" hidden></small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="extra_active_exchanges" hidden>
|
||||
<span data-i18n="overviewExtraActiveExchanges">Active HTTP exchanges</span><strong
|
||||
@@ -410,21 +422,21 @@
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_active_exchanges-line" points="0,55 300,55">
|
||||
</polyline>
|
||||
</svg><small id="overview-extra-extra_active_exchanges-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</svg><small id="overview-extra-extra_active_exchanges-detail" hidden></small>
|
||||
</article>
|
||||
<article class="stat stat-meter" data-dashboard-widget="extra_h1_share" hidden>
|
||||
<span data-i18n="overviewExtraH1Share">HTTP/1.1 share</span><strong id="overview-extra-extra_h1_share">-</strong>
|
||||
<div class="overview-meter" id="overview-extra-extra_h1_share-meter" role="progressbar"
|
||||
data-i18n-aria="overviewExtraH1Share" aria-valuemin="0" aria-valuemax="100" aria-valuetext="-">
|
||||
<span class="overview-meter-fill" id="overview-extra-extra_h1_share-meter-fill"></span>
|
||||
</div><small id="overview-extra-extra_h1_share-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</div><small id="overview-extra-extra_h1_share-detail" hidden></small>
|
||||
</article>
|
||||
<article class="stat stat-meter" data-dashboard-widget="extra_h3_share" hidden>
|
||||
<span data-i18n="overviewExtraH3Share">HTTP/3 share</span><strong id="overview-extra-extra_h3_share">-</strong>
|
||||
<div class="overview-meter" id="overview-extra-extra_h3_share-meter" role="progressbar"
|
||||
data-i18n-aria="overviewExtraH3Share" aria-valuemin="0" aria-valuemax="100" aria-valuetext="-">
|
||||
<span class="overview-meter-fill" id="overview-extra-extra_h3_share-meter-fill"></span>
|
||||
</div><small id="overview-extra-extra_h3_share-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</div><small id="overview-extra-extra_h3_share-detail" hidden></small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="extra_cache_miss_rate" hidden>
|
||||
<span data-i18n="overviewExtraCacheMissRate">Cache misses / s</span><strong
|
||||
@@ -433,7 +445,7 @@
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_cache_miss_rate-line" points="0,55 300,55">
|
||||
</polyline>
|
||||
</svg><small id="overview-extra-extra_cache_miss_rate-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</svg><small id="overview-extra-extra_cache_miss_rate-detail" hidden></small>
|
||||
</article>
|
||||
<article class="stat stat-chart" data-dashboard-widget="extra_backend_active" hidden>
|
||||
<span data-i18n="overviewExtraBackendActive">In-flight backend requests</span><strong
|
||||
@@ -441,7 +453,7 @@
|
||||
<svg preserveAspectRatio="none" viewBox="0 0 300 60" role="img" aria-label="In-flight backend requests">
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line" id="overview-extra-extra_backend_active-line" points="0,55 300,55"></polyline>
|
||||
</svg><small id="overview-extra-extra_backend_active-detail" data-i18n="overviewExtraRecentSamples">-</small>
|
||||
</svg><small id="overview-extra-extra_backend_active-detail" hidden></small>
|
||||
</article>
|
||||
<!-- RP_METRICS_SPLIT -->
|
||||
<article class="stat stat-donut" data-dashboard-widget="www_status" hidden>
|
||||
@@ -517,5 +529,4 @@
|
||||
<path class="chart-grid" d="M0 15H300 M0 30H300 M0 45H300"></path>
|
||||
<polyline class="diagnostic-line proto-h2-line" id="www_php_requests-line" points="0,55 300,55"></polyline>
|
||||
</svg>
|
||||
<small data-i18n="webMetricPerSecond">Requests per second</small>
|
||||
</article>
|
||||
@@ -26,7 +26,7 @@
|
||||
const input = (labelKey, name, type = "text") => { const label = el("label"); label.append(el("span", t(labelKey))); const node = el("input"); node.type = type; node.dataset.field = name; label.append(node); grid.append(label); return node; };
|
||||
const select = (labelKey, name, values) => { const label = el("label"); label.append(el("span", t(labelKey))); const node = el("select"); node.dataset.field = name; for (const [v, k] of values) node.append(option(v, k)); label.append(node); grid.append(label); return node; };
|
||||
const check = (labelKey, name) => { const label = el("label", undefined, "check"); const node = el("input"); node.type = "checkbox"; node.dataset.field = name; label.append(node, el("span", t(labelKey))); grid.append(label); return node; };
|
||||
const id = input("redirectRuleId", "id"); id.required = true; id.maxLength = 64; id.pattern = "[A-Za-z0-9_-]{1,64}"; id.value = data.id;
|
||||
const id = input("redirectRuleId", "id"); id.required = true; id.maxLength = 64; id.pattern = "[A-Za-z0-9_\\-]{1,64}"; id.value = data.id;
|
||||
const enabled = check("enabled", "enabled"); enabled.checked = data.enabled !== false;
|
||||
const sourceScheme = select("redirectSourceScheme", "source_scheme", [["any", "redirectSchemeAny"], ["http", "redirectSchemeHttp"], ["https", "redirectSchemeHttps"]]); sourceScheme.value = data.source_scheme;
|
||||
const matchType = select("redirectMatchType", "match_type", [["prefix", "redirectMatchPrefix"], ["exact", "redirectMatchExact"]]); matchType.value = data.match_type;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
window.rustProxyRefresh?.setSettingsTab(name);
|
||||
if (authenticated && name === "security") void window.rustProxyApiTokens?.refresh?.();
|
||||
if (authenticated && name === "prometheus") void window.rustProxyPrometheusToken?.refresh?.();
|
||||
if (authenticated && name === "certificate-api") void window.rustProxyCertificateApi?.load?.();
|
||||
if (name !== "prometheus") window.rustProxyPrometheusToken?.hideSecret?.();
|
||||
if (name !== "security") window.rustProxyApiTokens?.hideSecret?.();
|
||||
}
|
||||
@@ -251,7 +252,8 @@
|
||||
$("tls-policy-key-exchange").textContent = kxGroups.length ? `${t("tlsPqcKeyExchangeGroups")}: ${kxGroups.join(", ")}` : "";
|
||||
$("tls-policy-effective").textContent = effective.length ? `${t("tlsEffectiveCiphers")}: ${effective.join(", ")}` : "";
|
||||
$("tls-policy-available").textContent = available.length ? `${t("tlsAvailableCiphers")}: ${available.join(", ")}` : "";
|
||||
window.rustProxyCertificateApi?.render(); window.rustProxyCertificateApi?.load();
|
||||
window.rustProxyCertificateApi?.render();
|
||||
if (authenticated && active === "certificate-api") void window.rustProxyCertificateApi?.load?.();
|
||||
}
|
||||
$("geoip-format").addEventListener("change", syncGeoipFormat); $("geoip-enabled").addEventListener("change", syncGeoipFormat);
|
||||
bindSettingsForm("geoip-form", next => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
(() => {
|
||||
let loading = false, lastData = null, activeTab = "overview";
|
||||
let loading = false, lastData = null, activeTab = "overview", staticData = null, staticRevision = null;
|
||||
const chartPalette = ["var(--chart-accent)", "var(--chart-secondary)", "var(--chart-tertiary)", "var(--chart-quaternary)", "var(--chart-quinary)", "var(--chart-senary)", "var(--chart-septenary)", "var(--chart-octonary)"];
|
||||
const scope = () => $("traffic-scope")?.value || "*";
|
||||
const number = value => fmt(Number(value) || 0);
|
||||
@@ -116,7 +116,17 @@
|
||||
if (!authenticated || currentPanel !== "traffic" || loading) return;
|
||||
loading = true;
|
||||
try {
|
||||
const data = await api(`/api/traffic?vhost=${encodeURIComponent(scope())}`, { signal });
|
||||
const base = `/api/traffic?vhost=${encodeURIComponent(scope())}`;
|
||||
let data = await api(staticData ? `${base}&view=live` : base, { signal });
|
||||
if (staticData && data.revision !== staticRevision) {
|
||||
data = await api(base, { signal });
|
||||
}
|
||||
if (Array.isArray(data.vhosts)) {
|
||||
staticData = { vhosts: data.vhosts };
|
||||
staticRevision = data.revision;
|
||||
} else if (staticData) {
|
||||
data = { ...staticData, ...data };
|
||||
}
|
||||
if (isCurrent()) render(data);
|
||||
} catch (error) {
|
||||
if (error?.name !== "AbortError" && isCurrent()) $("traffic-panel-state").textContent = error.message;
|
||||
@@ -125,7 +135,7 @@
|
||||
function refresh() { return rustProxyRefresh.manual("traffic"); }
|
||||
|
||||
function reset() {
|
||||
lastData = null; if ($("traffic-panel-state")) $("traffic-panel-state").textContent = "";
|
||||
lastData = null; staticData = null; staticRevision = null; if ($("traffic-panel-state")) $("traffic-panel-state").textContent = "";
|
||||
document.querySelectorAll(".traffic-bar-chart").forEach(chart => chart.replaceChildren());
|
||||
for (const id of ["countries", "methods", "methods-detail", "statuses", "statuses-detail", "cache", "cache-detail"]) {
|
||||
const chart = $(`traffic-chart-${id}`), legend = $(`traffic-chart-${id}-legend`), total = $(`traffic-chart-${id}-total`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
(() => {
|
||||
let loading = false, generation = 0, lastData = null;
|
||||
let loading = false, generation = 0, lastData = null, staticData = null, staticRevision = null;
|
||||
let liveChartScope = "", liveChartPrevious = null, liveChartPreviousAt = null, liveChartGeneration = null;
|
||||
const liveChartSamples = { applied: [], cache_hits: [], skipped: [], errors: [] };
|
||||
const LIVE_CHART_LIMITS = new Set([60, 120, 300, 600]);
|
||||
@@ -155,7 +155,14 @@
|
||||
loading = true;
|
||||
const epoch = authEpoch, token = generation;
|
||||
try {
|
||||
const data = await api("/api/transform", { signal });
|
||||
let data = await api(staticData ? "/api/transform?view=live" : "/api/transform", { signal });
|
||||
if (staticData && data.revision !== staticRevision) data = await api("/api/transform", { signal });
|
||||
if (data.settings && Array.isArray(data.vhosts)) {
|
||||
staticData = { settings: data.settings, vhosts: data.vhosts };
|
||||
staticRevision = data.revision;
|
||||
} else if (staticData) {
|
||||
data = { ...staticData, ...data };
|
||||
}
|
||||
if (isCurrent() && token === generation) render(data);
|
||||
} catch (error) {
|
||||
if (error?.name !== "AbortError" && epoch === authEpoch && isCurrent()) {
|
||||
@@ -179,7 +186,7 @@
|
||||
window.rustProxyTransformPanel = {
|
||||
refresh,
|
||||
reset() {
|
||||
generation++; lastData = null; resetLiveChart();
|
||||
generation++; lastData = null; staticData = null; staticRevision = null; resetLiveChart();
|
||||
$("transform-type-rows")?.replaceChildren();
|
||||
$("transform-vhost-rows")?.replaceChildren();
|
||||
$("transform-reason-list")?.replaceChildren();
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ impl Store {
|
||||
}
|
||||
pub async fn save_admin_preferences(&self, username: &str, document: &str) -> Result<bool> {
|
||||
ensure!(
|
||||
(2..=4096).contains(&document.len()),
|
||||
(2..=crate::db::ADMIN_PREFERENCES_MAX_BYTES).contains(&document.len()),
|
||||
"administrator preferences document is too large"
|
||||
);
|
||||
let result = sqlx::query(
|
||||
|
||||
Vendored
+39
-2
@@ -6,7 +6,6 @@ mod tests {
|
||||
h.insert("cache-control", value.parse().unwrap());
|
||||
h
|
||||
}
|
||||
// Legacy policy; varnish-compatible behavior is tested separately.
|
||||
fn settings() -> Settings {
|
||||
Settings {
|
||||
enabled: true,
|
||||
@@ -1559,7 +1558,10 @@ mod tests {
|
||||
let second = cache
|
||||
.ticket(1, "http", "example.test", "app", "/second", &headers)
|
||||
.unwrap();
|
||||
fill(&cache, first.clone(), "first", &s).await;
|
||||
// Stored bodies are trimmed to their real size, so the first object must
|
||||
// itself be large for the next fill reservation to need its space.
|
||||
let large: &'static str = Box::leak("f".repeat(60 * 1024).into_boxed_str());
|
||||
fill(&cache, first.clone(), large, &s).await;
|
||||
assert!(cache.get(&first).is_some());
|
||||
let before = cache.view();
|
||||
assert!(before.hot_allocated_bytes <= s.max_bytes);
|
||||
@@ -1821,4 +1823,39 @@ mod tests {
|
||||
assert_eq!(cache.view().entries, 0);
|
||||
assert_eq!(cache.view().fills_active, 0);
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn stored_entries_do_not_pin_origin_buffers_or_spare_capacity() {
|
||||
let cache = Cache::new(1);
|
||||
let s = settings();
|
||||
let t = ticket(&cache, &HeaderMap::new());
|
||||
// Header values parsed by hyper are slices of a larger read buffer.
|
||||
let read_buffer = Bytes::from(vec![b'x'; 64 * 1024]);
|
||||
let mut h = headers("max-age=60");
|
||||
h.insert(
|
||||
"x-origin",
|
||||
HeaderValue::from_maybe_shared(read_buffer.slice(0..16)).unwrap(),
|
||||
);
|
||||
h.insert(
|
||||
::http::header::ETAG,
|
||||
HeaderValue::from_maybe_shared(read_buffer.slice(16..24)).unwrap(),
|
||||
);
|
||||
let p = plan(StatusCode::OK, &h, &s, Duration::ZERO).unwrap();
|
||||
let mut response = Response::new(Body::from("small body"));
|
||||
*response.headers_mut() = h;
|
||||
cache
|
||||
.wrap(response, t.clone(), p, &s)
|
||||
.into_body()
|
||||
.collect()
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(cache.get(&t).is_some());
|
||||
assert!(
|
||||
read_buffer.try_into_mut().is_ok(),
|
||||
"cached headers must not keep the origin read buffer alive"
|
||||
);
|
||||
let store = cache.store.lock().unwrap();
|
||||
let entry = store.entries.values().next().expect("stored object");
|
||||
assert_eq!(entry.body.len(), 10);
|
||||
assert!(entry.body_allocated <= 10 + 10 / 8 + 1);
|
||||
}
|
||||
}
|
||||
Vendored
+11
-2
@@ -126,10 +126,19 @@ impl Cache {
|
||||
.uncacheable_until
|
||||
.lock()
|
||||
.unwrap_or_else(|e| e.into_inner());
|
||||
if memo.len() >= UNCACHEABLE_MEMO_CAPACITY {
|
||||
if memo.len() >= UNCACHEABLE_MEMO_CAPACITY && !memo.contains_key(&ticket.key) {
|
||||
memo.retain(|_, until| *until > now);
|
||||
if memo.len() >= UNCACHEABLE_MEMO_CAPACITY {
|
||||
return;
|
||||
// Keep hit-for-miss working for new keys under sustained churn:
|
||||
// drop the marker closest to expiry instead of silently
|
||||
// re-enabling request collapsing for this (uncacheable) key.
|
||||
if let Some(oldest) = memo
|
||||
.iter()
|
||||
.min_by_key(|(_, until)| **until)
|
||||
.map(|(key, _)| *key)
|
||||
{
|
||||
memo.remove(&oldest);
|
||||
}
|
||||
}
|
||||
}
|
||||
memo.insert(ticket.key, now + UNCACHEABLE_MEMO_TTL);
|
||||
|
||||
Vendored
+40
-2
@@ -1,3 +1,16 @@
|
||||
fn detached_header_value(value: &HeaderValue) -> HeaderValue {
|
||||
let mut detached = HeaderValue::from_bytes(value.as_bytes())
|
||||
.expect("existing HTTP header value must remain valid when copied");
|
||||
detached.set_sensitive(value.is_sensitive());
|
||||
detached
|
||||
}
|
||||
|
||||
fn detach_header_map(headers: &mut HeaderMap) {
|
||||
for value in headers.values_mut() {
|
||||
*value = detached_header_value(value);
|
||||
}
|
||||
}
|
||||
|
||||
struct ByteGaugeGuard<'a> {
|
||||
counter: &'a AtomicU64,
|
||||
bytes: u64,
|
||||
@@ -102,6 +115,9 @@ impl Candidate {
|
||||
let (body, body_allocation) = if let Some(body) = self.shared.take() {
|
||||
(body, self.shared_allocated)
|
||||
} else {
|
||||
if self.data.capacity() > self.data.len().saturating_add(self.data.len() / 8) {
|
||||
self.data.shrink_to_fit();
|
||||
}
|
||||
let allocated = self.data.capacity().max(self.data.len());
|
||||
(Bytes::from(std::mem::take(&mut self.data)), allocated)
|
||||
};
|
||||
@@ -111,6 +127,12 @@ impl Candidate {
|
||||
let domain = self.ticket.domain.clone();
|
||||
let path = self.ticket.path.clone();
|
||||
let target = self.ticket.target.clone();
|
||||
detach_header_map(&mut self.headers);
|
||||
self.origin_etag = self.origin_etag.as_ref().map(detached_header_value);
|
||||
self.origin_last_modified = self
|
||||
.origin_last_modified
|
||||
.as_ref()
|
||||
.map(detached_header_value);
|
||||
let tags = cache_tags(&self.headers);
|
||||
let cost = hot_entry_cost(
|
||||
body_allocation,
|
||||
@@ -226,7 +248,21 @@ impl HttpBody for FillBody {
|
||||
let needed = candidate.data.len().saturating_add(data.len());
|
||||
if needed <= candidate.settings.max_object_bytes {
|
||||
let before = candidate.data.capacity();
|
||||
let required_growth = needed.saturating_sub(before);
|
||||
let target_capacity = if needed <= before {
|
||||
before
|
||||
} else if let Some(length) =
|
||||
candidate.plan.expected_length.filter(|length| {
|
||||
*length >= needed
|
||||
&& *length <= candidate.settings.max_object_bytes
|
||||
})
|
||||
{
|
||||
length
|
||||
} else {
|
||||
needed
|
||||
.max(before.saturating_mul(2))
|
||||
.min(candidate.settings.max_object_bytes)
|
||||
};
|
||||
let required_growth = target_capacity.saturating_sub(before);
|
||||
if required_growth > 0
|
||||
&& !candidate
|
||||
.fill_gauge
|
||||
@@ -246,7 +282,9 @@ impl HttpBody for FillBody {
|
||||
} else if required_growth > 0
|
||||
&& candidate
|
||||
.data
|
||||
.try_reserve_exact(needed.saturating_sub(candidate.data.len()))
|
||||
.try_reserve_exact(
|
||||
target_capacity.saturating_sub(candidate.data.len()),
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
candidate.cache.record_reason(
|
||||
|
||||
Vendored
+1
@@ -106,6 +106,7 @@ impl Cache {
|
||||
cache.demote_idle();
|
||||
cache.sweep_cold().await;
|
||||
cache.gc_banned(256);
|
||||
flush_pending_allocator_release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+21
-6
@@ -43,7 +43,18 @@ impl Cache {
|
||||
ticket.freshness_headers(),
|
||||
);
|
||||
if state.servable() {
|
||||
let sequence = store.next_sequence();
|
||||
// Approximate LRU: an entry already among the most recently used
|
||||
// eighth of the store is not re-linked on every hit. This keeps the
|
||||
// global HOT lock short for popular objects without changing which
|
||||
// cold entries are evicted first.
|
||||
let promote = store
|
||||
.entries
|
||||
.get(&storage_key)
|
||||
.is_some_and(|entry| {
|
||||
store.sequence.saturating_sub(entry.sequence)
|
||||
> (store.entries.len() as u64) / 8
|
||||
});
|
||||
let sequence = if promote { store.next_sequence() } else { 0 };
|
||||
let (
|
||||
old_sequence,
|
||||
headers,
|
||||
@@ -59,7 +70,9 @@ impl Cache {
|
||||
let old_sequence = entry.sequence;
|
||||
entry.hits = entry.hits.saturating_add(1);
|
||||
entry.last_access = Instant::now();
|
||||
entry.sequence = sequence;
|
||||
if promote {
|
||||
entry.sequence = sequence;
|
||||
}
|
||||
(
|
||||
old_sequence,
|
||||
Arc::clone(&entry.headers),
|
||||
@@ -72,8 +85,10 @@ impl Cache {
|
||||
entry.body.len(),
|
||||
)
|
||||
};
|
||||
store.lru.remove(&old_sequence);
|
||||
store.lru.insert(sequence, storage_key);
|
||||
if promote {
|
||||
store.lru.remove(&old_sequence);
|
||||
store.lru.insert(sequence, storage_key);
|
||||
}
|
||||
self.counters.hits.fetch_add(1, Ordering::Relaxed);
|
||||
drop(store);
|
||||
|
||||
@@ -88,7 +103,7 @@ impl Cache {
|
||||
response.extensions_mut().insert(crate::compression::Skip);
|
||||
}
|
||||
response.headers_mut().insert(::http::header::AGE,
|
||||
HeaderValue::from_str(&age.to_string()).expect("integer header"),
|
||||
HeaderValue::from(age),
|
||||
);
|
||||
self.domain_stats
|
||||
.saved_body_hit(&ticket.scope, &ticket.domain, body_bytes);
|
||||
@@ -285,7 +300,7 @@ impl Cache {
|
||||
response.extensions_mut().insert(crate::compression::Skip);
|
||||
}
|
||||
response.headers_mut().insert(::http::header::AGE,
|
||||
HeaderValue::from_str(&age.to_string()).expect("integer header"),
|
||||
HeaderValue::from(age),
|
||||
);
|
||||
self.domain_stats
|
||||
.saved_body_hit(&ticket.scope, &ticket.domain, entry.body_bytes);
|
||||
|
||||
Vendored
+1
-1
@@ -99,7 +99,7 @@ impl Cache {
|
||||
self.counters.hits.fetch_add(1, Ordering::Relaxed);
|
||||
let mut response = cached.response(headers);
|
||||
response.headers_mut().insert(::http::header::AGE,
|
||||
HeaderValue::from_str(&age.to_string()).expect("integer header"),
|
||||
HeaderValue::from(age),
|
||||
);
|
||||
Some(Hit {
|
||||
response,
|
||||
|
||||
Vendored
+5
-5
@@ -277,8 +277,8 @@ struct ColdEntry {
|
||||
|
||||
#[derive(Default)]
|
||||
struct ColdStore {
|
||||
entries: HashMap<Key, ColdEntry>,
|
||||
variants: HashMap<Key, Vec<Key>>,
|
||||
entries: KeyMap<ColdEntry>,
|
||||
variants: KeyMap<Vec<Key>>,
|
||||
lru: BTreeMap<u64, Key>,
|
||||
bytes: u64,
|
||||
sequence: u64,
|
||||
@@ -304,8 +304,8 @@ enum ColdCommand {
|
||||
}
|
||||
#[derive(Default)]
|
||||
struct Store {
|
||||
entries: HashMap<Key, Entry>,
|
||||
variants: HashMap<Key, Vec<Key>>,
|
||||
entries: KeyMap<Entry>,
|
||||
variants: KeyMap<Vec<Key>>,
|
||||
lru: BTreeMap<u64, Key>,
|
||||
bytes: usize,
|
||||
logical_bytes: usize,
|
||||
@@ -314,7 +314,7 @@ struct Store {
|
||||
revision: u64,
|
||||
control_revision: u64,
|
||||
scope_generations: HashMap<String, u64>,
|
||||
key_generations: HashMap<Key, u64>,
|
||||
key_generations: KeyMap<u64>,
|
||||
}
|
||||
impl Store {
|
||||
fn index_variant(&mut self, base_key: Key, key: Key) {
|
||||
|
||||
Vendored
+32
-25
@@ -268,13 +268,12 @@ impl Settings {
|
||||
if !self.enabled {
|
||||
return;
|
||||
}
|
||||
if let Some(value) = &self.via_header {
|
||||
headers.append(
|
||||
http::header::VIA,
|
||||
value
|
||||
.parse::<HeaderValue>()
|
||||
.expect("validated cache Via header"),
|
||||
);
|
||||
if let Some(value) = self
|
||||
.via_header
|
||||
.as_deref()
|
||||
.and_then(crate::settings::cached_header_value)
|
||||
{
|
||||
headers.append(http::header::VIA, value);
|
||||
}
|
||||
if self.expose_only_hits && outcome != "HIT" {
|
||||
return;
|
||||
@@ -300,7 +299,7 @@ impl Settings {
|
||||
headers,
|
||||
"x-cache-hits",
|
||||
"x-upstream-cache-hits",
|
||||
HeaderValue::from_str(&hits.to_string()).expect("integer header"),
|
||||
HeaderValue::from(hits),
|
||||
);
|
||||
}
|
||||
if self.expose_cache_status {
|
||||
@@ -311,30 +310,34 @@ impl Settings {
|
||||
)
|
||||
.then_some(("stale", Some(StatusCode::NOT_MODIFIED)))
|
||||
});
|
||||
let mut value = if let Some((why, status)) = forwarded {
|
||||
let mut value = format!("RustProxy; fwd={why}");
|
||||
use std::fmt::Write as _;
|
||||
let mut value = String::with_capacity(96);
|
||||
value.push_str("RustProxy; ");
|
||||
if let Some((why, status)) = forwarded {
|
||||
let _ = write!(value, "fwd={why}");
|
||||
if let Some(status) = status {
|
||||
value.push_str(&format!("; fwd-status={}", status.as_u16()));
|
||||
let _ = write!(value, "; fwd-status={}", status.as_u16());
|
||||
}
|
||||
value
|
||||
} else {
|
||||
match outcome {
|
||||
"HIT" => format!("RustProxy; hit; ttl={ttl}"),
|
||||
"MISS" => "RustProxy; fwd=miss".to_owned(),
|
||||
"BYPASS" if reason == Some("request_method") => {
|
||||
"RustProxy; fwd=method".to_owned()
|
||||
"HIT" => {
|
||||
let _ = write!(value, "hit; ttl={ttl}");
|
||||
}
|
||||
_ => "RustProxy; fwd=bypass".to_owned(),
|
||||
"MISS" => value.push_str("fwd=miss"),
|
||||
"BYPASS" if reason == Some("request_method") => value.push_str("fwd=method"),
|
||||
_ => value.push_str("fwd=bypass"),
|
||||
}
|
||||
};
|
||||
}
|
||||
if let Some(reason) = reason {
|
||||
value.push_str(&format!("; detail=\"{reason}\""));
|
||||
let _ = write!(value, "; detail=\"{reason}\"");
|
||||
}
|
||||
if transformed {
|
||||
value.push_str("; transformed");
|
||||
}
|
||||
headers.append(::http::header::CACHE_STATUS,
|
||||
HeaderValue::from_str(&value).expect("generated Cache-Status member"),
|
||||
headers.append(
|
||||
::http::header::CACHE_STATUS,
|
||||
HeaderValue::from_maybe_shared(bytes::Bytes::from(value))
|
||||
.expect("generated Cache-Status member"),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -345,7 +348,7 @@ impl Settings {
|
||||
headers,
|
||||
"x-cache-resident-age",
|
||||
"x-upstream-cache-resident-age",
|
||||
HeaderValue::from_str(&resident_age.to_string()).expect("integer header"),
|
||||
HeaderValue::from(resident_age),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -357,9 +360,13 @@ fn insert_cache_diagnostic(
|
||||
upstream_name: &'static str,
|
||||
value: HeaderValue,
|
||||
) {
|
||||
let upstream_values: Vec<HeaderValue> = headers.get_all(name).iter().cloned().collect();
|
||||
for upstream_value in upstream_values {
|
||||
headers.append(upstream_name, upstream_value);
|
||||
let name = http::HeaderName::from_static(name);
|
||||
if headers.contains_key(&name) {
|
||||
let upstream_values: Vec<HeaderValue> = headers.get_all(&name).iter().cloned().collect();
|
||||
let upstream_name = http::HeaderName::from_static(upstream_name);
|
||||
for upstream_value in upstream_values {
|
||||
headers.append(&upstream_name, upstream_value);
|
||||
}
|
||||
}
|
||||
headers.insert(name, value);
|
||||
}
|
||||
|
||||
Vendored
+69
@@ -28,6 +28,36 @@ const COLD_QUEUE: usize = 16;
|
||||
const COLD_FORMAT_VERSION: u8 = 3;
|
||||
type Key = [u8; 32];
|
||||
|
||||
/// Cache keys are SHA-256 digests, so their bytes are already uniformly
|
||||
/// distributed and not attacker-steerable. Hashing them again with SipHash
|
||||
/// costs measurable time on every HOT lookup; this hasher folds the digest
|
||||
/// cheaply instead (any other input is still mixed, Fx-style).
|
||||
#[derive(Default, Clone, Copy)]
|
||||
struct DigestKeyHasher(u64);
|
||||
impl std::hash::Hasher for DigestKeyHasher {
|
||||
fn finish(&self) -> u64 {
|
||||
self.0
|
||||
}
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
if bytes.len() == 32 {
|
||||
let mut word = [0u8; 8];
|
||||
word.copy_from_slice(&bytes[..8]);
|
||||
self.0 ^= u64::from_le_bytes(word);
|
||||
return;
|
||||
}
|
||||
for chunk in bytes.chunks(8) {
|
||||
let mut word = [0u8; 8];
|
||||
word[..chunk.len()].copy_from_slice(chunk);
|
||||
self.0 = (self.0.rotate_left(5) ^ u64::from_le_bytes(word))
|
||||
.wrapping_mul(0x51_7c_c1_b7_27_22_0a_95);
|
||||
}
|
||||
}
|
||||
fn write_usize(&mut self, _length: usize) {
|
||||
// The only usize written for `[u8; 32]` is its constant length prefix.
|
||||
}
|
||||
}
|
||||
type KeyMap<V> = HashMap<Key, V, std::hash::BuildHasherDefault<DigestKeyHasher>>;
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
|
||||
enum CleanupPriority {
|
||||
Automatic(u64, SystemTime, SystemTime),
|
||||
@@ -41,7 +71,46 @@ struct CleanupCandidate {
|
||||
key: Key,
|
||||
}
|
||||
|
||||
/// Minimum spacing between two `malloc_trim` calls. Trimming walks every glibc
|
||||
/// arena under its lock and can take milliseconds with a large heap; doing it
|
||||
/// after each eviction made a full HOT cache with constant turnover several
|
||||
/// times slower. Skipped requests are remembered and flushed by the cache
|
||||
/// maintenance tick, so freed memory still returns to the OS within seconds.
|
||||
const ALLOCATOR_RELEASE_INTERVAL_MS: u64 = 250;
|
||||
static ALLOCATOR_RELEASE_LAST_MS: AtomicU64 = AtomicU64::new(0);
|
||||
static ALLOCATOR_RELEASE_PENDING: std::sync::atomic::AtomicBool =
|
||||
std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
fn allocator_clock_ms() -> u64 {
|
||||
static EPOCH: std::sync::OnceLock<Instant> = std::sync::OnceLock::new();
|
||||
// +1 so the very first request is never mistaken for "just trimmed".
|
||||
(EPOCH.get_or_init(Instant::now).elapsed().as_millis() as u64)
|
||||
.saturating_add(ALLOCATOR_RELEASE_INTERVAL_MS + 1)
|
||||
}
|
||||
|
||||
fn release_allocator_memory() {
|
||||
let now = allocator_clock_ms();
|
||||
let last = ALLOCATOR_RELEASE_LAST_MS.load(Ordering::Relaxed);
|
||||
if now.saturating_sub(last) < ALLOCATOR_RELEASE_INTERVAL_MS
|
||||
|| ALLOCATOR_RELEASE_LAST_MS
|
||||
.compare_exchange(last, now, Ordering::AcqRel, Ordering::Relaxed)
|
||||
.is_err()
|
||||
{
|
||||
ALLOCATOR_RELEASE_PENDING.store(true, Ordering::Relaxed);
|
||||
return;
|
||||
}
|
||||
ALLOCATOR_RELEASE_PENDING.store(false, Ordering::Relaxed);
|
||||
cache_trim_allocator();
|
||||
}
|
||||
|
||||
/// Called from the periodic cache maintenance task.
|
||||
fn flush_pending_allocator_release() {
|
||||
if ALLOCATOR_RELEASE_PENDING.load(Ordering::Relaxed) {
|
||||
release_allocator_memory();
|
||||
}
|
||||
}
|
||||
|
||||
fn cache_trim_allocator() {
|
||||
#[cfg(all(target_os = "linux", target_env = "gnu"))]
|
||||
unsafe {
|
||||
libc::malloc_trim(0);
|
||||
|
||||
@@ -13,7 +13,8 @@ use sqlx::{
|
||||
};
|
||||
use std::{path::Path, time::Duration};
|
||||
|
||||
pub const SCHEMA_VERSION: i64 = 11;
|
||||
pub const SCHEMA_VERSION: i64 = 12;
|
||||
pub const ADMIN_PREFERENCES_MAX_BYTES: usize = 64 * 1024;
|
||||
pub const CERTIFICATE_API_CREDENTIAL_CAPACITY: i64 = 32;
|
||||
pub const AUDIT_CAPACITY: i64 = 10_000;
|
||||
|
||||
@@ -129,6 +130,13 @@ impl Store {
|
||||
sqlx::raw_sql(include_str!("../migrations/0011_tokens.sql"))
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
if version < 12 {
|
||||
sqlx::raw_sql(include_str!(
|
||||
"../migrations/0012_admin_preferences_size.sql"
|
||||
))
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
}
|
||||
sqlx::query("INSERT OR IGNORE INTO configuration(id, revision, document) VALUES(1, 0, ?)")
|
||||
.bind(serde_json::to_string(initial)?)
|
||||
.execute(&mut *tx)
|
||||
@@ -139,7 +147,7 @@ impl Store {
|
||||
.bind(crate::auth::now())
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
sqlx::query("PRAGMA user_version = 11")
|
||||
sqlx::query("PRAGMA user_version = 12")
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
tx.commit().await?;
|
||||
|
||||
+22
-1
@@ -454,13 +454,34 @@ impl ServerHeader {
|
||||
headers.remove(::http::header::SERVER);
|
||||
}
|
||||
ServerMode::Custom => {
|
||||
if let Ok(value) = self.value.parse() {
|
||||
if let Some(value) = cached_header_value(&self.value) {
|
||||
headers.insert(::http::header::SERVER, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn cached_header_value(value: &str) -> Option<HeaderValue> {
|
||||
const CAPACITY: usize = 16;
|
||||
thread_local! {
|
||||
static CACHE: std::cell::RefCell<Vec<(Box<str>, HeaderValue)>> =
|
||||
const { std::cell::RefCell::new(Vec::new()) };
|
||||
}
|
||||
CACHE.with(|cache| {
|
||||
let mut cache = cache.borrow_mut();
|
||||
if let Some((_, header)) = cache.iter().find(|(key, _)| key.as_ref() == value) {
|
||||
return Some(header.clone());
|
||||
}
|
||||
let header =
|
||||
HeaderValue::from_maybe_shared(bytes::Bytes::copy_from_slice(value.as_bytes())).ok()?;
|
||||
if cache.len() >= CAPACITY {
|
||||
cache.remove(0);
|
||||
}
|
||||
cache.push((value.into(), header.clone()));
|
||||
Some(header)
|
||||
})
|
||||
}
|
||||
include!("settings/public_origin.rs");
|
||||
#[cfg(test)]
|
||||
include!("settings/tests.rs");
|
||||
@@ -132,7 +132,7 @@ pub async fn apply(
|
||||
parts.headers.remove(::http::header::ACCEPT_RANGES);
|
||||
parts.headers.insert(::http::header::ETAG, transformed_etag(&transformed));
|
||||
parts.headers.insert(::http::header::CONTENT_LENGTH,
|
||||
HeaderValue::from_str(&transformed.len().to_string()).expect("integer header"),
|
||||
HeaderValue::from(transformed.len()),
|
||||
);
|
||||
drop_vary_accept_encoding(&mut parts.headers);
|
||||
parts.extensions.insert(validators);
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Browser smoke test for the optional semantic SVG interface icons.
|
||||
|
||||
Uses a locally installed Chromium when available and otherwise exits successfully
|
||||
with a skip message. It exercises the real index.html plus the embedded icon
|
||||
module without requiring a running RustProxy backend.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
import html
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
WEB = ROOT / "src/admin/web"
|
||||
chromium = next((shutil.which(name) for name in ("chromium", "chromium-browser", "google-chrome") if shutil.which(name)), None)
|
||||
if not chromium:
|
||||
print("Panel SVG icon browser smoke: SKIP (Chromium not installed)")
|
||||
raise SystemExit(0)
|
||||
|
||||
page = (WEB / "index.html").read_text(encoding="utf-8")
|
||||
page = re.sub(r'<script\s+defer=""\s+src="/assets/app___RUSTPROXY_ASSET_ID__\.js"></script>', "", page, count=1)
|
||||
icons = (WEB / "app/icons.js").read_text(encoding="utf-8")
|
||||
script = r'''
|
||||
const $ = id => document.getElementById(id);
|
||||
const translations = { edit: "Edit", remove: "Remove", copyValue: "Copy value", previous: "Previous", next: "Next" };
|
||||
function t(key) { return translations[key] || key; }
|
||||
''' + icons + r'''
|
||||
(() => {
|
||||
const fail = message => { document.getElementById("browser-icon-test").textContent = `FAIL: ${message}`; throw new Error(message); };
|
||||
const result = document.getElementById("browser-icon-test");
|
||||
const eligible = [...document.querySelectorAll("button, a.primary, a.outline, a.quiet")].filter(node => !node.matches(".chart-style-choice"));
|
||||
if (document.querySelectorAll("svg.ui-icon").length !== 0) fail("icons must be absent before enabling the preference");
|
||||
window.rustProxyIcons.setEnabled(true);
|
||||
const decorated = eligible.filter(node => node.querySelector(":scope > svg.ui-icon"));
|
||||
if (decorated.length !== eligible.length) fail(`expected ${eligible.length} decorated controls, got ${decorated.length}`);
|
||||
if ([...document.querySelectorAll("svg.ui-icon")].some(icon => icon.getAttribute("aria-hidden") !== "true")) fail("SVG icons must be aria-hidden");
|
||||
const expectedPanels = { overview: "grid", vhosts: "network", "web-server": "globe", "docker-vhosts": "box", redirects: "route", notfound: "fileX", streams: "network", "acl-profiles": "shield", tls: "certificate", traffic: "activity", cache: "database", transform: "wand", settings: "settings" };
|
||||
for (const [panel, icon] of Object.entries(expectedPanels)) {
|
||||
const button = document.querySelector(`[data-panel="${panel}"]`);
|
||||
if (button?.querySelector(":scope > svg.ui-icon")?.dataset.uiIcon !== icon) fail(`panel ${panel} must use ${icon}`);
|
||||
}
|
||||
const dynamic = document.createElement("button"); dynamic.type = "button"; dynamic.className = "quiet"; dynamic.textContent = "Edit"; document.body.append(dynamic);
|
||||
window.rustProxyIcons.refresh(dynamic);
|
||||
if (dynamic.querySelector("svg.ui-icon")?.dataset.uiIcon !== "edit") fail("translated dynamic Edit action must use edit icon");
|
||||
dynamic.textContent = "Remove item"; dynamic.setAttribute("aria-label", "Remove item"); window.rustProxyIcons.refresh(dynamic);
|
||||
if (dynamic.querySelector("svg.ui-icon")?.dataset.uiIcon !== "trash") fail("dynamic Remove action must use trash icon");
|
||||
const visibility = document.createElement("button"); visibility.dataset.dashboardWidgetAction = "toggle"; visibility.className = "dashboard-widget-toggle is-hidden"; document.body.append(visibility);
|
||||
window.rustProxyIcons.refresh(visibility);
|
||||
if (visibility.querySelector("svg.ui-icon")?.dataset.uiIcon !== "eyeOff") fail("hidden widget action must use eyeOff");
|
||||
visibility.classList.remove("is-hidden"); window.rustProxyIcons.refresh(visibility);
|
||||
if (visibility.querySelector("svg.ui-icon")?.dataset.uiIcon !== "eye") fail("visible widget action must use eye");
|
||||
window.rustProxyIcons.setEnabled(false);
|
||||
if (document.querySelectorAll("svg.ui-icon").length !== 0) fail("disabling preference must remove all injected icons");
|
||||
result.textContent = `OK ${eligible.length} controls`;
|
||||
})();
|
||||
'''
|
||||
page = page.replace("</body>", '<pre id="browser-icon-test">PENDING</pre><script>' + script + "</script></body>", 1)
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="rustproxy-icons-") as tmp:
|
||||
target = Path(tmp) / "icons-test.html"
|
||||
target.write_text(page, encoding="utf-8")
|
||||
try:
|
||||
proc = subprocess.run(
|
||||
[chromium, "--headless", "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage", "--virtual-time-budget=1000", "--dump-dom", target.as_uri()],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True,
|
||||
timeout=8,
|
||||
check=False,
|
||||
)
|
||||
except subprocess.TimeoutExpired:
|
||||
print("Panel SVG icon browser smoke: SKIP (Chromium cannot start in this environment)")
|
||||
raise SystemExit(0)
|
||||
match = re.search(r'<pre id="browser-icon-test">([^<]+)</pre>', proc.stdout)
|
||||
status = html.unescape(match.group(1)) if match else "missing result marker"
|
||||
if proc.returncode != 0 or not status.startswith("OK "):
|
||||
raise SystemExit(f"Panel SVG icon browser smoke failed: {status}\n{proc.stderr[-4000:]}")
|
||||
print(f"Panel SVG icon browser smoke: {status}")
|
||||
@@ -0,0 +1,50 @@
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const root = path.join(__dirname, "..");
|
||||
const read = relative => fs.readFileSync(path.join(root, relative), "utf8");
|
||||
const preferences = read("src/admin/web/app/preferences.js");
|
||||
const icons = read("src/admin/web/app/icons.js");
|
||||
const core = read("src/admin/web/app/core.js");
|
||||
const html = read("src/admin/web/index.html");
|
||||
const css = read("src/admin/web/css/10-base.css");
|
||||
const overviewCss = read("src/admin/web/css/30-overview.css");
|
||||
const integrations = read("src/admin/web/integrations.js");
|
||||
const metricsPartial = read("src/admin/web/partials/overview-metrics.html");
|
||||
const pl = JSON.parse(read("langs/pl_pl.json"));
|
||||
const openapi = JSON.parse(read("src/admin/openapi.json"));
|
||||
|
||||
assert.match(html, /id="ui-interface-icons"[^>]*type="checkbox"/);
|
||||
assert.match(preferences, /interface_icons:\s*false/);
|
||||
assert.match(preferences, /applyAdminInterfaceIcons\(value\.interface_icons\)/);
|
||||
assert.match(preferences, /saveAppearancePreference\(\{ interface_icons: next \}/);
|
||||
assert.match(preferences, /interface:\s*\{[^}]*interface_icons:\s*false/);
|
||||
assert.match(core, /rustProxyIcons\?\.refresh\?\.\(\)/);
|
||||
assert.match(icons, /dataset\.interfaceIcons !== "true"/);
|
||||
assert.match(icons, /aria-hidden", "true"/);
|
||||
assert.match(icons, /data\.panel|dataset\.panel/);
|
||||
assert.match(icons, /MutationObserver/);
|
||||
assert.match(icons, /if \(target\.dataset\.httpSettingsTab\) return "network"/);
|
||||
assert.match(icons, /#web-service-preset-apply.*return "wand"/);
|
||||
assert.match(icons, /vhost-quick-toggle\.is-enable.*return "toggleOn"/);
|
||||
assert.match(icons, /vhost-quick-toggle\.is-disable.*return "toggleOff"/);
|
||||
assert.equal((html.match(/class="outline about-repository" data-ui-icon-name="none"/g) || []).length, 4);
|
||||
assert.match(metricsPartial, /backend-latency-stat[\s\S]*backend-health-origins[\s\S]*backend-dashboard-latency-detail/);
|
||||
assert.equal(JSON.parse(read("langs/en_US.json")).translations.backendWidgetProbeCount, "Health Origins");
|
||||
assert.match(icons, /#tunnels-open.*return null/);
|
||||
assert.match(icons, /#logs-menu > summary/);
|
||||
assert.match(integrations, /listener-h2-settings-link.*uiIconName = "settings"/);
|
||||
assert.match(integrations, /listener-h3-settings-link.*uiIconName = "settings"/);
|
||||
assert.match(metricsPartial, /stat-corner-badge[^>]+data-ui-icon-name="none"[^>]+id="tunnels-open"/);
|
||||
assert.match(overviewCss, /\.stat-corner-badge/);
|
||||
assert.equal(pl.translations.interfaceIconsHelp, "Dodaje semantyczne ikony SVG do nawigacji, akcji, zakładek i okien dialogowych.");
|
||||
assert.match(css, /html\[data-interface-icons="true"\]/);
|
||||
assert.equal(openapi.components.schemas.AdminPreferences.properties.interface_icons.default, false);
|
||||
assert.equal(openapi.components.schemas.AdminPreferences.properties.interface_icons.type, "boolean");
|
||||
|
||||
for (const icon of ["plus", "save", "check", "trash", "edit", "refresh", "settings", "search", "key", "certificate", "shield", "network", "database", "wand", "grid", "activity", "book", "toggleOn", "toggleOff"]) {
|
||||
assert.ok(new RegExp(`\\b${icon}:`).test(icons), `missing semantic SVG icon definition: ${icon}`);
|
||||
}
|
||||
|
||||
console.log("Panel SVG icon preference contract: OK");
|
||||
@@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Static integrity checks for the embedded administration interface.
|
||||
|
||||
The test intentionally uses only the Python standard library. It verifies the
|
||||
actual HTML assembly and JavaScript files embedded by src/admin/router.rs; it is
|
||||
not a replacement for Rust/browser integration tests.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
WEB = ROOT / "src/admin/web"
|
||||
ROUTER = (ROOT / "src/admin/router.rs").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def assembled_html() -> str:
|
||||
html = (WEB / "index.html").read_text(encoding="utf-8")
|
||||
metrics = (WEB / "partials/overview-metrics.html").read_text(encoding="utf-8")
|
||||
charts = (WEB / "partials/overview-charts.html").read_text(encoding="utf-8")
|
||||
metrics_main, metrics_web = metrics.split("<!-- RP_METRICS_SPLIT -->", 1)
|
||||
charts_main, charts_web = charts.split("<!-- RP_CHARTS_SPLIT -->", 1)
|
||||
return (
|
||||
html.replace("<!-- RP_METRICS_MAIN -->", metrics_main)
|
||||
.replace("<!-- RP_METRICS_WEB -->", metrics_web)
|
||||
.replace("<!-- RP_CHARTS_MAIN -->", charts_main)
|
||||
.replace("<!-- RP_CHARTS_WEB -->", charts_web)
|
||||
)
|
||||
|
||||
|
||||
def embedded_app_sources() -> list[Path]:
|
||||
start = ROUTER.index("fn admin_app_javascript()")
|
||||
end = ROUTER.index("fn admin_vhosts_javascript()", start)
|
||||
app_block = ROUTER[start:end]
|
||||
paths = [WEB / rel for rel in re.findall(r'include_str!\("web/([^"\n]+\.js)"\)', app_block)]
|
||||
|
||||
vstart = end
|
||||
vend = ROUTER.index("pub fn router", vstart)
|
||||
vhost_block = ROUTER[vstart:vend]
|
||||
vhost_paths = [WEB / rel for rel in re.findall(r'include_str!\("web/([^"\n]+\.js)"\)', vhost_block)]
|
||||
|
||||
result: list[Path] = []
|
||||
for path in [*paths, *vhost_paths]:
|
||||
if path not in result:
|
||||
result.append(path)
|
||||
return result
|
||||
|
||||
|
||||
def attribute_values(html: str, name: str) -> set[str]:
|
||||
return set(re.findall(rf'\b{re.escape(name)}=["\']([^"\']+)', html))
|
||||
|
||||
|
||||
html = assembled_html()
|
||||
ids = re.findall(r'\bid=["\']([^"\']+)', html)
|
||||
duplicates = sorted(name for name, count in Counter(ids).items() if count > 1)
|
||||
assert not duplicates, f"duplicate panel DOM ids: {duplicates}"
|
||||
id_set = set(ids)
|
||||
|
||||
sources = embedded_app_sources()
|
||||
assert sources, "no embedded administration JavaScript sources found"
|
||||
missing_files = [str(path.relative_to(ROOT)) for path in sources if not path.is_file()]
|
||||
assert not missing_files, f"missing embedded JS sources: {missing_files}"
|
||||
|
||||
literal_refs: dict[str, set[str]] = {}
|
||||
patterns = [
|
||||
re.compile(r'\$\(["\']([^"\']+)["\']\)'),
|
||||
re.compile(r'document\.getElementById\(["\']([^"\']+)["\']\)'),
|
||||
]
|
||||
for path in sources:
|
||||
source = path.read_text(encoding="utf-8")
|
||||
for pattern in patterns:
|
||||
for dom_id in pattern.findall(source):
|
||||
literal_refs.setdefault(dom_id, set()).add(str(path.relative_to(ROOT)))
|
||||
missing_refs = {dom_id: sorted(paths) for dom_id, paths in literal_refs.items() if dom_id not in id_set}
|
||||
assert not missing_refs, f"embedded panel JS references missing DOM ids: {missing_refs}"
|
||||
|
||||
assert "ui-interface-icons" in id_set, "Appearance must expose the SVG icon toggle"
|
||||
assert any(path.name == "icons.js" for path in sources), "semantic icon module must be embedded in app.js"
|
||||
|
||||
assert 'data-i18n="overviewExtraRecentSamples"' not in html, "Overview metric tiles must not show the redundant Recent samples footer"
|
||||
overview_extra = (WEB / "app/overview-extra-metrics.js").read_text(encoding="utf-8")
|
||||
assert 't("overviewExtraRecentSamples")' not in overview_extra, "Overview metric details must not fall back to the generic Recent samples label"
|
||||
|
||||
# Every visible primary navigation target must have a panel section. filelogs is
|
||||
# intentionally opened from the Logs menu rather than the main navigation.
|
||||
panel_targets = attribute_values(html, "data-panel")
|
||||
panel_sections = {value.removeprefix("panel-") for value in id_set if value.startswith("panel-")}
|
||||
assert panel_targets <= panel_sections, f"navigation targets without panels: {sorted(panel_targets - panel_sections)}"
|
||||
assert panel_sections - panel_targets <= {"filelogs"}, f"unexpected orphan panels: {sorted(panel_sections - panel_targets)}"
|
||||
|
||||
# Tab/page contracts used by the generic tab handlers in the embedded JS.
|
||||
for prefix in ("settings", "policy-settings", "cache-settings", "logging-settings", "traffic"):
|
||||
tabs = attribute_values(html, f"data-{prefix}-tab")
|
||||
pages = attribute_values(html, f"data-{prefix}-page")
|
||||
assert tabs == pages, f"{prefix} tab/page mismatch: tabs={sorted(tabs - pages)}, pages={sorted(pages - tabs)}"
|
||||
|
||||
print(
|
||||
f"Panel interface contract: OK ({len(ids)} unique DOM ids, "
|
||||
f"{len(literal_refs)} literal JS references, {len(sources)} embedded JS files)"
|
||||
)
|
||||
@@ -0,0 +1,55 @@
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const root = path.join(__dirname, "..");
|
||||
const read = relative => fs.readFileSync(path.join(root, relative), "utf8");
|
||||
|
||||
const settings = read("src/admin/web/settings.js");
|
||||
const certificateApi = read("src/admin/web/certificate-api.js");
|
||||
const core = read("src/admin/web/app/core.js");
|
||||
const cache = read("src/admin/web/cache-panel.js");
|
||||
const transform = read("src/admin/web/transform-panel.js");
|
||||
const traffic = read("src/admin/web/traffic-panel.js");
|
||||
const refresh = read("src/admin/web/app/refresh.js");
|
||||
const management = read("src/admin/web/management.js");
|
||||
const loggingApi = read("src/admin/logging_api.rs");
|
||||
const openapi = JSON.parse(read("src/admin/openapi.json"));
|
||||
|
||||
assert.match(settings, /authenticated && name === "certificate-api"[^\n]+rustProxyCertificateApi\?\.load/);
|
||||
assert.match(settings, /authenticated && active === "certificate-api"[^\n]+rustProxyCertificateApi\?\.load/);
|
||||
assert.ok(!/renderCertificateApi\(\);\s*loadCertificateApi\(\);\s*\}\)\(\);\s*$/.test(certificateApi),
|
||||
"Certificate API must not fetch credentials when its module is initialized");
|
||||
|
||||
assert.match(core, /async function refresh\(force = false\)/);
|
||||
assert.doesNotMatch(core, /includeLogs/);
|
||||
assert.match(core, /new EventSource\(`\/api\/events\?interval=\$\{seconds\}&logs=false`\)/);
|
||||
assert.match(loggingApi, /logs: Option<bool>/);
|
||||
assert.match(loggingApi, /let include_logs = query\.logs\.unwrap_or\(true\)/);
|
||||
assert.match(loggingApi, /if include_logs[\s\S]+logs_payload\(&state\)[\s\S]+else[\s\S]+live_status_payload/);
|
||||
assert.match(core, /if \(payload\.logs\) renderLogs\(payload\.logs\)/);
|
||||
|
||||
assert.match(refresh, /active: \(\) => !!window\.rustProxyLogs\?\.active\?\.\(\)/);
|
||||
assert.doesNotMatch(refresh, /manual\("logs-fallback"\).*manual\("system-info"\)/);
|
||||
assert.match(management, /function active\(\) \{ return dialog\.open && !paused && !expanded; \}/);
|
||||
assert.match(management, /syncLivePolling\(true\)/);
|
||||
|
||||
for (const [name, source, endpoint] of [
|
||||
["cache", cache, "/api/cache"],
|
||||
["transform", transform, "/api/transform"],
|
||||
["traffic", traffic, "/api/traffic"],
|
||||
]) {
|
||||
assert.ok(/view=live/.test(source) || /set\(\"view\", \"live\"\)/.test(source), `${name} panel must use the lightweight polling view`);
|
||||
assert.match(source, /data\.revision !== staticRevision/, `${name} panel must invalidate static data on config revision changes`);
|
||||
assert.match(source, /reset\(\)[\s\S]{0,220}staticData = null[\s\S]{0,120}staticRevision = null/, `${name} panel reset must discard static cached API data`);
|
||||
const operation = openapi.paths[endpoint].get;
|
||||
const view = (operation.parameters || []).find(parameter => parameter.name === "view");
|
||||
assert.deepEqual(view?.schema?.enum, ["live"], `${endpoint} must document view=live`);
|
||||
}
|
||||
|
||||
const events = openapi.paths["/api/events"].get;
|
||||
const logsFlag = (events.parameters || []).find(parameter => parameter.name === "logs");
|
||||
assert.equal(logsFlag?.schema?.type, "boolean");
|
||||
assert.equal(logsFlag?.schema?.default, true);
|
||||
assert.equal(openapi.info.version, "0.36.1");
|
||||
console.log("Panel refresh/API contract checks: OK");
|
||||
Reference in new issue
Block a user