- 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
31 lines
757 B
Go
31 lines
757 B
Go
package process
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"connectrpc.com/connect"
|
|
"github.com/creack/pty"
|
|
|
|
rpc "git.omukk.dev/wrenn/sandbox/envd/internal/services/spec/process"
|
|
)
|
|
|
|
func (s *Service) Update(_ context.Context, req *connect.Request[rpc.UpdateRequest]) (*connect.Response[rpc.UpdateResponse], error) {
|
|
proc, err := s.getProcess(req.Msg.GetProcess())
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if req.Msg.GetPty() != nil {
|
|
err := proc.ResizeTty(&pty.Winsize{
|
|
Rows: uint16(req.Msg.GetPty().GetSize().GetRows()),
|
|
Cols: uint16(req.Msg.GetPty().GetSize().GetCols()),
|
|
})
|
|
if err != nil {
|
|
return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("error resizing tty: %w", err))
|
|
}
|
|
}
|
|
|
|
return connect.NewResponse(&rpc.UpdateResponse{}), nil
|
|
}
|