kalibrado / trailer-finder

Trailer Finder is a tool that automatically searches and downloads movie trailers for your media collection. It integrates with media management tools like Radarr and Sonarr to keep your trailers up-to-date.
MIT License
15 stars 0 forks source link

Set UID and GID #43

Closed TaylanTatli closed 2 weeks ago

TaylanTatli commented 2 weeks ago

Is it possible to set UID and GID. Trailer-finder creates folders for unreleased movies and then downloads the trailer for it. But when the movie is released, Radarr can't import it because of a permission problem. Trailer-finder creates folders as root, but Radarr uses non-root user account (1000:1000). So I have to delete folder that trailer-finder created and let Radarr recreate and import movie, after that trailer-finder finds and download trailer successfully. I tried to set it as environment variable in my docker compose without success.

kalibrado commented 2 weeks ago

Hello,

Thank you for bringing this up!

Currently, trailer-finder does not support PUID and PGID environment variables for setting file and folder permissions. However, you can work around this issue by configuring the Docker container to run with the appropriate UID and GID.

To do this, you can add the following directive to your docker-compose.yml file:

services:
  trailer-finder:
    image: ldfe/trailer-finder:latest
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    user: "1000:1000"  # Replace with the UID and GID of the non-root user 
    volumes:
      - /services/trailerfinder/config.yaml:/config/config.yaml
      - /mnt/storage/otherVids/trailers:/downloads
      - /mnt/movies:/movies

This will ensure that trailer-finder creates folders and files with the same permissions as Radarr, avoiding the permission issues you're experiencing.

Thank you again for your feedback, and feel free to reach out if you have any more questions!

TaylanTatli commented 2 weeks ago

Oh, thanks. I'm new to all these. I didn't know it was this easy. 😅

kalibrado commented 2 weeks ago

No worries, we’ve all been there! 😅 And you’ll see, with a bit of practice, it’ll become a piece of cake! 😉