v0.30.1
This commit is contained in:
1 parent
f3dd34dae4
commit
f213d853e2
28 files changed
+5368
-4692
No files matched your search
@@ -192,21 +192,8 @@ function enhanceEnabledControl(input, hintKey = "entityEnableHint") {
|
||||
}
|
||||
window.rustProxyEnableControl = enhanceEnabledControl;
|
||||
function action(label, fn) { const b = el("button", label, "quiet"); b.type = "button"; b.addEventListener("click", fn); return b; }
|
||||
function renderAboutRuntime(status = latestStatus) {
|
||||
const value = status?.runtime?.certificate_runtime || {};
|
||||
const availability = flag => flag === true ? t("runtimeAvailable") : flag === false ? t("runtimeUnavailable") : t("unavailable");
|
||||
const mode = value.status === "unavailable" ? t("certificateRuntimeUnavailable") : value.status === "ready" && value.mode === "managed" ? t("certificateRuntimeManaged") : value.status === "ready" && value.mode === "system" ? t("certificateRuntimeSystem") : t("certificateRuntimePreparing");
|
||||
const modeNode = $("about-acme-mode"), runtimeNode = $("about-python-runtime"), details = $("about-python-details");
|
||||
if (modeNode) modeNode.textContent = mode;
|
||||
if (runtimeNode) runtimeNode.textContent = `${t("runtimePython")}: ${availability(value.python)} · ${t("runtimePip")}: ${availability(value.pip)} · ${t("runtimeCertbot")}: ${availability(value.certbot)}`;
|
||||
if (details) {
|
||||
const parts = [value.message ? t(value.message) : ""];
|
||||
if (value.managed_directory) parts.push(`${t("certificateRuntimePath")}: ${value.managed_directory}`);
|
||||
details.textContent = parts.filter(Boolean).join(" · ");
|
||||
}
|
||||
}
|
||||
function renderStatus(s) {
|
||||
const firstStatus = latestStatus === null; latestStatus = s; renderAboutRuntime(s); window.rustProxySettings?.render(); if (firstStatus) renderSettings();
|
||||
const firstStatus = latestStatus === null; latestStatus = s; window.rustProxySettings?.render(); if (firstStatus) renderSettings();
|
||||
connected = true; $("connection-label").textContent = t("connected"); $("signal").classList.remove("status-error"); const m = s.metrics;
|
||||
$("metric-ws").textContent = m.websocket_active || 0;
|
||||
$("metric-ws-h1").textContent = m.websocket_h1_active || 0;
|
||||
@@ -384,7 +371,7 @@ function stopTunnelRefresh() { if (tunnelRefreshTimer) clearInterval(tunnelRefre
|
||||
function startTunnelRefresh() { stopTunnelRefresh(); tunnelRefreshTimer = setInterval(() => { if ($("tunnels-dialog")?.open) void loadTunnels(); }, 2000); }
|
||||
$("login-form").addEventListener("submit", async event => { event.preventDefault(); const form = event.currentTarget; authMessage(""); try { await withFormSubmitState(form, event.submitter, async () => { const username = $("username").value.trim(); const password = $("password").value; if (setupRequired) { if (password !== $("password-confirm").value) throw fieldError("password-confirm", t("passwordMismatch")); await api("/api/auth/setup", { method: "POST", body: JSON.stringify({ token: $("setup-token").value.trim(), username, password }) }); setupRequired = false; syncAuthForm(); } const info = await api("/api/auth/login", { method: "POST", body: JSON.stringify({ username, password }) }); await activate(info); clearTimeout(toastTimer); hideToast(); }); } catch (e) { if (e.code === "auth.already_initialized") { setupRequired = false; syncAuthForm(); } $("password").value = ""; $("password-confirm").value = ""; authMessage(e.message); } });
|
||||
$("logout").addEventListener("click", async () => { try { await api("/api/auth/logout", { method: "POST" }); lock(); toast(t("locked")); } catch (e) { if (e.status === 401) lock(); toast(e.message, true); } });
|
||||
$("about-open").addEventListener("click", () => { renderAboutRuntime(); const dialog = $("about-dialog"); if (!dialog.open) dialog.showModal(); });
|
||||
$("about-open").addEventListener("click", () => { const dialog = $("about-dialog"); if (!dialog.open) dialog.showModal(); });
|
||||
$("about-close").addEventListener("click", () => $("about-dialog").close());
|
||||
const mobileMenuToggle = $("mobile-menu-toggle"), dashboardSidebar = document.querySelector(".sidebar");
|
||||
function setMobileMenu(open) {
|
||||
|
||||
+45
-29
@@ -1768,6 +1768,9 @@
|
||||
aria-controls="settings-page-administration" aria-selected="false"
|
||||
data-i18n="administration" data-settings-tab="administration"
|
||||
id="settings-tab-administration" role="tab" tabindex="-1" type="button"></button><button
|
||||
aria-controls="settings-page-system-info" aria-selected="false"
|
||||
data-i18n="systemInformation" data-settings-tab="system-info"
|
||||
id="settings-tab-system-info" role="tab" tabindex="-1" type="button"></button><button
|
||||
aria-controls="settings-page-certificate-api" aria-selected="false"
|
||||
data-i18n="certificateApiTitle" data-settings-tab="certificate-api"
|
||||
id="settings-tab-certificate-api" role="tab" tabindex="-1" type="button"></button><button
|
||||
@@ -2698,30 +2701,52 @@
|
||||
<div class="form-actions"><button class="primary" data-i18n="apply"
|
||||
type="submit">Validate, save and apply</button></div>
|
||||
</form>
|
||||
</div>
|
||||
<div aria-labelledby="settings-tab-system-info" class="settings-page"
|
||||
data-settings-page="system-info" hidden="" id="settings-page-system-info" role="tabpanel">
|
||||
<article class="card edit-form runtime-information-card">
|
||||
<div class="card-heading">
|
||||
<h2 data-i18n="runtimeInformation">Runtime information</h2><span
|
||||
class="pill">API</span>
|
||||
<h2 data-i18n="systemInformation">System information</h2><span class="pill">API</span>
|
||||
</div>
|
||||
<p class="fine" data-i18n="runtimeInformationHelp">Reported by the running RustProxy
|
||||
process and available only from the authenticated administrator status API.</p>
|
||||
<p class="fine" data-i18n="systemInformationHelp">Live, read-only information from the authenticated RustProxy status API. Unavailable metrics are not estimated.</p>
|
||||
<h3 data-i18n="systemHostHeading">Operating system and hardware</h3>
|
||||
<div class="runtime-information-grid">
|
||||
<div><span class="small-label" data-i18n="runtimePlatform">Platform</span><code
|
||||
id="runtime-platform">-</code></div>
|
||||
<div><span class="small-label" data-i18n="statisticsSource">Statistics
|
||||
source</span><code id="runtime-statistics-source">-</code></div>
|
||||
<div><span class="small-label" data-i18n="dataDirectory">Data directory</span><code
|
||||
id="runtime-data-directory">-</code></div>
|
||||
<div><span class="small-label" data-i18n="databaseLocation">Database</span><code
|
||||
id="runtime-database-path">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimeAcmeMode">ACME mode</span><code
|
||||
id="runtime-acme-mode">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimePython">Python</span><code
|
||||
id="runtime-python">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimePip">pip</span><code
|
||||
id="runtime-pip">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimeCertbot">Certbot</span><code
|
||||
id="runtime-certbot">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimePlatform">Platform</span><code id="runtime-platform">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemOsVersion">Operating system</span><code id="runtime-operating-system">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemKernel">Kernel</span><code id="runtime-kernel-version">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemArchitecture">Architecture</span><code id="runtime-architecture">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemLogicalCpus">Logical CPUs</span><code id="runtime-logical-cpus">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemCpuLoad">CPU usage</span><code id="runtime-cpu-usage">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemMemory">RAM used / total</span><code id="runtime-system-memory">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemUptime">System uptime</span><code id="runtime-system-uptime">-</code></div>
|
||||
</div>
|
||||
<h3 data-i18n="systemProcessHeading">RustProxy process</h3>
|
||||
<div class="runtime-information-grid">
|
||||
<div><span class="small-label" data-i18n="systemAppVersion">RustProxy version</span><code id="runtime-version">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemProcessUptime">Process uptime</span><code id="runtime-process-uptime">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemProcessMemory">Process RAM (RSS)</span><code id="runtime-process-memory">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemProcessThreads">Process threads</span><code id="runtime-process-threads">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemOpenFds">Open file descriptors</span><code id="runtime-open-fds">-</code></div>
|
||||
<div><span class="small-label" data-i18n="statisticsSource">Statistics source</span><code id="runtime-statistics-source">-</code></div>
|
||||
</div>
|
||||
</article>
|
||||
<article class="card edit-form runtime-information-card">
|
||||
<div class="card-heading"><h2 data-i18n="systemCertificateHeading">ACME / Python environment</h2></div>
|
||||
<p class="fine" data-i18n="systemCertificateHelp">Versions refer to the interpreter and tools actually selected for certificate management, not an arbitrary Python installation.</p>
|
||||
<div class="runtime-information-grid">
|
||||
<div><span class="small-label" data-i18n="runtimeAcmeMode">ACME mode</span><code id="runtime-acme-mode">-</code></div>
|
||||
<div><span class="small-label" data-i18n="systemAcmeStatus">ACME status</span><code id="runtime-acme-status">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimePython">Python</span><code id="runtime-python">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimePip">pip</span><code id="runtime-pip">-</code></div>
|
||||
<div><span class="small-label" data-i18n="runtimeCertbot">Certbot</span><code id="runtime-certbot">-</code></div>
|
||||
<div><span class="small-label" data-i18n="certificateRuntimePath">Managed environment</span><code id="runtime-acme-directory">-</code></div>
|
||||
</div>
|
||||
</article>
|
||||
<article class="card edit-form runtime-information-card">
|
||||
<div class="card-heading"><h2 data-i18n="systemPathsHeading">Data locations</h2></div>
|
||||
<div class="runtime-information-grid">
|
||||
<div><span class="small-label" data-i18n="dataDirectory">Data directory</span><code id="runtime-data-directory">-</code></div>
|
||||
<div><span class="small-label" data-i18n="databaseLocation">Database</span><code id="runtime-database-path">-</code></div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
@@ -3659,18 +3684,9 @@ log_errors = On</code></pre>
|
||||
<dt data-i18n="aboutLicense">License</dt>
|
||||
<dd data-i18n="aboutLicenseValue">Open Source</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt data-i18n="runtimeAcmeMode">ACME mode</dt>
|
||||
<dd id="about-acme-mode">-</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt data-i18n="aboutPythonRuntime">Certificate Python runtime</dt>
|
||||
<dd id="about-python-runtime">-</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p data-i18n="aboutOpenSourceText">RustProxy is an open-source project. Its source code is publicly
|
||||
available for inspection, development and community contribution.</p>
|
||||
<p class="about-python-details" id="about-python-details"></p>
|
||||
<a class="outline about-repository" href="https://git.linuxiarz.pl/gru/RustProxy" rel="noopener noreferrer"
|
||||
target="_blank"><span data-i18n="aboutRepository">Official source
|
||||
repository</span><span>git.linuxiarz.pl/gru/RustProxy</span></a>
|
||||
|
||||
@@ -219,13 +219,44 @@ curl --fail --show-error --request POST \
|
||||
const syncAdminTls = () => { $("admin-certificate").disabled = !$("admin-tls").checked; }; syncAdminTls();
|
||||
$("admin-status").textContent = adminStatus?.restart_required ? t("restartPending") : adminStatus?.active?.tls ? `${t("administrationActiveHttps")}: ${adminStatus.active.listen}` : `${t("administrationActiveHttp")}: ${adminStatus?.active?.listen || latestStatus?.admin_listen || "-"}`;
|
||||
const runtime = latestStatus?.runtime || {};
|
||||
for (const [id, key] of [["runtime-platform", "platform"], ["runtime-statistics-source", "statistics_source"], ["runtime-data-directory", "data_directory"], ["runtime-database-path", "database_path"]]) {
|
||||
const node = $(id); if (node) node.textContent = runtime[key] || t("unavailable");
|
||||
}
|
||||
const system = latestStatus?.system || {};
|
||||
const hasMetric = value => value !== null && value !== undefined && Number.isFinite(Number(value));
|
||||
const humanCount = value => hasMetric(value) ? Number(value).toLocaleString(locale()) : t("unavailable");
|
||||
const humanBytes = value => hasMetric(value) ? bytes(Number(value)) : t("unavailable");
|
||||
const humanUptime = value => hasMetric(value) ? uptime(Number(value)) : t("unavailable");
|
||||
const percent = value => hasMetric(value) ? `${Number(value).toLocaleString(locale(), { maximumFractionDigits: 1 })}%` : t("unavailable");
|
||||
const ram = hasMetric(system.memory_used_bytes) || hasMetric(system.memory_total_bytes)
|
||||
? `${humanBytes(system.memory_used_bytes)} / ${humanBytes(system.memory_total_bytes)}` : t("unavailable");
|
||||
for (const [id, value] of [
|
||||
["runtime-version", latestStatus?.version],
|
||||
["runtime-platform", runtime.platform],
|
||||
["runtime-operating-system", runtime.operating_system],
|
||||
["runtime-kernel-version", runtime.kernel_version],
|
||||
["runtime-architecture", runtime.architecture],
|
||||
["runtime-logical-cpus", humanCount(system.logical_cpus)],
|
||||
["runtime-cpu-usage", percent(system.cpu_percent)],
|
||||
["runtime-system-memory", ram],
|
||||
["runtime-system-uptime", humanUptime(system.system_uptime_seconds)],
|
||||
["runtime-process-uptime", humanUptime(latestStatus?.uptime_seconds)],
|
||||
["runtime-process-memory", humanBytes(system.process_rss_bytes)],
|
||||
["runtime-process-threads", humanCount(system.process_threads)],
|
||||
["runtime-open-fds", humanCount(system.open_fds)],
|
||||
["runtime-statistics-source", runtime.statistics_source],
|
||||
["runtime-data-directory", runtime.data_directory],
|
||||
["runtime-database-path", runtime.database_path]
|
||||
]) { const node = $(id); if (node) node.textContent = value ?? t("unavailable"); }
|
||||
const certificateRuntime = runtime.certificate_runtime || {};
|
||||
const availability = flag => flag === true ? t("runtimeAvailable") : flag === false ? t("runtimeUnavailable") : t("unavailable");
|
||||
const modeLabel = certificateRuntime.status === "unavailable" ? t("certificateRuntimeUnavailable") : certificateRuntime.status === "ready" && certificateRuntime.mode === "managed" ? t("certificateRuntimeManaged") : certificateRuntime.status === "ready" && certificateRuntime.mode === "system" ? t("certificateRuntimeSystem") : t("certificateRuntimePreparing");
|
||||
for (const [id, text] of [["runtime-acme-mode", modeLabel], ["runtime-python", availability(certificateRuntime.python)], ["runtime-pip", availability(certificateRuntime.pip)], ["runtime-certbot", availability(certificateRuntime.certbot)]]) { const node = $(id); if (node) node.textContent = text; }
|
||||
const versioned = (flag, version) => version && flag === true ? `${availability(flag)} · ${version}` : availability(flag);
|
||||
for (const [id, value] of [
|
||||
["runtime-acme-mode", modeLabel],
|
||||
["runtime-acme-status", certificateRuntime.message ? t(certificateRuntime.message) : t("unavailable")],
|
||||
["runtime-python", versioned(certificateRuntime.python, certificateRuntime.python_version)],
|
||||
["runtime-pip", versioned(certificateRuntime.pip, certificateRuntime.pip_version)],
|
||||
["runtime-certbot", versioned(certificateRuntime.certbot, certificateRuntime.certbot_version)],
|
||||
["runtime-acme-directory", certificateRuntime.managed_directory]
|
||||
]) { const node = $(id); if (node) node.textContent = value || t("unavailable"); }
|
||||
|
||||
const policy = envelope.config.tls?.policy || { tls12: true, tls13: true, cipher_suites: [] };
|
||||
if (!settingsDirty.has("tls-policy-form")) { $("tls-policy-12").checked = policy.tls12 !== false; $("tls-policy-13").checked = policy.tls13 !== false; $("tls-policy-ciphers").value = (policy.cipher_suites || []).join("\n"); }
|
||||
|
||||
+12
-1
@@ -7606,6 +7606,11 @@ body[data-density="compact"] .page-footer {
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
/* The legend keys must use the same theme/preset palette as the SVG strokes. */
|
||||
.stat-chart .stat-chart-legend .legend-h1 i { background: var(--traffic-h1); }
|
||||
.stat-chart .stat-chart-legend .legend-h2 i { background: var(--traffic-h2); }
|
||||
.stat-chart .stat-chart-legend .legend-h3 i { background: var(--traffic-h3); }
|
||||
|
||||
.stat-chart .stat-chart-legend b {
|
||||
font-family: var(--mono);
|
||||
font-weight: 500;
|
||||
@@ -7809,7 +7814,13 @@ body[data-density="compact"] .page-footer {
|
||||
}
|
||||
|
||||
.runtime-information-card {
|
||||
margin-top: 12px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.runtime-information-card h3 {
|
||||
margin: 16px 0 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.runtime-information-grid {
|
||||
|
||||
Reference in new issue
Block a user