From 20ca4fb246c0a94ca2d9f07f8c64c44de1f14df2 Mon Sep 17 00:00:00 2001 From: pomdtr Date: Thu, 9 Jan 2025 22:07:03 +0100 Subject: [PATCH] add read access to the npm cache dir --- worker/worker.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/worker.go b/worker/worker.go index 82688de..1c63f91 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -120,6 +120,7 @@ func (me *Worker) DenoArgs(a app.App, deno string, allowRun ...string) []string } args = append(args, a.Config.DenoArgs...) + npmCache := filepath.Join(xdg.CacheHome, "smallweb", "deno", "npm", "registry.npmjs.org") if a.Admin { args = append( @@ -146,13 +147,13 @@ func (me *Worker) DenoArgs(a app.App, deno string, allowRun ...string) []string args = append( args, - fmt.Sprintf("--allow-read=%s,%s,%s,%s", root, target, sandboxPath, deno), + fmt.Sprintf("--allow-read=%s,%s,%s,%s,%s", root, target, sandboxPath, deno, npmCache), fmt.Sprintf("--allow-write=%s,%s", filepath.Join(root, "data"), filepath.Join(target, "data")), ) } else { args = append( args, - fmt.Sprintf("--allow-read=%s,%s,%s", root, sandboxPath, deno), + fmt.Sprintf("--allow-read=%s,%s,%s,%s", root, sandboxPath, deno, npmCache), fmt.Sprintf("--allow-write=%s", filepath.Join(root, "data")), ) }