fix(mindspace): keep standalone service data paths under MindSpace root

Prevent Portal .env from overriding MindSpace storage/users roots, and
set launchd env plus runtime docs to use /Users/john/MindSpace paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-12 18:06:16 +08:00
parent f9561cd91d
commit 67d529c81e
3 changed files with 49 additions and 4 deletions
@@ -279,6 +279,10 @@ cat > "${SERVICE_PLIST}" <<EOF
<string>8082</string>
<key>MINDSPACE_SERVICE_HOST</key>
<string>127.0.0.1</string>
<key>MINDSPACE_STORAGE_ROOT</key>
<string>${APP_DIR}/data/mindspace</string>
<key>H5_USERS_ROOT</key>
<string>${APP_DIR}/users</string>
<key>MINDSPACE_SERVICE_AGENT_WORKER_ENABLED</key>
<string>true</string>
<key>MINDSPACE_SERVICE_WORKSPACE_MAINTENANCE</key>
@@ -306,6 +310,7 @@ mv "${NEW_DIR}" "${APP_DIR}"
APP_MOVED=1
say "启动 MindSpace service"
mkdir -p "${APP_DIR}/data/mindspace" "${APP_DIR}/users"
launchctl bootstrap "${LAUNCHD_GUI}" "${SERVICE_PLIST}" >/dev/null 2>&1 || true
launchctl enable "${LAUNCHD_GUI}/${SERVICE_LABEL}" >/dev/null 2>&1 || true
launchctl kickstart -k "${LAUNCHD_GUI}/${SERVICE_LABEL}" >/dev/null 2>&1 || true