Merge branch 'v0.2.0'

This commit is contained in:
Kelvin Chen 2016-10-07 02:45:52 -04:00
commit bb83ddd2e7
26 changed files with 87 additions and 117 deletions

View File

@ -1,20 +0,0 @@
FROM debian:jessie
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
# Install all dependencies that are used in multiple images.
RUN echo "deb http://httpredir.debian.org/debian jessie non-free" \
>> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
vim \
ca-certificates \
python \
python-dev \
curl \
git \
nginx \
unzip \
unrar \
supervisor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View File

@ -1,10 +1,7 @@
FROM kelvinchen/seedbox:base
FROM nginx:1.11-alpine
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
RUN apt-get update \
&& apt-get install --no-install-recommends -y apache2-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apk add --no-cache apache2-utils openssl
VOLUME /config
@ -15,7 +12,7 @@ ENV USERNAME=user \
USE_SSL=false
COPY nginx.conf common_default.conf ssl.conf /etc/nginx/
COPY start /
COPY init /
COPY ssl-gen /usr/local/bin
CMD ["/start"]
CMD ["/init"]

View File

@ -3,7 +3,10 @@
listen 80;
listen [::]:80;
include proxy_params;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_redirect off;

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# Make placeholder config directory
mkdir -p /config/frontend

View File

