domma-cms 1.40.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +6 -0
- package/admin/css/admin.css +1 -1
- package/admin/dist/domma/domma-tools.css +3 -3
- package/admin/dist/domma/domma-tools.min.js +4 -4
- package/admin/js/lib/themes.js +1 -1
- package/docs/plugin-development.md +1 -0
- package/package.json +2 -2
- package/server/services/hostClaims.js +46 -0
- package/server/services/plugins.js +5 -1
- package/server/services/seo/index.js +3 -0
- package/server/services/themeSettings.js +16 -7
- package/server/services/wpImport/index.js +2 -0
package/admin/js/lib/themes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const THEMES=[{id:"charcoal-dark",label:"Charcoal",dark:!0,primary:"#5b8cff",bg:"#1a1d23"},{id:"charcoal-light",label:"Charcoal",dark:!1,primary:"#4a7aff",bg:"#f4f5f7"},{id:"ocean-dark",label:"Ocean",dark:!0,primary:"#00b4d8",bg:"#0d1b2a"},{id:"ocean-light",label:"Ocean",dark:!1,primary:"#0096c7",bg:"#e8f4f8"},{id:"forest-dark",label:"Forest",dark:!0,primary:"#52b788",bg:"#1a231e"},{id:"forest-light",label:"Forest",dark:!1,primary:"#40916c",bg:"#f0f7f4"},{id:"sunset-dark",label:"Sunset",dark:!0,primary:"#ff6b6b",bg:"#1f1a1a"},{id:"sunset-light",label:"Sunset",dark:!1,primary:"#e05555",bg:"#fff0f0"},{id:"royal-dark",label:"Royal",dark:!0,primary:"#9b59b6",bg:"#1a1525"},{id:"royal-light",label:"Royal",dark:!1,primary:"#8e44ad",bg:"#f5f0fa"},{id:"lemon-dark",label:"Lemon",dark:!0,primary:"#f1c40f",bg:"#1a1a10"},{id:"lemon-light",label:"Lemon",dark:!1,primary:"#d4ac0d",bg:"#fffef0"},{id:"silver-dark",label:"Silver",dark:!0,primary:"#95a5a6",bg:"#1c1e20"},{id:"silver-light",label:"Silver",dark:!1,primary:"#7f8c8d",bg:"#f2f3f4"},{id:"grayve-dark",label:"Grayve",dark:!0,primary:"#00bcd4",bg:"#1a1e21"},{id:"grayve-light",label:"Grayve",dark:!1,primary:"#00838f",bg:"#ffffff"},{id:"mint-dark",label:"Mint",dark:!0,primary:"#00c896",bg:"#0f1f1a"},{id:"mint-light",label:"Mint",dark:!1,primary:"#00a878",bg:"#f0faf6"},{id:"unicorn-dark",label:"Unicorn",dark:!0,primary:"#e040fb",bg:"#1a0a1e"},{id:"unicorn-light",label:"Unicorn",dark:!1,primary:"#ba68c8",bg:"#fdf5ff"},{id:"dreamy-dark",label:"Dreamy",dark:!0,primary:"#7986cb",bg:"#15152a"},{id:"dreamy-light",label:"Dreamy",dark:!1,primary:"#5c6bc0",bg:"#f3f4fd"},{id:"christmas-dark",label:"Christmas",dark:!0,primary:"#e53935",bg:"#0a1a0a"},{id:"christmas-light",label:"Christmas",dark:!1,primary:"#c62828",bg:"#f5fff5"},{id:"wedding-dark",label:"Wedding",dark:!0,primary:"#ec407a",bg:"#1a0e14"},{id:"wedding-light",label:"Wedding",dark:!1,primary:"#e91e63",bg:"#fff5f8"},{id:"corporate-dark",label:"Corporate",dark:!0,primary:"#2563eb",bg:"#0b0f19"},{id:"corporate-light",label:"Corporate",dark:!1,primary:"#1e40af",bg:"#f8fafc"},{id:"admin-sharp-indigo",label:"Admin \xB7 Sharp",name:"Indigo",admin:!0,dark:!1,primary:"#5b63a8",bg:"#eef1f6"},{id:"admin-sharp-steel",label:"Admin \xB7 Sharp",name:"Steel",admin:!0,dark:!1,primary:"#3b76bc",bg:"#eef1f6"},{id:"admin-sharp-teal",label:"Admin \xB7 Sharp",name:"Teal",admin:!0,dark:!1,primary:"#2a8178",bg:"#eef1f6"},{id:"admin-slate-indigo",label:"Admin \xB7 Slate",name:"Indigo",admin:!0,dark:!0,primary:"#5b63a8",bg:"#252c37"},{id:"admin-slate-steel",label:"Admin \xB7 Slate",name:"Steel",admin:!0,dark:!0,primary:"#3b76bc",bg:"#252c37"},{id:"admin-slate-teal",label:"Admin \xB7 Slate",name:"Teal",admin:!0,dark:!0,primary:"#2a8178",bg:"#252c37"},{id:"admin-smooth-indigo",label:"Admin \xB7 Smooth",name:"Indigo",admin:!0,dark:!0,primary:"#5b63a8",bg:"#586170"},{id:"admin-smooth-steel",label:"Admin \xB7 Smooth",name:"Steel",admin:!0,dark:!0,primary:"#3b76bc",bg:"#586170"},{id:"admin-smooth-teal",label:"Admin \xB7 Smooth",name:"Teal",admin:!0,dark:!0,primary:"#2a8178",bg:"#586170"}];export function paletteOrder(e){const d=[...new Set(e.map(a=>a.label))],r=a=>a.toLowerCase().startsWith("admin")?1:0;return d.sort((a,l)=>r(a)-r(l)||a.localeCompare(l))}export function themesInDisplayOrder(e=THEMES){const d=paletteOrder(e);return[...e].sort((r,a)=>d.indexOf(r.label)-d.indexOf(a.label)||(r.dark===a.dark?0:r.dark?-1:1))}export function populateThemeSelect(e,{includeDefault:d=!1,defaultLabel:r="Use site default",includeAdmin:a=!1}={}){for(;e.firstChild;)e.removeChild(e.firstChild);if(d){const i=document.createElement("option");i.value="",i.textContent=r,e.appendChild(i)}const l=THEMES.filter(i=>a||!i.admin);for(const i of paletteOrder(l)){const
|
|
1
|
+
export const THEMES=[{id:"charcoal-dark",label:"Charcoal",dark:!0,primary:"#5b8cff",bg:"#1a1d23"},{id:"charcoal-light",label:"Charcoal",dark:!1,primary:"#4a7aff",bg:"#f4f5f7"},{id:"ocean-dark",label:"Ocean",dark:!0,primary:"#00b4d8",bg:"#0d1b2a"},{id:"ocean-light",label:"Ocean",dark:!1,primary:"#0096c7",bg:"#e8f4f8"},{id:"forest-dark",label:"Forest",dark:!0,primary:"#52b788",bg:"#1a231e"},{id:"forest-light",label:"Forest",dark:!1,primary:"#40916c",bg:"#f0f7f4"},{id:"sunset-dark",label:"Sunset",dark:!0,primary:"#ff6b6b",bg:"#1f1a1a"},{id:"sunset-light",label:"Sunset",dark:!1,primary:"#e05555",bg:"#fff0f0"},{id:"royal-dark",label:"Royal",dark:!0,primary:"#9b59b6",bg:"#1a1525"},{id:"royal-light",label:"Royal",dark:!1,primary:"#8e44ad",bg:"#f5f0fa"},{id:"lemon-dark",label:"Lemon",dark:!0,primary:"#f1c40f",bg:"#1a1a10"},{id:"lemon-light",label:"Lemon",dark:!1,primary:"#d4ac0d",bg:"#fffef0"},{id:"silver-dark",label:"Silver",dark:!0,primary:"#95a5a6",bg:"#1c1e20"},{id:"silver-light",label:"Silver",dark:!1,primary:"#7f8c8d",bg:"#f2f3f4"},{id:"grayve-dark",label:"Grayve",dark:!0,primary:"#00bcd4",bg:"#1a1e21"},{id:"grayve-light",label:"Grayve",dark:!1,primary:"#00838f",bg:"#ffffff"},{id:"mint-dark",label:"Mint",dark:!0,primary:"#00c896",bg:"#0f1f1a"},{id:"mint-light",label:"Mint",dark:!1,primary:"#00a878",bg:"#f0faf6"},{id:"unicorn-dark",label:"Unicorn",dark:!0,primary:"#e040fb",bg:"#1a0a1e"},{id:"unicorn-light",label:"Unicorn",dark:!1,primary:"#ba68c8",bg:"#fdf5ff"},{id:"dreamy-dark",label:"Dreamy",dark:!0,primary:"#7986cb",bg:"#15152a"},{id:"dreamy-light",label:"Dreamy",dark:!1,primary:"#5c6bc0",bg:"#f3f4fd"},{id:"christmas-dark",label:"Christmas",dark:!0,primary:"#e53935",bg:"#0a1a0a"},{id:"christmas-light",label:"Christmas",dark:!1,primary:"#c62828",bg:"#f5fff5"},{id:"wedding-dark",label:"Wedding",dark:!0,primary:"#ec407a",bg:"#1a0e14"},{id:"wedding-light",label:"Wedding",dark:!1,primary:"#e91e63",bg:"#fff5f8"},{id:"corporate-dark",label:"Corporate",dark:!0,primary:"#2563eb",bg:"#0b0f19"},{id:"corporate-light",label:"Corporate",dark:!1,primary:"#1e40af",bg:"#f8fafc"},{id:"admin-atelier-dark",label:"Admin Atelier",name:"Dark",admin:!0,dark:!0,primary:"#8fb7d2",bg:"#242526"},{id:"admin-atelier-light",label:"Admin Atelier",name:"Light",admin:!0,dark:!1,primary:"#34546a",bg:"#f5f1e9"},{id:"admin-sharp-indigo",label:"Admin \xB7 Sharp",name:"Indigo",admin:!0,dark:!1,primary:"#5b63a8",bg:"#eef1f6"},{id:"admin-sharp-steel",label:"Admin \xB7 Sharp",name:"Steel",admin:!0,dark:!1,primary:"#3b76bc",bg:"#eef1f6"},{id:"admin-sharp-teal",label:"Admin \xB7 Sharp",name:"Teal",admin:!0,dark:!1,primary:"#2a8178",bg:"#eef1f6"},{id:"admin-slate-indigo",label:"Admin \xB7 Slate",name:"Indigo",admin:!0,dark:!0,primary:"#5b63a8",bg:"#252c37"},{id:"admin-slate-steel",label:"Admin \xB7 Slate",name:"Steel",admin:!0,dark:!0,primary:"#3b76bc",bg:"#252c37"},{id:"admin-slate-teal",label:"Admin \xB7 Slate",name:"Teal",admin:!0,dark:!0,primary:"#2a8178",bg:"#252c37"},{id:"admin-smooth-indigo",label:"Admin \xB7 Smooth",name:"Indigo",admin:!0,dark:!0,primary:"#5b63a8",bg:"#586170"},{id:"admin-smooth-steel",label:"Admin \xB7 Smooth",name:"Steel",admin:!0,dark:!0,primary:"#3b76bc",bg:"#586170"},{id:"admin-smooth-teal",label:"Admin \xB7 Smooth",name:"Teal",admin:!0,dark:!0,primary:"#2a8178",bg:"#586170"}];export function paletteOrder(e){const d=[...new Set(e.map(a=>a.label))],r=a=>a.toLowerCase().startsWith("admin")?1:0;return d.sort((a,l)=>r(a)-r(l)||a.localeCompare(l))}export function themesInDisplayOrder(e=THEMES){const d=paletteOrder(e);return[...e].sort((r,a)=>d.indexOf(r.label)-d.indexOf(a.label)||(r.dark===a.dark?0:r.dark?-1:1))}export function populateThemeSelect(e,{includeDefault:d=!1,defaultLabel:r="Use site default",includeAdmin:a=!1}={}){for(;e.firstChild;)e.removeChild(e.firstChild);if(d){const i=document.createElement("option");i.value="",i.textContent=r,e.appendChild(i)}const l=THEMES.filter(i=>a||!i.admin);for(const i of paletteOrder(l)){const m=document.createElement("optgroup");m.label=i;for(const n of l.filter(t=>t.label===i)){const t=document.createElement("option");t.value=n.id,t.textContent=n.name||`${n.label} ${n.dark?"Dark":"Light"}`,m.appendChild(t)}e.appendChild(m)}}
|
|
@@ -357,6 +357,7 @@ roles and notifications are stamped with it). The sections below cover the main
|
|
|
357
357
|
| `registerLoginCheck({id, phase, check, verify?})` | A sign-in check: `phase: 'before'` (e.g. lockout, before the password is checked) or `'after'` (e.g. two-factor, can ask one more question) (0.83.0) |
|
|
358
358
|
| `registerPasswordCheck({id, check})` | A password rule applied wherever a password is set (0.83.0) |
|
|
359
359
|
| `safeFetch(url, {method, headers, body, timeoutMs, maxBytes, maxRedirects, truncate, signal})` | Fetch an address a site user chose, under the site's outbound rules (`services/outbound.js`): public addresses only, the connection pinned to the checked address, redirects re-checked, ports 80/443; `outboundAllowPrivate` applies on a self-hosted site and never on a signed-only one. Limits default to 1 MB / 15 s / 3 redirects and may be raised to 25 MB / 60 s / 5. Resolves `{ok, status, headers, buffer, text(), json(), url, truncated}`; a refusal rejects with `err.code === 'EREFUSED_SSRF'`. `body` is a string, Buffer or Uint8Array and `headers` a plain object or `Headers`; anything else rejects with a TypeError rather than going out empty. Use it instead of `fetch` for any user-chosen URL. Call it with `?.` - older cores lack it (1.10.31) |
|
|
360
|
+
| `claimHosts(fn)` | `fn(host)` returns `true` for a host this server hands on to another (a proxy - the Manager's site-manager). Core's redirect hooks, which run before plugins' `onRequest` hooks (SEO's rules, the WordPress importer's `/?p=`), then leave that host's requests alone. `host` is lower case with no port. Returns a function that withdraws the claim. Call it with `?.` - older cores lack it |
|
|
360
361
|
| `registerComponent({name, source})` | Add a Domma component from a `.dmc` source string, used on pages as `<dm-name>` or `[component]`; it is listed read-only in Components (0.92.2) |
|
|
361
362
|
|
|
362
363
|
`onEnable` / `onDisable` exports receive `{fastify, services, hooks}` where `hooks` holds only the role and notification
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domma-cms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server/server.js",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"bcryptjs": "^3.0.3",
|
|
87
87
|
"css-select": "^7.0.0",
|
|
88
88
|
"dom-serializer": "^3.1.1",
|
|
89
|
-
"domma-js": "1.0
|
|
89
|
+
"domma-js": "1.1.0",
|
|
90
90
|
"dotenv": "^17.2.3",
|
|
91
91
|
"fastify": "5.12.7",
|
|
92
92
|
"gray-matter": "^4.0.3",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosts another server answers - the Manager's proxied sites.
|
|
3
|
+
*
|
|
4
|
+
* On a Manager, one process receives every hosted site's requests and its site-manager plugin proxies them
|
|
5
|
+
* from an onRequest hook added during registerPlugins(). Core hooks added BEFORE that (SEO's redirects, the
|
|
6
|
+
* WordPress importer's `/?p=` redirects) see those requests first, so the Manager's own redirect rules used to
|
|
7
|
+
* answer other sites' addresses: a rule `/tools -> https://domma-cms.com/tools` on the Manager looped
|
|
8
|
+
* domma-cms.com/tools. A plugin that hands a host on claims it here (`hooks.claimHosts(fn)`), and those core
|
|
9
|
+
* hooks step aside for a claimed host. Nothing else is decided by it - the plugin still does the proxying.
|
|
10
|
+
*
|
|
11
|
+
* @module services/hostClaims
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const claims = new Map();
|
|
15
|
+
|
|
16
|
+
/** The request's host name: lower case, no port (IPv6 brackets kept). */
|
|
17
|
+
export function hostOf(request) {
|
|
18
|
+
const raw = String(request?.headers?.host || '').trim().toLowerCase();
|
|
19
|
+
if (raw.startsWith('[')) return raw.slice(0, raw.indexOf(']') + 1);
|
|
20
|
+
return raw.split(':')[0];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `fn(host)` answers true for a host this server does not answer itself. One per owner; a second call replaces it.
|
|
25
|
+
* Returns a function that withdraws the claim.
|
|
26
|
+
*/
|
|
27
|
+
export function claimHosts(owner, fn) {
|
|
28
|
+
if (typeof fn !== 'function') throw new TypeError('claimHosts needs a function (host) => boolean.');
|
|
29
|
+
const key = String(owner || 'unknown');
|
|
30
|
+
claims.set(key, fn);
|
|
31
|
+
return () => { if (claims.get(key) === fn) claims.delete(key); };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** True when a plugin hands this request's host on - this site's own rules are not for it. Never throws. */
|
|
35
|
+
export function answeredElsewhere(request) {
|
|
36
|
+
if (!claims.size) return false;
|
|
37
|
+
const host = hostOf(request);
|
|
38
|
+
if (!host) return false;
|
|
39
|
+
for (const fn of claims.values()) {
|
|
40
|
+
try { if (fn(host) === true) return true; } catch { /* a broken claim claims nothing */ }
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Tests only. */
|
|
46
|
+
export function _resetHostClaims() { claims.clear(); }
|
|
@@ -39,6 +39,7 @@ import {registerThemeProvider} from './themeSettings.js';
|
|
|
39
39
|
import {classifyEntitlement, mayLoad} from './pluginEntitlement.js';
|
|
40
40
|
import {notifierFor} from './notify.js';
|
|
41
41
|
import {disableInstantCalls, enableInstantCalls, grantInstantCallsOnce} from './instantCalls.js';
|
|
42
|
+
import {claimHosts} from './hostClaims.js';
|
|
42
43
|
import {pluginSafeFetch} from './outbound.js';
|
|
43
44
|
import {disableDashboardPro, enableDashboardPro, registerWidget, unregisterWidgetsFrom} from './widgets.js';
|
|
44
45
|
import {createCollection, getCollection} from './collections.js';
|
|
@@ -573,7 +574,10 @@ export async function registerPlugins(fastify) {
|
|
|
573
574
|
// Direct messages between team members (Messages) - hooks.js 7c; a call's "Add people" uses it.
|
|
574
575
|
registerDirectMessenger: (fn) => registerDirectMessenger(manifest.name, fn),
|
|
575
576
|
// Fetching an address a site user chose (services/outbound.js) - the site's policy, never the plugin's.
|
|
576
|
-
safeFetch: pluginSafeFetch
|
|
577
|
+
safeFetch: pluginSafeFetch,
|
|
578
|
+
// Hosts this plugin hands on to another server (the Manager's site proxy): core's redirect
|
|
579
|
+
// hooks, which run before plugins' onRequest hooks, step aside for them (services/hostClaims.js).
|
|
580
|
+
claimHosts: (fn) => claimHosts(manifest.name, fn)},
|
|
577
581
|
settings,
|
|
578
582
|
config: {}
|
|
579
583
|
});
|
|
@@ -28,6 +28,7 @@ import fp from 'fastify-plugin';
|
|
|
28
28
|
import {createStore} from './store.js';
|
|
29
29
|
import {auditAll, auditOne, AUDIT_UA, fetchLocal, hostOf, scanDetached} from './audit.js';
|
|
30
30
|
import {seoRegistry} from './registry.js';
|
|
31
|
+
import {answeredElsewhere} from '../hostClaims.js';
|
|
31
32
|
import {analyse, scanHtml, siteIssues} from '../../../admin/js/lib/seo-analyse.js';
|
|
32
33
|
import {chains, checkRule, matchRedirect, MAX_RULES, normalisePath, onMoved} from '../../../admin/js/lib/seo-redirects.js';
|
|
33
34
|
import {applySeo, robotsLines} from '../../../admin/js/lib/seo-schema.js';
|
|
@@ -114,6 +115,8 @@ async function seo(fastify, {enabled = true, getBaseUrl = null, rolesService = n
|
|
|
114
115
|
if (request.method !== 'GET' && request.method !== 'HEAD') return;
|
|
115
116
|
const url = String(request.url || '');
|
|
116
117
|
if (SKIP.test(url)) return;
|
|
118
|
+
// Another site's request passing through (the Manager's proxy): this site's rules are not for it.
|
|
119
|
+
if (answeredElsewhere(request)) return;
|
|
117
120
|
const rules = store.rules();
|
|
118
121
|
if (!rules.length) return;
|
|
119
122
|
const hit = matchRedirect(rules, url);
|
|
@@ -111,22 +111,31 @@ export function defaultThemeConfig() {
|
|
|
111
111
|
// ---------------------------------------------------------------------------
|
|
112
112
|
|
|
113
113
|
let _cssCache = null;
|
|
114
|
+
let _cssStamp = null;
|
|
114
115
|
|
|
115
116
|
function readThemeStylesheet() {
|
|
116
|
-
if (_cssCache !== null) return _cssCache;
|
|
117
117
|
for (const file of THEME_CSS_CANDIDATES) {
|
|
118
118
|
try {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
const stat = fsSync.statSync(file);
|
|
120
|
+
const stamp = `${file}:${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`;
|
|
121
|
+
if (_cssCache !== null && _cssStamp === stamp) return _cssCache;
|
|
122
|
+
const css = fsSync.readFileSync(file, 'utf8');
|
|
123
|
+
invalidateThemeStylesheet();
|
|
124
|
+
_cssCache = css;
|
|
125
|
+
_cssStamp = stamp;
|
|
126
|
+
return css;
|
|
121
127
|
} catch { /* try the next candidate */ }
|
|
122
128
|
}
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
// A package can disappear briefly while an upgrade replaces it. Do not
|
|
130
|
+
// retain ids from the old file, or permanently cache an empty catalogue.
|
|
131
|
+
invalidateThemeStylesheet();
|
|
132
|
+
return '';
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
/** Drop the memoised stylesheet - after an upgrade, or in tests. */
|
|
128
136
|
export function invalidateThemeStylesheet() {
|
|
129
137
|
_cssCache = null;
|
|
138
|
+
_cssStamp = null;
|
|
130
139
|
_themeIdCache = null;
|
|
131
140
|
_tokenNameCache = null;
|
|
132
141
|
}
|
|
@@ -139,8 +148,8 @@ let _themeIdCache = null;
|
|
|
139
148
|
* @returns {string[]}
|
|
140
149
|
*/
|
|
141
150
|
export function listThemeIds() {
|
|
142
|
-
if (_themeIdCache) return _themeIdCache;
|
|
143
151
|
const css = readThemeStylesheet();
|
|
152
|
+
if (_themeIdCache) return _themeIdCache;
|
|
144
153
|
const ids = new Set();
|
|
145
154
|
for (const m of css.matchAll(/^\.dm-theme-([a-z0-9-]+)\s*\{/gm)) ids.add(m[1]);
|
|
146
155
|
_themeIdCache = [...ids];
|
|
@@ -157,8 +166,8 @@ let _tokenNameCache = null;
|
|
|
157
166
|
* @returns {string[]}
|
|
158
167
|
*/
|
|
159
168
|
export function listThemeTokens() {
|
|
160
|
-
if (_tokenNameCache) return _tokenNameCache;
|
|
161
169
|
const css = readThemeStylesheet();
|
|
170
|
+
if (_tokenNameCache) return _tokenNameCache;
|
|
162
171
|
const names = new Set();
|
|
163
172
|
for (const m of css.matchAll(/(--dm-[a-z0-9-]+)\s*:/g)) names.add(m[1]);
|
|
164
173
|
_tokenNameCache = [...names].sort();
|
|
@@ -91,6 +91,7 @@ import {readWie, widgetAreaHtml, WIE_MAX_BYTES} from './widgets.js';
|
|
|
91
91
|
import {FOOTER_BLOCKS_MAX} from '../renderer.js';
|
|
92
92
|
import {allowInGitignore} from '../siteGitignore.js';
|
|
93
93
|
import fsSync from 'node:fs';
|
|
94
|
+
import {answeredElsewhere} from '../hostClaims.js';
|
|
94
95
|
|
|
95
96
|
export const WXR_MAX_BYTES = 50 * 1024 * 1024;
|
|
96
97
|
export const UPLOADS_ZIP_MAX_BYTES = 1024 * 1024 * 1024;
|
|
@@ -1667,6 +1668,7 @@ async function wordpressQueryRedirects(fastify) {
|
|
|
1667
1668
|
if (q === -1) return;
|
|
1668
1669
|
const p = url.slice(0, q);
|
|
1669
1670
|
if (p !== '/' && p !== '/index.php') return;
|
|
1671
|
+
if (answeredElsewhere(request)) return; // another site's request on its way through the Manager
|
|
1670
1672
|
let params;
|
|
1671
1673
|
try { params = new URLSearchParams(url.slice(q + 1)); } catch { return; }
|
|
1672
1674
|
for (const name of QUERY_PARAMS) {
|