LMS-Community / slimserver-platforms

Platform-specific build tools for Lyrion Music Server
48 stars 41 forks source link

squeezeboxserver user in docker image is not added to group $PGID #16

Open doctorjames opened 3 years ago

doctorjames commented 3 years ago

The squeezeboxserver user is set up as part of the Dockerfile build process.

The line usermod -g $PGID squeezeboxserver has therefore already been executed when building the image, not with the user specified PGID at runtime.

If the user overrides the group using the PGID environment variable, this is used to chown various files in start-container.sh but the squeezeboxserver user is not added to this group. This prevents using the PGID to allow access to music files mounted from the host.

I would expect changing:

usermod -o -u "$PUID" squeezeboxserver
groupmod -o -g "$PGID" nogroup

to:

groupmod -o -g "$PGID" nogroup
usermod -o -u "$PUID" -g nogroup squeezeboxserver

in start-container.sh would make it work, however using a differently named group to "nogroup" would be semantically better since it is a group, and in my use case, one that serves an access role.

It might be cleanest to specify an (optional) group for the read/write files (i.e. what is affected at present) and a separate group that the squeezeboxserver user is put in by start-container.sh intended for access to the read only music.

edgar-vincent commented 2 years ago

I am sorry to bump this, but could anyone implement the fixes that @doctorjames suggests? They seem to be insightful.

ppbdrinker commented 1 year ago

I wish I read this bugreport prior to wasting 90 minutes on debugging the FS access denial. %)

michaelherger commented 1 year ago

Yes, would be great if somebody could come up with a pull request. Thanks!