diff --git a/Dockerfile b/Dockerfile index 64b49ec..3b97135 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ FROM linuxserver/baseimage MAINTAINER Etienne Blondelle +#Exposing ports and volumes +VOLUME ["/downloads", "/config"] +EXPOSE 8000 + #Installing pyLoad RUN echo "deb http://archive.ubuntu.com/ubuntu/ trusty-security multiverse" >> /etc/apt/sources.list \ && echo "deb-src http://archive.ubuntu.com/ubuntu/ trusty-security multiverse" >> /etc/apt/sources.list \ @@ -9,6 +13,7 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu/ trusty-security multiverse" >> / && apt-get install -y python \ python-pycurl \ python-crypto \ + python-openssl \ tesseract-ocr \ python-beaker \ python-imaging \ @@ -18,10 +23,11 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu/ trusty-security multiverse" >> / git \ rhino \ && git clone -b stable https://github.com/pyload/pyload.git /opt/pyload \ - && echo "/opt/pyload/pyload-config" > /opt/pyload/module/config/configdir \ + && echo "/config" > /opt/pyload/module/config/configdir \ && apt-get purge -y git \ && apt-get autoremove -y \ - && apt-get clean -y + && apt-get clean -y \ + && chown abc:abc -R /opt/pyload #Adding default config files ADD config/ /tmp/pyload-config @@ -29,7 +35,3 @@ ADD services/ /etc/service/ #Changing rights RUN chmod -v 0755 /etc/service/* /etc/service/*/run - -#Exposing ports and volumes -VOLUME /opt/pyload/Downloads -EXPOSE 8000 diff --git a/README.md b/README.md index 84676d4..17c8366 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,23 @@ $ docker create \ -p 8000:8000 \ -e PUID= -e PGID= \ -e TZ=/ \ - -v :/opt/pyload/Downloads \ + -v :/downloads \ + -v :/config \ cobraeti/pyload ``` ### Parameters - * -p 8000:8000 - the webUI port mapping - * -v :/opt/pyload/Downloads - path to your downloads folder + * -p 8000:8000 - The webUI port mapping + * -v :/downloads - Path to your downloads folder + * -v :/config - Path to your configs folder (recommended for persisting config) * -v /etc/localtime:/etc/localtime:ro - Share of the host localtime (optionnal) - * -e PUID= for UserID - see below for explanation - * -e PGID= for GroupID - see below for explanation + * -e PUID= for UserID - See below for explanation + * -e PGID= for GroupID - See below for explanation * -e TZ=/ for timezone information - eg Europe/Paris ### User / Group Identifiers From LinuxServer.io description: -> TL;DR - The PGID and PUID values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). +> The PGID and PUID values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). > Part of what makes our containers work so well is by allowing you to specify your own PUID and PGID. This avoids nasty permissions errors with relation to data volumes (-v flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. ### Default configs @@ -34,7 +36,7 @@ The default port for webUI is 8000 and must stay like that. If you need to use a * Default login: `admin` * Default password: `pyload` -You can (and should ^^) change the password through the webUI (Top right corner > Administrate > User > change). +You can (and should :yum:) change the password through the webUI (Top right corner > Administrate > User > change). If you want to create users, you need to run the following command on the docker host: ```shellsession @@ -51,7 +53,10 @@ Notes: * Don't forget to leave the user management script with choice 4 (Quit) or users won't be added #### Downloads folder -The default folder for downloads is `/opt/pyload/Downloads`and must stay like that. If you need to change the destination folder for downloads, only change the volume mapping when creating the container (ex: `$ docker create --name pyLoad -v :/pyload/downloads ...`) +The default folder for downloads is `/downloads`and must stay like that. If you need to change the destination folder for downloads, only change the volume mapping when creating the container (eg: `$ docker create --name pyLoad -v :/downloads ...`) #### Remote control If you are planning to activate this option, just add a port mapping for the dedicated port with `-p 7227:7227` and when pyload is up, just activate the remote control in the dedicated config menu (Top right corner > Config tab > General tab > Menu tab > Remote > Activated > on) + +#### SSL +The container was packed with all requirements (obviously except for GUI...), so you just have to add a volume mapping to a folder containing your certificate and key with `-v :/ssl` and configure SSL in the dedicated config menu (Top right corner > Config tab > General tab > Menu tab > SSL) diff --git a/config/files.db b/config/files.db index 26e5573..ae53e98 100644 Binary files a/config/files.db and b/config/files.db differ diff --git a/config/pyload.conf b/config/pyload.conf index a7317d5..964ec87 100644 --- a/config/pyload.conf +++ b/config/pyload.conf @@ -1,74 +1,74 @@ version: 1 -remote - "Remote": - bool nolocalauth : "No authentication on local connections" = True - bool activated : "Activated" = False - int port : "Port" = 7227 - ip listenaddr : "Adress" = 0.0.0.0 +download - "Download": + int chunks : "Max connections for one download" = 3 + str interface : "Download interface to bind (ip or Name)" = None + bool ipv6 : "Allow IPv6" = False + bool limit_speed : "Limit Download Speed" = False + int max_downloads : "Max Parallel Downloads" = 3 + int max_speed : "Max Download Speed in kb/s" = -1 + bool skip_existing : "Skip already existing files" = False + +downloadTime - "Download Time": + time end : "End" = 0:00 + time start : "Start" = 0:00 + +general - "General": + bool checksum : "Use Checksum" = False + bool debug_mode : "Debug Mode" = False + folder download_folder : "Download Folder" = /downloads + bool folder_per_package : "Create folder for each package" = True + en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en + int min_free_space : "Min Free Space (MB)" = 200 + int renice : "CPU Priority" = 0 log - "Log": - int log_size : "Size in kb" = 100 - folder log_folder : "Folder" = Logs bool file_log : "File Log" = True int log_count : "Count" = 5 + folder log_folder : "Folder" = Logs bool log_rotate : "Log Rotate" = True + int log_size : "Size in kb" = 100 permission - "Permissions": - str group : "Groupname" = users bool change_dl : "Change Group and User of Downloads" = False bool change_file : "Change file mode of downloads" = False - str user : "Username" = user - str file : "Filemode for Downloads" = 0644 bool change_group : "Change group of running process" = False - str folder : "Folder Permission mode" = 0755 bool change_user : "Change user of running process" = False - -general - "General": - en;de;fr;it;es;nl;sv;ru;pl;cs;sr;pt_BR language : "Language" = en - folder download_folder : "Download Folder" = /opt/pyload/Downloads - bool checksum : "Use Checksum" = False - bool folder_per_package : "Create folder for each package" = True - bool debug_mode : "Debug Mode" = False - int min_free_space : "Min Free Space (MB)" = 200 - int renice : "CPU Priority" = 0 - -ssl - "SSL": - file cert : "SSL Certificate" = ssl.crt - bool activated : "Activated" = False - file key : "SSL Key" = ssl.key - -webinterface - "Webinterface": - str template : "Template" = default - bool activated : "Activated" = True - str prefix : "Path Prefix" = - builtin;threaded;fastcgi;lightweight server : "Server" = builtin - ip host : "IP" = 0.0.0.0 - bool https : "Use HTTPS" = False - int port : "Port" = 8000 + str file : "Filemode for Downloads" = 0644 + str folder : "Folder Permission mode" = 0755 + str group : "Groupname" = users + str user : "Username" = user proxy - "Proxy": - str username : "Username" = None - bool proxy : "Use Proxy" = False str address : "Address" = "localhost" password password : "Password" = None - http;socks4;socks5 type : "Protocol" = http int port : "Port" = 7070 + bool proxy : "Use Proxy" = False + http;socks4;socks5 type : "Protocol" = http + str username : "Username" = None reconnect - "Reconnect": - time endTime : "End" = 0:00 bool activated : "Use Reconnect" = False + time endTime : "End" = 0:00 str method : "Method" = None time startTime : "Start" = 0:00 -download - "Download": - int max_downloads : "Max Parallel Downloads" = 3 - bool limit_speed : "Limit Download Speed" = False - str interface : "Download interface to bind (ip or Name)" = None - bool skip_existing : "Skip already existing files" = False - int max_speed : "Max Download Speed in kb/s" = -1 - bool ipv6 : "Allow IPv6" = False - int chunks : "Max connections for one download" = 3 +remote - "Remote": + bool activated : "Activated" = False + ip listenaddr : "Adress" = 0.0.0.0 + bool nolocalauth : "No authentication on local connections" = True + int port : "Port" = 7227 -downloadTime - "Download Time": - time start : "Start" = 0:00 - time end : "End" = 0:00 +ssl - "SSL": + bool activated : "Activated" = False + file cert : "SSL Certificate" = ssl.crt + file key : "SSL Key" = ssl.key + +webinterface - "Webinterface": + bool activated : "Activated" = True + ip host : "IP" = 0.0.0.0 + bool https : "Use HTTPS" = False + int port : "Port" = 8000 + str prefix : "Path Prefix" = + builtin;threaded;fastcgi;lightweight server : "Server" = builtin + str template : "Template" = classic diff --git a/services/pyload/run b/services/pyload/run index 9ceee78..66ce31d 100644 --- a/services/pyload/run +++ b/services/pyload/run @@ -2,21 +2,22 @@ umask 0002 #Checking if config files exists (if not, copy default ones) -if [ ! -f "/opt/pyload/pyload-config/files.db" ] || [ ! -f "/opt/pyload/pyload-config/files.version" ] || [ ! -f "/opt/pyload/pyload-config/plugin.conf" ] || [ ! -f "/opt/pyload/pyload-config/pyload.conf" ] +if [ ! -f "/config/files.db" ] || [ ! -f "/config/files.version" ] || [ ! -f "/config/plugin.conf" ] || [ ! -f "/config/pyload.conf" ] then - mkdir -p /opt/pyload/pyload-config - chmod 777 /opt/pyload/pyload-config + mkdir -p /config + chmod 777 /config - mv /tmp/pyload-config/* /opt/pyload/pyload-config/ + mv /tmp/pyload-config/* /config/ fi -if [ -f "/opt/pyload/pyload-config/pyload.pid" ] +if [ -f "/config/pyload.pid" ] then - rm -f /opt/pyload/pyload-config/pyload.pid + rm -f /config/pyload.pid fi #Changing rights if needed chown -v abc:abc -R /opt/pyload +chown -v abc:abc -R /config #Starting pyload exec /sbin/setuser abc /usr/bin/python /opt/pyload/pyLoadCore.py