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

[BUG] UMASK ignored #169

Closed
1 task done
Maximumi opened this issue Dec 7, 2024 · 14 comments
Closed
1 task done

[BUG] UMASK ignored #169

Maximumi opened this issue Dec 7, 2024 · 14 comments

Comments

@Maximumi
Copy link

Maximumi commented Dec 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello

I report in the last version of docker-nzbget the umask environnement variable is ignored

Expected Behavior

The umask must be taken into account

Steps To Reproduce

Set UMASK=002 in docker-compose.yml file

**docker-compose.yml**
services:
  nzbget:
    image: lscr.io/linuxserver/nzbget:latest
    container_name: nzbget
    environment:
      - PUID=999
      - PGID=1005
      - TZ=Europe/Paris
      - NZBGET_USER=${NZBGET_USER}
      - NZBGET_PASS=${NZBGET_PASS}
      - UMASK=002

docker compose exec --user abc nzbget sh
abc@5ab65b71285f:/$ env
...
PGID=1005
PUID=999
UMASK=002
TZ=Europe/Paris
...
abc@5ab65b71285f:/$ umask
0022

Environment

- OS: Debian 12
- How docker service was installed: https://docs.docker.com/engine/install/debian/

CPU architecture

x86-64

Docker creation

**docker-compose.yml**
services:
  nzbget:
    image: lscr.io/linuxserver/nzbget:latest
    container_name: nzbget
    environment:
      - PUID=999
      - PGID=1005
      - TZ=Europe/Paris
      - NZBGET_USER=${NZBGET_USER}
      - NZBGET_PASS=${NZBGET_PASS}
      - UMASK=002

Container logs

nzbget  | [custom-init] No custom files found, skipping...
nzbget  | [INFO] nzbget 24.5 server-mode
nzbget  | [INFO] using /config/nzbget.conf
nzbget  | [INFO] nzbget runs on 0.0.0.0:6789
nzbget  | Connection to localhost (127.0.0.1) 6789 port [tcp/*] succeeded!
nzbget  | [ls.io-init] done.
nzbget  | [INFO] Stopping, please wait...
nzbget  | [migrations] started
nzbget  | [migrations] no migrations found
nzbget  | usermod: no changes
nzbget  | ───────────────────────────────────────
nzbget  |
nzbget  |       ██╗     ███████╗██╗ ██████╗
nzbget  |       ██║     ██╔════╝██║██╔═══██╗
nzbget  |       ██║     ███████╗██║██║   ██║
nzbget  |       ██║     ╚════██║██║██║   ██║
nzbget  |       ███████╗███████║██║╚██████╔╝
nzbget  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
nzbget  |
nzbget  |    Brought to you by linuxserver.io
nzbget  | ───────────────────────────────────────
nzbget  |
nzbget  | To support the app dev(s) visit:
nzbget  | NZBGet: https://nzbget.com/donate/
nzbget  |
nzbget  | To support LSIO projects visit:
nzbget  | https://www.linuxserver.io/donate/
nzbget  |
nzbget  | ───────────────────────────────────────
nzbget  | GID/UID
nzbget  | ───────────────────────────────────────
nzbget  |
nzbget  | User UID:    999
nzbget  | User GID:    1005
nzbget  | ───────────────────────────────────────
nzbget  | Linuxserver.io version: v24.5-ls172
nzbget  | Build-date: 2024-12-06T15:36:27+00:00
nzbget  | ───────────────────────────────────────
nzbget  |
nzbget  | [custom-init] No custom files found, skipping...
nzbget  | [INFO] nzbget 24.5 server-mode
nzbget  | [INFO] using /config/nzbget.conf
nzbget  | [INFO] nzbget runs on 0.0.0.0:6789
nzbget  | Connection to localhost (127.0.0.1) 6789 port [tcp/*] succeeded!
nzbget  | [ls.io-init] done.
Copy link

github-actions bot commented Dec 7, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@Roxedus
Copy link
Member

Roxedus commented Dec 7, 2024

This is not a valid test. /usr/bin/with-contenv env is.

@Maximumi
Copy link
Author

Maximumi commented Dec 7, 2024

Same result

abc@5ab65b71285f:/$ /usr/bin/with-contenv env
S6_STAGE2_HOOK=/docker-mods
SHLVL=2
VIRTUAL_ENV=/lsiopy
PWD=/
HOSTNAME=5ab65b71285f
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
UMASK=002
PUID=999
TERM=xterm
TZ=Europe/Paris
PATH=/command:/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PGID=1005
NZBGET_USER=xxxx
PS1=$(whoami)@$(hostname):$(pwd)$
NZBGET_PASS=xxxx
S6_VERBOSITY=1
LSIO_FIRST_PARTY=true
HOME=/root
abc@5ab65b71285f:/$ umask
0022

@Roxedus
Copy link
Member

Roxedus commented Dec 7, 2024

UMASK=002 the container env has the correct umask

@Maximumi
Copy link
Author

Maximumi commented Dec 7, 2024

but the user not create file with the good umask

@Roxedus
Copy link
Member

Roxedus commented Dec 7, 2024

Do you know for certain that nzbget respects the umask variable?

@Maximumi
Copy link
Author

Maximumi commented Dec 7, 2024

if i change manually and create folder the rights is good
No change in my configuration of container or nzbget just update

Actually configuration in nzbget
image

@Maximumi
Copy link
Author

Maximumi commented Dec 7, 2024

The current bypass in nzbget for me is
image

@Maximumi
Copy link
Author

Maximumi commented Dec 7, 2024

If I've understood correctly, the env parameter change the shell umask of user abc. Do you agree?

@Roxedus
Copy link
Member

Roxedus commented Dec 7, 2024

No, its independent of the user. the shell just needs to be run in the container environment context

@aptalca
Copy link
Member

aptalca commented Dec 8, 2024

We just realized the umask setting in alpine 3.20 based images broke a couple of days ago and nzbget built after that so the latest has it broken. The next build of nzbget will fix it.

With that said, seeing as nzbget has a umask setting in its gui, it may be ignoring the environment umask setting and using its own gui setting instead. That I'm not sure. Not every app respects the environment umask setting.

Also, to clarify, the way umask is set in the container is quite convoluted and hard to confirm. It is set for the app's service in a wrapper. Exec'ing into the container and running umask is not going to show you the umask setting that is set for the app's shell.

@aptalca
Copy link
Member

aptalca commented Dec 8, 2024

A new build is pushed.

With the new image, here's my quick test to check whether umask is being set correctly in the app's shell:

docker run -d --rm --name test -e UMASK=333 ghcr.io/linuxserver/nzbget
docker exec -it test bash -c 'cd /run/s6-rc:s6-rc-init:*/servicedirs/svc-cron && with-contenv bash -c "umask"'

The second command returns 0333 so it is indeed working. But like I said, nzbget could still ignore that and whether it does or not is a question for the nzbget devs.

@aptalca aptalca closed this as completed Dec 8, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Dec 8, 2024
@Maximumi
Copy link
Author

Maximumi commented Dec 8, 2024

Hello,

Thank you it's works !
I've updated the container and inverted the parameter in nzbget and everything works as before
image

@BKWQ

This comment was marked as off-topic.

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

No branches or pull requests

4 participants