diff --git a/crates/churn/src/agent/plugins.rs b/crates/churn/src/agent/plugins.rs index fa115c1..6a3651a 100644 --- a/crates/churn/src/agent/plugins.rs +++ b/crates/churn/src/agent/plugins.rs @@ -6,7 +6,7 @@ use tokio::io::AsyncWriteExt; use tokio::sync::Mutex; use wasmtime::component::*; use wasmtime::{Config, Engine, Store}; -use wasmtime_wasi::{WasiCtx, WasiCtxBuilder, WasiView}; +use wasmtime_wasi::{DirPerms, FilePerms, WasiCtx, WasiCtxBuilder, WasiView}; wasmtime::component::bindgen!({ path: "wit/world.wit", @@ -144,7 +144,14 @@ struct ServerWasiView { impl ServerWasiView { fn new() -> Self { let table = ResourceTable::new(); - let ctx = WasiCtxBuilder::new().inherit_stdio().build(); + + let ctx = WasiCtxBuilder::new() + .inherit_stdio() + .inherit_env() + .inherit_network() + .preopened_dir("/", "/", DirPerms::all(), FilePerms::all()) + .expect("to be able to open root") + .build(); Self { table, ctx } }