alfem/telegram-download-daemon

[Question] Downloaded file owner

Closed this issue · 4 comments

Hi! I've put PUID and PGID to 1000 into docker-compose, so my dockerized plex can delete files, but telegram user is still 0:0 and files belong to root.... how can i do it for files to be downloaded with 1000:1000 owner or 666 file permissions?

alfem commented

That seems ok to me. Can you post the full command line or the composer configuration file you are using?

my docker-compose:

version: '3.5'

services:
  telegram-download-daemon:
 
    container_name: telegram
   image: alfem/telegram-download-daemon:latest
    labels:
      - wud.watch.digest=false     
    environment:
      PUID: 1000
      PGID: 1000
      TELEGRAM_DAEMON_API_ID: "xxxxxxxxxxxx"
      TELEGRAM_DAEMON_API_HASH: "xxxxxxxxxxxxxxxxxxx"
      TELEGRAM_DAEMON_CHANNEL: "xxxxxxxxxxxxxxxx"
      TELEGRAM_DAEMON_DEST: "/downloads"
      TELEGRAM_DAEMON_SESSION_PATH: "/session"
    volumes:
       - /media/download:/downloads
       - /home/user/docker/telegram/sessions:/session
    restart: always

what doesnt seem to work.

My workaround is to change file permissions via crontab every day, so far so good by now.

Thanks for your work!!!

alfem commented

I am afraid the base image we are using (python3-slim) does not include the PUID/PGID feature.

I made some tweaks to the Dockerfile to run the script with an unprivileged user (without the popular PUID trick).

Just add a line like this to your docker-compose.yaml:

`user:` "1000"

under the image: line

Your will need to regenerate your container, and perhaps adjust permissions in your download and session directories.

Please, give me some feedback.

it works!
new downloaded file has '1000' user and root group, but plex (in my usercase) can delete it!

thanks for your great and useful work!

the way to do it was writing
user: '1000'