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.
|
server.listen({ path, host, port }, () => { |
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.
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_USERandSOCKET_GROUPenvironment variablesAlternatives 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.
kit/packages/adapter-node/src/index.js
Line 41 in 0afc71d
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.