-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove PGID PUID Limitations #34
Comments
Yes, I know I can build the Dockerfile. Why not just add a permissions correction into entrypoint to allow using PGID/PUID? For now, I'm using this
It's to maintain share permissions correctly in Syn&QTS. Edit: This was lazily put together, mind. The redundant shells were from tinkering and left over, I didn't bother to remove them. |
Could you elaborate on that? Anyway, we'd be open to PRs to remedy this. There has not been a concrete reason to use these ids in particular - iirc that was essentially copied from elsewhere 🤷 |
Let the end user decide which PID and GID and even username that the Docker should use for Mumble for those that will use binding paths. This allows us to seamlessly maintain permissions. It's easier to restrict than to grant more permissions with Docker.
The change would need to be made in the entrypoint.sh. It needs to modify the mumble user and group permissions to whatever MUMBLE_UID and MUMBLE_GID are set to. It leaves them alone, which means they'll use whatever the Dockerfile used, which is 1000. Just maybe add a section at the beginning of the script to change the uid and gid of the user and chown the correct directories, then proceed the rest of the script. I built that ugly short-cut above to circumvent the Docker Image's pre-built limitation, for now. |
Asking on reddit, I got this as a working solution when using podman.
It seems to work, will |
You're assuming people have access to the shell or process parameters of a non-Docker software. Wrong way to implement. |
How would one implement this using docker or podman to allow the volume permissions to remain unchanged for the host user? |
Currently, the Docker image is build on a no-root user, so volume cannot be
To do the second possibility, we need to refactor the Dockerfile and the entrypoint.sh script. See an example make by plex |
We mostly use the 1000 ID because it's the first one proposed when your create a new user into a Unix system. ID 0 (root), shouldn't be used by a program. Docker is quite a dirty man of security. It's not they goal, they use additional layer to do it. |
Running as non-root in a Docker is just security through obscurity. But that comment wasn't meant about people who decide to use security through obscurity, it was meant as in 'why are developers preventing others from running as they wish?' If I want to |
Because the first part of run will start as root, so the entrypoint need to be carefully write until we drop the privileged. |
Not just Synology/Qnap, but in general any Docker. A simple fix, yeah. Run as PGID/PUID and Docker's user var. |
It would be great to have an update on the docker image to allow it to work easily with docker and podman and have the volume permissions be no different when running a mumble via debian apt package |
Are there PUID and PGID variables we can use in this? I just tried this container and it failed out with a permissions error. It should have PUID and PGID variables like the linuxserver containers do. |
Answer is in the thread...did you miss the entire thread? :/ |
Maybe this problem and a solution should be added to the "common problems" section in the README? Edit: I stumbled across this and it says to |
Having to dig through multiple layers of posts, replies and quotes is difficult to parse and this should be in the documentation or in an example docker compose file. Please do not punch down. |
It was not a punch down, it was a fish-slap. People that don't read threads but then try to make comments asking for the very information in the thread just wastes everyone's time and is an insult to those that took the time to contribute and post. |
I ended up reading this thread because my server stopped working. Here is what I did: I was setting MUMBLE_UID and MUMBLE_GID to 1000 in my docker-compose.yml. I removed these lines. Next, I changed the permissions on my mount point to chown 10000:10000. This matches the UID/GID that is set in the Dockerfile when this image is built.. That aligned the permissions correctly so that I no longer received the "/entrypoint.sh: line 77: /data/mumble_server_config.ini: Permission denied" error. |
That works for you because you're fine with your host files being chowned by user 10000 under group 10000. Those of us wanting this changed do not. (You meant chowned, by the way.) |
For those thinking "just chown/chmod it": Some might prefer to control ownership and access to files to better help secure them, especially on shared servers or when simply locking down a server from unauthorized changes mitigating damage done by compromised users. |
Here the change we need to do on the entrypoint. #!/bin/bash
MUMBLE_UID=${MUMBLE_UID:-10000}
MUMBLE_GID=${MUMBLE_GID:-10000}
if [ "MUMBLE_UID" != "0" ]; then
groupmod -og "$MUMBLE_GID" mumble
usermod -ou "$MUMBLE_UID" mumble
chown -R mumble:mumble /data && chown -R mumble:mumble /etc/mumble
exec gosu mumble "$@"
fi
exec "$@" |
I'd only alter the user and let the user chown/chmod the files as they wish. They may be using shared directories with different permissions for any reason. Edit: I don't see any need for gosu at all. |
Is #43 good for your usages ? |
Edit: Why would it change things? It's not using |
i didn't try it out, but i did review the code changes in #34. i think it make my use case much better. thanks! |
I was able to solve this for myself using Portainer. In Advanced Container Settings, under the Commands & logging tab, set the User field to whatever user you want to set (e.g. for me I set But it would be lovely if someone made it so that there were |
PUID and PGID are (edit: already) able to be set, the internal user for 'mumble' is 1000:1000 though, so you either need to hijack the entrypoint to adjust the |
Broken bind mount access for Syn&QTS even with PGID=0, PUID=0, MUMBLE_GID=0, MUMBLE_UID=0, /data:770 (normally 660) and owned (docker running under UID=0, GID=0, forced requirement). Why is every docker trying to force running as 1000:1000+ when you can let the end user do what they need? So much hand-holding...*sigh* Breaking usability.
The text was updated successfully, but these errors were encountered: