From 797a914c2022b7faef93956493d43b483ea978cf Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Thu, 6 Jul 2017 11:06:25 -0500 Subject: [PATCH] Updating naming convention in preperation for docker push --- Makefile | 6 ++++-- deps/Dockerfile | 7 +++---- deps/Dockerfile.web | 14 ++++++++++---- deps/config.ovpn | 2 +- deps/{run.sh => start_server.sh} | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) rename deps/{run.sh => start_server.sh} (91%) diff --git a/Makefile b/Makefile index b005868..da14fef 100755 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ IMAGE_NAME=unixvoid/seedpod WEB_THEME=https://github.com/Secretmapper/combustion/archive/v0.6.2.tar.gz ALPINE_FS=https://cryo.unixvoid.com/bin/filesystem/alpine/linux-latest-amd64.rootfs.tar.gz OS_PERMS=sudo +ROOT_DIR:=$(shell pwd) all: @@ -27,7 +28,7 @@ aci_build: pull_actool cp deps/config.ovpn seedpod-layout/rootfs/ cp deps/creds.x seedpod-layout/rootfs/ cp deps/settings.json seedpod-layout/rootfs/transmission/ - cp deps/run.sh seedpod-layout/rootfs/ + cp deps/start_server.sh seedpod-layout/rootfs/ cp deps/manifest.json seedpod-layout/manifest ./appc-v0.8.7/actool build seedpod-layout seedpod.aci ./appc-v0.8.7/actool --debug validate seedpod.aci @@ -44,7 +45,7 @@ aci_build_web: pull_actool cp deps/creds.x seedpod-layout/rootfs/ cp deps/settings.json seedpod-layout/rootfs/transmission/ cp -R deps/stage.tmp/theme/ seedpod-layout/rootfs/usr/share/transmission/web/ - cp deps/run.sh seedpod-layout/rootfs/ + cp deps/start_server.sh seedpod-layout/rootfs/ cp deps/manifest.json seedpod-layout/manifest ./appc-v0.8.7/actool build seedpod-layout seedpod.aci ./appc-v0.8.7/actool --debug validate seedpod.aci @@ -76,6 +77,7 @@ docker_run: --device=/dev/net/tun \ --dns=8.8.8.8 \ -p 9091:9091 \ + -v $(ROOT_DIR)/deps/creds.x:/openvpn/creds.x:ro \ -v ~/Downloads/transmission/downloads:/transmission/downloads:rw \ -v ~/Downloads/transmission/incomplete:/transmission/incomplete:rw \ $(IMAGE_NAME) diff --git a/deps/Dockerfile b/deps/Dockerfile index 38446cb..99092fc 100644 --- a/deps/Dockerfile +++ b/deps/Dockerfile @@ -4,9 +4,8 @@ RUN apk --update add openvpn transmission-daemon RUN mkdir -p /transmission/downloads RUN mkdir -p /transmission/incomplete -COPY config.ovpn / -COPY creds.x / +COPY config.ovpn /openvpn/ COPY settings.json /transmission/ -COPY run.sh / +COPY start_server.sh / -CMD ["/run.sh"] +CMD ["/start_server.sh"] diff --git a/deps/Dockerfile.web b/deps/Dockerfile.web index 5d865df..9983426 100644 --- a/deps/Dockerfile.web +++ b/deps/Dockerfile.web @@ -1,13 +1,19 @@ FROM alpine +# install openvpn and the transmission-daemon RUN apk --update add openvpn transmission-daemon +# create directories for downloaded files RUN mkdir -p /transmission/downloads RUN mkdir -p /transmission/incomplete -COPY config.ovpn / -COPY creds.x / +# copy in openvpn configs +COPY config.ovpn /openvpn/ COPY settings.json /transmission/ + +# copy in custom transmission theme COPY stage.tmp/theme/ /usr/share/transmission/web/ -COPY run.sh / -CMD ["/run.sh"] +# copy in runscript +COPY start_server.sh / + +CMD ["/start_server.sh"] diff --git a/deps/config.ovpn b/deps/config.ovpn index adeef3e..7748423 100644 --- a/deps/config.ovpn +++ b/deps/config.ovpn @@ -48,7 +48,7 @@ cipher aes-128-cbc auth sha1 tls-client remote-cert-tls server -auth-user-pass creds.x +auth-user-pass /openvpn/creds.x comp-lzo verb 1 reneg-sec 0 diff --git a/deps/run.sh b/deps/start_server.sh similarity index 91% rename from deps/run.sh rename to deps/start_server.sh index a99eefa..e9bc851 100755 --- a/deps/run.sh +++ b/deps/start_server.sh @@ -12,7 +12,7 @@ iptables -I OUTPUT 1 -m owner --uid-owner root -p udp --dport 53 -j ACCEPT iptables -A OUTPUT -m mark ! --mark 0x1 ! -o tun+ -j DROP # start openvpn with killswitch whitelist mark -openvpn --mark 1 --config /config.ovpn & +openvpn --mark 1 --config /openvpn/config.ovpn & # start transmission transmission-daemon --foreground --config-dir /transmission