From 3409a1215e20cc54727b40a73fc4e1b9893040ac Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 11 Jul 2022 13:50:55 +0200 Subject: [PATCH] FS syscalls require "fs" permission --- packages/server/express_server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/server/express_server.ts b/packages/server/express_server.ts index ba8f387..e153cc2 100644 --- a/packages/server/express_server.ts +++ b/packages/server/express_server.ts @@ -113,10 +113,7 @@ export class ExpressServer { // The cron hook this.system.addHook(new NodeCronHook()); - // Register syscalls available on the server sid - this.system.registerSyscalls(["shell"], shellSyscalls(options.pagesPath)); - // YOLO - this.system.registerSyscalls([], fileSystemSyscalls("/")); + // Register syscalls available on the server side this.system.registerSyscalls( [], pageIndexSyscalls(this.db), @@ -129,6 +126,9 @@ export class ExpressServer { sandboxSyscalls(this.system), jwtSyscalls() ); + // Danger zone + this.system.registerSyscalls(["shell"], shellSyscalls(options.pagesPath)); + this.system.registerSyscalls(["fs"], fileSystemSyscalls("/")); // Register the HTTP endpoint hook (with "/_/"" prefix, hardcoded for now) this.system.addHook(new EndpointHook(this.app, "/_"));