diff --git a/server/src/nest/plugins/paths.ts b/server/src/nest/plugins/paths.ts index 93945f73e..93ec768d5 100644 --- a/server/src/nest/plugins/paths.ts +++ b/server/src/nest/plugins/paths.ts @@ -182,6 +182,8 @@ export function pluginPermissionArgs(pluginId: string): string[] { const codeRoot = serverCodeRoot(); return [ '--permission', + // Built-in SQLite is outside Node's filesystem allowlist. Plugins use ctx.db. + '--no-experimental-sqlite', `--allow-fs-read=${codeRoot}`, // The server package.json sits one level above dist and Node reads it to // resolve the child's module type. Grant just that file — never its dir, diff --git a/server/tests/unit/plugins/protocol-paths.test.ts b/server/tests/unit/plugins/protocol-paths.test.ts index 13a1de712..c8d4c416c 100644 --- a/server/tests/unit/plugins/protocol-paths.test.ts +++ b/server/tests/unit/plugins/protocol-paths.test.ts @@ -82,6 +82,7 @@ describe('paths', () => { delete process.env.TREK_PLUGIN_PERMISSIONS; const args = pluginPermissionArgs('flight-tracker'); expect(args).toContain('--permission'); + expect(args).toContain('--no-experimental-sqlite'); // read is scoped to the compiled server dir + this plugin's own code dir… expect(args.some((a) => a === `--allow-fs-read=${serverCodeRoot()}`)).toBe(true); expect(args.some((a) => a === `--allow-fs-read=${pluginCodeDir('flight-tracker')}`)).toBe(true);