From e93a180d9b4df1c7e6578f624b4e57d05937880c Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 11 Jan 2015 15:44:19 -0800 Subject: [PATCH] Initial commit --- Dockerfile | 46 +++++++++++++++++++++ auth | 1 + core.conf | 103 +++++++++++++++++++++++++++++++++++++++++++++++ run_deluge.sh | 5 +++ start | 5 +++ supervisord.conf | 19 +++++++++ web.conf | 22 ++++++++++ web_plugin.conf | 8 ++++ 8 files changed, 209 insertions(+) create mode 100644 Dockerfile create mode 100644 auth create mode 100644 core.conf create mode 100644 run_deluge.sh create mode 100644 start create mode 100644 supervisord.conf create mode 100644 web.conf create mode 100644 web_plugin.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f671bf9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:14.04 +MAINTAINER Dave P + +# Create user (user/password is deluge) +RUN useradd --create-home --uid 1000 deluge ; \ + echo "deluge:deluge" | chpasswd ; \ + locale-gen en + +# Install deluge +COPY auth /home/deluge/.config/deluge/ +COPY core.conf /home/deluge/.config/deluge/ +COPY web_plugin.conf /home/deluge/.config/deluge/ +COPY web.conf /home/deluge/.config/ +COPY run_deluge.sh / +RUN apt-get update ; \ + apt-get -y install deluged deluge-web deluge-console ; \ + chown -R deluge /home/deluge/.config ; \ + chgrp -R deluge /home/deluge/.config ; \ + chmod +x /run_deluge.sh + +# Install SSH server +RUN mkdir /var/run/sshd ; \ + apt-get -y install openssh-server + +# Install supervisor, vnstat, & start script +RUN apt-get -y install supervisor vnstat +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY start /start +RUN chmod +x /start ; \ + chown -R deluge /var/lib/vnstat ; \ + chgrp -R deluge /var/lib/vnstat ; \ + sed -i -e"s/^UnitMode\s0/UnitMode 1/" /etc/vnstat.conf ; \ + sed -i -e"s/^RateUnit\s1/RateUnit 0/" /etc/vnstat.conf + + +# Expose ssh, deluge, peer, deluge-web +EXPOSE 22 +EXPOSE 8112 +#EXPOSE 8113 +EXPOSE 58846 + +# REMEMBER TO MANUALLY SPECIFY A PEER PORT ON RUN + +# Set boot command +CMD /start + diff --git a/auth b/auth new file mode 100644 index 0000000..de3c897 --- /dev/null +++ b/auth @@ -0,0 +1 @@ +deluge:deluge:10 diff --git a/core.conf b/core.conf new file mode 100644 index 0000000..84664ab --- /dev/null +++ b/core.conf @@ -0,0 +1,103 @@ +{ + "file": 1, + "format": 1 +}{ + "info_sent": 0.0, + "lsd": true, + "send_info": false, + "move_completed_path": "/home/deluge", + "enc_in_policy": 1, + "queue_new_to_top": false, + "ignore_limits_on_local_network": true, + "rate_limit_ip_overhead": true, + "daemon_port": 58846, + "natpmp": true, + "max_active_limit": 8, + "utpex": true, + "max_active_downloading": 3, + "max_active_seeding": 5, + "allow_remote": true, + "max_half_open_connections": 50, + "download_location": "/home/deluge", + "compact_allocation": false, + "max_upload_speed": -1.0, + "cache_expiry": 60, + "prioritize_first_last_pieces": false, + "auto_managed": true, + "enc_level": 2, + "max_connections_per_second": 20, + "dont_count_slow_torrents": false, + "random_outgoing_ports": true, + "max_upload_slots_per_torrent": -1, + "new_release_check": false, + "enc_out_policy": 1, + "outgoing_ports": [ + 0, + 0 + ], + "seed_time_limit": 180, + "cache_size": 512, + "share_ratio_limit": 2.0, + "max_download_speed": -1.0, + "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", + "torrentfiles_location": "/home/deluge", + "stop_seed_at_ratio": false, + "peer_tos": "0x00", + "listen_interface": "", + "upnp": true, + "max_download_speed_per_torrent": -1, + "max_upload_slots_global": 4, + "enabled_plugins": [ + "WebUi" + ], + "random_port": false, + "autoadd_enable": false, + "max_connections_global": 200, + "enc_prefer_rc4": true, + "listen_ports": [ + 49013, + 49013 + ], + "dht": true, + "stop_seed_ratio": 2.0, + "seed_time_ratio_limit": 7.0, + "max_upload_speed_per_torrent": -1, + "copy_torrent_file": false, + "del_copy_torrent_file": false, + "move_completed": false, + "proxies": { + "peer": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "web_seed": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "tracker": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + }, + "dht": { + "username": "", + "password": "", + "type": 0, + "hostname": "", + "port": 8080 + } + }, + "add_paused": false, + "max_connections_per_torrent": -1, + "remove_seed_at_ratio": false, + "autoadd_location": "/home/deluge", + "plugins_location": "/home/deluge/.config/deluge/plugins" +} diff --git a/run_deluge.sh b/run_deluge.sh new file mode 100644 index 0000000..2b771f0 --- /dev/null +++ b/run_deluge.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd /home/deluge/ +su -c "/usr/bin/deluged --do-not-daemonize" deluge + diff --git a/start b/start new file mode 100644 index 0000000..b8ff4e6 --- /dev/null +++ b/start @@ -0,0 +1,5 @@ +#!/bin/bash + +# start services +supervisord + diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..7cf6e4e --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,19 @@ +[supervisord] +nodaemon=true + +[program:sshd] +command=/usr/sbin/sshd -D +autorestart=true + +[program:deluged] +autorestart=true +command=/run_deluge.sh + +[program:cron] +command=/usr/sbin/cron -f +autorestart=true + +[program:vnstatd] +command=/bin/su -c '/usr/sbin/vnstatd -n' deluge +autorestart=true + diff --git a/web.conf b/web.conf new file mode 100644 index 0000000..e2d9b3f --- /dev/null +++ b/web.conf @@ -0,0 +1,22 @@ +{ + "file": 1, + "format": 1 +}{ + "sidebar_show_zero": false, + "show_session_speed": false, + "pwd_sha1": "2ce1a410bcdcc53064129b6d950f2e9fee4edc1e", + "show_sidebar": true, + "sessions": {}, + "enabled_plugins": [], + "base": "/", + "first_login": false, + "theme": "gray", + "pkey": "ssl/daemon.pkey", + "cert": "ssl/daemon.cert", + "session_timeout": 3600, + "https": false, + "default_daemon": "", + "sidebar_multiple_filters": true, + "pwd_salt": "c26ab3bbd8b137f99cd83c2c1c0963bcc1a35cad", + "port": 8112 +} diff --git a/web_plugin.conf b/web_plugin.conf new file mode 100644 index 0000000..c96b8b6 --- /dev/null +++ b/web_plugin.conf @@ -0,0 +1,8 @@ +{ + "file": 1, + "format": 1 +}{ + "ssl": false, + "enabled": true, + "port": 8112 +}