Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LaserKaspar opened this issue Apr 7, 2021 · 1 comment

Comments

@LaserKaspar
Copy link

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.

@grigio
Copy link
Contributor

grigio commented Jul 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants