diff --git a/Dockerfile b/Dockerfile index db7dfc8e3792c92f2f5a1c640685227f033347d3..f853de756d000de83aaeaaf5c068fc9810c3f54e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM lsiobase/alpine:3.7 # set version label ARG BUILD_DATE ARG VERSION -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="sparklyballs" +LABEL build_version="Cylo.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="cylo" #Â environment variables ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" @@ -46,12 +46,21 @@ RUN \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ - rm -rf \ - /root/.cache + rm -rf /root/.cache && \ + wget -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz && \ + gunzip GeoIP.dat.gz && \ + mkdir -p /usr/share/GeoIP && \ + mv GeoIP.dat /usr/share/GeoIP/GeoIP.dat #Â add local files COPY root/ / +RUN mkdir /configs +COPY configs /configs +RUN chmod +x /Entrypoint.sh -#Â ports and volumes +#Â ports EXPOSE 8112 58846 58946 58946/udp -VOLUME /config /downloads + +ENTRYPOINT /Entrypoint.sh + +CMD ["/init"] \ No newline at end of file diff --git a/configs/core.conf b/configs/core.conf new file mode 100644 index 0000000000000000000000000000000000000000..26b3dda1a72442c7fd03ec4e712dbb85c20f3a1c --- /dev/null +++ b/configs/core.conf @@ -0,0 +1,106 @@ +{ +"file": 1, +"format": 1 +}{ +"info_sent": 0.0, +"lsd": true, +"send_info": false, +"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": 999, +"utpex": true, +"max_active_downloading": 999, +"max_active_seeding": 999, +"allow_remote": true, +"max_half_open_connections": 50, +"download_location": "/torrents/downloading", +"move_completed_path": "/torrents/completed", +"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": 0, +"cache_size": 32768, +"share_ratio_limit": 0.0, +"max_download_speed": -1.0, +"geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", +"torrentfiles_location": "/torrents/config/torrents", +"stop_seed_at_ratio": false, +"peer_tos": "0x00", +"listen_interface": "", +"upnp": true, +"max_download_speed_per_torrent": -1, +"max_upload_slots_global": -1, +"enabled_plugins": [ +"AutoAdd", +"Scheduler", +"Label", +"Notifications" +], +"random_port": false, +"autoadd_enable": false, +"max_connections_global": -1, +"enc_prefer_rc4": true, +"listen_ports": [ +6881, +6891 +], +"dht": true, +"stop_seed_ratio": 2.0, +"seed_time_ratio_limit": 0.0, +"max_upload_speed_per_torrent": -1, +"copy_torrent_file": true, +"del_copy_torrent_file": true, +"move_completed": true, +"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": "/torrents/config/watch", +"plugins_location": "/torrents/config/deluge/plugins" +} \ No newline at end of file diff --git a/configs/web.conf b/configs/web.conf new file mode 100644 index 0000000000000000000000000000000000000000..eb4d63ef00fb0adfdc60033e453d164ac099e437 --- /dev/null +++ b/configs/web.conf @@ -0,0 +1,19 @@ +{ + "file": 1, + "format": 1 +}{ + "sidebar_show_zero": false, + "pwd_sha1": "4f496c6a4e555132a1cc4034127a6af4bff88644", + "show_sidebar": true, + "enabled_plugins": [], + "first_login": false, + "theme": "gray", + "session_timeout": 3600, + "base": "/", + "show_session_speed": false, + "https": false, + "default_daemon": "127.0.0.1:58846", + "sidebar_multiple_filters": true, + "pwd_salt": "5588bea86a36353faf34c488a54e81a39a8fab27", + "port": 8112 +} \ No newline at end of file diff --git a/root/Entrypoint.sh b/root/Entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..47d6051592410e33d8a2c629db64ecab558117c4 --- /dev/null +++ b/root/Entrypoint.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +set -x + +mkdir -p /torrents/downloading +mkdir -p /torrents/completed +mkdir -p /torrents/config/deluge +mkdir -p /torrents/config/deluge/plugins +mkdir -p /torrents/config/log +mkdir -p /torrents/config/torrents +mkdir -p /torrents/config/watch + +mv /configs/* /torrents/config/deluge/ +rm -fr /configs + +chown -R abc:abc /torrents + +chmod +x /deluge-pass.py +/deluge-pass.py /torrents/config/deluge ${DELUGE_PASSWORD} + +exec "/init" diff --git a/root/deluge-pass.py b/root/deluge-pass.py new file mode 100644 index 0000000000000000000000000000000000000000..fa9ff5da1ca221f56cf8e645933b4fc4e218de08 --- /dev/null +++ b/root/deluge-pass.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# Changes the password for Deluge's Web UI + +from deluge.config import Config +import hashlib +import os.path +import sys +import subprocess + +if len(sys.argv) == 3: + deluge_dir = os.path.expanduser(sys.argv[1]) + + if os.path.isdir(deluge_dir): + try: + config = Config("web.conf", config_dir=deluge_dir) + except IOError, e: + print "Can't open web ui config file: ", e + else: + p = sys.argv[2] + password = sys.argv[2] + s = hashlib.sha1() + s.update(config['pwd_salt']) + s.update(password) + config['pwd_sha1'] = s.hexdigest() + try: + config.save() + except IOError, e: + print "Couldn't save new password: ", e + else: + print "New password successfully set!" + else: + print "%s is not a directory!" % deluge_dir +else: + print "Usage: %s <deluge config dir> <pass>" % (os.path.basename(sys.argv[0])) \ No newline at end of file diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index 3c84a24b1656113ab82f4d43a17a11f02a2c62b8..0000000000000000000000000000000000000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash - -#Â permissions -chown -R abc:abc \ - /config -chown abc:abc \ - /downloads diff --git a/root/etc/services.d/deluge-web/run b/root/etc/services.d/deluge-web/run index 7566762c9ff1094369e3371acf516bc75c9b6c09..83aadee67f5ee0e520ffe4833bd5ed0fb3f4cfe7 100644 --- a/root/etc/services.d/deluge-web/run +++ b/root/etc/services.d/deluge-web/run @@ -6,4 +6,4 @@ umask "$UMASK_SET" exec \ s6-setuidgid abc /usr/bin/deluge-web \ - -c /config --loglevel=info + -c /torrents/config/deluge/ --loglevel=info diff --git a/root/etc/services.d/deluged/run b/root/etc/services.d/deluged/run index 00781cf9b48248c84fe64ed5d5f7de2c7874d430..0469502b20c4aa794976ce77da67c02296c5bb09 100644 --- a/root/etc/services.d/deluged/run +++ b/root/etc/services.d/deluged/run @@ -5,5 +5,5 @@ UMASK_SET=${UMASK_SET:-022} umask "$UMASK_SET" exec \ - s6-setuidgid abc /usr/bin/deluged -c /config \ - -d --loglevel=info -l /config/deluged.log + s6-setuidgid abc /usr/bin/deluged -c /torrents/config/deluge/ \ + -d --loglevel=info -l /torrents/config/log/deluged.log