Unpackerr / unpackerr

Extracts downloads for Radarr, Sonarr, Lidarr, Readarr, and/or a Watch folder - Deletes extracted files after import
https://unpackerr.zip
MIT License
991 stars 36 forks source link

Does not create the /config folder with the proper user #486

Open gjobin opened 3 weeks ago

gjobin commented 3 weeks ago

I am building a docker compose to generate my media stack, that includes unpackerr.

All my other apps are generating my appdata folder with the specified user, but somehow unpackerr creates it with root instead, and then complains it does not have access to create the default config file.

[INFO] 2024/08/21 21:21:37 Unpackerr v0.14.5-797 Starting! PID: 1, UID: 99, GID: 100, Umask: 18, Now: 2024-08-21 21:21:37 -0400 EDT
[INFO] 2024/08/21 21:21:37 ==> GoLift Discord: https://golift.io/discord <==
[INFO] 2024/08/21 21:21:37 ==> Startup Settings <==
[INFO] 2024/08/21 21:21:37  => Using env variables only. Could not create config file: creating config file: open /config/unpackerr.conf: permission denied

Here is my docker compose service :

  unpackerr:
    restart: unless-stopped
    image: golift/unpackerr
    user: ${PUID}:${PGID}
    environment:
      - TZ=${TZ}
    volumes:
      - ${APPDATA_PATH}/unpackerr:/config
      - ${DOWNLOAD_PATH}:/downloads

I'm running unraid, and my PUID=99 and GUID=100 are corresponding to user nobody

And the result of the created folder :

image

If I manually change the owner of the folder, things works as expected. However, I would expect the folder to be created with the proper owner, like all the other apps are doing.

Thank you for your help

davidnewhall commented 3 weeks ago

Unpackerr does't create the /config folder. I do not recommend using a config file with Docker.

These lines in your compose made Docker create ${APPDATA_PATH}/unpackerr, and since Docker runs as root, you got a root-owned folder.

    volumes:
      - ${APPDATA_PATH}/unpackerr:/config
gjobin commented 3 weeks ago

In understand it is not your recommended way, however this is the way I need to set it up, unless there is a way to get the api keys of each arr dynamically.

Why does every other apps I run properly creates the folder as nobody ?

Am I missing anything ? Thanks for your help

gjobin commented 3 weeks ago

I wonder if line 27 is what changes the user on the path from within the linuxserver images: https://hub.docker.com/layers/linuxserver/bazarr/latest/images/sha256-7db4caaef1bb65c5f75fcc531f61f2e9722683c6884228c23a060a1e7b9f94e8?context=explore

davidnewhall commented 3 weeks ago

unless there is a way to get the api keys of each arr dynamically.

If putting them in an environment file is not dynamic enough, you can read them from other files like this. UN_SONARR_0_API_KEY=filepath:/keys/sonarr.api.key.txt

But you didn't really explain what dynamic means in your environment.

Why does every other apps I run properly creates the folder as nobody ?

I'm familiar with Unpackerr, not your other containers. Unpackerr doe not create the config folder. It will only create a config file if: 1. the app is running in docker, and 2. the /config folder exists, and 3. there's not already a config file in it.

however this is the way I need to set it up,

You've come to a solution. A solution that you can't implement yourself. Can you describe the problem so we can make sure we're troubleshooting the proper solution?

bakerboy448 commented 3 weeks ago

unless there is a way to get the api keys of each arr dynamically.

question to think on: why are arr api keys changing frequently where you must gather than dynamically? but they can be parsed from starr's config files with some script you write and dumped to unpackerr files to read