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

[pull] master from Wonderfall:master #18

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM alpine:3.12
FROM alpine:3.15

ARG RTORRENT_VER=0.9.8
ARG LIBTORRENT_VER=0.13.8
ARG MEDIAINFO_VER=20.09
ARG FLOOD_VER=4.3.1
ARG FLOOD_VER=4.7.0
ARG BUILD_CORES

ENV UID=991 GID=991 \
Expand All @@ -14,6 +13,7 @@ ENV UID=991 GID=991 \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

RUN NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} \
&& echo "@3.14 https://nl.alpinelinux.org/alpine/v3.14/main" >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add -t build-dependencies \
build-base \
Expand Down Expand Up @@ -43,9 +43,10 @@ RUN NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} \
su-exec \
python2 \
nodejs \
nodejs-npm \
unrar \
npm \
unrar@3.14 \
findutils \
mediainfo \
&& cd /tmp && mkdir libtorrent rtorrent \
&& cd libtorrent && wget -qO- https://github.com/rakshasa/libtorrent/archive/v${LIBTORRENT_VER}.tar.gz | tar xz --strip 1 \
&& cd ../rtorrent && wget -qO- https://github.com/rakshasa/rtorrent/releases/download/v${RTORRENT_VER}/rtorrent-${RTORRENT_VER}.tar.gz | tar xz --strip 1 \
Expand All @@ -54,19 +55,7 @@ RUN NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} \
&& cd /tmp/xmlrpc-c/advanced && ./configure && make -j ${NB_CORES} && make install \
&& cd /tmp/libtorrent && ./autogen.sh && ./configure && make -j ${NB_CORES} && make install \
&& cd /tmp/rtorrent && ./autogen.sh && ./configure --with-xmlrpc-c && make -j ${NB_CORES} && make install \
&& cd /tmp \
&& wget -q http://mediaarea.net/download/binary/mediainfo/${MEDIAINFO_VER}/MediaInfo_CLI_${MEDIAINFO_VER}_GNU_FromSource.tar.gz \
&& wget -q http://mediaarea.net/download/binary/libmediainfo0/${MEDIAINFO_VER}/MediaInfo_DLL_${MEDIAINFO_VER}_GNU_FromSource.tar.gz \
&& tar xzf MediaInfo_DLL_${MEDIAINFO_VER}_GNU_FromSource.tar.gz \
&& tar xzf MediaInfo_CLI_${MEDIAINFO_VER}_GNU_FromSource.tar.gz \
&& cd /tmp/MediaInfo_DLL_GNU_FromSource && ./SO_Compile.sh \
&& cd /tmp/MediaInfo_DLL_GNU_FromSource/ZenLib/Project/GNU/Library && make install \
&& cd /tmp/MediaInfo_DLL_GNU_FromSource/MediaInfoLib/Project/GNU/Library && make install \
&& cd /tmp/MediaInfo_CLI_GNU_FromSource && ./CLI_Compile.sh \
&& cd /tmp/MediaInfo_CLI_GNU_FromSource/MediaInfo/Project/GNU/CLI && make install \
&& strip -s /usr/local/bin/rtorrent \
&& strip -s /usr/local/bin/mediainfo \
&& ln -sf /usr/local/bin/mediainfo /usr/bin/mediainfo \
&& mkdir /usr/flood && cd /usr/flood && wget -qO- https://github.com/jesec/flood/archive/v${FLOOD_VER}.tar.gz | tar xz --strip 1 \
&& npm install && npm cache clean --force \
&& apk del build-dependencies \
Expand Down
61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
## wonderfall/rtorrent-flood

![](https://camo.githubusercontent.com/d8f5cb502f06e0ea1cc171550c2bed035293c1a9/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6a6f686e667572726f772e636f6d2f73686172652f666c6f6f642d73637265656e73686f742d612d303630362e706e67)
### What is this image?
This image was made for my own use a few years ago and while it is being updated, the structure hasn't changed much. I do not trust third-party Dockerfiles, and so should you: consider this repository as a base for your own Docker setup. If you want to do it "the Docker way", you should consider using proper containers for Flood and rtorrent, and use docker-compose.

**Be aware this image was made for my own use.**
### Security
As many images from the time it was first made, this image follows the principle of degrading privileges. It runs first as root to ensure permissions are set correctly and then only makes use of the UID/GID of your choice. While I agree it's not perfect (due to Linux insecurity), it seemed the best security/comfort balance at the time and it'll remain so for a while.

#### Main features
### Main features
- Based on Alpine Linux.
- rTorrent and libtorrent are compiled from source.
- Provides by default a solid configuration.
- [Flood](https://github.com/jesec/flood), a modern web UI for rTorrent with a Node.js backend and React frontend (jesec fork).
- Automatically unpack RAR releases (so Sonarr can deal with them).

#### Build-time variables
### Build-time variables
- **RTORRENT_VER** : rtorrent version
- **LIBTORRENT_VER** : libtorrent version
- **MEDIAINFO_VER** : libmediainfo version
- **BUILD_CORES** : number of cores used during build

#### Environment variables
### Environment variables
- **UID** : user id (default : 991)
- **GID** : group id (defaut : 991)
- **FLOOD_SECRET** : flood secret key (defaut : supersecret30charactersminimum) (CHANGE IT)
Expand All @@ -30,13 +32,52 @@
- Run this container with tty mode enabled. In your `docker-compose.yml`, add `tty: true`. If you don't do this, [rtorrent will use 100% of CPU](https://github.com/Wonderfall/dockerfiles/issues/156).
- Connect Flood UI to rTorrent through `Unix socket`. Enter `/tmp/rtorrent.sock` as rTorrent Socket. If SCGI is used, configure accordingly.

#### Ports
- **49184** (bind it).
- **3000** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)
### Ports
- **49184**
- **3000** (use a reverse proxy)

#### Tags
### Tags
- **latest** : latest versions of rTorrent/libtorrent/Flood.

#### Volumes
### Volumes
- **/data** : your downloaded torrents, session files, symlinks...
- **/flood-db** : Flood databases.

### My docker-compose

```yaml
rtorrent:
image: wonderfall/rtorrent-flood
container_name: rtorrent
restart: unless-stopped
tty: true
security_opt:
- no-new-privileges:true
ports:
- 49184:49184
- 49184:49184/udp
environment:
- UID=1000
- GID=1000
- FLOOD_SECRET=supersecret
# - RTORRENT_SOCK=false
volumes:
- /home/docker/flood:/flood-db
- /home/media/torrents:/data
networks:
- http_network
- rtorrent_network
labels:
- traefik.enable=true
- traefik.http.routers.rtorrent.entrypoints=http
- traefik.http.routers.rtorrent.rule=Host(`box.domain.tld`)
- traefik.http.routers.rtorrent.middlewares=https-redirect@file
- traefik.http.routers.rtorrent-secure.entrypoints=https
- traefik.http.routers.rtorrent-secure.rule=Host(`box.domain.tld`)
- traefik.http.routers.rtorrent-secure.tls=true
- traefik.http.routers.rtorrent-secure.middlewares=secure-headers@file,hsts-headers@file
- traefik.http.routers.rtorrent-secure.tls.certresolver=http
- traefik.http.routers.rtorrent-secure.service=rtorrent
- traefik.http.services.rtorrent.loadbalancer.server.port=3000
- traefik.docker.network=http_network
```