@ -29,25 +29,25 @@ http {
gzip on;
gzip_disable "msie6";
client_max_body_size 8M;
client_max_body_size 0;
auth_basic "Restricted";
auth_basic_user_file .htpasswd;
upstream rtorrent {
server seedbox_rtorrent_1;
server rtorrent;
}
upstream syncthing {
server seedbox_syncthing_1:8384;
server syncthing:8384;
}
upstream plex {
server seedbox_plex_1:32400;
server plex:32400;
}
upstream sickrage {
server seedbox_sickrage_1:8081;
server sickrage:8081;
}
server {

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# Short helper script to generate self signed SSL certificates.

View File

@ -1,4 +1,4 @@
FROM kelvinchen/seedbox:base
FROM ubuntu:xenial
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
# Install OpenVPN
@ -17,7 +17,7 @@ EXPOSE 1194/udp
VOLUME /config
COPY vars /usr/share/easy-rsa/
COPY openvpn.conf start client.ovpn /
COPY create-client /usr/local/bin/
COPY openvpn.conf init client.ovpn /
COPY export-client /usr/local/bin/
CMD ["/start"]
CMD ["/init"]

View File

@ -1,8 +1,12 @@
FROM kelvinchen/seedbox:base
FROM buildpack-deps:xenial-scm
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
RUN curl -sL "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=" > /tmp/plex.deb \
&& dpkg -i /tmp/plex.deb \
# Download plexupdate script and install Plex
# This script can be later used to update Plex directly in the container
RUN curl -sL "https://github.com/mrworf/plexupdate/raw/master/plexupdate.sh" \
> /usr/local/bin/plexupdate \
&& chmod +x /usr/local/bin/plexupdate \
&& plexupdate -pad \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -11,6 +15,6 @@ VOLUME /config
EXPOSE 32400
COPY plexmediaserver /etc/default/plexmediaserver
COPY start Preferences.xml /
COPY init Preferences.xml /
CMD ["/start"]
CMD ["/init"]

13
Dockerfiles/plex/init Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Update to latest plexpass version
if [[ "$PLEX_EMAIL" ]]; then
echo -e "EMAIL='$PLEX_EMAIL'\nPASS='$PLEX_PASSWORD'" > "$HOME/.plexupdate"
plexupdate -ad
fi
mkdir -p "/config/Plex Media Server/"
cp -n /Preferences.xml "/config/Plex Media Server/"
rm -f "/config/Plex Media Server/plexmediaserver.pid"
start_pms > /dev/null 2>&1

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
mkdir -p "/config/Plex Media Server/"
cp -n /Preferences.xml "/config/Plex Media Server/"
rm "/config/Plex Media Server/plexmediaserver.pid"
start_pms > /dev/null 2>&1

View File

@ -1,48 +1,35 @@
FROM kelvinchen/seedbox:base
FROM buildpack-deps:xenial-scm
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
# Install all dependencies
RUN echo "deb http://httpredir.debian.org/debian stretch main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
# Install dependencies
RUN apt-get update \
&& apt-get install -y \
supervisor \
rtorrent \
php5-fpm \
php5-cli \
php5-geoip \
mediainfo \
irssi \
libxml-libxml-perl \
libxml-libxslt-perl \
libjson-perl \
libjson-xs-perl \
libnet-ssleay-perl \
libdigest-perl \
libdigest-sha-perl \
libhtml-parser-perl \
libarchive-zip-perl \
php7.0-fpm \
php7.0-cli \
nginx \
unrar-free \
unzip \
ffmpeg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Configure/install r(u)torrent and autodl-irssi
# Configure/install r(u)torrent
RUN ln -s /config/rtorrent/rtorrent.rc ~/.rtorrent.rc \
&& mkdir -p /var/run/php \
&& git clone --depth=1 \
https://github.com/Novik/ruTorrent.git \
/opt/rutorrent \
&& git clone --depth=1 --recursive \
https://github.com/autodl-community/autodl-irssi.git \
~/.irssi/scripts \
&& mkdir -p ~/.irssi/scripts/autorun \
&& cp ~/.irssi/scripts/autodl-irssi.pl ~/.irssi/scripts/autorun \
&& ln -s /config/autodl/ ~/.autodl \
&& sed -i "s/www-data/root/g" /etc/php5/fpm/pool.d/www.conf
&& sed -i "s/www-data/root/g" /etc/php/7.0/fpm/pool.d/www.conf
VOLUME /config /torrents
EXPOSE 80 49161 49161/udp 6881/udp
COPY start rtorrent.rc supervisord.conf autodl.cfg /
COPY init rtorrent.rc supervisord.conf /
COPY nginx.conf /etc/nginx/nginx.conf
COPY rutorrent_config.php /opt/rutorrent/conf/config.php
COPY irssi.cfg /root/.irssi/config
CMD ["/start"]
CMD ["/init"]

View File

@ -1,3 +0,0 @@
[options]
gui-server-port = 39410
gui-server-password = password

View File

@ -7,17 +7,10 @@ mkdir -p /config/rtorrent
cp -n /rtorrent.rc /config/rtorrent/rtorrent.rc
# Remove rtorrent lock file if it exists so rtorrent can start
rm /config/rtorrent/rtorrent.lock
rm -f /config/rtorrent/rtorrent.lock
# Make folders for storing rutorrent data
mkdir -p /config/rutorrent/settings /config/rutorrent/torrents \
/config/rutorrent/users /config/rutorrent/plugins
# Copy all plugins in /config/rutorrent/plugins to the rutorrent directory
cp -rf $(ls -d1 /config/rutorrent/plugins/**) /opt/rutorrent/plugins/
# Set up autodl-irssi
mkdir -p /config/autodl
cp -n /autodl.cfg /config/autodl
supervisord -c /supervisord.conf

View File

@ -1,4 +0,0 @@
settings = {
core = { real_name = "irssi"; user_name = "irssi"; nick = "irssi"; };
"fe-text" = { actlist_sort = "refnum"; };
};

View File

@ -24,10 +24,7 @@ http {
access_log off;
error_log off;
gzip on;
gzip_disable "msie6";
client_max_body_size 8M;
client_max_body_size 0;
server {
listen 80 default_server;
@ -46,7 +43,7 @@ http {
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}

View File

@ -11,16 +11,10 @@ autorestart = true
[program:php]
priority = 2
command = php5-fpm -F -R
command = php-fpm7.0 -F -R
autorestart = true
[program:nginx]
priority = 3
command = nginx -g "daemon off;"
autorestart = true
[program:autodl-irssi]
priority = 4
environment = TERM=xterm
command = irssi
autorestart = true

View File

@ -1,4 +1,4 @@
FROM kelvinchen/seedbox:base
FROM buildpack-deps:xenial-scm
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
RUN apt-get update \

View File

@ -1,4 +1,4 @@
FROM kelvinchen/seedbox:base
FROM buildpack-deps:xenial-curl
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
RUN curl -sL https://syncthing.net/release-key.txt | apt-key add - \
@ -13,6 +13,6 @@ VOLUME /config
EXPOSE 8384 22000 21027/udp
COPY start config.xml /
COPY init config.xml /
CMD ["/start"]
CMD ["/init"]

View File

@ -47,6 +47,13 @@ at `/config/frontend/ssl.crt` and `/config/frontend/ssl.key` respectively. The
frontend image includes a command `ssl-gen` to automatically create self signed
certificates for you.
## PlexPass
If you own PlexPass, you can get the docker image to auto-update to the latest
PlexPass version when the container starts up. This is arguably bad docker
practice since containers are supposed to be immutable, but in this case, I
think the convenience outweighs that. All you have to do is set the
`PLEX_EMAIL` and `PLEX_PASSWORD` variables in the config file.
## Where is my data?
All data are saved in the docker volumes `seedbox_config` or
`seedbox_torrents`.
@ -58,7 +65,7 @@ editing the volumes settings in the `docker-compose.yml` file.
The OpenVPN container generates a single client key/cert pair by default.
Run the command below to get your OpenVPN config file:
```sh
$ docker exec seedbox_openvpn_1 create-client client >> client.ovpn
$ docker-compose exec openvpn export-client client >> client.ovpn
```
Edit the `client.ovpn` and replace the line `remote MYSERVER_HOST 1194` with
the hostname or IP address of your server.

View File

@ -22,8 +22,6 @@ while getopts ":nq" opt; do
esac
done
docker build -t kelvinchen/seedbox:base --pull Dockerfiles/base
docker build -t kelvinchen/seedbox:frontend $ARGS Dockerfiles/frontend &
docker build -t kelvinchen/seedbox:plex $ARGS Dockerfiles/plex &
docker build -t kelvinchen/seedbox:rtorrent $ARGS Dockerfiles/rtorrent &

View File

@ -1,3 +1,7 @@
USERNAME=username
PASSWORD=hunter2
USE_SSL=false
# For Plex Pass downlaod
PLEX_EMAIL=
PLEX_PASSWORD=

View File

@ -12,6 +12,7 @@ volumes:
services:
frontend:
image: kelvinchen/seedbox:frontend
build: Dockerfiles/frontend
restart: always
networks:
- main
@ -25,6 +26,7 @@ services:
rtorrent:
image: kelvinchen/seedbox:rtorrent
build: Dockerfiles/rtorrent
restart: always
networks:
- main
@ -38,6 +40,7 @@ services:
plex:
image: kelvinchen/seedbox:plex
build: Dockerfiles/plex
restart: always
networks:
- main
@ -46,9 +49,12 @@ services:
volumes:
- config:/config
- torrents:/torrents
env_file:
- config
sickrage:
image: kelvinchen/seedbox:sickrage
build: Dockerfiles/sickrage
restart: always
networks:
- main
@ -58,6 +64,7 @@ services:
syncthing:
image: kelvinchen/seedbox:syncthing
build: Dockerfiles/syncthing
restart: always
networks:
- main
@ -70,6 +77,7 @@ services:
openvpn:
image: kelvinchen/seedbox:openvpn
build: Dockerfiles/openvpn
restart: always
networks:
- main

View File

@ -2,7 +2,6 @@
# Push all images to the docker registry.
docker push kelvinchen/seedbox:base
docker push kelvinchen/seedbox:frontend
docker push kelvinchen/seedbox:plex
docker push kelvinchen/seedbox:rtorrent