Skip to content

Commit

Permalink
add read access to the npm cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Jan 9, 2025
1 parent 375f6a1 commit 20ca4fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")),
)
}
Expand Down

0 comments on commit 20ca4fb

Please sign in to comment.