Add `SOCKET_MODE`, `SOCKET_USER` and `SOCKET_GROUP` in addition to `SOCKET_PATH` to adapter-node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
I'm struggling with sharing sveltekit app's socket with a web server.
Describe the proposed solution
Most daemons nowadays allow you to customize socket permissions and ownership via flags. Add SOCKET_MODE, SOCKET_USER and SOCKET_GROUP environment variables
Alternatives considered
One way would be to add web server to the app's linux group but that way the web server will be able to read more than just the socket.
Importance
would make my life easier
Additional Information
Looks like adapter-node uses polka to serve http requests.
Which uses nodejs's http server.listen function which accepts the path to unix socket to create it
https://nodejs.org/docs/v22.19.0/api/net.html#serverlistenoptions-callback
I couldn't find any info on how to change permission/ownership for it. I did try to change ownership and permissions manually after starting the app but it keeps resetting it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/adapter-node/src/index.js around the referenced server.listen call, then read Node.js net.Server.listen options documentation. Trace how SOCKET_PATH is handled and determine how the three requested environment variables should map to Unix socket permissions and ownership. Done means adapter-node supports the variables without regressing existing socket behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100