summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-02 16:36:13 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-02 16:36:13 +0200
commitd2025190eba38cdcc3894130f756114374c08b3d (patch)
tree61a90ccf0f052f0a0b49aee66e04d22e49d62411
parentUse 'import' instead 'from' (2) (diff)
downloadpyload-d2025190eba38cdcc3894130f756114374c08b3d.tar.xz
Auto choose webserver
-rw-r--r--pyload/config/default.conf14
-rw-r--r--pyload/manager/thread/Server.py8
-rw-r--r--pyload/webui/__init__.py4
3 files changed, 13 insertions, 13 deletions
diff --git a/pyload/config/default.conf b/pyload/config/default.conf
index 17753bb8c..c70d4d71a 100644
--- a/pyload/config/default.conf
+++ b/pyload/config/default.conf
@@ -12,13 +12,13 @@ ssl - "SSL":
file key : "SSL Key" = ssl.key
webui - "Web User Interface":
- bool activated : "Activated" = True
- builtin;threaded;fastcgi;lightweight server : "Server" = threaded
- bool https : "Use HTTPS" = False
- ip host : "IP" = 0.0.0.0
- int port : "Port" = 8001
- Default;Dark;Flat;Next theme : "Theme" = Next
- str prefix : "Path Prefix" = None
+ bool activated : "Activated" = True
+ auto;threaded;fastcgi;lightweight server : "Server" = auto
+ bool https : "Use HTTPS" = False
+ ip host : "IP" = 0.0.0.0
+ int port : "Port" = 8001
+ Default;Dark;Flat;Next theme : "Theme" = Next
+ str prefix : "Path Prefix" = None
log - "Log":
bool file_log : "File Log" = True
diff --git a/pyload/manager/thread/Server.py b/pyload/manager/thread/Server.py
index 6eab58ca7..a26ffe6a1 100644
--- a/pyload/manager/thread/Server.py
+++ b/pyload/manager/thread/Server.py
@@ -63,7 +63,7 @@ class WebServer(threading.Thread):
log.warning(_("You need to download and compile bjoern, https://github.com/jonashaag/bjoern"))
log.warning(_("Copy the boern.so file to lib/Python/Lib or use setup.py install"))
log.warning(_("Of course you need to be familiar with linux and know how to compile software"))
- self.server = "builtin"
+ self.server = "auto"
else:
self.core.log.info(_("Server set to threaded, due to known performance problems on windows."))
self.core.config.set("webui", "server", "threaded")
@@ -76,15 +76,15 @@ class WebServer(threading.Thread):
elif self.server == "lightweight":
self.start_lightweight()
else:
- self.start_builtin()
+ self.start_auto()
- def start_builtin(self):
+ def start_auto(self):
if self.https:
log.warning(_("This server offers no SSL, please consider using `threaded` instead"))
self.core.log.info(_("Starting builtin webserver: %(host)s:%(port)d") % {"host": self.host, "port": self.port})
- webinterface.run_simple(host=self.host, port=self.port)
+ webinterface.run_auto(host=self.host, port=self.port)
def start_threaded(self):
diff --git a/pyload/webui/__init__.py b/pyload/webui/__init__.py
index 841e5abd9..3b3d62b26 100644
--- a/pyload/webui/__init__.py
+++ b/pyload/webui/__init__.py
@@ -103,8 +103,8 @@ if PREFIX:
import pyload.webui.app
-def run_simple(host="0.0.0.0", port="8000"):
- run(app=web, host=host, port=port, quiet=True)
+def run_auto(host="0.0.0.0", port="8000"):
+ run(app=web, host=host, port=port, server="auto", quiet=True)
def run_lightweight(host="0.0.0.0", port="8000"):