Problem
As an unprevileged user (ie. non-sudoer nor root) but actually a member of the docker user group, it's currently impossible to install and run php-devbox or modify files created by php-devbox in working directories.
Possible Solution
Installing as unprevileged user
As an unprevileged user, who is not a sudoer, the sudo commands and writing to /usr/local/bin is prohibited.
For these cases it would be a great feature to either detect the user as such an unprevileged user and automatically installing the script into the users home directory, as well as providing an flag like '--home' (or similar) to enable optional installation into the home-directory.
That way even unprevileged users could install and use php-devbox as long as they're allowed to run and use docker (eg. being a member of the docker user-group).
The desintation could be the XDG compliant ~/.local/bin directory. Also the installer could check if it's already part of $PATH and either extend ~/.profile or ~/.bashrc, or at least advise the user to do it themselves according to their personal setup.
Running as unprevileged user
Running any scripts that creates or modifies files inside php-devbox will create those files as uid 0 (root). even if running a container is allowed for the unprevileged user due to being in the docker group on the host-os makes it impossible for those users to read, edit or delete these files that are owned by root.
For these cases docker provides a user-id mapping that could be used to translate uids between the host and container. That way files would be created using the real host-user uid and ensure files are owned by the running user. (that counts for docker, for podman there "might" be a similar feature, yet i do not know exactly if it exists)
Problem
As an unprevileged user (ie. non-sudoer nor root) but actually a member of the docker user group, it's currently impossible to install and run php-devbox or modify files created by php-devbox in working directories.
Possible Solution
Installing as unprevileged user
As an unprevileged user, who is not a sudoer, the
sudocommands and writing to/usr/local/binis prohibited.For these cases it would be a great feature to either detect the user as such an unprevileged user and automatically installing the script into the users home directory, as well as providing an flag like '--home' (or similar) to enable optional installation into the home-directory.
That way even unprevileged users could install and use
php-devboxas long as they're allowed to run and use docker (eg. being a member of the docker user-group).The desintation could be the XDG compliant
~/.local/bindirectory. Also the installer could check if it's already part of$PATHand either extend~/.profileor~/.bashrc, or at least advise the user to do it themselves according to their personal setup.Running as unprevileged user
Running any scripts that creates or modifies files inside php-devbox will create those files as uid 0 (root). even if running a container is allowed for the unprevileged user due to being in the docker group on the host-os makes it impossible for those users to read, edit or delete these files that are owned by root.
For these cases docker provides a user-id mapping that could be used to translate uids between the host and container. That way files would be created using the real host-user uid and ensure files are owned by the running user. (that counts for docker, for podman there "might" be a similar feature, yet i do not know exactly if it exists)