You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a home lab server monitoring app with Deno so I need to grab some system metrics. I found a library which gives me APIs to access system metrics which aren't provided my native Deno APIs. I'm trying to access the battery info but it's not working if I don't use --allow-all permissions. This is because the library is basically reading this file on linux: /sys/class/power_supply/BAT0/uevent. So, giving just read permission for that file doesn't seem to work (I suspect because it's inside a virtual filesystem but I don't have enough linux expertise to be certain).
limited replication
Try running this code without giving --allow-all permission acces
I get this error message when it tries to read that file (works fine if I do --allow-all)
error: Uncaught (in promise) NotCapable: Requires all access to "/sys/class/power_supply/BAT0/uevent", specify the required permissions during compilation using `deno compile --allow-all`
at Object.readFile (ext:deno_fs/30_fs.js:753:24)
at getBatteryStats (file:///tmp/deno-compile-agent/server-monitor-app/agent/main.ts:32:39)
at Object.runMicrotasks (ext:core/01_core.js:683:26)
at Array.processTicksAndRejections (ext:deno_node/_next_tick.ts:59:10)
at eventLoopTick (ext:core/01_core.js:172:29)
at async getMetrics (file:///tmp/deno-compile-agent/server-monitor-app/agent/main.ts:43:14)
at async file:///tmp/deno-compile-agent/server-monitor-app/agent/main.ts:89:19
The text was updated successfully, but these errors were encountered:
Similarly, writing to /dev/stdout seems to require --allow-all.
$ deno repl --allow-write=/dev/stdout
Deno 2.1.4
exit using ctrl+d, ctrl+c, or close()
> await Deno.writeTextFile('/dev/stdout', 'hello world')
Uncaught NotCapable: Requires all access to "/dev/stdout", run again with the --allow-all flag
at writeFile (ext:deno_fs/30_fs.js:841:13)
at Object.writeTextFile (ext:deno_fs/30_fs.js:883:12)
at <anonymous>:1:33
I'd like to run commands that accept an output file path, and sometimes I want that "output file" to be /dev/stdout, which requires me to pass --allow-all (since --allow-all=/dev/stdout is not allowed).
version info
deno 2.1.4 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
context
I'm trying to create a home lab server monitoring app with Deno so I need to grab some system metrics. I found a library which gives me APIs to access system metrics which aren't provided my native Deno APIs. I'm trying to access the battery info but it's not working if I don't use --allow-all permissions. This is because the library is basically reading this file on linux: /sys/class/power_supply/BAT0/uevent. So, giving just read permission for that file doesn't seem to work (I suspect because it's inside a virtual filesystem but I don't have enough linux expertise to be certain).
limited replication
Try running this code without giving --allow-all permission acces
error messages
I get this error message when it tries to read that file (works fine if I do --allow-all)
The text was updated successfully, but these errors were encountered: