- 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
30 lines
717 B
Go
30 lines
717 B
Go
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"git.omukk.dev/wrenn/sandbox/envd/internal/logs"
|
|
)
|
|
|
|
func (a *API) GetEnvs(w http.ResponseWriter, _ *http.Request) {
|
|
operationID := logs.AssignOperationID()
|
|
|
|
a.logger.Debug().Str(string(logs.OperationIDKey), operationID).Msg("Getting env vars")
|
|
|
|
envs := make(EnvVars)
|
|
a.defaults.EnvVars.Range(func(key, value string) bool {
|
|
envs[key] = value
|
|
|
|
return true
|
|
})
|
|
|
|
w.Header().Set("Cache-Control", "no-store")
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
if err := json.NewEncoder(w).Encode(envs); err != nil {
|
|
a.logger.Error().Err(err).Str(string(logs.OperationIDKey), operationID).Msg("Failed to encode env vars")
|
|
}
|
|
}
|