feat: add docker UMASK, PUID, PGID setting support #588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
利用gosu实现账户切换,增加Docker镜像的UMASK,PUID,PGID的设置,从而更好的支持linux系统的权限管理。
默认UMASK为022,文件创建后权限为-rw-r--r-,仅当前用户可读写,其他用户仅可读,而docker内默认用户为root,所以会导致录播文件写入到宿主机后,宿主机非root用户无法写入编辑。
增加了新设置后,可以通过环境变量指定UMASK,如果将UMASK设置为000则全部用户可读写录播文件,002则为当前用户组的所有用户可读写录播文件。
同时可以使用PUID,和PGID设置文件所有者的用户,在某些系统中该设置可以更好的帮助管理权限。例如在unRaid系统内,PUID设置为99,PGID设置为100,UMASK设置为002。则可以实现文件创建后,共享文件用户可读写,文件所有者为nobody。