ziahamza/webui-aria2

Downloaded files have root privileges and can not be edited / moved / deleted by other users.

Opened this issue · 1 comments

Here is a sample output of a file I downloaded using aria WebUI.

ls -l
-rw-r--r-- 1 root root 11748 Apr 7 16:32 logo.1.svg

As seen above the file is owned by root. This could be a problem with my RPC configuration, but I didn't find any information there either. What service is responsible for the autostart of the RPC socket maybe that is the issue.

Getting the socket to use another user would probably solve my issue.

I hope someone can help me.
If you need any further information I will happily provide them.

yeah it's complicated, it works with this

Dockerfile

# docker build -f Dockerfile -t grigio/webui-aria2 .
FROM debian:10

# less priviledge user, the id should map the user the downloaded files belongs to
RUN groupadd -r dummy && useradd -r -g dummy dummy -u 1000

# webui + aria2
RUN apt-get update \
	&& apt-get install -y aria2 busybox curl \
	&& rm -rf /var/lib/apt/lists/*

ADD ./docs /webui-aria2

# gosu install latest
RUN GITHUB_REPO="https://github.com/tianon/gosu" \
  && LATEST=`curl -s  $GITHUB_REPO"/releases/latest" | grep -Eo "[0-9].[0-9]*"` \
  && curl -L $GITHUB_REPO"/releases/download/"$LATEST"/gosu-amd64" > /usr/local/bin/gosu \
  && chmod +x /usr/local/bin/gosu

# goreman supervisor install latest
RUN GITHUB_REPO="https://github.com/mattn/goreman" \
  && LATEST=`curl -s  $GITHUB_REPO"/releases/latest" | grep -Eo "v[0-9]*.[0-9]*.[0-9]*"` \
  && curl -L $GITHUB_REPO"/releases/download/"$LATEST"/goreman_"$LATEST"_linux_amd64.tar.gz" > goreman.tar.gz \
  && tar xvf goreman.tar.gz && mv /goreman*/goreman /usr/local/bin/goreman && rm -R goreman*

# goreman setup
RUN echo "web: gosu dummy /bin/busybox httpd -f -p 8080 -h /webui-aria2\nbackend: gosu dummy /usr/bin/aria2c --enable-rpc --rpc-listen-all --dir=/data" > Procfile

# aria2 downloads directory
VOLUME /data

# aria2 RPC port, map as-is or reconfigure webui
EXPOSE 6800/tcp

# webui static content web server, map wherever is convenient
EXPOSE 8080/tcp

CMD ["start"]
ENTRYPOINT ["/usr/local/bin/goreman"]

docker-compose.yml

---
version: "3"
services:
  aria2:
    image: grigio/webui-aria2
    volumes:
        - ./data:/data
    ports:
        - "6800:6800"
        - "8888:8080"
    environment:
      - PUID=1000
      - PGID=1000
    networks:
      - proxy
    restart: unless-stopped
  
networks:
  proxy:
    external: true