Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions runtime/wasmhost/wasmhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"crypto/rand"
"fmt"
"io"
"os"
"strings"

"github.com/hypermodeinc/modus/runtime/functions"
"github.com/hypermodeinc/modus/runtime/logger"
Expand Down Expand Up @@ -135,6 +137,15 @@ func (host *wasmHost) GetModuleInstance(ctx context.Context, plugin *plugins.Plu
WithEnv("TZ", timeZone).
WithEnv("CLAIMS", jwtClaims)

for _, env := range os.Environ() {
split := strings.SplitN(env, "=", 2)
key, val := split[0], split[1]
if strings.HasPrefix(key, "MODUS_") {
// Remove the MODUS_ prefix
cfg = cfg.WithEnv(key[6:], val)
}
}

// Instantiate the plugin as a module.
// NOTE: This will also invoke the plugin's `_start` function,
// which will call any top-level code in the plugin.
Expand Down
Loading