levix-bot 2.1.1 → 2.2.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/README.md +3 -1
- package/app.cjs +13 -5
- package/package.json +1 -1
- package/public/dashboard.css +2167 -519
- package/public/dashboard.js +100 -36
- package/scheduler.cjs +84 -17
- package/src/bootstrap/core.js +17 -11
- package/src/bootstrap/session-startup-policy.js +23 -0
- package/src/commands/autoschedule.cjs +19 -42
- package/src/config/ai-identity.cjs +4 -3
- package/src/config/brand.cjs +3 -0
- package/src/db/db.cjs +8 -0
- package/src/db/store.cjs +25 -5
- package/src/routes/dashboard.api.esm.js +60 -3
- package/src/utils/recurrence.cjs +161 -0
- package/src/utils/storage.cjs +1 -0
- package/src/utils/storage.esm.js +1 -0
- package/views/dashboard.ejs +464 -94
- package/views/login.ejs +50 -86
- package/views/qr.ejs +51 -53
- package/views/setup.ejs +67 -110
package/README.md
CHANGED
|
@@ -54,7 +54,9 @@ is a Markdown file you can edit from the panel.
|
|
|
54
54
|
per-chat file. Plain Markdown, hand-editable, injected into every prompt.
|
|
55
55
|
|
|
56
56
|
**Scheduled messages** — one-off (`!schedule`) or recurring (`!autoschedule`),
|
|
57
|
-
|
|
57
|
+
including daily and weekly schedules with Arabic or English day names. Jobs
|
|
58
|
+
survive restarts; their latest delivery result is shown in the panel, where a
|
|
59
|
+
failed message can be retried manually.
|
|
58
60
|
|
|
59
61
|
**Optional proxy** — Settings → WhatsApp proxy routes the WhatsApp connection
|
|
60
62
|
through an HTTP, HTTPS or SOCKS5 proxy, including the media it sends and
|
package/app.cjs
CHANGED
|
@@ -41,11 +41,11 @@ function isAllowedOrigin(origin, host) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Browsers may legitimately serialize the Origin header as the literal string
|
|
44
|
-
// "null" for a same-origin navigation in an opaque-origin context.
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
|
|
44
|
+
// "null" for a same-origin navigation in an opaque-origin context. Prefer
|
|
45
|
+
// Fetch Metadata when the browser sends it. Some Chromium form navigations omit
|
|
46
|
+
// Sec-Fetch-Site entirely, so only the two credential-gated auth forms get a
|
|
47
|
+
// narrow fallback for Origin:null; every other mutation remains strict.
|
|
48
|
+
const OPAQUE_ORIGIN_AUTH_PATHS = new Set(["/setup", "/login"]);
|
|
49
49
|
function isAllowedMutationRequest(req) {
|
|
50
50
|
const origin = req.get("origin");
|
|
51
51
|
const host = req.get("host");
|
|
@@ -58,6 +58,14 @@ function isAllowedMutationRequest(req) {
|
|
|
58
58
|
if (fetchSite === "same-origin") return true;
|
|
59
59
|
if (fetchSite === "cross-site") return false;
|
|
60
60
|
|
|
61
|
+
// Real Chromium can submit a top-level auth form with Origin:null and no
|
|
62
|
+
// Sec-Fetch-Site header. Setup is still protected by the one-time setup code
|
|
63
|
+
// for remote clients; login by the password; both share TCP-peer throttling.
|
|
64
|
+
// Do not generalize this exception to dashboard APIs or logout.
|
|
65
|
+
if (origin === "null" && !fetchSite && OPAQUE_ORIGIN_AUTH_PATHS.has(req.path)) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
return isAllowedOrigin(origin, host);
|
|
62
70
|
}
|
|
63
71
|
|