Skip to content
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

feat: custom PUID/PGID #390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: custom PUID/PGID #390

wants to merge 1 commit into from

Conversation

adripo
Copy link
Contributor

@adripo adripo commented Nov 3, 2022

fix: #362

@AnalogJ
Copy link
Owner

AnalogJ commented Nov 5, 2022

hey @adripo
Thanks for the PR! 🥳

However I'm not quite sure this will work as intended.

  • we should name our user scrutiny rather than abc
  • /config doesnt exist in Scrutiny. our home dir should be /home/scrutiny
  • the main problem is: the scrutiny-web, scrutiny-collector and influxdb processes will still run as root, not the new abc/scrutiny user.

Hope that all makes sense, could you make those changes? Thanks again!

@adripo
Copy link
Contributor Author

adripo commented Nov 6, 2022

Hi @AnalogJ, I just added the script in a hurry, but I am now working on different issues in this project so I will check all the point that you raised. I agree with your suggestions, but I have one doubt. If I run the main process with the new scrutiny user you will never be able to run it as root anymore because you cannot set id 0 to a different user, right?

@AnalogJ
Copy link
Owner

AnalogJ commented Nov 6, 2022

We wouldn't start the main process (s6-overlay) with root, instead we would just start the child process as scrutiny.

Once other thing I forgot to mention (that complicates this even further) is that smartctl needs to run as root from what I remember, even within the container.

So only the webapp and influxdb processes can be changed to run under the scrutiny user

@AnalogJ
Copy link
Owner

AnalogJ commented Nov 6, 2022

Here's an old example for how to update the service files to run as a (non-root) user - just-containers/s6-overlay#207

@EkilDeew
Copy link

EkilDeew commented Apr 20, 2023

Once other thing I forgot to mention (that complicates this even further) is that smartctl needs to run as root from what I remember, even within the container.

You could just add the sudo package and allow the scrutiny user to only use smartctl as sudo. ie (in the sudoers file or another file under /etc/sudoers.d) :

scrutiny ALL = (ALL) NOPASSWD:/bin/smartctl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Permissions of Influxdb folder do not follow PUID/PGID set in the docker-compose file
3 participants