v0.38.4
This commit is contained in:
1 parent
9e81cce271
commit
185d5da6f9
31 files changed
+296
-199
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# RustProxy source and documentation maintenance
|
||||
|
||||
Current source version: **0.38.3**. The Cargo package and binary are named `rust-proxy`.
|
||||
Current source version: **0.38.4**. 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,13 @@
|
||||
|
||||
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.38.4 — on/off switches in the panel
|
||||
|
||||
- **Switches for on/off settings:** a setting that turns a feature or a whole section on or off is now a switch instead of a checkbox, with the same rule in every editor: **Enabled** of vhosts, backends, locations, streams, listeners, redirect and 404 hosts, cache rules and PHP profiles; per-host features (WebSockets, Force HTTPS, www redirect, HTTP/2, HTTP/3, keep-alive, client IP forwarding, Cloudflare client IP, diagnostic headers, passive health checks, Content-Type denylist, rate limit, HSTS, User-Agent blocking, cache, transformations, compression, PQC key exchange) in the vhost and Docker app editors alike; the "custom"/"inherit" overrides; and global features (ACL countries, cache and its subsystems, Varnish-compatible policy, Via header, transformations, logging outputs and captured fields, GeoIP, Prometheus, alerts, trusted X-Forwarded-Proto, admin TLS, Web Server directory listing, .htaccess, precompressed files, PHP and hardening, default certificate), plus live refresh, appearance and layout preferences.
|
||||
- **Checkboxes stay where they fit:** choices from a set (TLS versions, compression algorithms, cache headers, cache stale-if-error and COLD triggers, passive health error types, metric groups, alert types, transformation types, precompressed formats), row and column selection, cache-rule modifiers and risk confirmations (terms of service, production issuance, private or local destinations, certificate mismatch). Every other standalone on/off setting, including options inside a section (for example HSTS includeSubDomains/preload, legacy WebSocket support, retry conditions, preserve Host, backend TLS verification, backup/drain, listener protocols, .htaccess and PHP options), is a switch.
|
||||
- **Appearance preference:** **Settings → Appearance → Interface → Show on/off settings as switches** (on by default) brings back ordinary checkboxes everywhere when turned off. Preferences API: additive `switch_controls` boolean (default `true`) in `/api/preferences`; no migration is required.
|
||||
- The Docker **Publish** switch uses the same shared style; switches follow the selected corner style, show a keyboard focus ring and respect reduced motion. Saved configuration and the API are unchanged.
|
||||
|
||||
## 0.38.3 — Docker vhosts ready for production
|
||||
|
||||
- **Security and access for Docker apps:** the per-service editor has a new **Security and access** section with HTTP method policy, per-client IP rate limit, country access, security headers (HSTS, nosniff, X-Frame-Options, Referrer-Policy) and the verified Cloudflare client IP, the same engine as ordinary vhosts. Unused options are not stored, existing assignments are unchanged.
|
||||
|
||||
Generated
+1
-1
@@ -1943,7 +1943,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rust-proxy"
|
||||
version = "0.38.3"
|
||||
version = "0.38.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rust-proxy"
|
||||
version = "0.38.3"
|
||||
version = "0.38.4"
|
||||
edition = "2021"
|
||||
rust-version = "1.99.1"
|
||||
description = "RustProxy - independent reverse proxy with local administration"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
var version = "0.38.3" // overridden by the package builder using -ldflags -X main.version
|
||||
var version = "0.38.4" // overridden by the package builder using -ldflags -X main.version
|
||||
|
||||
type config struct {
|
||||
Listen string
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ The current bundled `src/admin/openapi.json` declares these operations (among ot
|
||||
| `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, including theme/layout, optional `interface_icons` and `logo_animation` (both default `false`), and `stable_dialog_position` (default `true`). |
|
||||
| `GET/PUT /api/preferences` | Personal UI settings, including theme/layout, optional `interface_icons` and `logo_animation` (both default `false`), `stable_dialog_position` and `switch_controls` (both default `true`). |
|
||||
| `GET /api/dashboard-presets` and named preset operations | Saved Overview presets. |
|
||||
| `GET /docs/openapi.json` | Protected machine-readable API specification. |
|
||||
|
||||
|
||||
@@ -98,6 +98,10 @@ The **Corner style** setting (Original, Square, Subtle, Rounded, Extra) also app
|
||||
|
||||
Under **Settings → Appearance → Interface**, **Keep dialogs at a stable top position** is **on by default**. It anchors primary panel dialogs near the top of the viewport, so switching between editor tabs whose contents have different heights does not make the dialog jump vertically. The account preference is `stable_dialog_position: true|false` in `/api/preferences`; turning it off restores the browser's vertically centered dialog behavior. The setting changes only panel presentation and does not affect proxy configuration or editor data.
|
||||
|
||||
### Switches for on/off settings
|
||||
|
||||
Under **Settings → Appearance → Interface**, **Show on/off settings as switches** is **on by default**. Settings that turn a feature or a whole section on or off (for example a vhost's **Enabled**, HSTS, rate limit, cache, Prometheus or alerts) are drawn as switches. Every standalone on/off setting, including options inside a section, is a switch. Choices from a set (TLS versions, compression algorithms, alert types, metric groups), row and column selection, cache-rule modifiers and risk confirmations stay checkboxes. Turning the preference off draws every control as an ordinary checkbox. The account preference is `switch_controls: true|false` in `/api/preferences`; it changes only panel presentation.
|
||||
|
||||
## Editing configuration safely
|
||||
|
||||
1. Open the relevant workspace and inspect existing state before editing.
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ In a container, mount the file read-only (RustProxy never writes it) and keep `/
|
||||
`GET /healthz` on `--health-listen` answers `200` while every vhost with backends has at least one healthy backend and `503` otherwise:
|
||||
|
||||
```json
|
||||
{"status":"ok","mode":"headless","version":"0.38.3","revision":4,"uptime_seconds":120,
|
||||
{"status":"ok","mode":"headless","version":"0.38.4","revision":4,"uptime_seconds":120,
|
||||
"last_reload":{"ok":true,"at_unix":1794743660,"error":null},
|
||||
"vhosts_without_healthy_backends":[],
|
||||
"pools":[{"vhost":"app","healthy":3,"backends":3}]}
|
||||
|
||||
@@ -77,10 +77,10 @@ ENV_FILE=integrations/routeros-oci-build/.env \
|
||||
bash integrations/routeros-oci-build/build-routeros-oci.sh push
|
||||
```
|
||||
|
||||
For example, with RustProxy version `0.38.3` and the defaults this publishes:
|
||||
For example, with RustProxy version `0.38.4` and the defaults this publishes:
|
||||
|
||||
```text
|
||||
oci.example.net/network/rustproxy:0.38.3
|
||||
oci.example.net/network/rustproxy:0.38.4
|
||||
oci.example.net/network/rustproxy:latest
|
||||
oci.example.net/network/rustproxy:routeros
|
||||
```
|
||||
|
||||
@@ -2523,6 +2523,8 @@
|
||||
"logoAnimationHelp": "Plays short, subtle animations of the sidebar logo from time to time and on hover.",
|
||||
"stableDialogPosition": "Keep dialogs at a stable top position",
|
||||
"stableDialogPositionHelp": "Keeps editor dialogs anchored near the top of the viewport so switching between tabs with different content heights does not move the dialog.",
|
||||
"switchControls": "Show on/off settings as switches",
|
||||
"switchControlsHelp": "Draws settings that turn a feature or section on or off as switches instead of checkboxes. Option lists keep checkboxes.",
|
||||
"entityEnableHint": "Controls whether this item is active.",
|
||||
"setupCommandExample": "Standard service installation example:",
|
||||
"certificateRuntimeTitle": "ACME runtime",
|
||||
|
||||
@@ -2523,6 +2523,8 @@
|
||||
"logoAnimationHelp": "Od czasu do czasu (i po najechaniu kursorem) odtwarza krótkie, subtelne animacje logo w panelu bocznym.",
|
||||
"stableDialogPosition": "Stabilna pozycja okien dialogowych",
|
||||
"stableDialogPositionHelp": "Utrzymuje edytory blisko górnej krawędzi widoku, dzięki czemu przełączanie między kartami o różnej wysokości nie przesuwa okna.",
|
||||
"switchControls": "Przełączniki zamiast pól wyboru",
|
||||
"switchControlsHelp": "Ustawienia włączające lub wyłączające funkcję albo sekcję są pokazywane jako przełączniki zamiast pól wyboru. Listy opcji zostają polami wyboru.",
|
||||
"entityEnableHint": "Określa, czy ten element jest aktywny.",
|
||||
"setupCommandExample": "Przykład dla standardowej instalacji usługi:",
|
||||
"certificateRuntimeTitle": "Środowisko ACME",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"openapi": "3.0.3",
|
||||
"info": {
|
||||
"title": "RustProxy Administration API",
|
||||
"version": "0.38.3",
|
||||
"version": "0.38.4",
|
||||
"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": [
|
||||
@@ -4174,6 +4174,11 @@
|
||||
"default": true,
|
||||
"description": "Account-scoped administration UI preference. When enabled, primary panel dialogs stay anchored near the top of the viewport instead of being vertically re-centered when their content height changes."
|
||||
},
|
||||
"switch_controls": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Since 0.38.4. Account-scoped administration UI preference. When enabled, settings that turn a feature or section on or off are drawn as switches; when disabled they are drawn as ordinary checkboxes. Presentation only; does not change the stored configuration."
|
||||
},
|
||||
"button_style": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
@@ -24,6 +24,9 @@ fn default_admin_corner_style() -> String {
|
||||
fn default_admin_stable_dialog_position() -> bool {
|
||||
true
|
||||
}
|
||||
fn default_admin_switch_controls() -> bool {
|
||||
true
|
||||
}
|
||||
fn default_admin_table_density() -> String {
|
||||
"normal".to_owned()
|
||||
}
|
||||
@@ -160,6 +163,8 @@ struct AdminPreferences {
|
||||
logo_animation: bool,
|
||||
#[serde(default = "default_admin_stable_dialog_position")]
|
||||
stable_dialog_position: bool,
|
||||
#[serde(default = "default_admin_switch_controls")]
|
||||
switch_controls: bool,
|
||||
#[serde(default = "default_admin_button_style")]
|
||||
button_style: String,
|
||||
#[serde(default = "default_admin_corner_style")]
|
||||
@@ -235,6 +240,7 @@ impl Default for AdminPreferences {
|
||||
interface_icons: false,
|
||||
logo_animation: false,
|
||||
stable_dialog_position: default_admin_stable_dialog_position(),
|
||||
switch_controls: default_admin_switch_controls(),
|
||||
button_style: default_admin_button_style(),
|
||||
corner_style: default_admin_corner_style(),
|
||||
table_density: default_admin_table_density(),
|
||||
|
||||
@@ -48,6 +48,21 @@ fn overview_factory_preset_matches_registry_and_operator_visibility() {
|
||||
assert!(!AdminPreferences::default().interface_icons);
|
||||
assert!(!AdminPreferences::default().logo_animation);
|
||||
assert!(AdminPreferences::default().stable_dialog_position);
|
||||
assert!(AdminPreferences::default().switch_controls);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn switch_controls_default_on_for_new_and_legacy_documents() {
|
||||
assert!(AdminPreferences::default().switch_controls);
|
||||
let legacy: AdminPreferences = serde_json::from_str(r#"{"theme":"light"}"#).unwrap();
|
||||
assert!(legacy.switch_controls);
|
||||
let mut disabled = legacy.clone();
|
||||
disabled.switch_controls = false;
|
||||
assert!(validate_admin_preferences(&disabled).is_ok());
|
||||
let stored = serde_json::to_string(&disabled).unwrap();
|
||||
assert!(stored.contains("\"switch_controls\":false"));
|
||||
let recovered: AdminPreferences = serde_json::from_str(&stored).unwrap();
|
||||
assert!(!recovered.switch_controls);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -2177,6 +2177,7 @@ mod tests {
|
||||
assert_eq!(initial["interface_icons"], false);
|
||||
assert_eq!(initial["logo_animation"], false);
|
||||
assert_eq!(initial["stable_dialog_position"], true);
|
||||
assert_eq!(initial["switch_controls"], true);
|
||||
assert_eq!(initial["button_style"], "normal");
|
||||
assert_eq!(initial["corner_style"], "default");
|
||||
assert_eq!(
|
||||
@@ -2227,6 +2228,7 @@ mod tests {
|
||||
assert_eq!(legacy["interface_icons"], false);
|
||||
assert_eq!(legacy["logo_animation"], false);
|
||||
assert_eq!(legacy["stable_dialog_position"], true);
|
||||
assert_eq!(legacy["switch_controls"], true);
|
||||
assert_eq!(legacy["button_style"], "normal");
|
||||
assert_eq!(legacy["corner_style"], "default");
|
||||
assert_eq!(
|
||||
@@ -2252,6 +2254,7 @@ mod tests {
|
||||
"interface_icons":true,
|
||||
"logo_animation":true,
|
||||
"stable_dialog_position":false,
|
||||
"switch_controls":false,
|
||||
"button_style":"compact",
|
||||
"corner_style":"rounded",
|
||||
"table_density":"ultra",
|
||||
|
||||
@@ -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, interface_icons: false, logo_animation: false, stable_dialog_position: true,
|
||||
chart_axes: false, interface_icons: false, logo_animation: false, stable_dialog_position: true, switch_controls: true,
|
||||
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, dashboard_widget_heights: null, dashboard_widget_positions: null, dashboard_auto_fit: true, sidebar_collapsed: false,
|
||||
});
|
||||
const CHART_STYLE_KEYS = Object.freeze({ default: "chartStyleDefault", soft: "chartStyleSoft", technical: "chartStyleTechnical", high_contrast: "chartStyleHighContrast", neon: "chartStyleNeon", monochrome: "chartStyleMonochrome", warm: "chartStyleWarm", cool: "chartStyleCool", sunset: "chartStyleSunset", aurora: "chartStyleAurora", ocean: "chartStyleOcean", forest: "chartStyleForest", pastel: "chartStylePastel", terminal: "chartStyleTerminal", blueprint: "chartStyleBlueprint", colorblind: "chartStyleColorblind" });
|
||||
@@ -152,6 +152,12 @@ function applyAdminStableDialogPosition(value) {
|
||||
const input = $("ui-stable-dialog-position"); if (input) input.checked = enabled;
|
||||
return enabled;
|
||||
}
|
||||
function applyAdminSwitchControls(value) {
|
||||
const enabled = value !== false;
|
||||
document.documentElement.dataset.switchControls = String(enabled);
|
||||
const input = $("ui-switch-controls"); if (input) input.checked = enabled;
|
||||
return enabled;
|
||||
}
|
||||
function applyAdminButtonStyle(value) {
|
||||
const style = normalizeAdminButtonStyle(value); document.documentElement.dataset.buttonStyle = style;
|
||||
const select = $("ui-button-style"); if (select) select.value = style; return style;
|
||||
@@ -331,7 +337,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), interface_icons: applyAdminInterfaceIcons(value.interface_icons), logo_animation: applyAdminLogoAnimation(value.logo_animation), stable_dialog_position: applyAdminStableDialogPosition(value.stable_dialog_position), 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), logo_animation: applyAdminLogoAnimation(value.logo_animation), stable_dialog_position: applyAdminStableDialogPosition(value.stable_dialog_position), switch_controls: applyAdminSwitchControls(value.switch_controls), 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, dashboard_widget_heights: savedHeights, dashboard_widget_positions: savedPositions, dashboard_auto_fit: savedAutoFit,
|
||||
};
|
||||
adminPreferences = normalized;
|
||||
@@ -383,7 +389,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.interface_icons = next.interface_icons === true; next.logo_animation = next.logo_animation === true; next.stable_dialog_position = next.stable_dialog_position !== false; 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.logo_animation = next.logo_animation === true; next.stable_dialog_position = next.stable_dialog_position !== false; next.switch_controls = next.switch_controls !== false; 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); next.dashboard_widget_heights = normalizeDashboardWidgetHeights(next.dashboard_widget_heights); next.dashboard_widget_positions = normalizeDashboardWidgetPositions(next.dashboard_widget_positions); next.dashboard_auto_fit = next.dashboard_auto_fit !== false; next.sidebar_collapsed = next.sidebar_collapsed === true;
|
||||
const saved = await api("/api/preferences", { method: "PUT", body: JSON.stringify(next) });
|
||||
if (!authenticated || epoch !== authEpoch) return adminPreferences;
|
||||
@@ -491,6 +497,14 @@ $("ui-stable-dialog-position")?.addEventListener("change", () => {
|
||||
applyAdminStableDialogPosition(previous);
|
||||
});
|
||||
});
|
||||
$("ui-switch-controls")?.addEventListener("change", () => {
|
||||
const control = $("ui-switch-controls"), previous = adminPreferences?.switch_controls !== false, next = control.checked;
|
||||
applyAdminSwitchControls(next); if (adminPreferences) adminPreferences.switch_controls = next;
|
||||
void saveAppearancePreference({ switch_controls: next }, control, () => {
|
||||
if (adminPreferences) adminPreferences.switch_controls = previous;
|
||||
applyAdminSwitchControls(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); });
|
||||
@@ -522,7 +536,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", interface_icons: false, logo_animation: false, stable_dialog_position: true, 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, logo_animation: false, stable_dialog_position: true, switch_controls: true, 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, dashboard_widget_heights: null, dashboard_auto_fit: true },
|
||||
};
|
||||
void resetAppearancePatch(patches[control.dataset.appearanceReset] || {}, control);
|
||||
|
||||
@@ -228,7 +228,7 @@ window.rustProxyCacheRules = (() => {
|
||||
const exportButton = el("button", t("cacheRulesExportVcl"), "outline"); exportButton.type = "button";
|
||||
const addButton = el("button", t("cacheRulesAdd"), "primary"); addButton.type = "button";
|
||||
toolbar.append(templates, importButton, exportButton, addButton);
|
||||
const ignoreWrap = el("label", undefined, "check cache-rules-ignore"), ignoreBox = el("input"); ignoreBox.type = "checkbox"; ignoreBox.checked = ignoreGlobal; if (options.ignoreId !== "") ignoreBox.id = options.ignoreId || "vh-cache-ignore-global-rules";
|
||||
const ignoreWrap = el("label", undefined, "check cache-rules-ignore"), ignoreBox = el("input", undefined, "switch"); ignoreBox.type = "checkbox"; ignoreBox.checked = ignoreGlobal; if (options.ignoreId !== "") ignoreBox.id = options.ignoreId || "vh-cache-ignore-global-rules";
|
||||
ignoreWrap.append(ignoreBox, el("span", t("cacheRulesIgnoreGlobal")));
|
||||
const notices = el("div", undefined, "cache-rules-notices");
|
||||
const list = el("div", undefined, "cache-rules-list");
|
||||
@@ -284,7 +284,7 @@ window.rustProxyCacheRules = (() => {
|
||||
card.addEventListener("drop", event => { event.preventDefault(); card.classList.remove("is-drop"); const from = Number(event.dataTransfer.getData("text/plain")); if (Number.isInteger(from) && from !== index) move(from, index); });
|
||||
const head = el("div", undefined, "cache-rule-head");
|
||||
const grip = el("span", "⠿", "cache-rule-grip"); grip.title = t("cacheRulesDrag");
|
||||
const toggle = el("input"); toggle.type = "checkbox"; toggle.checked = rule.enabled; toggle.setAttribute("aria-label", t("enabled"));
|
||||
const toggle = el("input", undefined, "switch"); toggle.type = "checkbox"; toggle.checked = rule.enabled; toggle.setAttribute("aria-label", t("enabled"));
|
||||
toggle.addEventListener("change", () => { rule.enabled = toggle.checked; card.classList.toggle("is-disabled", !rule.enabled); exportPre.textContent = exportVcl(rules); changed(); });
|
||||
const title = el("button", undefined, "cache-rule-title"); title.type = "button"; title.dataset.uiIconName = "none";
|
||||
title.append(el("b", rule.name || rule.id), el("span", t(STAGE_KEYS[rule.stage]), "pill cache-rule-stage"), el("span", summary(rule), "fine cache-rule-summary"));
|
||||
|
||||
@@ -1146,6 +1146,65 @@ html[data-dashboard-density=compact] #panel-overview .dashboard-overview-grid>.c
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* On/off switch: an ordinary checkbox with class "switch". Used for settings
|
||||
that turn a feature or section on; option lists, row selection and risk
|
||||
confirmations stay plain checkboxes. The account preference
|
||||
switch_controls=false (html[data-switch-controls="false"]) keeps the plain
|
||||
checkbox look. */
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch {
|
||||
--rp-switch-h: calc(var(--ui-check-size) + 1px);
|
||||
--rp-switch-w: calc(var(--rp-switch-h) * 1.875);
|
||||
--rp-switch-knob: calc(var(--rp-switch-h) - 6px);
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
position: relative;
|
||||
flex: 0 0 var(--rp-switch-w);
|
||||
width: var(--rp-switch-w);
|
||||
min-width: var(--rp-switch-w);
|
||||
height: var(--rp-switch-h);
|
||||
min-height: var(--rp-switch-h);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid var(--field-line);
|
||||
border-radius: min(var(--rp-switch-h), var(--rp-radius-control, 3px));
|
||||
background: var(--field-bg);
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
transition: background-color .12s ease, border-color .12s ease;
|
||||
}
|
||||
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: var(--rp-switch-knob);
|
||||
height: var(--rp-switch-knob);
|
||||
border-radius: max(0px, calc(min(var(--rp-switch-h), var(--rp-radius-control, 3px)) - 2px));
|
||||
background: var(--muted);
|
||||
transition: transform .12s ease, background-color .12s ease;
|
||||
}
|
||||
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch:checked {
|
||||
border-color: var(--green);
|
||||
background: var(--nav-selected-bg);
|
||||
}
|
||||
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch:checked::before {
|
||||
transform: translateX(calc(var(--rp-switch-w) - var(--rp-switch-knob) - 6px));
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch:focus-visible {
|
||||
outline: 2px solid var(--green);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch:disabled {
|
||||
opacity: .5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.operation-message {
|
||||
margin: 14px 0 0;
|
||||
padding: 11px 12px;
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
.appearance-interface-icons-setting,
|
||||
.appearance-logo-animation-setting,
|
||||
.appearance-stable-dialog-position-setting,
|
||||
.appearance-switch-controls-setting,
|
||||
.appearance-chart-axes-setting {
|
||||
align-self: center;
|
||||
min-width: 0;
|
||||
@@ -90,6 +91,7 @@
|
||||
.appearance-interface-icons-setting>span,
|
||||
.appearance-logo-animation-setting>span,
|
||||
.appearance-stable-dialog-position-setting>span,
|
||||
.appearance-switch-controls-setting>span,
|
||||
.appearance-chart-axes-setting>span {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
@@ -612,52 +614,13 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.docker-publish-field input[type=checkbox].docker-publish {
|
||||
-webkit-appearance: none;
|
||||
position: relative;
|
||||
flex: 0 0 30px;
|
||||
width: 30px;
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid var(--field-line);
|
||||
border-radius: min(3px, var(--rp-radius-control, 3px));
|
||||
background: var(--field-bg);
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.docker-publish-field .docker-publish::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 2px auto 2px 2px;
|
||||
width: 10px;
|
||||
background: var(--muted);
|
||||
border-radius: min(1px, var(--rp-radius-control, 1px));
|
||||
transition: transform .12s ease;
|
||||
}
|
||||
|
||||
.docker-publish-field .docker-publish:checked {
|
||||
background: var(--field-bg);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.docker-publish-field .docker-publish:checked::before {
|
||||
transform: translateX(14px);
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.docker-publish-field .docker-publish:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.docker-publish-field:has(.docker-publish:disabled) {
|
||||
opacity: .55;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
.docker-publish-field .docker-publish:disabled {
|
||||
html:not([data-switch-controls="false"]) .docker-publish-field input.docker-publish:disabled {
|
||||
opacity: 1;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
|
||||
@@ -1558,8 +1558,8 @@
|
||||
|
||||
@media (prefers-reduced-motion:reduce) {
|
||||
|
||||
.docker-publish-field .docker-publish,
|
||||
.docker-publish-field .docker-publish::before,
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch,
|
||||
html:not([data-switch-controls="false"]) input[type=checkbox].switch::before,
|
||||
#panel-overview .overview-meter-fill,
|
||||
#panel-overview .www-segmented span {
|
||||
transition: none;
|
||||
|
||||
+24
-24
@@ -431,7 +431,7 @@
|
||||
const value = agent || { id: "", name: "", enabled: true, endpoint: "https://127.0.0.1:9876", token: "", tls_fingerprint_sha256: null, domains: [], poll_interval_seconds: 30, certificate_ids: [], acl_profile_id: null, default_target_ip: null, listener_ids: [firstListener()], assignments: [] };
|
||||
const row = el("div", undefined, "docker-agent-settings entity"); row.dataset.originalId = agent?.id || ""; row._assignments = structuredClone(value.assignments || []);
|
||||
const head = el("div", undefined, "card-heading"), title = el("div"), titleText = el("h3", value.name || value.id || t("dockerAgentNew")); title.append(el("span", t("dockerAgent"), "small-label"), titleText);
|
||||
const enabled = input("", "checkbox", "docker-agent-enabled"); enabled.checked = value.enabled !== false;
|
||||
const enabled = input("", "checkbox", "docker-agent-enabled switch"); enabled.checked = value.enabled !== false;
|
||||
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");
|
||||
@@ -484,7 +484,7 @@
|
||||
provisionInput.addEventListener("change", () => void applyProvision());
|
||||
provisionInput.addEventListener("keydown", event => { if (event.key === "Enter") { event.preventDefault(); void applyProvision(); } });
|
||||
row.focusProvision = () => { provision.open = true; provisionInput.focus(); };
|
||||
const labelPublish = input("", "checkbox", "docker-agent-label-publish"); labelPublish.checked = value.label_publish === true;
|
||||
const labelPublish = input("", "checkbox", "docker-agent-label-publish switch"); labelPublish.checked = value.label_publish === true;
|
||||
const labelField = checkboxField("dockerLabelPublish", labelPublish), labelHelp = el("small", undefined, "fine docker-label-help"), labelInfo = el("button", "?", "docker-label-info"); labelInfo.type = "button"; labelInfo.dataset.uiIconName = "none"; labelInfo.title = t("dockerLabelHelpTitle"); labelInfo.setAttribute("aria-label", t("dockerLabelHelpTitle")); labelInfo.addEventListener("click", openLabelHelp);
|
||||
labelHelp.append(el("span", t("dockerLabelPublishHelp")), labelInfo); labelField.append(labelHelp);
|
||||
let closeBubble = null;
|
||||
@@ -528,7 +528,7 @@
|
||||
summary.append(el("span", t("dockerAlertSettings")), el("small", t("dockerAlertSettingsHelp"), "fine")); box.append(summary);
|
||||
const grid = el("div", undefined, "field-grid docker-alert-grid"), check = (cls, checked) => { const node = input("", "checkbox", cls); node.checked = checked; return node; };
|
||||
const num = (cls, val, min, max, step = 1) => { const node = input(val, "number", cls); node.min = min; node.max = max; node.step = step; node.required = true; return node; };
|
||||
grid.append(checkboxField("dockerAlertEnabled", check("docker-alert-enabled", value.enabled !== false)),
|
||||
grid.append(checkboxField("dockerAlertEnabled", check("docker-alert-enabled switch", value.enabled !== false)),
|
||||
labeled("dockerAlertDisk", num("docker-alert-disk", value.disk_percent, 50, 100)),
|
||||
labeled("dockerAlertMemory", num("docker-alert-memory", value.memory_percent, 50, 100)),
|
||||
labeled("dockerAlertLoad", num("docker-alert-load", value.load_per_cpu, 0.1, 64, 0.1)),
|
||||
@@ -675,7 +675,7 @@
|
||||
const passive = { ...defaultPassiveHealth(), ...(assignment?.passive_health || {}) }, details = el("details", undefined, "docker-health-editor docker-passive-health-editor"), summary = el("summary");
|
||||
summary.append(el("span", t("dockerPassiveHealth")), el("small", t("dockerPassiveHealthSummary"), "fine")); details.append(summary);
|
||||
const grid = el("div", undefined, "field-grid docker-health-grid");
|
||||
const enabled = input("", "checkbox", "docker-passive-enabled"); enabled.checked = passive.enabled === true;
|
||||
const enabled = input("", "checkbox", "docker-passive-enabled switch"); enabled.checked = passive.enabled === true;
|
||||
const connect = input("", "checkbox", "docker-passive-connect"); connect.checked = passive.count_connect_errors !== false;
|
||||
const timeouts = input("", "checkbox", "docker-passive-timeouts"); timeouts.checked = passive.count_timeouts !== false;
|
||||
const io = input("", "checkbox", "docker-passive-io"); io.checked = passive.count_io_errors !== false;
|
||||
@@ -716,9 +716,9 @@
|
||||
details._inheritedProfiles = inheritedProfiles;
|
||||
const help = el("small", "", "fine"), profileControl = el("div", undefined, "docker-field docker-profile-field");
|
||||
profileControl.append(el("span", t("dockerAclProfile")), profile, help, profileWarning(profile, 0));
|
||||
const publicAccess = input("", "checkbox", "docker-acl-public"); publicAccess.checked = !explicit.length && !inherit && !assignment?.acl;
|
||||
const publicAccess = input("", "checkbox", "docker-acl-public switch"); publicAccess.checked = !explicit.length && !inherit && !assignment?.acl;
|
||||
const publicLabel = checkboxField("dockerAclPublic", publicAccess); publicLabel.append(el("small", t("dockerAclPublicHelp"), "fine"));
|
||||
const inline = input("", "checkbox", "docker-acl-inline"); inline.checked = !!assignment?.acl; const inlineLabel = checkboxField("dockerAclInline", inline); inlineLabel.classList.add("docker-acl-inline-row");
|
||||
const inline = input("", "checkbox", "docker-acl-inline switch"); inline.checked = !!assignment?.acl; const inlineLabel = checkboxField("dockerAclInline", inline); inlineLabel.classList.add("docker-acl-inline-row");
|
||||
const defaultAction = el("select", undefined, "docker-acl-default"); for (const value of ["deny", "allow"]) { const option = el("option", t(value)); option.value = value; defaultAction.append(option); } defaultAction.value = assignment?.acl?.default || "deny";
|
||||
const rules = document.createElement("textarea"); rules.className = "docker-acl-rules"; rules.rows = 4; rules.maxLength = 32768; rules.spellcheck = false; rules.value = rulesText(assignment?.acl); rules.placeholder = "allow 10.0.0.0/8\ndeny 0.0.0.0/0";
|
||||
const sameSet = (a, b) => a.length === b.length && a.every(id => b.includes(id));
|
||||
@@ -769,10 +769,10 @@
|
||||
}
|
||||
function selectFrom(values, current, cls) { const control = el("select", undefined, cls); for (const [value, key] of values) { const option = el("option", t(key)); option.value = value; control.append(option); } control.value = current; return control; }
|
||||
function basicAuthControls(assignment) {
|
||||
const basic = assignment?.basic_auth || {}, enabled = input("", "checkbox", "docker-basic-enabled"); enabled.checked = basic.enabled === true;
|
||||
const basic = assignment?.basic_auth || {}, enabled = input("", "checkbox", "docker-basic-enabled switch"); enabled.checked = basic.enabled === true;
|
||||
const realm = input(basic.realm || "Restricted", "text", "docker-basic-realm"); realm.maxLength = 128;
|
||||
const requireTls = input("", "checkbox", "docker-basic-tls"); requireTls.checked = basic.require_tls !== false;
|
||||
const forward = input("", "checkbox", "docker-basic-forward"); forward.checked = basic.forward_credentials === true;
|
||||
const requireTls = input("", "checkbox", "docker-basic-tls switch"); requireTls.checked = basic.require_tls !== false;
|
||||
const forward = input("", "checkbox", "docker-basic-forward switch"); forward.checked = basic.forward_credentials === true;
|
||||
const users = el("div", undefined, "docker-basic-users docker-wide-field");
|
||||
const addRow = (user = {}) => {
|
||||
if (users.children.length >= 64) { toast(t("basic.too_many_users"), true); return; }
|
||||
@@ -812,18 +812,18 @@
|
||||
const methodList = document.createElement("textarea"); methodList.className = "docker-method-list"; methodList.rows = 3; methodList.maxLength = 1024; methodList.value = (method.methods || []).join("\n");
|
||||
const methodListField = labeled("vhMethodList", methodList); methodListField.classList.add("docker-wide-field");
|
||||
const rate = assignment?.rate_limit || {}, access = rate.country_access || {};
|
||||
const rateEnabled = input("", "checkbox", "docker-rate-enabled"); rateEnabled.checked = rate.enabled === true;
|
||||
const rateEnabled = input("", "checkbox", "docker-rate-enabled switch"); rateEnabled.checked = rate.enabled === true;
|
||||
const requests = numberInput(rate.requests ?? 120, "docker-rate-requests", 1, 1000000), windowSeconds = numberInput(rate.window_seconds ?? 60, "docker-rate-window", 1, 3600), burst = numberInput(rate.burst ?? 30, "docker-rate-burst", 0, 1000000);
|
||||
const countryMode = selectFrom([["off", "vhOff"], ["block", "vhCountryBlock"], ["allow", "vhCountryAllow"]], access.mode || "off", "docker-country-mode");
|
||||
const countryList = document.createElement("textarea"); countryList.className = "docker-country-list"; countryList.rows = 2; countryList.maxLength = 1024; countryList.value = (access.countries || []).join("\n");
|
||||
const countryListField = labeled("vhCountryList", countryList, t("dockerCountryHelp")); countryListField.classList.add("docker-wide-field");
|
||||
const security = assignment?.security_headers || {}, hsts = security.hsts || {};
|
||||
const hstsEnabled = input("", "checkbox", "docker-hsts"); hstsEnabled.checked = hsts.enabled === true;
|
||||
const hstsAge = numberInput(hsts.max_age_seconds ?? 31536000, "docker-hsts-age", 0, 63072000), hstsSub = input("", "checkbox", "docker-hsts-sub"); hstsSub.checked = hsts.include_subdomains === true;
|
||||
const nosniff = input("", "checkbox", "docker-nosniff"); nosniff.checked = security.nosniff === true;
|
||||
const hstsEnabled = input("", "checkbox", "docker-hsts switch"); hstsEnabled.checked = hsts.enabled === true;
|
||||
const hstsAge = numberInput(hsts.max_age_seconds ?? 31536000, "docker-hsts-age", 0, 63072000), hstsSub = input("", "checkbox", "docker-hsts-sub switch"); hstsSub.checked = hsts.include_subdomains === true;
|
||||
const nosniff = input("", "checkbox", "docker-nosniff switch"); nosniff.checked = security.nosniff === true;
|
||||
const frame = selectFrom([["preserve", "vhPreserve"], ["deny", "vhDeny"], ["sameorigin", "vhSameorigin"]], security.frame_options || "preserve", "docker-frame");
|
||||
const referrer = input(security.referrer_policy || "", "text", "docker-referrer"); referrer.maxLength = 256; referrer.placeholder = "strict-origin-when-cross-origin";
|
||||
const cloudflare = input("", "checkbox", "docker-cloudflare-ip"); cloudflare.checked = assignment?.cloudflare_client_ip === true;
|
||||
const cloudflare = input("", "checkbox", "docker-cloudflare-ip switch"); cloudflare.checked = assignment?.cloudflare_client_ip === true;
|
||||
const heading = key => el("h4", t(key), "docker-subheading"), basic = basicAuthControls(assignment);
|
||||
grid.append(heading("dockerBasicSection"), ...basic.fields,
|
||||
heading("vhTrafficMethodsSection"), labeled("vhMethodMode", methodMode), methodListField,
|
||||
@@ -866,7 +866,7 @@
|
||||
function diagnosticsEditor(assignment) {
|
||||
const details = el("details", undefined, "docker-diagnostics-editor"), summary = el("summary"); summary.append(el("span", t("dockerDiagnostics")), el("small", t("dockerDiagnosticsHelp"), "fine")); details.append(summary);
|
||||
const grid = el("div", undefined, "field-grid docker-diagnostics-grid");
|
||||
const box = (cls, value) => { const node = input("", "checkbox", cls); node.checked = value === true; return node; };
|
||||
const box = (cls, value) => { const node = input("", "checkbox", `${cls} switch`); node.checked = value === true; return node; };
|
||||
grid.append(checkboxField("vhTimingHeaders", box("docker-timing-headers", assignment?.timing_headers)), checkboxField("vhBackendHeader", box("docker-backend-header", assignment?.backend_header)), checkboxField("vhBackendTimingHeader", box("docker-backend-timing-header", assignment?.backend_timing_header)));
|
||||
details.append(grid); return details;
|
||||
}
|
||||
@@ -950,7 +950,7 @@
|
||||
status: stale ? 4 : assignment?.enabled === false || !assignment ? 3 : member?.status === "up" ? 0 : member?.status === "down" ? 1 : 2,
|
||||
backend: String(assignment?.target_ip || agent.default_target_ip || inventory?.public_ip || "").toLowerCase(), scheme: String(assignment?.scheme || "http"), published: assignment && assignment.enabled !== false ? 0 : 1,
|
||||
};
|
||||
const top = el("div", undefined, "docker-service-head"), publish = input("", "checkbox", "docker-publish"); publish.checked = !!assignment && assignment.enabled !== false;
|
||||
const top = el("div", undefined, "docker-service-head"), publish = input("", "checkbox", "docker-publish switch"); publish.checked = !!assignment && assignment.enabled !== false;
|
||||
publish.setAttribute("role", "switch");
|
||||
publish.setAttribute("aria-checked", String(publish.checked));
|
||||
const publishLabel = el("label", undefined, "docker-publish-field");
|
||||
@@ -997,12 +997,12 @@
|
||||
domainSelect.addEventListener("change", () => { syncHostHelp(); aliases.refresh(); syncOpenActions(host.value); updateHint(); }); host.addEventListener("input", syncHostHelp);
|
||||
const target = el("select", undefined, "docker-target-ip"), auto = el("option", agent.default_target_ip ? `${t("dockerBackendIpAuto")} (${agent.default_target_ip})` : t("dockerBackendIpAuto")); auto.value = ""; target.append(auto); for (const [ip, label] of targetOptions(inventory, service, assignment, agent)) { const option = el("option", label); option.value = ip; target.append(option); } target.value = assignment?.target_ip || "";
|
||||
const scheme = el("select", undefined, "docker-scheme"); for (const name of ["http", "https"]) { const option = el("option", name.toUpperCase()); option.value = name; scheme.append(option); } scheme.value = assignment?.scheme || "http";
|
||||
const preserve = input("", "checkbox", "docker-preserve-host"); preserve.checked = assignment?.preserve_host !== false; const preserveLabel = checkboxField("dockerPreserveHost", preserve); preserveLabel.classList.add("docker-preserve-field");
|
||||
const forceSsl = input("", "checkbox", "docker-force-ssl"), forceCapable = canForceSsl(agent); forceSsl.checked = assignment ? assignment.force_ssl === true : forceCapable; forceSsl.disabled = !forceCapable; const forceSslField = checkboxField("dockerForceSsl", forceSsl); if (!forceCapable) forceSslField.append(el("small", t("dockerForceSslUnavailable"), "fine"));
|
||||
const websockets = input("", "checkbox", "docker-websockets"); websockets.checked = assignment?.websockets !== false; const websocketField = checkboxField("dockerWebsockets", websockets);
|
||||
const cacheEnabled = input("", "checkbox", "docker-cache-enabled"); cacheEnabled.checked = assignment?.cache_enabled === true; const cacheField = checkboxField("dockerCache", cacheEnabled);
|
||||
const transformEnabled = input("", "checkbox", "docker-transform-enabled"); transformEnabled.checked = assignment?.transform_enabled === true; const transformField = checkboxField("dockerTransform", transformEnabled);
|
||||
const compressionEnabled = input("", "checkbox", "docker-compression-enabled"); compressionEnabled.checked = assignment?.compression_enabled !== false; const compressionField = checkboxField("dockerCompression", compressionEnabled); compressionField.title = t("dockerCompressionHelp");
|
||||
const preserve = input("", "checkbox", "docker-preserve-host switch"); preserve.checked = assignment?.preserve_host !== false; const preserveLabel = checkboxField("dockerPreserveHost", preserve); preserveLabel.classList.add("docker-preserve-field");
|
||||
const forceSsl = input("", "checkbox", "docker-force-ssl switch"), forceCapable = canForceSsl(agent); forceSsl.checked = assignment ? assignment.force_ssl === true : forceCapable; forceSsl.disabled = !forceCapable; const forceSslField = checkboxField("dockerForceSsl", forceSsl); if (!forceCapable) forceSslField.append(el("small", t("dockerForceSslUnavailable"), "fine"));
|
||||
const websockets = input("", "checkbox", "docker-websockets switch"); websockets.checked = assignment?.websockets !== false; const websocketField = checkboxField("dockerWebsockets", websockets);
|
||||
const cacheEnabled = input("", "checkbox", "docker-cache-enabled switch"); cacheEnabled.checked = assignment?.cache_enabled === true; const cacheField = checkboxField("dockerCache", cacheEnabled);
|
||||
const transformEnabled = input("", "checkbox", "docker-transform-enabled switch"); transformEnabled.checked = assignment?.transform_enabled === true; const transformField = checkboxField("dockerTransform", transformEnabled);
|
||||
const compressionEnabled = input("", "checkbox", "docker-compression-enabled switch"); compressionEnabled.checked = assignment?.compression_enabled !== false; const compressionField = checkboxField("dockerCompression", compressionEnabled); compressionField.title = t("dockerCompressionHelp");
|
||||
const switches = el("div", undefined, "docker-switch-row"); switches.append(preserveLabel, forceSslField, websocketField, cacheField, compressionField, transformField);
|
||||
const certMismatch = input("", "checkbox", "docker-cert-mismatch"); certMismatch.checked = assignment?.allow_certificate_mismatch === true;
|
||||
certMismatch.disabled = !agentCertificates(agent).length;
|
||||
@@ -1027,8 +1027,8 @@
|
||||
const backendIpSettings = el("div", undefined, "docker-backend-ip-settings");
|
||||
backendIpSettings.append(labeled("dockerBackendIp", target), certificateBar);
|
||||
|
||||
const h2Enabled = input("", "checkbox", "docker-http2-enabled"); h2Enabled.checked = assignment?.http2_enabled !== false;
|
||||
const h3Enabled = input("", "checkbox", "docker-http3-enabled"); h3Enabled.checked = assignment ? assignment.http3_enabled !== false : false;
|
||||
const h2Enabled = input("", "checkbox", "docker-http2-enabled switch"); h2Enabled.checked = assignment?.http2_enabled !== false;
|
||||
const h3Enabled = input("", "checkbox", "docker-http3-enabled switch"); h3Enabled.checked = assignment ? assignment.http3_enabled !== false : false;
|
||||
const protocolBox = el("details", undefined, "docker-protocol-editor"), protocolSummary = el("summary");
|
||||
protocolSummary.append(el("span", t("dockerFrontendProtocols")), el("small", t("dockerFrontendProtocolsHelp"), "fine"));
|
||||
const protocolOptions = el("div", undefined, "docker-protocol-options");
|
||||
|
||||
+74
-68
@@ -152,12 +152,12 @@
|
||||
title="Move blocks into empty grid space once">Fill gaps</button>
|
||||
<label class="overview-inline-autofit" id="overview-inline-autofit-label"
|
||||
title="Re-flow this layout for the current screen width">
|
||||
<input id="overview-inline-autofit" type="checkbox" checked>
|
||||
<input class="switch" id="overview-inline-autofit" type="checkbox" checked>
|
||||
<span data-i18n="overviewLayoutAutoFit">Fit to screen</span>
|
||||
</label>
|
||||
<label class="overview-inline-autofit" id="overview-inline-manual-label"
|
||||
title="Blocks stay in place while dragging; the drop position is only marked">
|
||||
<input id="overview-inline-manual" type="checkbox">
|
||||
<input class="switch" id="overview-inline-manual" type="checkbox">
|
||||
<span data-i18n="overviewLayoutManual">Arrange manually</span>
|
||||
</label>
|
||||
<button class="quiet" id="overview-inline-cancel" type="button"
|
||||
@@ -949,7 +949,7 @@
|
||||
</select></label><button class="quiet backend-sort-direction"
|
||||
data-i18n-aria="backendSortAscending" id="docker-vhost-sort-direction"
|
||||
type="button">↑</button><label class="check compact-check docker-live-switch"
|
||||
title="Refresh this view from RustProxy memory every 5 seconds"><input
|
||||
title="Refresh this view from RustProxy memory every 5 seconds"><input class="switch"
|
||||
id="docker-live-refresh" type="checkbox" /><span data-i18n="dockerLiveView">Live
|
||||
view</span></label><button class="primary" data-i18n="dockerPublishedOpen"
|
||||
id="docker-published-open" type="button">Published apps</button><button class="outline" data-i18n="dockerRefresh"
|
||||
@@ -1159,7 +1159,7 @@
|
||||
<div><strong data-i18n="aclProfileCountryExceptions">Country exceptions</strong>
|
||||
<p class="fine" id="acl-profile-country-help"></p>
|
||||
</div>
|
||||
</div><label class="acl-policy-switch"><input id="acl-profile-country-enabled"
|
||||
</div><label class="acl-policy-switch"><input class="switch" id="acl-profile-country-enabled"
|
||||
type="checkbox" /><span data-i18n="aclProfileUseCountries">Use
|
||||
countries</span></label>
|
||||
</div>
|
||||
@@ -1354,7 +1354,7 @@
|
||||
data-i18n="acmePropagation"></span><input id="acme-propagation"
|
||||
max="900" min="10" required="" type="number"
|
||||
value="60" /></label>
|
||||
<label class="check" data-acme-provider="rfc2136"><input
|
||||
<label class="check" data-acme-provider="rfc2136"><input class="switch"
|
||||
id="acme-sign-query" type="checkbox" /><span
|
||||
data-i18n="acmeSignQuery"></span></label>
|
||||
<label class="check vh-wide"><input id="acme-tos" required=""
|
||||
@@ -1405,7 +1405,7 @@
|
||||
accept=".pem,.crt,.cer" id="cert-import-pem" required="" type="file" />
|
||||
<label data-i18n="vhPrivateKeyFile" for="cert-import-key"></label><input
|
||||
accept=".key,.pem" id="cert-import-key" required="" type="file" />
|
||||
<label class="check"><input id="cert-import-default" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cert-import-default" type="checkbox" /><span
|
||||
data-i18n="defaultCertificate"></span></label>
|
||||
<button class="primary" data-i18n="certImportSave" type="submit"></button>
|
||||
<p class="fine" data-i18n="certAcmeLater"></p>
|
||||
@@ -1439,7 +1439,7 @@
|
||||
</div>
|
||||
<p class="fine" id="certificate-inspect-status" role="status"
|
||||
aria-live="polite"></p>
|
||||
<label class="check"><input id="certificate-default" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="certificate-default" type="checkbox" /><span
|
||||
data-i18n="defaultCertificate"></span></label>
|
||||
<div class="form-actions"><button class="primary"
|
||||
data-i18n="saveCertificate" type="submit"></button>
|
||||
@@ -1462,7 +1462,7 @@
|
||||
<button class="quiet" data-i18n="settings" id="traffic-settings" type="button">Settings</button>
|
||||
<div class="cache-toolbar-status"><span class="fine" id="traffic-panel-state"
|
||||
role="status"></span>
|
||||
<label class="check cache-live-toggle"><input checked="" id="traffic-live"
|
||||
<label class="check cache-live-toggle"><input class="switch" checked="" id="traffic-live"
|
||||
type="checkbox" />
|
||||
<span data-i18n="refreshViewLive">Auto in this view</span></label>
|
||||
</div>
|
||||
@@ -1617,7 +1617,7 @@
|
||||
Ban</button><button class="outline" data-i18n="cacheBanListOpen" id="cache-bans-open"
|
||||
type="button">Active BANs</button>
|
||||
<div class="cache-toolbar-status"><span class="fine" id="cache-panel-state"
|
||||
role="status"></span><label class="check cache-live-toggle"><input checked=""
|
||||
role="status"></span><label class="check cache-live-toggle"><input class="switch" checked=""
|
||||
id="cache-live" type="checkbox" /><span data-i18n="refreshViewLive">Auto in this
|
||||
view</span></label></div>
|
||||
<p class="operation-message cache-toolbar-message" id="cache-toolbar-operation-status"
|
||||
@@ -1774,7 +1774,7 @@
|
||||
type="button">Refresh</button><button class="quiet" data-i18n="settings"
|
||||
id="transform-panel-settings" type="button">Settings</button>
|
||||
<div class="cache-toolbar-status"><span class="fine" id="transform-panel-state"
|
||||
role="status"></span><label class="check cache-live-toggle"><input checked=""
|
||||
role="status"></span><label class="check cache-live-toggle"><input class="switch" checked=""
|
||||
id="transform-live" type="checkbox" /><span data-i18n="refreshViewLive">Auto in this
|
||||
view</span></label></div>
|
||||
</div>
|
||||
@@ -1918,7 +1918,7 @@
|
||||
<code>error:"connection reset"</code>
|
||||
</div>
|
||||
</details>
|
||||
<label class="file-log-consolidate" title="Consolidate vhost log rotations"><input
|
||||
<label class="file-log-consolidate" title="Consolidate vhost log rotations"><input class="switch"
|
||||
checked id="file-log-consolidate-vhosts" type="checkbox" /><span
|
||||
data-i18n="fileLogsConsolidateShort">Merge rotations</span></label>
|
||||
<button class="outline" data-i18n="refresh" id="file-logs-refresh"
|
||||
@@ -2129,24 +2129,30 @@
|
||||
</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
|
||||
<label class="check appearance-interface-icons-setting"><input class="switch"
|
||||
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 class="check appearance-logo-animation-setting"><input
|
||||
<label class="check appearance-logo-animation-setting"><input class="switch"
|
||||
id="ui-logo-animation" type="checkbox" /><span><b
|
||||
data-i18n="logoAnimation">Animate logo</b><small
|
||||
data-i18n="logoAnimationHelp">Plays short, subtle animations of
|
||||
the sidebar logo from time to time and on
|
||||
hover.</small></span></label>
|
||||
<label class="check appearance-stable-dialog-position-setting"><input
|
||||
<label class="check appearance-stable-dialog-position-setting"><input class="switch"
|
||||
id="ui-stable-dialog-position" type="checkbox" /><span><b
|
||||
data-i18n="stableDialogPosition">Keep dialogs at a stable top
|
||||
position</b><small data-i18n="stableDialogPositionHelp">Prevents
|
||||
editor dialogs from moving vertically when switching between tabs
|
||||
with different content heights.</small></span></label>
|
||||
<label class="check appearance-switch-controls-setting"><input class="switch"
|
||||
id="ui-switch-controls" type="checkbox" checked /><span><b
|
||||
data-i18n="switchControls">Show on/off settings as
|
||||
switches</b><small data-i18n="switchControlsHelp">Draws settings
|
||||
that turn a feature or section on or off as switches instead of
|
||||
checkboxes. Option lists keep checkboxes.</small></span></label>
|
||||
<label><span data-i18n="cornerStyle">Corner rounding</span><select
|
||||
id="ui-corner-style">
|
||||
<option data-i18n="cornerStyleDefault" value="default">Original
|
||||
@@ -2195,7 +2201,7 @@
|
||||
<option data-i18n="chartStyleColorblind" value="colorblind">Colorblind
|
||||
safe</option>
|
||||
</select></label>
|
||||
<label class="check appearance-chart-axes-setting"><input id="ui-chart-axes"
|
||||
<label class="check appearance-chart-axes-setting"><input class="switch" id="ui-chart-axes"
|
||||
type="checkbox" /><span><b data-i18n="chartAxes">Show X/Y scales on
|
||||
charts</b><small data-i18n="chartAxesHelp">Keep automatic scaling;
|
||||
show Y values and sample indices on X (not elapsed
|
||||
@@ -2301,7 +2307,7 @@
|
||||
<p class="fine" data-i18n="refreshHelp">Per-account refresh intervals. Off pauses
|
||||
all automatic sources; manual refresh remains available.</p>
|
||||
<div class="appearance-settings-grid refresh-settings-grid">
|
||||
<label class="check"><input type="checkbox" checked id="refresh-live-enabled"
|
||||
<label class="check"><input class="switch" type="checkbox" checked id="refresh-live-enabled"
|
||||
data-refresh-preference="live_enabled" />
|
||||
<span data-i18n="refreshLiveEnabled">Automatic refresh
|
||||
enabled</span></label>
|
||||
@@ -2511,7 +2517,7 @@
|
||||
<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
|
||||
<label class="check"><input class="switch" 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"
|
||||
@@ -2525,7 +2531,7 @@
|
||||
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
|
||||
<label class="check"><input class="switch" 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
|
||||
@@ -2567,7 +2573,7 @@
|
||||
(exact or type/*) with 403. This is a header rule, not body inspection.
|
||||
</p>
|
||||
</div>
|
||||
<label class="check"><input id="global-content-type-enabled"
|
||||
<label class="check"><input class="switch" 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
|
||||
@@ -2582,7 +2588,7 @@
|
||||
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
|
||||
<label class="check"><input class="switch" id="global-rate-enabled" type="checkbox" /><span
|
||||
data-i18n="globalRateEnabled">Enable global request rate
|
||||
limit</span></label>
|
||||
<div class="global-rate-fields">
|
||||
@@ -2615,21 +2621,21 @@
|
||||
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
|
||||
<label class="check"><input class="switch" 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
|
||||
<label class="check"><input class="switch" 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
|
||||
<label class="check"><input class="switch" 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
|
||||
<label class="check"><input class="switch" 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">
|
||||
@@ -2698,7 +2704,7 @@
|
||||
spellcheck="false" />
|
||||
<h3 class="subheading" data-i18n="diagnosticHeaders">Diagnostic headers</h3>
|
||||
<div class="switch-grid">
|
||||
<label class="check"><input id="expose-request-id"
|
||||
<label class="check"><input class="switch" id="expose-request-id"
|
||||
type="checkbox" /><span>X-Request-ID</span></label>
|
||||
</div>
|
||||
<h3 class="subheading" data-i18n="compression">Streaming compression</h3>
|
||||
@@ -2755,14 +2761,14 @@
|
||||
<div data-cache-settings-page="general">
|
||||
<h3 class="subheading cache-section-title" data-i18n="cacheSectionBehavior">Behavior
|
||||
</h3>
|
||||
<label class="check"><input id="cache-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-enabled" type="checkbox" /><span
|
||||
data-i18n="enableCache">Enable shared cache</span></label>
|
||||
<p class="fine" data-i18n="cacheSafety">Only complete public-safe GET responses.
|
||||
Authorization, cookies and private/no-store responses still bypass the cache.
|
||||
One byte range can be served from a complete cached object;
|
||||
multipart/unsupported ranges pass through.</p>
|
||||
<div class="cache-varnish-setting">
|
||||
<label class="check"><input id="cache-varnish-compatible"
|
||||
<label class="check"><input class="switch" id="cache-varnish-compatible"
|
||||
type="checkbox" /><span
|
||||
data-i18n="cacheVarnishCompatible">Varnish-compatible cache policy
|
||||
(recommended; enabled by default)</span></label>
|
||||
@@ -2803,7 +2809,7 @@
|
||||
<label data-i18n="cacheDefaultTtl" for="cache-default-ttl">Fallback TTL for public
|
||||
responses (0 = off)</label><input id="cache-default-ttl" max="604800" min="0"
|
||||
required="" type="number" />
|
||||
<label class="check"><input id="cache-query" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-query" type="checkbox" /><span
|
||||
data-i18n="bypassQuery">Bypass URLs with a query string</span></label>
|
||||
<label data-i18n="cachePrefixes" for="cache-prefixes">Bypass path prefixes, one per
|
||||
line</label><textarea id="cache-prefixes" placeholder="/api/private" rows="3"
|
||||
@@ -2859,7 +2865,7 @@
|
||||
(seconds)</label><input id="cache-ttl" max="604800" min="1" required=""
|
||||
type="number" /></div>
|
||||
</div>
|
||||
<label class="check"><input id="cache-auto-trim-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-auto-trim-enabled" type="checkbox" /><span
|
||||
data-i18n="cacheAutoTrimEnabled">Automatically release idle HOT cache
|
||||
memory</span></label>
|
||||
<p class="fine" data-i18n="cacheAutoTrimHelp">When HOT memory is above the target,
|
||||
@@ -2869,7 +2875,7 @@
|
||||
</div>
|
||||
<div data-cache-settings-page="resilience" hidden>
|
||||
<h3 class="subheading" data-i18n="cacheCollapseTitle">Request collapsing</h3>
|
||||
<label class="check"><input id="cache-collapse-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-collapse-enabled" type="checkbox" /><span
|
||||
data-i18n="cacheCollapseEnable">Collapse concurrent fills for one cache
|
||||
key</span></label>
|
||||
<div class="field-grid">
|
||||
@@ -2901,7 +2907,7 @@
|
||||
eligible for stale fallback</label><input id="cache-sie-statuses"
|
||||
maxlength="127" placeholder="500, 502, 503, 504" required="" />
|
||||
<h3 class="subheading" data-i18n="cacheProactiveTitle">Proactive refresh</h3>
|
||||
<label class="check"><input id="cache-proactive-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-proactive-enabled" type="checkbox" /><span
|
||||
data-i18n="cacheProactiveEnable">Refresh sampled cached objects before
|
||||
expiry</span></label>
|
||||
<div class="field-grid">
|
||||
@@ -2936,7 +2942,7 @@
|
||||
data-i18n="cachePresetRecommended" type="button">Recommended</button>
|
||||
</div>
|
||||
</div>
|
||||
<label class="check"><input id="cache-cold-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-cold-enabled" type="checkbox" /><span
|
||||
data-i18n="cacheColdEnable">Enable persistent disk tier</span></label>
|
||||
<p class="fine" data-i18n="cacheColdHelp">Idle and LRU hot objects are demoted to
|
||||
disk. A cold hit is read asynchronously and promoted back to RAM. Metadata is
|
||||
@@ -2987,7 +2993,7 @@
|
||||
</div>
|
||||
<div data-cache-settings-page="diagnostics" hidden>
|
||||
<h3 class="subheading" data-i18n="cacheStaticTitle">Static asset cache boost</h3>
|
||||
<label class="check"><input id="cache-static-cookie" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-static-cookie" type="checkbox" /><span
|
||||
data-i18n="cacheStaticCookie">Ignore request cookies for static
|
||||
files</span></label>
|
||||
<label data-i18n="cacheStaticExtensions" for="cache-static-extensions">Global static
|
||||
@@ -3006,14 +3012,14 @@
|
||||
type="checkbox" /><span>Cache-Status (RFC 9211)</span></label><label
|
||||
class="check"><input id="cache-resident-age-header"
|
||||
type="checkbox" /><span>X-Cache-Resident-Age</span></label></div>
|
||||
<label class="check"><input id="cache-only-hits" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-only-hits" type="checkbox" /><span
|
||||
data-i18n="cacheOnlyHits">Show RustProxy cache diagnostics only on HIT
|
||||
(retain origin headers)</span></label>
|
||||
<label class="check"><input id="cache-detailed-status" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-detailed-status" type="checkbox" /><span
|
||||
data-i18n="cacheDetailedStatus">X-Cache shows STALE and REVALIDATED
|
||||
instead of HIT</span></label>
|
||||
<div class="cache-via-setting">
|
||||
<label class="check"><input id="cache-via-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="cache-via-enabled" type="checkbox" /><span
|
||||
data-i18n="cacheViaEnable">Add Via response header</span></label>
|
||||
<label><span data-i18n="cacheViaValue">Via header value</span><input
|
||||
id="cache-via-value" maxlength="256" placeholder="RustProxy" required=""
|
||||
@@ -3066,7 +3072,7 @@
|
||||
<h2 data-i18n="transformSettings">Static response transformation</h2><span
|
||||
class="pill live" data-i18n="hotApply">LIVE APPLY</span>
|
||||
</div>
|
||||
<label class="check"><input id="transform-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="transform-enabled" type="checkbox" /><span
|
||||
data-i18n="transformEnable">Enable transformation engine globally</span></label>
|
||||
<p class="fine" data-i18n="transformHelp">Transformation happens after upstream decoding
|
||||
and before cache storage and client compression. Each vhost must opt in separately.
|
||||
@@ -3137,7 +3143,7 @@
|
||||
<p class="fine" data-i18n="forwardingHelp"></p><label data-i18n="trustedProxies"
|
||||
for="trusted-proxies"></label><textarea id="trusted-proxies"
|
||||
placeholder="10.0.0.5/32" rows="3" spellcheck="false"></textarea><label
|
||||
class="check"><input id="trusted-proto" type="checkbox" /><span
|
||||
class="check"><input class="switch" id="trusted-proto" type="checkbox" /><span
|
||||
data-i18n="trustForwardedProto"></span></label>
|
||||
<p class="fine" data-i18n="forwardingCanonical"></p><button class="primary"
|
||||
data-i18n="apply" type="submit"></button>
|
||||
@@ -3192,10 +3198,10 @@
|
||||
<article class="card soft-card">
|
||||
<h3 class="subheading" data-i18n="loggingCaptureTitle">Captured request
|
||||
dimensions</h3>
|
||||
<label class="check"><input id="log-capture-user-agent"
|
||||
<label class="check"><input class="switch" id="log-capture-user-agent"
|
||||
type="checkbox" /><span data-i18n="loggingCaptureUserAgent">Capture
|
||||
User-Agent</span></label>
|
||||
<label class="check"><input id="log-capture-country" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="log-capture-country" type="checkbox" /><span
|
||||
data-i18n="loggingCaptureCountry">Capture country from
|
||||
GeoIP</span></label>
|
||||
<p class="fine" data-i18n="loggingCaptureCountryHelp">Country lookup is
|
||||
@@ -3206,10 +3212,10 @@
|
||||
<div class="logging-grid">
|
||||
<article class="card">
|
||||
<h3 class="subheading" data-i18n="loggingFile">JSON file</h3>
|
||||
<label class="check"><input id="log-file-enabled"
|
||||
<label class="check"><input class="switch" id="log-file-enabled"
|
||||
type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<label class="check"><input id="log-file-per-vhost"
|
||||
<label class="check"><input class="switch" id="log-file-per-vhost"
|
||||
type="checkbox" /><span data-i18n="loggingPerVhost">Separate
|
||||
file per vhost</span></label>
|
||||
<label><span data-i18n="loggingPath">File path</span><input
|
||||
@@ -3225,7 +3231,7 @@
|
||||
</article>
|
||||
<article class="card">
|
||||
<h3 class="subheading">Logstash</h3>
|
||||
<label class="check"><input id="log-logstash-enabled"
|
||||
<label class="check"><input class="switch" id="log-logstash-enabled"
|
||||
type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<label><span data-i18n="loggingAddress">TCP address</span><input
|
||||
@@ -3234,7 +3240,7 @@
|
||||
</article>
|
||||
<article class="card">
|
||||
<h3 class="subheading">Loki</h3>
|
||||
<label class="check"><input id="log-loki-enabled"
|
||||
<label class="check"><input class="switch" id="log-loki-enabled"
|
||||
type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<label><span data-i18n="loggingPushUrl">Push URL</span><input
|
||||
@@ -3294,7 +3300,7 @@
|
||||
<form class="logging-settings-subform" data-logging-settings-page="errors" hidden
|
||||
id="error-log-form">
|
||||
<h3 class="subheading" data-i18n="errorLogTitle">Error file</h3>
|
||||
<label class="check"><input id="error-log-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="error-log-enabled" type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<p class="fine" data-i18n="errorLogRoutingHelp">Warnings, errors and worker panics
|
||||
go to this file when enabled, or to the console/systemd journal when disabled.
|
||||
@@ -3322,7 +3328,7 @@
|
||||
<h2 data-i18n="geoipUpdatesTitle"></h2><span class="pill">AUTO</span>
|
||||
</div>
|
||||
<p class="fine" data-i18n="geoipUpdatesHelp"></p>
|
||||
<label class="check"><input id="geoip-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="geoip-enabled" type="checkbox" /><span
|
||||
data-i18n="geoipUpdatesEnable"></span></label>
|
||||
<div class="field-grid">
|
||||
<label><span data-i18n="geoipFormat"></span><select id="geoip-format">
|
||||
@@ -3368,7 +3374,7 @@
|
||||
<p class="fine" data-i18n="prometheusHelp"></p>
|
||||
<section class="settings-section">
|
||||
<h3 class="subheading" data-i18n="prometheusEndpoint">Endpoint</h3>
|
||||
<label class="check" data-restart=""><input id="prom-enabled"
|
||||
<label class="check" data-restart=""><input class="switch" id="prom-enabled"
|
||||
type="checkbox" /><span data-i18n="prometheusEnable"></span></label>
|
||||
<div class="field-grid"><label data-restart=""><span
|
||||
data-i18n="prometheusListen"></span><input id="prom-listen"
|
||||
@@ -3397,7 +3403,7 @@
|
||||
<pre class="metrics-example" id="prom-token-secret"></pre>
|
||||
<p class="fine" data-i18n="promTokenCopyNow">Copy the token now.</p>
|
||||
</div>
|
||||
<label class="check"><input id="prom-trusted-no-token" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="prom-trusted-no-token" type="checkbox" /><span
|
||||
data-i18n="prometheusTrustedNoToken"></span></label>
|
||||
<p class="fine" data-i18n="prometheusTrustedNoTokenHelp"></p>
|
||||
</section>
|
||||
@@ -3446,9 +3452,9 @@
|
||||
<section class="settings-section">
|
||||
<h3 class="subheading" data-i18n="alertSettingsGeneral">General</h3>
|
||||
<div class="switch-grid">
|
||||
<label class="check"><input id="alerts-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="alerts-enabled" type="checkbox" /><span
|
||||
data-i18n="alertSettingsEnabled">Alerts enabled</span></label>
|
||||
<label class="check"><input id="alerts-notifications" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="alerts-notifications" type="checkbox" /><span
|
||||
data-i18n="alertSettingsNotifications">Show notifications for new alerts</span></label>
|
||||
</div>
|
||||
<p class="fine" id="alerts-active" role="status"></p>
|
||||
@@ -3516,7 +3522,7 @@
|
||||
<p class="fine" id="admin-listen-lock-note" hidden
|
||||
data-i18n="administrationStartupLocked">This address is fixed by the process
|
||||
startup/systemd configuration and cannot be changed here.</p>
|
||||
<label class="check" data-restart=""><input id="admin-tls" type="checkbox" /><span
|
||||
<label class="check" data-restart=""><input class="switch" id="admin-tls" type="checkbox" /><span
|
||||
data-i18n="administrationHttps">Enable HTTPS for administration</span></label>
|
||||
<label data-restart=""><span
|
||||
data-i18n="administrationCertificate">Certificate</span><select
|
||||
@@ -3915,7 +3921,7 @@
|
||||
defaults)</span><textarea id="tls-policy-ciphers" rows="8"
|
||||
spellcheck="false"></textarea></label>
|
||||
<div class="tls-pqc-control">
|
||||
<label class="check"><input id="tls-policy-pqc" type="checkbox" />
|
||||
<label class="check"><input class="switch" id="tls-policy-pqc" type="checkbox" />
|
||||
<span data-i18n="tlsPqcLabel">Experimental post-quantum key exchange
|
||||
(PQC)</span>
|
||||
</label>
|
||||
@@ -4473,9 +4479,9 @@
|
||||
action</span><button class="outline" data-i18n="webServicePresetApply"
|
||||
id="web-service-preset-apply" type="button">Apply preset</button></div>
|
||||
<div class="vh-wide web-service-preset-toggles">
|
||||
<label class="check"><input id="web-service-hardening-attacks" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-hardening-attacks" type="checkbox" /><span
|
||||
data-i18n="webServiceHardeningAttacks">Block common attack probes</span></label>
|
||||
<label class="check"><input id="web-service-hardening-headers" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-hardening-headers" type="checkbox" /><span
|
||||
data-i18n="webServiceHardeningHeaders">Strip unnecessary fingerprint
|
||||
headers</span></label>
|
||||
</div>
|
||||
@@ -4495,7 +4501,7 @@
|
||||
id="web-service-index" maxlength="4096" rows="5" spellcheck="false"></textarea><small
|
||||
class="fine" data-i18n="webServiceIndexHelp">Optional ordered index list. index.php may be
|
||||
used when PHP-FPM is enabled.</small></label>
|
||||
<label class="check"><input id="web-service-listing" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-listing" type="checkbox" /><span
|
||||
data-i18n="webServiceDirectoryListing">Directory listing</span></label>
|
||||
</div>
|
||||
<div class="vh-grid web-service-page" data-web-service-page="routing" hidden>
|
||||
@@ -4511,13 +4517,13 @@
|
||||
/target for an internal rewrite or pattern => 301:/target for a redirect.</small></label>
|
||||
</div>
|
||||
<div class="vh-grid web-service-page" data-web-service-page="htaccess" hidden>
|
||||
<label class="check"><input id="web-service-htaccess-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-htaccess-enabled" type="checkbox" /><span
|
||||
data-i18n="webServiceHtaccessEnabled">Enable .htaccess compatibility</span></label>
|
||||
<label><span data-i18n="webServiceHtaccessFilename">Configuration file</span><input
|
||||
id="web-service-htaccess-filename" maxlength="64" value=".htaccess" /></label>
|
||||
<label class="check"><input id="web-service-htaccess-recursive" type="checkbox" checked /><span
|
||||
<label class="check"><input class="switch" id="web-service-htaccess-recursive" type="checkbox" checked /><span
|
||||
data-i18n="webServiceHtaccessRecursive">Scan subdirectories</span></label>
|
||||
<label class="check"><input id="web-service-htaccess-strict" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-htaccess-strict" type="checkbox" /><span
|
||||
data-i18n="webServiceHtaccessStrict">Strict unsupported-directive mode</span></label>
|
||||
<div class="vh-wide"><button class="outline" id="web-service-htaccess-help"
|
||||
data-i18n="webServiceHtaccessDocs" type="button">Compatibility documentation</button></div>
|
||||
@@ -4623,7 +4629,7 @@
|
||||
<section class="vh-wide vh-setting-section web-service-setting-section">
|
||||
<h3 data-i18n="webServiceSidecarsSection">Precompressed assets</h3>
|
||||
<div class="vh-grid">
|
||||
<label class="check"><input id="web-service-precompressed" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="web-service-precompressed" type="checkbox" /><span
|
||||
data-i18n="webServicePrecompressed">Serve precompressed sidecars</span></label>
|
||||
<label class="check"><input id="web-service-precompressed-br" type="checkbox" /><span
|
||||
data-i18n="webServicePrecompressedBr">Brotli (.br)</span></label>
|
||||
@@ -4647,7 +4653,7 @@
|
||||
</label>
|
||||
<div class="vh-wide"><button type="button" class="outline" id="web-service-php-profiles"
|
||||
data-i18n="phpProfileManage">Manage PHP-FPM profiles</button></div>
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input class="switch"
|
||||
id="web-service-php-enabled" type="checkbox" /><span
|
||||
data-i18n="webServicePhpEnabled">Enable PHP-FPM / FastCGI</span></label>
|
||||
<details class="metric-info php-field-info">
|
||||
@@ -4677,7 +4683,7 @@
|
||||
<section class="vh-wide vh-setting-section web-service-setting-section">
|
||||
<h3 data-i18n="webServicePhpRequestSection">Request handling</h3>
|
||||
<div class="vh-grid">
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input class="switch"
|
||||
id="web-service-php-pass-authorization" type="checkbox" /><span
|
||||
data-i18n="webServicePhpPassAuthorization">Forward Authorization
|
||||
header</span></label>
|
||||
@@ -4693,7 +4699,7 @@
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input
|
||||
<div class="vh-wide php-switch-row"><label class="check php-switch-label"><input class="switch"
|
||||
id="web-service-php-path-info" type="checkbox" /><span
|
||||
data-i18n="webServicePhpPathInfo">Enable PHP PATH_INFO splitting</span></label>
|
||||
<details class="metric-info php-field-info">
|
||||
@@ -4981,7 +4987,7 @@ log_errors = On</code></pre>
|
||||
maxlength="96" /></label>
|
||||
<label class="auto-id-field"><span data-i18n="redirectId">Redirect ID</span><input id="redirect-id"
|
||||
maxlength="64" pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label class="check"><input id="redirect-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="redirect-enabled" type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<div class="vh-wide" id="redirect-hosts-editor"></div>
|
||||
</div>
|
||||
@@ -4999,9 +5005,9 @@ log_errors = On</code></pre>
|
||||
<div class="redirect-listeners" id="redirect-listeners"></div>
|
||||
<div class="frontend-protocol-controls">
|
||||
<span class="small-label" data-i18n="vhProtocols">Protocols</span>
|
||||
<div class="protocol-toggle-row"><label class="check"><input id="redirect-http2"
|
||||
<div class="protocol-toggle-row"><label class="check"><input class="switch" id="redirect-http2"
|
||||
type="checkbox" /><span data-i18n="vhHttp2Enabled">Enable HTTP/2 for this
|
||||
host</span></label><label class="check"><input id="redirect-http3"
|
||||
host</span></label><label class="check"><input class="switch" id="redirect-http3"
|
||||
type="checkbox" /><span data-i18n="vhHttp3Enabled">Enable HTTP/3 for this
|
||||
host</span></label></div>
|
||||
</div>
|
||||
@@ -5040,7 +5046,7 @@ log_errors = On</code></pre>
|
||||
maxlength="96" /></label>
|
||||
<label class="auto-id-field"><span data-i18n="notfoundId">Host ID</span><input id="notfound-id"
|
||||
maxlength="64" pattern="[A-Za-z0-9_\-]{1,64}" required="" /></label>
|
||||
<label class="check"><input id="notfound-enabled" type="checkbox" /><span
|
||||
<label class="check"><input class="switch" id="notfound-enabled" type="checkbox" /><span
|
||||
data-i18n="enabled">Enabled</span></label>
|
||||
<div class="vh-wide" id="notfound-hosts-editor"></div>
|
||||
</div>
|
||||
@@ -5058,9 +5064,9 @@ log_errors = On</code></pre>
|
||||
<div id="notfound-listeners"></div>
|
||||
<div class="frontend-protocol-controls">
|
||||
<span class="small-label" data-i18n="vhProtocols">Protocols</span>
|
||||
<div class="protocol-toggle-row"><label class="check"><input id="notfound-http2"
|
||||
<div class="protocol-toggle-row"><label class="check"><input class="switch" id="notfound-http2"
|
||||
type="checkbox" /><span data-i18n="vhHttp2Enabled">Enable HTTP/2 for this
|
||||
host</span></label><label class="check"><input id="notfound-http3"
|
||||
host</span></label><label class="check"><input class="switch" id="notfound-http3"
|
||||
type="checkbox" /><span data-i18n="vhHttp3Enabled">Enable HTTP/3 for this
|
||||
host</span></label></div>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
else if (type !== "textarea") input.type = type;
|
||||
if (type === "checkbox") input.checked = !!value; else input.value = value ?? "";
|
||||
for (const key of ["min", "max", "maxLength", "required", "pattern", "rows", "step"]) if (Object.hasOwn(options, key)) input[key] = options[key];
|
||||
if (options.switch) input.classList.add("switch");
|
||||
if (type === "checkbox") wrapper.append(input, label("span", key)); else wrapper.append(label("span", key), input);
|
||||
parent.append(wrapper); return input;
|
||||
}
|
||||
@@ -134,8 +135,8 @@
|
||||
const startupAddress = b.tls ? latestStatus?.listeners?.locked_https : latestStatus?.listeners?.locked_http;
|
||||
const startupLocked = !!startupAddress && currentAddresses.includes(startupAddress);
|
||||
const readAddresses = addressTagEditor(grid, currentAddresses, startupLocked ? [startupAddress] : []);
|
||||
const enabled = field(grid, "listener-enabled", "vhEnabled", item.enabled !== false, "checkbox");
|
||||
const tls = field(grid, "listener-tls", "vhTls", !!b.tls, "checkbox"); const h2 = field(grid, "listener-h2", "vhHttp2", b.tls && b.http2 !== false, "checkbox"); const h2c = field(grid, "listener-h2c", "listenerH2c", !b.tls && !!b.h2c, "checkbox");
|
||||
const enabled = field(grid, "listener-enabled", "vhEnabled", item.enabled !== false, "checkbox", { switch: true });
|
||||
const tls = field(grid, "listener-tls", "vhTls", !!b.tls, "checkbox", { switch: true }); const h2 = field(grid, "listener-h2", "vhHttp2", b.tls && b.http2 !== false, "checkbox", { switch: true }); const h2c = field(grid, "listener-h2c", "listenerH2c", !b.tls && !!b.h2c, "checkbox", { switch: true });
|
||||
const preservedHttp2 = effectiveHttp2Settings(b);
|
||||
const protocolActions = el("div", undefined, "listener-protocol-settings-actions vh-wide"); body.append(protocolActions);
|
||||
const h2Settings = button(protocolActions, "h2Configure", () => {
|
||||
@@ -145,7 +146,7 @@
|
||||
});
|
||||
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 h3 = field(grid, "listener-h3", "h3Enable", b.tls && !!preservedHttp3, "checkbox", { switch: true });
|
||||
const h3Settings = button(protocolActions, "h3Configure", () => {
|
||||
window.rustProxySettings?.select("connections");
|
||||
window.rustProxySettings?.selectHttpTab?.("http3");
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
const response = pageEditor(parent, "pageStaticHost", values.response), fallback = pageEditor(parent, "pageMissingPath", values.fallback);
|
||||
const interception = el("section", undefined, "php-origin-errors");
|
||||
const toggle = el("label", undefined, "check"), enabled = document.createElement("input");
|
||||
enabled.type = "checkbox"; enabled.checked = (values.intercept_statuses || []).length > 0;
|
||||
enabled.type = "checkbox"; enabled.className = "switch"; enabled.checked = (values.intercept_statuses || []).length > 0;
|
||||
toggle.append(enabled, label("span", "vhostInterceptOriginErrors"));
|
||||
const codesLabel = el("label"), codesCaption = label("span", "vhostInterceptOriginStatuses"), statuses = document.createElement("input");
|
||||
statuses.type = "text"; statuses.maxLength = 64;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
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 enabled = check("enabled", "enabled"); enabled.checked = data.enabled !== false;
|
||||
const enabled = check("enabled", "enabled"); enabled.classList.add("switch"); 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;
|
||||
const prefix = input("redirectSourcePath", "path_prefix"); prefix.required = true; prefix.maxLength = 512; prefix.value = data.path_prefix;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
else input.type = type;
|
||||
if (type === "checkbox") input.checked = Boolean(value); else input.value = value ?? "";
|
||||
for (const attr of ["min", "max", "step", "maxLength", "required", "pattern", "readOnly"]) if (Object.hasOwn(options, attr)) input[attr] = options[attr];
|
||||
if (options.switch) input.classList.add("switch");
|
||||
if (type === "checkbox") label.append(input, text("span", key)); else label.append(text("span", key), input);
|
||||
parent.append(label); return input;
|
||||
};
|
||||
@@ -73,8 +74,8 @@
|
||||
field(connectionFields, "backend-address", "streamBackendAddress", backend.address, "text", { required: true, maxLength: 128 });
|
||||
field(connectionFields, "backend-weight", "streamBackendWeight", backend.weight ?? 1, "number", { min: 1, max: 16, required: true });
|
||||
field(connectionFields, "backend-max", "streamBackendMaxSessions", backend.max_sessions ?? "", "number", { min: 1, max: 65535 });
|
||||
field(connectionFields, "backend-enabled", "vhEnabled", backend.enabled !== false, "checkbox");
|
||||
field(connectionFields, "backend-drain", "streamBackendDrain", backend.drain === true, "checkbox");
|
||||
field(connectionFields, "backend-enabled", "vhEnabled", backend.enabled !== false, "checkbox", { switch: true });
|
||||
field(connectionFields, "backend-drain", "streamBackendDrain", backend.drain === true, "checkbox", { switch: true });
|
||||
const detail = backend.metrics_enabled == null ? "inherit" : String(backend.metrics_enabled);
|
||||
field(connectionFields, "backend-metrics", "streamBackendDetailMetrics", detail, "select", { values: [["inherit", "streamMetricsFromStream"], ["true", "streamMetricsOn"], ["false", "streamMetricsOff"]] });
|
||||
const hc = backend.health || backendDefaults().health;
|
||||
@@ -131,7 +132,7 @@
|
||||
const streamIdInput = field(g, "id", "streamId", value.id, "text", { required: true, maxLength: 64, pattern: "[A-Za-z0-9_\\-]{1,64}", readOnly: Boolean(editing) });
|
||||
window.rustProxyAutoId.attach(streamIdInput, { elements: [streamName], taken: () => (envelope?.config.streams || []).map(item => item.id) });
|
||||
const protocol = field(g, "protocol", "streamProtocol", value.protocol || "tcp", "select", { values: [["tcp", "streamTcp"], ["udp", "streamUdp"]] });
|
||||
const enabledControl = field(g, "enabled", "vhEnabled", value.enabled !== false, "checkbox");
|
||||
const enabledControl = field(g, "enabled", "vhEnabled", value.enabled !== false, "checkbox", { switch: true });
|
||||
window.rustProxyEnableControl(enabledControl);
|
||||
const enabledLabel = enabledControl.closest("label");
|
||||
enabledLabel?.querySelector(".vh-enable-hint")?.remove();
|
||||
|
||||
@@ -16,6 +16,7 @@ const field = (parent, name, key, value, type = "text", options = {}) => {
|
||||
else if (type !== "textarea") input.type = type;
|
||||
if (type === "checkbox") input.checked = Boolean(value); else input.value = value ?? "";
|
||||
for (const attr of ["min", "max", "step", "maxLength", "rows", "required", "pattern", "readOnly"]) if (Object.hasOwn(options, attr)) input[attr] = options[attr];
|
||||
if (options.switch) input.classList.add("switch");
|
||||
if (type === "textarea") input.spellcheck = false;
|
||||
if (type === "checkbox") label.append(input, text("span", key)); else label.append(text("span", key), input);
|
||||
parent.append(label); return input;
|
||||
@@ -215,8 +216,9 @@ function memberRow(parent, value = { id: `origin-${parent.children.length + 1}`,
|
||||
const controls = {};
|
||||
for (const [name, key, checked] of [["member-enabled", "vhEnabled", value.enabled !== false], ["member-pool", "locationPoolEligible", value.pool_eligible !== false], ["member-backup", "vhBackup", value.backup], ["member-drain", "vhDrain", value.drain], ["member-health-enabled", "backendHealthEnabled", value.health_check_enabled !== false]]) controls[name] = field(routing, name, key, checked, "checkbox");
|
||||
const connection = el("div", undefined, "vh-wide vh-backend-switches vh-backend-connection"); main.append(connection);
|
||||
for (const name of ["member-enabled", "member-pool", "member-backup", "member-drain", "member-health-enabled"]) controls[name].classList.add("switch");
|
||||
controls["member-private"] = field(connection, "member-private", "vhPrivate", value.allow_private, "checkbox");
|
||||
const preserve = field(connection, "member-host", "vhPreserveHost", value.preserve_host === true, "checkbox");
|
||||
const preserve = field(connection, "member-host", "vhPreserveHost", value.preserve_host === true, "checkbox", { switch: true });
|
||||
|
||||
const advanced = el("details", undefined, "vh-wide vh-backend-advanced"), extra = el("div", undefined, "vh-grid"); advanced.append(text("summary", "advanced"), extra);
|
||||
field(extra, "member-allowlist", "vhAddressAllowlist", (value.address_allowlist || []).join("\n"), "textarea", { rows: 2, maxLength: 8192 });
|
||||
@@ -225,13 +227,13 @@ function memberRow(parent, value = { id: `origin-${parent.children.length + 1}`,
|
||||
localRisk.addEventListener("change", async () => { if (localRisk.checked && !(await appConfirm(t("vhLocalListenerRiskConfirm"), { danger: true }))) localRisk.checked = false; });
|
||||
note(riskGate, "vhLocalListenerRiskHelp");
|
||||
field(extra, "member-tls-name", "vhTlsServerName", value.tls_server_name || "", "text", { maxLength: 253, placeholder: "backend.example.internal" });
|
||||
const tlsVerify = field(extra, "member-tls-verify", "vhTlsVerify", value.tls_verify === true, "checkbox"); note(extra, "vhTlsVerifyHelp");
|
||||
const tlsVerify = field(extra, "member-tls-verify", "vhTlsVerify", value.tls_verify === true, "checkbox", { switch: true }); note(extra, "vhTlsVerifyHelp");
|
||||
field(extra, "member-ca", "vhCa", value.tls_ca_pem || "", "textarea", { rows: 2, maxLength: 65536 });
|
||||
field(extra, "member-max-concurrent", "vhMaxConcurrentRequests", value.max_concurrent_requests ?? 0, "number", { required: true, min: 0, max: 1000000 });
|
||||
field(extra, "member-queue-timeout", "vhBackendQueueTimeout", value.queue_timeout_ms ?? 0, "number", { required: true, min: 0, max: 60000 });
|
||||
note(extra, "vhBackendCapacityHelp");
|
||||
const healthPanel = el("section", undefined, "vh-grid vh-backend-health-panel");
|
||||
const customHealth = field(healthPanel, "member-health-custom", "backendHealthOverride", value.health_check != null, "checkbox");
|
||||
const customHealth = field(healthPanel, "member-health-custom", "backendHealthOverride", value.health_check != null, "checkbox", { switch: true });
|
||||
const health = value.health_check || {};
|
||||
const healthFields = el("div", undefined, "vh-wide vh-grid vh-backend-health-fields"); healthPanel.append(healthFields);
|
||||
field(healthFields, "member-health-mode", "vhHealthMode", health.mode || "tcp", "select", { values: [["off", "vhOff"], ["tcp", "vhTcp"], ["http", "vhHttp"]] });
|
||||
@@ -309,7 +311,7 @@ function debugOriginIssues(members) {
|
||||
});
|
||||
}
|
||||
function aclEditor(parent, initial, onChange = () => { }) {
|
||||
const enabled = field(parent, "acl-use", "aclUse", !!initial, "checkbox"), body = el("div", undefined, "vh-wide vh-grid"); parent.append(body);
|
||||
const enabled = field(parent, "acl-use", "aclUse", !!initial, "checkbox", { switch: true }), body = el("div", undefined, "vh-wide vh-grid"); parent.append(body);
|
||||
const policy = field(body, "acl-default", "aclDefault", initial?.default || "deny", "select", { values: [["deny", "vhDeny"], ["allow", "aclAllow"]] }), rows = el("div", undefined, "vh-wide"); body.append(rows);
|
||||
function add(value = { network: "", action: "allow" }) { const row = el("div", undefined, "acl-rule"); field(row, "network", "aclNetwork", value.network, "text", { maxLength: 64 }); field(row, "action", "aclAction", value.action, "select", { values: [["allow", "aclAllow"], ["deny", "vhDeny"]] }); row.append(button("remove", () => { row.remove(); onChange(); })); rows.append(row); }
|
||||
body.append(button("aclAdd", () => { add(); onChange(); })); for (const rule of initial?.rules || []) add(rule);
|
||||
@@ -381,12 +383,12 @@ function locationsEditor(parent, values) {
|
||||
field(body, "location-id", "locationId", value.id || `location-${suffix}`, "text", { required: true, pattern: "[A-Za-z0-9_\\-]{1,64}", maxLength: 64 });
|
||||
const match = field(body, "location-match", "locationMatchType", value.match_type || "prefix", "select", { values: [["prefix", "locationMatchPrefix"], ["prefix_priority", "locationMatchPriority"], ["exact", "locationMatchExact"], ["regex", "locationMatchRegex"], ["regex_insensitive", "locationMatchRegexI"]] });
|
||||
const path = field(body, "location-path", "locationPathPattern", value.path_prefix || "/", "text", { required: true, maxLength: 1024 }); path.placeholder = "/api or ^/api/v[0-9]+/";
|
||||
const internal = field(body, "location-internal", "locationInternal", value.internal === true, "checkbox");
|
||||
const internal = field(body, "location-internal", "locationInternal", value.internal === true, "checkbox", { switch: true });
|
||||
const initialAction = value.response ? "return" : value.redirect ? "redirect" : value.source?.type === "web_server" ? "web_server" : "proxy";
|
||||
const action = field(body, "location-action", "locationAction", initialAction, "select", { values: [["proxy", "locationProxyAction"], ["web_server", "locationWebServerAction"], ["redirect", "locationRedirectAction"], ["return", "locationReturnAction"]] });
|
||||
const backend = field(body, "location-backend", "backend", value.backend_id || "", "select"); memberOptions(backend, value.backend_id || "");
|
||||
const webService = field(body, "location-web-service", "webService", value.source?.web_service_id || "", "select"); fillWebServices(webService, value.source?.web_service_id || "");
|
||||
field(body, "location-enabled", "enabled", value.enabled !== false, "checkbox");
|
||||
field(body, "location-enabled", "enabled", value.enabled !== false, "checkbox", { switch: true });
|
||||
const cache = field(body, "location-cache", "cacheEnabled", value.cache === true ? "on" : value.cache === false ? "off" : "", "select", { values: [["", "inherit"], ["on", "enabled"], ["off", "notEnabled"]] });
|
||||
|
||||
const handling = el("details", undefined, "vh-wide location-section"), handlingBody = el("div", undefined, "vh-grid"); handling.append(text("summary", "locationHandling"), handlingBody); body.append(handling);
|
||||
@@ -403,7 +405,7 @@ function locationsEditor(parent, values) {
|
||||
field(redirectBox, "location-redirect-status", "locationRedirectStatus", value.redirect?.status ?? 302, "select", { values: [["301", "locationRedirect301"], ["302", "locationRedirect302"], ["303", "locationRedirect303"], ["307", "locationRedirect307"], ["308", "locationRedirect308"]] });
|
||||
field(redirectBox, "location-redirect-target", "locationRedirectTarget", value.redirect?.target || "", "url", { maxLength: 2048 });
|
||||
field(redirectBox, "location-redirect-pattern", "locationRedirectPattern", value.redirect?.rewrite_pattern || "", "text", { maxLength: 1024 });
|
||||
field(redirectBox, "location-redirect-query", "locationRedirectQuery", value.redirect?.preserve_query !== false, "checkbox");
|
||||
field(redirectBox, "location-redirect-query", "locationRedirectQuery", value.redirect?.preserve_query !== false, "checkbox", { switch: true });
|
||||
note(redirectBox, "locationRedirectHelp");
|
||||
note(handlingBody, "locationRewriteHelp");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function basicAuthEditor(parent, settings = {}) {
|
||||
const realm = field(parent, "basic-realm", "basicRealm", settings.realm || "Restricted", "text", { maxLength: 128 });
|
||||
const secure = field(parent, "basic-tls", "basicRequireTls", settings.require_tls !== false, "checkbox"), forward = field(parent, "basic-forward", "basicForward", settings.forward_credentials, "checkbox");
|
||||
const secure = field(parent, "basic-tls", "basicRequireTls", settings.require_tls !== false, "checkbox", { switch: true }), forward = field(parent, "basic-forward", "basicForward", settings.forward_credentials, "checkbox", { switch: true });
|
||||
const rows = el("div", undefined, "vh-wide basic-users"); parent.append(rows); let sequence = 0;
|
||||
function add(user = {}) {
|
||||
if (rows.children.length >= 64) { toast(t("basic.too_many_users"), true); return; } const row = el("div", undefined, "basic-user");
|
||||
@@ -72,7 +72,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
const vhostIdInput = field(basicFields, "id", "vhId", value.id, "text", { required: true, maxLength: 64, pattern: "[A-Za-z0-9_\\-]{1,64}" }); if (editing) note(basicFields, "vhIdRenameHelp");
|
||||
let refreshCanonical = () => { }, vhostAutoId = null, vhostAutoCertificate = null;
|
||||
vhostAutoId = window.rustProxyAutoId.attach(vhostIdInput, { text: () => lines(read("hosts")?.value || "")[0] || "", taken: () => (envelope?.config.vhosts || []).map(item => item.id), resettable: !editing });
|
||||
const enabledControl = field(basicFields, "enabled", "vhEnabled", value.enabled !== false, "checkbox");
|
||||
const enabledControl = field(basicFields, "enabled", "vhEnabled", value.enabled !== false, "checkbox", { switch: true });
|
||||
window.rustProxyEnableControl(enabledControl, "vhEnableHint");
|
||||
const enabledLabel = enabledControl.closest("label");
|
||||
enabledLabel?.querySelector(".vh-enable-hint")?.remove();
|
||||
@@ -82,24 +82,24 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
const syncMainSource = () => { const web = mainSource.value === "web_server"; mainWebService.disabled = !web; mainWebService.required = web; }; mainSource.addEventListener("change", syncMainSource); syncMainSource();
|
||||
note(basicFields, "sourceHelp");
|
||||
const websocketFields = subsection(g, "vhWebsocketOptionsSection");
|
||||
const websocketEnabled = field(websocketFields, "websockets", "vhWebsockets", value.websockets !== false, "checkbox");
|
||||
const websocketEnabled = field(websocketFields, "websockets", "vhWebsockets", value.websockets !== false, "checkbox", { switch: true });
|
||||
const websocketModeValue = value.websocket_rfc8441 === true && value.websocket_rfc9220 === true ? "h2h3" : value.websocket_rfc8441 === true ? "h2" : value.websocket_rfc9220 === true ? "h3" : "h1";
|
||||
const websocketMode = field(websocketFields, "websocket-mode", "vhWebsocketMode", websocketModeValue, "select", { values: [["h1", "vhWebsocketH1"], ["h2", "vhWebsocketH2Fallback"], ["h3", "vhWebsocketH3Fallback"], ["h2h3", "vhWebsocketH2H3Fallback"]] });
|
||||
note(websocketFields, "vhWebsocketTransportHelp");
|
||||
const websocketLegacy = field(websocketFields, "websocket-legacy-support", "vhWebsocketLegacySupport", value.websocket_legacy_support === true, "checkbox");
|
||||
const websocketLegacy = field(websocketFields, "websocket-legacy-support", "vhWebsocketLegacySupport", value.websocket_legacy_support === true, "checkbox", { switch: true });
|
||||
note(websocketFields, "vhWebsocketLegacySupportHelp");
|
||||
g = group("vhFrontends");
|
||||
readHosts = hostTagEditor(g, value.frontend?.hosts || [], hosts => { refreshCanonical(hosts); vhostAutoId?.refresh(); vhostAutoCertificate?.refresh(hosts); });
|
||||
if (!editing) g.lastElementChild?.after(vhostIdInput.closest("label"));
|
||||
const bindingControl = window.rustProxyIntegrations.bindings(g, value.frontend?.listener_ids || [], !editing); readBindings = bindingControl.read;
|
||||
note(g, "listenerDefaultPortsHint");
|
||||
field(g, "force-ssl", "vhForceSsl", value.force_ssl === true, "checkbox");
|
||||
field(g, "force-ssl", "vhForceSsl", value.force_ssl === true, "checkbox", { switch: true });
|
||||
note(g, "vhForceSslHelp");
|
||||
const wwwPanel = el("section", undefined, "vh-wide vh-www-panel");
|
||||
const wwwHeader = el("div", undefined, "vh-www-header");
|
||||
const wwwTitle = text("strong", "vhWwwPanelTitle", "vh-www-title");
|
||||
const wwwHostCount = el("span", "", "vh-www-host-count");
|
||||
const wwwRedirect = field(wwwHeader, "www-redirect", "vhWwwEnable", value.www_redirect === true, "checkbox");
|
||||
const wwwRedirect = field(wwwHeader, "www-redirect", "vhWwwEnable", value.www_redirect === true, "checkbox", { switch: true });
|
||||
wwwRedirect.closest("label").classList.add("vh-www-toggle");
|
||||
wwwHeader.prepend(wwwTitle, wwwHostCount);
|
||||
const wwwInactive = text("p", "vhWwwInactive", "fine vh-www-inactive");
|
||||
@@ -170,12 +170,12 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
refreshCanonical = syncCanonical;
|
||||
wwwRedirect.addEventListener("change", () => { syncCanonical(); changed(); });
|
||||
syncCanonical();
|
||||
field(g, "forward-client-ip", "vhForwardClientIp", value.forward_client_ip !== false, "checkbox");
|
||||
field(g, "forward-client-ip", "vhForwardClientIp", value.forward_client_ip !== false, "checkbox", { switch: true });
|
||||
note(g, "vhForwardClientIpHelp");
|
||||
field(g, "cloudflare-client-ip", "vhCloudflareClientIp", value.cloudflare_client_ip === true, "checkbox");
|
||||
field(g, "cloudflare-client-ip", "vhCloudflareClientIp", value.cloudflare_client_ip === true, "checkbox", { switch: true });
|
||||
const protocolRow = el("div", undefined, "vh-wide protocol-toggle-row"); g.append(protocolRow);
|
||||
const h2Enabled = field(protocolRow, "http2-enabled", "vhHttp2Enabled", value.http2_enabled !== false, "checkbox");
|
||||
const h3Enabled = field(protocolRow, "http3-enabled", "vhHttp3Enabled", value.http3_enabled !== false, "checkbox");
|
||||
const h2Enabled = field(protocolRow, "http2-enabled", "vhHttp2Enabled", value.http2_enabled !== false, "checkbox", { switch: true });
|
||||
const h3Enabled = field(protocolRow, "http3-enabled", "vhHttp3Enabled", value.http3_enabled !== false, "checkbox", { switch: true });
|
||||
note(g, "vhFrontendProtocolsHelp"); note(g, "vhFrontendSelectionOnly");
|
||||
const syncFrontendTransports = () => {
|
||||
const capabilities = bindingControl.capabilities();
|
||||
@@ -205,11 +205,11 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
g = group("vhBackendPool"); const members = el("div", undefined, "vh-wide vh-members"); g.append(members);
|
||||
(value.backends || []).forEach(m => memberRow(members, m)); g.append(button("vhAddBackend", () => { memberRow(members); changed(); }));
|
||||
g = group("vhBackendDiagnostics");
|
||||
field(g, "timing-headers", "vhTimingHeaders", value.timing_headers === true, "checkbox");
|
||||
field(g, "timing-headers", "vhTimingHeaders", value.timing_headers === true, "checkbox", { switch: true });
|
||||
field(g, "timing-header-names", "vhTimingHeaderNames", value.timing_header_names || "standard", "select", { values: [["standard", "vhTimingHeaderNamesStandard"], ["cdn", "vhTimingHeaderNamesCdn"], ["legacy", "vhTimingHeaderNamesLegacy"]] });
|
||||
field(g, "timing-allow-origin", "vhTimingAllowOrigin", (value.timing_allow_origin || []).join(", "), "text", { maxLength: 2048 }).placeholder = "https://app.example.com";
|
||||
field(g, "backend-header", "vhBackendHeader", value.backend_header === true, "checkbox");
|
||||
field(g, "backend-timing-header", "vhBackendTimingHeader", value.backend_timing_header === true, "checkbox");
|
||||
field(g, "backend-header", "vhBackendHeader", value.backend_header === true, "checkbox", { switch: true });
|
||||
field(g, "backend-timing-header", "vhBackendTimingHeader", value.backend_timing_header === true, "checkbox", { switch: true });
|
||||
note(g, "vhBackendDiagnosticsHelp");
|
||||
const proxyTimeouts = { ...defaultProxyTimeouts(), ...(value.proxy_timeouts || {}) };
|
||||
g = group("vhProxyTimeouts");
|
||||
@@ -225,12 +225,12 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
field(schedulingFields, "slow-start", "vhSlowStart", settings.slow_start_seconds ?? 10, "number", { required: true, min: 0, max: 300 });
|
||||
const retryFields = subsection(g, "vhBalancerRetrySection");
|
||||
field(retryFields, "retry-max", "vhRetryMax", retry.max_retries ?? 1, "number", { required: true, min: 0, max: 3 });
|
||||
field(retryFields, "retry-connect", "vhRetryConnect", retry.retry_connect_errors !== false, "checkbox");
|
||||
field(retryFields, "retry-timeouts", "vhRetryTimeouts", retry.retry_timeouts !== false, "checkbox");
|
||||
field(retryFields, "retry-connect", "vhRetryConnect", retry.retry_connect_errors !== false, "checkbox", { switch: true });
|
||||
field(retryFields, "retry-timeouts", "vhRetryTimeouts", retry.retry_timeouts !== false, "checkbox", { switch: true });
|
||||
field(retryFields, "retry-statuses", "vhRetryStatuses", (retry.retry_statuses || [502, 503, 504]).join(", "), "text", { maxLength: 64 });
|
||||
note(retryFields, "vhRetryHelp");
|
||||
const keepaliveFields = subsection(g, "vhBalancerKeepaliveSection");
|
||||
field(keepaliveFields, "keepalive", "vhKeepalive", keepalive.enabled !== false, "checkbox");
|
||||
field(keepaliveFields, "keepalive", "vhKeepalive", keepalive.enabled !== false, "checkbox", { switch: true });
|
||||
field(keepaliveFields, "idle-timeout", "vhIdleTimeout", keepalive.idle_timeout_seconds ?? 30, "number", { required: true, min: 1, max: 3600 });
|
||||
field(keepaliveFields, "max-idle", "vhMaxIdle", keepalive.max_idle_per_host ?? 64, "number", { required: true, min: 1, max: 64 });
|
||||
field(keepaliveFields, "tcp-keepalive", "vhTcpKeepalive", keepalive.tcp_keepalive_seconds ?? 30, "number", { required: true, min: 1, max: 3600 });
|
||||
@@ -249,7 +249,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
note(g, "backendHealthOverridesHelp");
|
||||
const passive = settings.passive_health || {};
|
||||
g = group("vhPassiveHealth");
|
||||
const passiveEnabled = field(g, "passive-enabled", "vhPassiveEnabled", passive.enabled === true, "checkbox");
|
||||
const passiveEnabled = field(g, "passive-enabled", "vhPassiveEnabled", passive.enabled === true, "checkbox", { switch: true });
|
||||
note(g, "vhPassiveHelp");
|
||||
const passiveFields = [
|
||||
field(g, "passive-connect", "vhPassiveConnect", passive.count_connect_errors !== false, "checkbox"),
|
||||
@@ -298,7 +298,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
|
||||
const mimePolicy = value.content_type_policy || {};
|
||||
const mimeFields = subsection(g, "vhContentTypeSection");
|
||||
const mimeEnabled = field(mimeFields, "content-type-block-enabled", "vhContentTypeBlock", mimePolicy.enabled === true, "checkbox");
|
||||
const mimeEnabled = field(mimeFields, "content-type-block-enabled", "vhContentTypeBlock", mimePolicy.enabled === true, "checkbox", { switch: true });
|
||||
const mimeList = field(mimeFields, "content-type-block-list", "vhContentTypeList", (mimePolicy.blocked || []).join("\n"), "textarea", { rows: 3, maxLength: 8192 });
|
||||
mimeList.placeholder = "multipart/form-data\napplication/*";
|
||||
const syncMime = () => { mimeList.disabled = !mimeEnabled.checked; };
|
||||
@@ -306,7 +306,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
note(mimeFields, "vhContentTypeHelp");
|
||||
|
||||
const rateFields = subsection(g, "vhTrafficRateSection");
|
||||
field(rateFields, "rate-enabled", "vhRateEnabled", rate.enabled === true, "checkbox");
|
||||
field(rateFields, "rate-enabled", "vhRateEnabled", rate.enabled === true, "checkbox", { switch: true });
|
||||
field(rateFields, "rate-requests", "vhRateRequests", rate.requests ?? 120, "number", { required: true, min: 1, max: 1000000 });
|
||||
field(rateFields, "rate-window", "vhRateWindow", rate.window_seconds ?? 60, "number", { required: true, min: 1, max: 3600 });
|
||||
field(rateFields, "rate-burst", "vhRateBurst", rate.burst ?? 30, "number", { required: true, min: 0, max: 1000000 });
|
||||
@@ -324,19 +324,19 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
const security = value.security_headers || {}, hsts = security.hsts || {};
|
||||
g = group("vhSecurity");
|
||||
const hstsFields = subsection(g, "vhSecurityHstsSection");
|
||||
field(hstsFields, "hsts", "vhHsts", hsts.enabled, "checkbox");
|
||||
field(hstsFields, "hsts", "vhHsts", hsts.enabled, "checkbox", { switch: true });
|
||||
field(hstsFields, "hsts-age", "vhHstsAge", hsts.max_age_seconds ?? 31536000, "number", { required: true, min: 0, max: 63072000 });
|
||||
field(hstsFields, "hsts-sub", "vhHstsSub", hsts.include_subdomains, "checkbox");
|
||||
field(hstsFields, "hsts-preload", "vhHstsPreload", hsts.preload, "checkbox");
|
||||
field(hstsFields, "hsts-sub", "vhHstsSub", hsts.include_subdomains, "checkbox", { switch: true });
|
||||
field(hstsFields, "hsts-preload", "vhHstsPreload", hsts.preload, "checkbox", { switch: true });
|
||||
const headersFields = subsection(g, "vhSecurityHeadersSection");
|
||||
field(headersFields, "nosniff", "vhNosniff", security.nosniff, "checkbox");
|
||||
field(headersFields, "nosniff", "vhNosniff", security.nosniff, "checkbox", { switch: true });
|
||||
field(headersFields, "frame", "vhFrame", security.frame_options || "preserve", "select", { values: [["preserve", "vhPreserve"], ["deny", "vhDeny"], ["sameorigin", "vhSameorigin"]] });
|
||||
field(headersFields, "referrer", "vhReferrer", security.referrer_policy || "", "text", { maxLength: 8192 });
|
||||
field(headersFields, "csp", "vhCsp", security.content_security_policy || "", "textarea", { rows: 2, maxLength: 8192 });
|
||||
field(headersFields, "permissions", "vhPermissions", security.permissions_policy || "", "text", { maxLength: 8192 });
|
||||
const uaBlock = value.user_agent_blocking || {};
|
||||
const uaBlockingFields = subsection(g, "vhUaBlockSection");
|
||||
field(uaBlockingFields, "ua-block-enabled", "vhUaBlockEnabled", uaBlock.enabled === true, "checkbox");
|
||||
field(uaBlockingFields, "ua-block-enabled", "vhUaBlockEnabled", uaBlock.enabled === true, "checkbox", { switch: true });
|
||||
field(uaBlockingFields, "ua-block-patterns", "vhUaBlockPatterns", (uaBlock.patterns || []).join("\n"), "textarea", { rows: 4, maxLength: 32768 });
|
||||
note(uaBlockingFields, "vhUaBlockHelp");
|
||||
g = group("vhAdvanced", true); field(g, "paths", "vhPaths", JSON.stringify(value.routes || [], null, 2), "textarea", { rows: 5, maxLength: 131072 });
|
||||
@@ -361,11 +361,11 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
g = group("vhSslSettings");
|
||||
const inheritedTlsPolicy = envelope?.config.tls?.policy || { tls12: true, tls13: true, cipher_suites: [] };
|
||||
const tlsPolicy = value.tls_policy || inheritedTlsPolicy;
|
||||
const customTlsPolicy = field(g, "tls-policy-custom", "vhTlsOverride", value.tls_policy != null, "checkbox");
|
||||
const customTlsPolicy = field(g, "tls-policy-custom", "vhTlsOverride", value.tls_policy != null, "checkbox", { switch: true });
|
||||
const tls12 = field(g, "tls-policy-12", "tls12", tlsPolicy.tls12 !== false, "checkbox");
|
||||
const tls13 = field(g, "tls-policy-13", "tls13", tlsPolicy.tls13 !== false, "checkbox");
|
||||
const tlsCiphers = field(g, "tls-policy-ciphers", "tlsCiphers", (tlsPolicy.cipher_suites || []).join("\n"), "textarea", { rows: 7, maxLength: 8192 });
|
||||
const tlsPqc = field(g, "tls-policy-pqc", "tlsPqcLabel", tlsPolicy.post_quantum === true, "checkbox");
|
||||
const tlsPqc = field(g, "tls-policy-pqc", "tlsPqcLabel", tlsPolicy.post_quantum === true, "checkbox", { switch: true });
|
||||
const syncTlsPolicy = () => { for (const input of [tls12, tls13, tlsCiphers, tlsPqc]) input.disabled = !customTlsPolicy.checked; };
|
||||
customTlsPolicy.addEventListener("change", syncTlsPolicy); syncTlsPolicy(); note(g, "vhTlsOverrideHelp"); note(g, "tlsPqcVhostHelp");
|
||||
g = group("vhTinyauth"); const auth = value.tinyauth || {};
|
||||
@@ -382,7 +382,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
authUrl.placeholder = "http://10.87.7.99:3000"; loginUrl.placeholder = "https://auth.example.com/login";
|
||||
const taOptions = el("div", undefined, "vh-wide auth-provider-options"); taPrimary.append(taOptions);
|
||||
field(taOptions, "auth-private", "vhPrivate", auth.allow_private, "checkbox");
|
||||
field(taOptions, "auth-redirect-forbidden", "taRedirectForbidden", auth.redirect_forbidden !== false, "checkbox");
|
||||
field(taOptions, "auth-redirect-forbidden", "taRedirectForbidden", auth.redirect_forbidden !== false, "checkbox", { switch: true });
|
||||
note(taBody, "taHelp");
|
||||
|
||||
const taAdvanced = el("details", undefined, "vh-wide auth-advanced"); taAdvanced.append(text("summary", "taAdvanced"));
|
||||
@@ -485,7 +485,7 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
const serverMode = field(g, "server-mode", "serverHeader", server?.mode || "inherit", "select", { values: [["inherit", "vhInherit"], ["preserve", "serverPreserve"], ["hide", "serverHide"], ["custom", "serverCustom"]] });
|
||||
const serverValue = field(g, "server-value", "serverValue", server?.value || "RustProxy", "text", { maxLength: 256 });
|
||||
const syncServer = () => { serverValue.disabled = serverMode.value !== "custom"; serverValue.required = !serverValue.disabled; }; serverMode.addEventListener("change", syncServer); syncServer();
|
||||
const inheritDiagnostics = field(g, "diag-inherit", "diagInherit", !diagnostics, "checkbox"), diagInputs = [];
|
||||
const inheritDiagnostics = field(g, "diag-inherit", "diagInherit", !diagnostics, "checkbox", { switch: true }), diagInputs = [];
|
||||
for (const [name, key] of [["request_id", "diagRequestId"]]) diagInputs.push(field(g, `diag-${name}`, key, diagnostics?.[name] ?? envelope?.config.diagnostic_headers?.[name], "checkbox"));
|
||||
const syncDiag = () => { for (const input of diagInputs) input.disabled = inheritDiagnostics.checked; }; inheritDiagnostics.addEventListener("change", syncDiag); syncDiag(); note(g, "diagHelp");
|
||||
g = group("vhCompression"); const compression = value.compression || {};
|
||||
@@ -516,17 +516,17 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
tri(cacheOptions, "vh-cache-query", "cacheBypassQuery", cache.bypass_query);
|
||||
tri(cacheOptions, "vh-cache-static-cookie", "vhCacheStaticCookie", cache.static_ignore_cookies);
|
||||
const staticExtensionFields = el("div", undefined, "vh-wide vh-override-fields"); cacheOptions.append(staticExtensionFields);
|
||||
const customStatic = field(staticExtensionFields, "vh-cache-static-custom", "vhCacheStaticCustom", cache.static_extensions != null, "checkbox");
|
||||
const customStatic = field(staticExtensionFields, "vh-cache-static-custom", "vhCacheStaticCustom", cache.static_extensions != null, "checkbox", { switch: true });
|
||||
const staticExtensions = field(staticExtensionFields, "vh-cache-static-extensions", "vhCacheStaticExtensions", (cache.static_extensions || envelope?.config.cache?.static_extensions || []).join("\n"), "textarea", { rows: 5, maxLength: 2048 });
|
||||
const syncStatic = () => { staticExtensions.disabled = !customStatic.checked; }; customStatic.addEventListener("change", syncStatic); syncStatic(); note(staticExtensionFields, "vhCacheStaticHelp");
|
||||
tri(cacheOptions, "vh-cache-status", "cacheStatusHeader", cache.expose_status); tri(cacheOptions, "vh-cache-hits", "cacheHitsHeader", cache.expose_hits); tri(cacheOptions, "vh-cache-rfc", "cacheRfcHeader", cache.expose_cache_status); tri(cacheOptions, "vh-cache-resident-age", "cacheResidentAge", cache.expose_resident_age); tri(cacheOptions, "vh-cache-only-hits", "cacheOnlyHits", cache.expose_only_hits); tri(cacheOptions, "vh-cache-detailed-status", "cacheDetailedStatus", cache.expose_detailed_status);
|
||||
const bypassFields = el("div", undefined, "vh-wide vh-override-fields"); cacheOptions.append(bypassFields);
|
||||
const customCachePrefixes = field(bypassFields, "vh-cache-prefix-custom", "vhCacheCustomPrefixes", cache.bypass_prefixes != null, "checkbox");
|
||||
const customCachePrefixes = field(bypassFields, "vh-cache-prefix-custom", "vhCacheCustomPrefixes", cache.bypass_prefixes != null, "checkbox", { switch: true });
|
||||
const bypassPrefixes = field(bypassFields, "vh-cache-prefixes", "cacheBypassPrefixes", (cache.bypass_prefixes || []).join("\n"), "textarea", { rows: 2, maxLength: 32768 });
|
||||
const syncBypassPrefixes = () => { bypassPrefixes.disabled = !customCachePrefixes.checked; };
|
||||
customCachePrefixes.addEventListener("change", syncBypassPrefixes); syncBypassPrefixes(); note(bypassFields, "vhCacheHint");
|
||||
const unsafeCacheFields = el("div", undefined, "vh-wide vh-override-fields"); cacheOptions.append(unsafeCacheFields);
|
||||
const forceCache = field(unsafeCacheFields, "vh-cache-force-enabled", "vhCacheForceEnabled", cache.unsafe_force?.enabled === true, "checkbox");
|
||||
const forceCache = field(unsafeCacheFields, "vh-cache-force-enabled", "vhCacheForceEnabled", cache.unsafe_force?.enabled === true, "checkbox", { switch: true });
|
||||
const forceTargets = field(unsafeCacheFields, "vh-cache-force-targets", "vhCacheForceTargets", (cache.unsafe_force?.targets || []).join("\n"), "textarea", { rows: 3, maxLength: 65536 });
|
||||
const syncForceCache = () => { forceTargets.disabled = !forceCache.checked; }; forceCache.addEventListener("change", async () => { if (forceCache.checked && !(await appConfirm(t("vhCacheForceConfirm"), { danger: true }))) forceCache.checked = false; syncForceCache(); }); syncForceCache();
|
||||
note(unsafeCacheFields, "vhCacheForceHelp");
|
||||
@@ -541,11 +541,11 @@ function load(value = defaults(), migrationIds = [], show = true) {
|
||||
};
|
||||
cacheToggle.addEventListener("change", syncCacheVisibility); syncCacheVisibility();
|
||||
g = group("vhTransform"); const transform = value.transform || { enabled: false };
|
||||
const transformEnabled = field(g, "vh-transform-enabled", "vhTransformEnable", transform.enabled === true, "checkbox");
|
||||
const transformEnabled = field(g, "vh-transform-enabled", "vhTransformEnable", transform.enabled === true, "checkbox", { switch: true });
|
||||
const transformOptions = el("div", undefined, "vh-wide vh-grid vh-transform-options"); g.append(transformOptions);
|
||||
for (const [name, key] of [["javascript", "transformJavascript"], ["css", "transformCss"], ["html", "transformHtml"], ["svg", "transformSvg"], ["json", "transformJson"]]) tri(transformOptions, `vh-transform-${name}`, key, transform[name]);
|
||||
const transformExtensionFields = el("div", undefined, "vh-wide vh-override-fields"); transformOptions.append(transformExtensionFields);
|
||||
const customTransformExtensions = field(transformExtensionFields, "vh-transform-extensions-custom", "vhTransformExtensionsCustom", transform.extensions != null, "checkbox");
|
||||
const customTransformExtensions = field(transformExtensionFields, "vh-transform-extensions-custom", "vhTransformExtensionsCustom", transform.extensions != null, "checkbox", { switch: true });
|
||||
const transformExtensions = field(transformExtensionFields, "vh-transform-extensions", "transformExtensions", (transform.extensions || envelope?.config.transform?.extensions || []).join("\n"), "textarea", { rows: 5, maxLength: 2048 });
|
||||
const syncTransform = () => {
|
||||
transformOptions.hidden = !transformEnabled.checked;
|
||||
|
||||
@@ -58,6 +58,7 @@ window.rustProxyPhpProfiles = ({ defaults, mapLines, lines, parseFastCgiParams,
|
||||
const labelEl = toggle ? el("label", undefined, "check php-switch-label") : wrapper;
|
||||
const input = document.createElement(kind === "textarea" ? "textarea" : "input");
|
||||
if (kind !== "textarea") input.type = kind;
|
||||
if (toggle) input.classList.add("switch");
|
||||
const caption = el("span", t(label));
|
||||
if (toggle) labelEl.append(input, caption); else labelEl.append(caption, input);
|
||||
if (toggle) input.checked = profile.php?.[key] === true;
|
||||
|
||||
@@ -88,6 +88,12 @@ assert "saveAppearancePreference({ stable_dialog_position: next }" in preference
|
||||
assert 'html[data-stable-dialog-position="true"] dialog.vhost-dialog[open]' in editors_css
|
||||
assert openapi["components"]["schemas"]["AdminPreferences"]["properties"]["stable_dialog_position"]["default"] is True
|
||||
assert pl.get("stableDialogPosition") and pl.get("stableDialogPositionHelp")
|
||||
assert "ui-switch-controls" in id_set, "Appearance must expose the switch controls toggle"
|
||||
assert re.search(r"switch_controls:\s*true", preferences_js), "switch controls must default on in the panel"
|
||||
assert "applyAdminSwitchControls(value.switch_controls)" in preferences_js
|
||||
assert "saveAppearancePreference({ switch_controls: next }" in preferences_js
|
||||
assert openapi["components"]["schemas"]["AdminPreferences"]["properties"]["switch_controls"]["default"] is True
|
||||
assert pl.get("switchControls") and pl.get("switchControlsHelp")
|
||||
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"
|
||||
|
||||
@@ -51,5 +51,5 @@ 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.38.3");
|
||||
assert.equal(openapi.info.version, "0.38.4");
|
||||
console.log("Panel refresh/API contract checks: OK");
|
||||
Reference in new issue
Block a user