diff --git a/DockerEnv b/DockerEnv index 9f5c2336c..c598c7e5a 100644 --- a/DockerEnv +++ b/DockerEnv @@ -3,6 +3,7 @@ #OPENVPN_CONFIG= #OPENVPN_USERNAME= #OPENVPN_PASSWORD= +#RSS_URL= #LOCAL_NETWORK= #ENABLE_UFW=false #TRANSMISSION_ALT_SPEED_DOWN=50 diff --git a/README.md b/README.md index 9514f4484..91969300e 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,15 @@ You may set the following parameters to customize the user id that runs transmis |`PUID` | Sets the user id who will run transmission | `PUID=1003`| |`PGID` | Sets the group id for the transmission user | `PGID=1003` | +### RSS plugin + +The Transmission RSS plugin can optionally be run as a separate container. It allow to download torrents based on an RSS URL, see [Plugin page](https://github.com/nning/transmission-rss). + +``` +$ docker run -d -e "RSS_URL=http://.../xxxxx.rss" \ + --link :transmission \--link +``` + #### Use docker env file Another way is to use a docker env file where you can easily store all your env variables and maintain multiple configurations for different providers. In the GitHub repository there is a provided DockerEnv file with all the current transmission and openvpn environment variables. You can use this to create local configurations diff --git a/docker-compose-armhf.yml b/docker-compose-armhf.yml index e21eaf1e8..7369517b1 100644 --- a/docker-compose-armhf.yml +++ b/docker-compose-armhf.yml @@ -37,3 +37,13 @@ services: - "8080:8080" volumes: - /etc/localtime:/etc/localtime:ro + + rss: + build: + context: ./plugins/rss + dockerfile: Dockerfile.armhf + image: haugene/rpi-transmission-plugin-rss + links: + - transmission + environment: + - RSS_URL=http://.../xxxxx.rss diff --git a/docker-compose.yml b/docker-compose.yml index 1cc6ee80d..6f0115e5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,3 +30,10 @@ services: - 8080:8080 volumes: - /etc/localtime:/etc/localtime:ro + + rss: + image: haugene/transmission-rss + links: + - transmission + environment: + - RSS_URL=http://.../xxxxx.rss diff --git a/plugins/rss/Dockerfile b/plugins/rss/Dockerfile new file mode 100644 index 000000000..5e312dab3 --- /dev/null +++ b/plugins/rss/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:16.04 +MAINTAINER Kristian Haugene + +# Update packages and install software +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install curl gcc make ruby2.3-dev \ + && gem install transmission-rss \ + && curl -L https://github.com/jwilder/dockerize/releases/download/v0.5.0/dockerize-linux-amd64-v0.5.0.tar.gz | tar -C /usr/local/bin -xzv + +ADD . /etc/transmission-rss + +ENV TRANSMISSION_DOWNLOAD_DIR=/data/completed \ + RSS_URL=**None** + +CMD ["/etc/transmission-rss/start.sh"] diff --git a/plugins/rss/Dockerfile.armhf b/plugins/rss/Dockerfile.armhf new file mode 100644 index 000000000..e16932dc4 --- /dev/null +++ b/plugins/rss/Dockerfile.armhf @@ -0,0 +1,16 @@ +FROM resin/rpi-raspbian:jessie +MAINTAINER Kristian Haugene + +# Update packages and install software +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install curl gcc make ruby2.3-dev \ + && gem install transmission-rss \ + && curl -L https://github.com/jwilder/dockerize/releases/download/v0.2.0/dockerize-linux-armhf-v0.2.0.tar.gz | tar -C /usr/local/bin -xzv \ + +ADD . /etc/transmission-rss + +ENV TRANSMISSION_DOWNLOAD_DIR=/data/completed \ + RSS_URL=**None** + +CMD ["/etc/transmission-rss/start.sh"] diff --git a/plugins/rss/environment-variables.tmpl b/plugins/rss/environment-variables.tmpl new file mode 100644 index 000000000..1a2f90ce6 --- /dev/null +++ b/plugins/rss/environment-variables.tmpl @@ -0,0 +1,4 @@ +#! /bin/sh + +export TRANSMISSION_DOWNLOAD_DIR={{ .Env.TRANSMISSION_DOWNLOAD_DIR }} +export RSS_URL="{{ .Env.RSS_URL }}" \ No newline at end of file diff --git a/plugins/rss/start.sh b/plugins/rss/start.sh new file mode 100755 index 000000000..348794f49 --- /dev/null +++ b/plugins/rss/start.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Source our persisted env variables from container startup +dockerize -template /etc/transmission-rss/environment-variables.tmpl:/etc/transmission-rss/environment-variables.sh +. /etc/transmission-rss/environment-variables.sh + +if [ -z "${RSS_URL}" ] || [ "${RSS_URL}" = "**None**" ] ; then + echo "NO RSS URL CONFIGURED, IGNORING" +else + dockerize -template /etc/transmission-rss/transmission-rss.tmpl:/etc/transmission-rss.conf + echo "STARTING RSS PLUGIN" + transmission-rss +fi diff --git a/plugins/rss/transmission-rss.tmpl b/plugins/rss/transmission-rss.tmpl new file mode 100644 index 000000000..d5dca3185 --- /dev/null +++ b/plugins/rss/transmission-rss.tmpl @@ -0,0 +1,7 @@ +feeds: + - url: {{ .Env.RSS_URL }} + download_path: {{ .Env.TRANSMISSION_DOWNLOAD_DIR }} +server: + host: transmission + port: 9091 + rpc_path: /transmission/rpc \ No newline at end of file