Harden auth/vault path sanitization and clean WeKnora docs
This commit is contained in:
+6
-7
@@ -4,12 +4,11 @@
|
||||
/**
|
||||
* dev:hot 启动入口。
|
||||
*
|
||||
* 目标:
|
||||
* - 不改动 desktop:hot 的默认行为。
|
||||
* - 使用 cargo-watch 自动重编译并重启 mnote-web。
|
||||
* - 通过 MNOTE_WEB_DEV_HOT_RELOAD 启用页面端轻量 reload 轮询。
|
||||
* - 默认启用 MNOTE_WEB_ALLOW_DEV_FIXTURES,保证依赖 /api/dev/seed 的 smoke 可直接运行;
|
||||
* 可显式设为 0 关闭,desktop:hot / prod:start 仍保持默认关闭。
|
||||
* 可显式设为 0 关闭;prod:start 保持关闭。
|
||||
* - 实际进程编排在 scripts/mnote-web-hot.js。
|
||||
*/
|
||||
|
||||
const { spawn } = require("node:child_process");
|
||||
@@ -17,7 +16,7 @@ const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const rootDir = path.resolve(__dirname, "..");
|
||||
const desktopHotPath = path.join(rootDir, "scripts", "desktop-hot.js");
|
||||
const hotPath = path.join(rootDir, "scripts", "mnote-web-hot.js");
|
||||
|
||||
function cargoWatchCommand(env = process.env) {
|
||||
const extraArgs = String(env.MNOTE_WEB_DEV_HOT_CARGO_WATCH_ARGS || "").trim();
|
||||
@@ -91,11 +90,11 @@ function buildDevHotEnv(baseEnv = process.env) {
|
||||
}
|
||||
|
||||
function main() {
|
||||
if (!fs.existsSync(desktopHotPath)) {
|
||||
throw new Error(`缺少 desktop-hot 入口:${desktopHotPath}`);
|
||||
if (!fs.existsSync(hotPath)) {
|
||||
throw new Error(`缺少 mnote-web-hot 入口:${hotPath}`);
|
||||
}
|
||||
|
||||
const child = spawn(process.execPath, [desktopHotPath], {
|
||||
const child = spawn(process.execPath, [hotPath], {
|
||||
cwd: rootDir,
|
||||
env: buildDevHotEnv(process.env),
|
||||
stdio: "inherit",
|
||||
|
||||
Reference in New Issue
Block a user