Skip to content

Add SOCKET_MODE, SOCKET_USER and SOCKET_GROUP in addition to SOCKET_PATH to adapter-node #14488

@VityaSchel

Description

@VityaSchel

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions