mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-25 14:11:40 +00:00
This allows configuring the group and mode of the unix socket after it has been created to allow reverse proxies to access it. Fixes #317. I decided to call `chown` and `chgrp` directly to change the owner and group (the former will almost definitely not be called; only root can chown a file to another user, and you are not running codimd as root. It is included for consistency). The nodejs chown/chgrp functions only accepts uid and gid, not the names of the user or group. The standard way to convert a group name into a gid is the `uid-number` package. The way this package works is that 1. It spawns a new nodejs process 2. The new nodejs process calls nodejs' setgid function, which *does* accept both the group name and gid 3. It then calls getuid to retrieve the uid of the process, and returns it to the parent process via stdout. While this *works*, it is hacky, and if we are spawning a process anyway, might as well call `chgrp` directly. This does not update the documentation because we are merging into release/2.0.x but master reworks the configuration section of the documentation, so there will be a conflict when we merge anyway. Signed-off-by: Dexter Chua <dalcde@yahoo.com.hk> |
||
---|---|---|
.. | ||
lib | ||
test |