Port envd from e2b with internalized shared packages and Connect RPC
- Copy envd source from e2b-dev/infra, internalize shared dependencies
into envd/internal/shared/ (keys, filesystem, id, smap, utils)
- Switch from gRPC to Connect RPC for all envd services
- Update module paths to git.omukk.dev/wrenn/{sandbox,sandbox/envd}
- Add proto specs (process, filesystem) with buf-based code generation
- Implement full envd: process exec, filesystem ops, port forwarding,
cgroup management, MMDS integration, and HTTP API
- Update main module dependencies (firecracker SDK, pgx, goose, etc.)
- Remove placeholder .gitkeep files replaced by real implementations
This commit is contained in:
37
envd/internal/execcontext/context.go
Normal file
37
envd/internal/execcontext/context.go
Normal file
@ -0,0 +1,37 @@
|
||||
package execcontext
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.omukk.dev/wrenn/sandbox/envd/internal/utils"
|
||||
)
|
||||
|
||||
type Defaults struct {
|
||||
EnvVars *utils.Map[string, string]
|
||||
User string
|
||||
Workdir *string
|
||||
}
|
||||
|
||||
func ResolveDefaultWorkdir(workdir string, defaultWorkdir *string) string {
|
||||
if workdir != "" {
|
||||
return workdir
|
||||
}
|
||||
|
||||
if defaultWorkdir != nil {
|
||||
return *defaultWorkdir
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func ResolveDefaultUsername(username *string, defaultUsername string) (string, error) {
|
||||
if username != nil {
|
||||
return *username, nil
|
||||
}
|
||||
|
||||
if defaultUsername != "" {
|
||||
return defaultUsername, nil
|
||||
}
|
||||
|
||||
return "", errors.New("username not provided")
|
||||
}
|
||||
Reference in New Issue
Block a user