This commit is contained in:
Mateusz Gruszczyński committed 2026-11-20 19:51:27 +01:00
1 parent 15425fb803
commit 0fc9c0d239
21 files changed
+395 -36

No files matched your search

+14 -1
View File
@@ -177,6 +177,19 @@ window.rustProxyCacheRules = (() => {
{ name: t("cacheRuleTplCdnRemaining"), stage: "request", match: "all", conditions: [{ field: "header", name: "Cookie", operator: "exists" }], actions: [{ type: "pass" }], stop: true },
];
},
// Opt-in for a verified public vhost. Do not try to infer the Cookie
// Domain: it is absent from the HTTP Cookie request header. Disabled by
// default; the operator must review the private-path exclusions first.
publiccookies: () => [{
name: t("cacheRuleTplPubliccookies"), enabled: false, stage: "request", match: "all",
conditions: [
{ field: "method", operator: "equals", values: ["GET", "HEAD"] },
{ field: "header", name: "Cookie", operator: "exists" },
{ field: "header", name: "Authorization", operator: "exists", negate: true },
{ field: "path", operator: "regex", values: ["^/(admin|api|auth|login|logout|account|profile|user|settings|dashboard|cart|checkout|panel|konto|wp-admin|wp-login[.]php)(/|[?]|$)"], negate: true },
],
actions: [{ type: "strip_cookies", keep: [] }, { type: "lookup" }], stop: true,
}],
tracking: () => [{ name: t("cacheRuleTplTracking"), stage: "request", match: "all", conditions: [], actions: [{ type: "strip_query", params: ["utm_*", "fbclid", "gclid", "msclkid", "mc_cid", "mc_eid", "_ga"] }] }],
api: () => [{ name: t("cacheRuleTplApi"), stage: "request", match: "all", conditions: [{ field: "path", operator: "prefix", values: ["/api/"] }], actions: [{ type: "pass" }] }],
language: () => [{ name: t("cacheRuleTplLanguage"), stage: "request", match: "all", conditions: [], actions: [{ type: "hash_cookie", name: "lang" }] }],
@@ -274,7 +287,7 @@ window.rustProxyCacheRules = (() => {
helpLinks.append(guide, docs);
root.append(helpLinks);
}
const templates = select([["", t("cacheRulesTemplates")], ...Object.keys(TEMPLATES).map(key => [key, t(`cacheRuleTpl${key[0].toUpperCase()}${key.slice(1)}`)])], "", t("cacheRulesTemplates"));
const templates = select([["", t("cacheRulesTemplates")], ...Object.keys(TEMPLATES).filter(key => scope === "vhost" || key !== "publiccookies").map(key => [key, t(`cacheRuleTpl${key[0].toUpperCase()}${key.slice(1)}`)])], "", t("cacheRulesTemplates"));
templates.classList.add("cache-rules-templates");
const importButton = el("button", t("cacheRulesImportVcl"), "outline"); importButton.type = "button";
const exportButton = el("button", t("cacheRulesExportVcl"), "outline"); exportButton.type = "button";