chore: checkpoint turso and ai runtime work

This commit is contained in:
Agent Board
2026-07-03 23:20:16 +08:00
parent a75b3d11f9
commit 36d027a4a1
67 changed files with 4224 additions and 914 deletions
+14 -3
View File
@@ -24,7 +24,8 @@ const BUILD_CACHE_DIR = path.join(ROOT, "dist", "prod-build-cache", "mnote-web")
const RUN_DIR = path.join(ROOT, "dist", "run", "mnote-web-prod");
const RUN_STATE_PATH = path.join(RUN_DIR, "process.json");
const DEFAULT_PORT = 3003;
const DEFAULT_CONTROL_PLANE_DB = "/mnt/Data1T/Mnote_data/control-plane/control-plane.db";
const DEFAULT_TURSO_LOCAL_PATH = "/mnt/Data1T/Mnote_data/control-plane/control-plane-prod-libsql.db";
const DEFAULT_CONTROL_PLANE_BACKEND = "libsql-local";
const ENV_ALL_PATH = path.join(ROOT, ".env.all");
const RELEASE_BUILD_SCHEMA = "mnote-web-prod-runtime-assets-v2";
const SUPPLEMENTAL_RUNTIME_ASSETS = [
@@ -529,6 +530,11 @@ async function startRelease(release) {
const logFd = fs.openSync(logPath, "a");
const bind = process.env.MNOTE_WEB_BIND || `0.0.0.0:${port}`;
const publicBind = process.env.MNOTE_WEB_PUBLIC_BIND || defaultPublicBind(port);
const controlPlaneBackend =
process.env.MNOTE_CONTROL_PLANE_BACKEND || DEFAULT_CONTROL_PLANE_BACKEND;
if (controlPlaneBackend === "sqlite") {
throw new Error("prod runtime 不再支持 SQLite control-plane fallback;请使用 libsql-local/turso-remote/turso-local-replica/turso-synced");
}
const child = spawn(binaryPath, [], {
cwd: release.metadata?.sourceDir || release.releaseDir,
@@ -538,8 +544,13 @@ async function startRelease(release) {
...process.env,
MNOTE_WEB_BIND: bind,
MNOTE_WEB_PUBLIC_BIND: publicBind,
MNOTE_CONTROL_PLANE_DB_PATH:
process.env.MNOTE_CONTROL_PLANE_DB_PATH || DEFAULT_CONTROL_PLANE_DB,
MNOTE_CONTROL_PLANE_BACKEND: controlPlaneBackend,
...(controlPlaneBackend === "libsql-local" || controlPlaneBackend === "turso-local" || controlPlaneBackend === "turso"
? {
MNOTE_TURSO_LOCAL_PATH:
process.env.MNOTE_TURSO_LOCAL_PATH || DEFAULT_TURSO_LOCAL_PATH,
}
: {}),
},
});