diff --git a/deluge/ui/webui/config_tabs_webui.py b/deluge/ui/webui/config_tabs_webui.py index 5f63cfe45..5c481d2a5 100644 --- a/deluge/ui/webui/config_tabs_webui.py +++ b/deluge/ui/webui/config_tabs_webui.py @@ -61,12 +61,6 @@ class Template(config_forms.WebCfgForm): class Server(config_forms.WebCfgForm): title = _("Server") port = forms.IntegerField(label = _("Port"),min_value=80) - use_https = forms.CheckBox(_("Use https (BROKEN)")) - - try: - import OpenSSL - except ImportError: - info = _("pyopenssl not installed, install this for https.") def post_save(self): pass diff --git a/deluge/ui/webui/deluge_webserver.py b/deluge/ui/webui/deluge_webserver.py index 398cea266..25a714263 100644 --- a/deluge/ui/webui/deluge_webserver.py +++ b/deluge/ui/webui/deluge_webserver.py @@ -35,6 +35,7 @@ from deluge.configmanager import ConfigManager import pkg_resources from deluge.ui.client import sclient import components +from deluge.log import LOG as log # Initialize gettext locale.setlocale(locale.LC_MESSAGES, '') @@ -80,49 +81,41 @@ config_forms.register() def WsgiApplication(middleware = None): - if not middleware: - middleware = [] from web import webpyfunc, wsgifunc from deluge import component - pagemanager = component.get("PageManager") + pagemanager = component.get("PageManager") + if not middleware: + middleware = [] + return wsgifunc(webpyfunc(pagemanager.urls, pagemanager.page_classes, False), *middleware) -def WebServer(debug = False): +def create_webserver(debug = False): "starts builtin webserver" + import web utils.set_config_defaults() config.set('base','') config.set('disallow',{}) utils.apply_config() - import web from lib.gtk_cherrypy_wsgiserver import CherryPyWSGIServer + middleware = None if debug: middleware = [web.reloader] - else: - middleware = [] wsgi_app = WsgiApplication(middleware) server_address=("0.0.0.0", int(config.get('port'))) server = CherryPyWSGIServer(server_address, wsgi_app, server_name="localhost") - """if config.get('use_https'): - server.ssl_certificate = os.path.join(ws.webui_path,'ssl/deluge.pem') - server.ssl_private_key = os.path.join(ws.webui_path,'ssl/deluge.key') - """ - - print "http://%s:%d/" % server_address + log.info("http://%s:%d/" % server_address) return server -def mod_wsgi_application(sub_dir, config_dir , template_dir): - pass - def run(debug = False): - server = WebServer(debug) + server = create_webserver(debug) try: server.start() except KeyboardInterrupt: diff --git a/deluge/ui/webui/webserver_common.py b/deluge/ui/webui/webserver_common.py index 5a9555d99..c2ae27466 100644 --- a/deluge/ui/webui/webserver_common.py +++ b/deluge/ui/webui/webserver_common.py @@ -66,7 +66,6 @@ CONFIG_DEFAULTS = { "pwd_salt":"2\xe8\xc7\xa6(n\x81_\x8f\xfc\xdf\x8b\xd1\x1e\xd5\x90", "pwd_md5":".\xe8w\\+\xec\xdb\xf2id4F\xdb\rUc", "cache_templates":True, - "use_https":False, "daemon":"http://localhost:58846", "base":"", "disallow":{}