v0.24.13
This commit is contained in:
1 parent
bd077754a9
commit
ed7e3377c1
40 files changed
+1764
-365
No files matched your search
@@ -76,6 +76,61 @@ function renderSettings() {
|
||||
$("error-log-status").textContent = errorSink ? `${t("loggingQueue")}: ${fmt(errorSink.queue_dropped)} ${t("loggingDropped")} / ${fmt(errorSink.written)} ${t("loggingSent")} / ${fmt(errorSink.errors)} ${t("errors")} · ${t("loggingCapacity")}: ${fmt(errorSink.queue_capacity)}` : "";
|
||||
if (!settingsDirty.has("forwarding-form")) { $("trusted-proxies").value = (config.forwarding?.trusted_proxies || []).join("\n"); $("trusted-proto").checked = !!config.forwarding?.trust_forwarded_proto; }
|
||||
if (!settingsDirty.has("headers-form")) { for (const direction of ["request", "response"]) renderHeaderRules(direction, config.headers?.[direction] || []); }
|
||||
const global = config.global_security || {};
|
||||
if (!settingsDirty.has("global-security-form")) {
|
||||
const country = global.country_access || {}, methods = global.method_policy || {}, content = global.content_type_policy || {}, rate = global.rate_limit || {};
|
||||
const ua = global.user_agent_blocking || {}, acl = global.acl;
|
||||
$("global-country-mode").value = country.mode || "off";
|
||||
$("global-country-list").value = (country.countries || []).join("\n");
|
||||
$("global-ua-block-enabled").checked = ua.enabled === true;
|
||||
$("global-ua-block-patterns").value = (ua.patterns || []).join("\n");
|
||||
$("global-ip-enabled").checked = !!acl;
|
||||
$("global-ip-default").value = acl?.default || "allow";
|
||||
$("global-ip-rules").value = rulesText(acl);
|
||||
$("global-method-mode").value = methods.mode || "off";
|
||||
$("global-method-list").value = (methods.methods || []).join("\n");
|
||||
$("global-content-type-enabled").checked = content.enabled === true;
|
||||
$("global-content-type-list").value = (content.blocked || []).join("\n");
|
||||
$("global-rate-enabled").checked = rate.enabled === true;
|
||||
$("global-rate-requests").value = rate.requests ?? 120;
|
||||
$("global-rate-window").value = rate.window_seconds ?? 60;
|
||||
$("global-rate-burst").value = rate.burst ?? 30;
|
||||
syncGlobalSecurityControls();
|
||||
}
|
||||
if (!settingsDirty.has("global-security-headers-form")) {
|
||||
const headers = global.security_headers || {}, hsts = headers.hsts || {};
|
||||
$("global-hsts-enabled").checked = hsts.enabled === true;
|
||||
$("global-hsts-age").value = hsts.max_age_seconds ?? 31536000;
|
||||
$("global-hsts-sub").checked = hsts.include_subdomains === true;
|
||||
$("global-hsts-preload").checked = hsts.preload === true;
|
||||
$("global-nosniff").checked = headers.nosniff === true;
|
||||
$("global-frame").value = headers.frame_options || "preserve";
|
||||
$("global-referrer").value = headers.referrer_policy || "";
|
||||
$("global-csp").value = headers.content_security_policy || "";
|
||||
$("global-permissions").value = headers.permissions_policy || "";
|
||||
syncGlobalSecurityControls();
|
||||
}
|
||||
}
|
||||
function syncGlobalSecurityControls() {
|
||||
for (const [toggle, children] of [
|
||||
["global-country-mode", ["global-country-list"]],
|
||||
["global-ua-block-enabled", ["global-ua-block-patterns"]],
|
||||
["global-ip-enabled", ["global-ip-default", "global-ip-rules"]],
|
||||
["global-method-mode", ["global-method-list"]],
|
||||
["global-content-type-enabled", ["global-content-type-list"]],
|
||||
["global-rate-enabled", ["global-rate-requests", "global-rate-window", "global-rate-burst"]],
|
||||
["global-hsts-enabled", ["global-hsts-age", "global-hsts-sub", "global-hsts-preload"]]
|
||||
]) {
|
||||
const source = $(toggle);
|
||||
const enabled = source.type === "checkbox" ? source.checked : source.value !== "off";
|
||||
for (const id of children) $(id).disabled = !enabled;
|
||||
}
|
||||
}
|
||||
for (const id of ["global-country-mode", "global-ua-block-enabled", "global-ip-enabled", "global-method-mode", "global-content-type-enabled", "global-rate-enabled", "global-hsts-enabled"]) {
|
||||
$(id)?.addEventListener("change", syncGlobalSecurityControls);
|
||||
}
|
||||
for (const id of ["global-security-form", "global-security-headers-form"]) {
|
||||
for (const type of ["input", "change"]) $(id)?.addEventListener(type, () => setSettingsDirty(id));
|
||||
}
|
||||
function effectiveCacheMemory() {
|
||||
const d = latestStatus?.system || {}, host = Number(d.memory_total_bytes), cgroup = Number(d.cgroup_memory_max_bytes);
|
||||
|
||||
Reference in new issue
Block a user