From 0185c94b682902add36c0fe98a92ff0c7ef74c3b Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Fri, 30 Jun 2017 15:45:43 -0500 Subject: [PATCH] Add transmission and openvpn --- .gitignore | 3 +++ Makefile | 29 ++++++++++++++++++++ deps/Dockerfile | 10 +++++++ deps/Dockerfile.web | 13 +++++++++ deps/run.sh | 4 +++ deps/settings.json | 66 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 125 insertions(+) create mode 100644 .gitignore create mode 100755 Makefile create mode 100644 deps/Dockerfile create mode 100644 deps/Dockerfile.web create mode 100755 deps/run.sh create mode 100644 deps/settings.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1048201 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +deps/creds.x +deps/config.ovpn +deps/stage.tmp diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..3cf6d25 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +DOCKER_PREFIX=sudo +IMAGE_NAME=unixvoid/seedpod +WEB_THEME=https://github.com/Secretmapper/combustion/archive/v0.6.2.tar.gz + +build: + cd deps/ && \ + $(DOCKER_PREFIX) docker build -t $(IMAGE_NAME) . + +build_web: + cd deps/ && \ + mkdir -p stage.tmp/theme && \ + wget -O stage.tmp/theme.tar.gz $(WEB_THEME) && \ + tar -xzf stage.tmp/theme.tar.gz -C stage.tmp/theme --strip-components 1 && \ + $(DOCKER_PREFIX) docker build -t $(IMAGE_NAME) -f Dockerfile.web . + +run: + $(DOCKER_PREFIX) docker run \ + -d \ + --name seedpod \ + --cap-add=NET_ADMIN \ + --device=/dev/net/tun \ + --dns=8.8.8.8 \ + -p 9091:9091 \ + -v ~/Downloads/transmission/downloads:/transmission/downloads:rw \ + -v ~/Downloads/transmission/incomplete:/transmission/incomplete:rw \ + $(IMAGE_NAME) + +clean: + rm -rf deps/stage.tmp diff --git a/deps/Dockerfile b/deps/Dockerfile new file mode 100644 index 0000000..c5664ea --- /dev/null +++ b/deps/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine + +RUN apk --update add openvpn transmission-daemon +RUN mkdir -p /transmission/downloads +RUN mkdir -p /transmission/incomplete + +COPY us-midwest.ovpn / +COPY settings.json /transmission/ + +CMD ["transmission-daemon", "--foreground", "--config-dir", "/transmission"] diff --git a/deps/Dockerfile.web b/deps/Dockerfile.web new file mode 100644 index 0000000..bfc123a --- /dev/null +++ b/deps/Dockerfile.web @@ -0,0 +1,13 @@ +FROM alpine + +RUN apk --update add openvpn transmission-daemon +RUN mkdir -p /transmission/downloads +RUN mkdir -p /transmission/incomplete + +COPY us-midwest.ovpn / +COPY creds.data / +COPY settings.json /transmission/ +COPY stage.tmp/theme/ /usr/share/transmission/web/ +COPY run.sh / + +CMD ["/run.sh"] diff --git a/deps/run.sh b/deps/run.sh new file mode 100755 index 0000000..bd38125 --- /dev/null +++ b/deps/run.sh @@ -0,0 +1,4 @@ +#!/bin/ash + + openvpn /config.ovpn & + transmission-daemon --foreground --config-dir /transmission diff --git a/deps/settings.json b/deps/settings.json new file mode 100644 index 0000000..63480a9 --- /dev/null +++ b/deps/settings.json @@ -0,0 +1,66 @@ +{ + "alt-speed-down": 50, + "alt-speed-enabled": false, + "alt-speed-time-begin": 540, + "alt-speed-time-day": 127, + "alt-speed-time-enabled": false, + "alt-speed-time-end": 1020, + "alt-speed-up": 50, + "bind-address-ipv4": "0.0.0.0", + "bind-address-ipv6": "::", + "blocklist-enabled": false, + "blocklist-url": "http://www.example.com/blocklist", + "cache-size-mb": 4, + "dht-enabled": true, + "download-dir": "/transmission/downloads", + "download-queue-enabled": true, + "download-queue-size": 2, + "encryption": 1, + "idle-seeding-limit": 30, + "idle-seeding-limit-enabled": false, + "incomplete-dir": "/transmission/incomplete", + "incomplete-dir-enabled": true, + "lpd-enabled": false, + "message-level": 2, + "peer-congestion-algorithm": "", + "peer-id-ttl-hours": 6, + "peer-limit-global": 200, + "peer-limit-per-torrent": 50, + "peer-port": 51413, + "peer-port-random-high": 65535, + "peer-port-random-low": 49152, + "peer-port-random-on-start": false, + "peer-socket-tos": "default", + "pex-enabled": true, + "port-forwarding-enabled": false, + "preallocation": 1, + "prefetch-enabled": 1, + "queue-stalled-enabled": true, + "queue-stalled-minutes": 10, + "ratio-limit": 3, + "ratio-limit-enabled": true, + "rename-partial-files": true, + "rpc-authentication-required": true, + "rpc-bind-address": "0.0.0.0", + "rpc-enabled": true, + "rpc-password": "password", + "rpc-port": 9091, + "rpc-url": "/transmission/", + "rpc-username": "admin", + "rpc-whitelist": "127.0.0.1", + "rpc-whitelist-enabled": false, + "scrape-paused-torrents-enabled": true, + "script-torrent-done-enabled": false, + "script-torrent-done-filename": "", + "seed-queue-enabled": true, + "seed-queue-size": 5, + "speed-limit-down": 100, + "speed-limit-down-enabled": false, + "speed-limit-up": 100, + "speed-limit-up-enabled": false, + "start-added-torrents": true, + "trash-original-torrent-files": false, + "umask": 18, + "upload-slots-per-torrent": 14, + "utp-enabled": true +}