lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
172 stars 42 forks source link

[Docker] Permissions on created files #131

Open glottisfaun0000 opened 5 months ago

glottisfaun0000 commented 5 months ago

Running via docker, I have the following environmental variables: environment:

But created video files have the following permissions: -rw-r--r-- 1 root root

Anything I can change to open up the permissions/get the right user/group? All it really means now is having to do rm -f rather than just rm to get rid of unwanted recordings, but it's a little annoying.

DerBunteBall commented 5 months ago

This isn't supported by the Docker container actually.

The simplest thing you could try is building a personal container and use the USER directive.

At the user creation make sure the IDs match.

# syntax=docker/dockerfile:1

FROM python:3.10-slim-buster

RUN \
 # Install additional dependencies
  apt update && \
  apt install -y ffmpeg && \
  rm -rf /var/cache/apt/lists ;

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY *.py ./
COPY streamonitor ./streamonitor 

EXPOSE 6969
# Change -u parameter to host user id
RUN useradd -r -u 1000 -g appuser appuser
USER appuser
ENTRYPOINT [ "python3", "Downloader.py"]

This should/could work.

To change user/group dynamically more work would be needed. At least a Bash Script as an entrypoint which makes sure to start the app as the wanted user/group.