Skip to content

Let envd listen on a Unix socket - #118

Open
cptspacemanspiff wants to merge 1 commit into
smartcomputer-ai:mainfrom
cptspacemanspiff:envd-unix-listener
Open

cptspacemanspiff wants to merge 1 commit into
smartcomputer-ai:mainfrom
cptspacemanspiff:envd-unix-listener

Conversation

@cptspacemanspiff

@cptspacemanspiff cptspacemanspiff commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

I have started working on a new environment provider wrapping SmolVM (I want to have something I can run cross-platform, and that seems to have that abstraction, and on user machines). As part of this I want to have the ability to fully lock-down the VM's network access, so envd only allowing TCP endpoints is an issue. To solve this I add the ability to use a unix domain socket as the endpoint, which a VM runtime can connect to from the other side.

For context here is the current (rough) additional provider: https://github.com/cptspacemanspiff/lightspeed-provider-smolvm

The only thing not directly related to unix domain socket, addition was that instead of crashing envd on 'out of file descriptors' or 'connect' errors, there is a sleep + error log, so that deamon and it's existing session connections won't get killed if there is something goes wrong with a new connection.

From Claude:

A host that reaches the daemon over a local bridge rather than the network, such as a microVM whose socket is relayed over vsock, needs envd to serve a Unix socket. LIGHTSPEED_ENVD_LISTEN (--listen) now accepts unix:///absolute/path alongside host:port and tcp://host:port.

Changes

  • The daemon creates the socket's parent directory, binds the socket and restricts it to its own user (0600).
  • A socket left behind by an earlier run is replaced only when connecting to it is refused; a live listener, a socket the daemon cannot probe, or any other file at the path is left alone.
  • Accept errors on the TCP and Unix listeners are logged and the listener keeps serving instead of stopping the daemon.
  • environment-variables.md documents the new unix:// form.

🤖 Generated with Claude Code

@cptspacemanspiff
cptspacemanspiff marked this pull request as ready for review October 13, 2026 01:16
A host that reaches the daemon over a local bridge rather than the
network, such as a microVM whose socket is relayed over vsock, needs envd
to serve a Unix socket. LIGHTSPEED_ENVD_LISTEN (--listen) now accepts
unix:///absolute/path alongside host:port and tcp://host:port.

- The daemon creates the socket's parent directory, binds the socket and
  restricts it to its own user (0600).
- A socket left behind by an earlier run is replaced only when connecting
  to it is refused; a live listener, a socket the daemon cannot probe, or
  any other file at the path is left alone.
- Accept errors on the TCP and Unix listeners are logged and the listener
  keeps serving instead of stopping the daemon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nicholas Long <19273992+cptspacemanspiff@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant