refactor: modularize portal server and harden session recovery

This commit is contained in:
john
2026-07-24 18:39:24 +08:00
parent 1d291fd528
commit 785731d98d
109 changed files with 29185 additions and 5836 deletions
+14
View File
@@ -12,10 +12,24 @@ import {
resolveMindSpaceServerRuntimeOptions,
resolveMindSpaceStorageRoot,
resolveMindSpaceUserPublishDir,
resolvePortalH5Root,
resolveWorkspaceMindSpacePublicUrl,
isPublicWorkspaceHtmlRelativePath,
} from './mindspace-runtime-config.mjs';
test('resolvePortalH5Root decouples persistent workspace data from the code directory', () => {
assert.equal(
resolvePortalH5Root('/private/tmp/memind-worktree', {
MEMIND_PORTAL_H5_ROOT: '/Users/john/Project/Memind',
}),
path.resolve('/Users/john/Project/Memind'),
);
assert.equal(
resolvePortalH5Root('/private/tmp/memind-worktree', {}),
path.resolve('/private/tmp/memind-worktree'),
);
});
test('resolveMindSpaceStorageRoot uses env override when present', () => {
const root = resolveMindSpaceStorageRoot('/tmp/h5', { MINDSPACE_STORAGE_ROOT: '/srv/mindspace-data' });
assert.equal(root, path.resolve('/srv/mindspace-data'));