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
{{ message }}
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
[[module]]
# Mount this to example.com/envroute = "/env"# Point to the directory that 'cargo build' wrote the WASM filemodule = "/path/to/env_wagi/target/wasm32-wasi/release/env_wagi.wasm"# Mount the source code of this repovolumes = { "/" = "/path/to/env_wagi" }
# Set an environment variableenvironment.TEST_NAME = "test value"
But it does not work on 0.3.0, any clue?
pubstructModule{/// The route, begining with a leading slash.////// The suffix "/..." means "this route and all sub-paths". For example, the route/// "/foo/..." will match "/foo" as well as "/foo/bar" and "/foo/bar/baz"pubroute:String,/// The path to the module that will be loaded.////// This should be an absolute path. It must point to a WASM+WASI 32-bit program/// with the read bit set.pubmodule:String,/// Directories on the local filesystem that can be opened by this module/// The key (left value) is the name of the directory INSIDE the WASM. The value is/// the location OUTSIDE the WASM. Two inside locations can map to the same outside/// location.pubvolumes:Option<HashMap<String,String>>,/// The name of the function that is the entrypoint for executing the module./// The default is `_start`.pubentrypoint:Option<String>,/// The URL fragment for the bindle server.////// If none is supplied, then http://localhost:8080/v1 is usedpubbindle_server:Option<String>,/// List of hosts that the guest module is allowed to make HTTP requests to./// If none or an empty vector is supplied, the guest module cannot send/// requests to any server.puballowed_hosts:Option<Vec<String>>,/// Max http concurrency that the guest module configures for the HTTP/// client. If none, the guest module uses the default concurrency provided/// by the WASM HTTP client module.pubhttp_max_concurrency:Option<u32>,}
wagi --envis good for global env vars for all modules, but for some cases, I need to inject some secret vars for a Wasm module only, not for all modules. I found the example from https://github.com/deislabs/wagi-examples/tree/main/env_wagiBut it does not work on 0.3.0, any clue?