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

[Feature Request] Add support for inheriting user and group permissions #24

Open
begna112 opened this issue Nov 5, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@begna112
Copy link

begna112 commented Nov 5, 2021

When running this in docker(-compose), it natively runs as root. This can cause some pretty unfortunate permissions issues when trying to later interact with those files as it will even override ACLs and setgid bits.

Could this be adapted to inherit a user and group id to avoid this? Spent some time hunting down ways of doing it, but its a bit over my head to push it over the finish line.

The method used by linuxserver.io is likely way to complex to implement and relies on their base images and another package when manages some of the permissions. I wasn't quite able to figure out how. https://github.com/just-containers/s6-overlay

Another Youtube-DL package which doesnt have any live or scheduling functions is a bit simpler, but is implemented in Bash before executing python. https://github.com/mikenye/docker-youtube-dl/blob/master/init#L44-L73

I think that something like this might work in your existing dockerfile, but have not been able to test it. Blatantly stolen from another dockerfile somewhere.

RUN \
 groupmod -g $PGID users && \
 useradd -u $PUID -U -d /config -s /bin/false abc && \
 usermod -G users abc
USER abc

PGID and PUID would need to be set as environment variables to the container in something like this:

x-defaults: &defaults
  image: sparanoid/live-dl:latest
  restart: always
  environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
  volumes:
    - ${DOCKER_APPDATA}/live-dl/config.yml:/opt/live-dl/config.yml
    - ${DOCKER_APPDATA}/live-dl/youtube.com_cookies.txt:/opt/live-dl/cookies.txt
    - /Torrents/live-dl:/opt/live-dl/downloads

If you've got a better way, please do.

@begna112 begna112 changed the title {Feature Request] Add support for inheriting user and group permissions [Feature Request] Add support for inheriting user and group permissions Nov 7, 2021
@sparanoid sparanoid added the enhancement New feature or request label Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants