Open bryfry opened 3 years ago
The underlying websocket feature (and unix socket) is based on libwebsockets, so if libwebsocket support it (didn't check yet), I'm OK to add it to ttyd.
I had the same or similar issue and solved it by having ttyd executed as user exampleuser
and group www-data
through a systemd service.
An example of this service can be found in the wiki here.
Instead of Group=root
you could use Group=www-data
.
When ttyd is called with -i /tmp/ttyd.sock
the socket file with have rw
permissions for user exampleuser
and group www-data
.
A solution is building docker image by yourself.
Like this https://github.com/xfl12345/docker-setup/tree/1e994e5d8bb17c1117061864e01dc7cf3b4b1bab/compose/standalone/ttyd
Is your feature request related to a problem? Please describe. I have a command that I want to run as root wrapped up by ttyd but I'd like nginx user (www-data) to be able to access the unix socket created by ttyd.
Describe the solution you'd like This would be made possible by allowing the permissions (owner:group) for the newly created ttyd socket file.
Describe alternatives you've considered I've worked around this issue by modifying the permissions of the socket after it comes online.
Additional context I'm a huge fan of the unix socket interface. This was only a minor inconvenience in an otherwise awesome experience getting ttyd setup to accomplish my project needs.