Ticket #1908: webui.patch

File webui.patch, 3.2 KB (added by friedrichg2, 13 years ago)

fixed huge mistake...

  • deluge/ui/web/server.py

    diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py
    index 072de51..d09f6b4 100644
    a b  
    8080
    8181    # Server Settings
    8282    "base": "/",
     83    "interface": "0.0.0.0",
    8384    "port": 8112,
    8485    "https": False,
    8586    "pkey": "ssl/daemon.pkey",
    def __init__(self):  
    607608        self.socket = None
    608609        self.top_level = TopLevel()
    609610        self.site = server.Site(self.top_level)
     611        self.interface = self.config["interface"]
    610612        self.port = self.config["port"]
    611613        self.https = self.config["https"]
    612614        self.pkey = self.config["pkey"]
    def start(self, start_reactor=True):  
    649651            reactor.run()
    650652
    651653    def start_normal(self):
    652         self.socket = reactor.listenTCP(self.port, self.site)
    653         log.info("serving on %s:%s view at http://127.0.0.1:%s", "0.0.0.0",
    654                  self.port, self.port)
     654        self.socket = reactor.listenTCP(self.port, self.site,
     655                 interface=self.interface)
     656        log.info("serving on %s:%s view at http://%s:%s", self.interface,
     657                 self.port, self.interface, self.port)
    655658
    656659    def start_ssl(self):
    657660        check_ssl_keys()
    658         self.socket = reactor.listenSSL(self.port, self.site, ServerContextFactory())
    659         log.info("serving on %s:%s view at https://127.0.0.1:%s", "0.0.0.0",
    660                  self.port, self.port)
     661        self.socket = reactor.listenSSL(self.port, self.site, ServerContextFactory(),
     662                 interface=self.interface)
     663        log.info("serving on %s:%s view at https://%s:%s", self.interface,
     664                 self.port, self.interface, self.port)
    661665
    662666    def stop(self):
    663667        log.info("Shutting down webserver")
  • deluge/ui/web/web.py

    diff --git a/deluge/ui/web/web.py b/deluge/ui/web/web.py
    index fb440b9..b9ded11 100644
    a b def __init__(self):  
    7171            group.add_option("-g", "--group", dest="group", type="str",
    7272                help="Group to switch to. Only use it when starting as root",
    7373                action="store", default=None)
     74        group.add_option("-i", "--interface", dest="interface",
     75            type="str", help="Binds the webserver to a specific IP address",
     76            action="store", default=None)
    7477        group.add_option("-p", "--port", dest="port", type="int",
    7578            help="Sets the port to be used for the webserver",
    7679            action="store", default=None)
    def start(self):  
    135138        if self.options.base:
    136139            self.server.base = self.options.base
    137140
     141        if self.options.interface:
     142            self.server.interface = self.options.interface
     143
    138144        if self.options.port:
    139145            self.server.port = self.options.port
    140146
  • docs/man/deluge-web.1

    diff --git a/docs/man/deluge-web.1 b/docs/man/deluge-web.1
    index b3d861c..10eabec 100644
    a b Set the base path that the ui is running on (proxying)  
    2222.B -f, --fork
    2323Fork the web interface process into the background
    2424.TP
     25.B -i INTERFACE, --interface=INTERFACE
     26Binds the webserver to a specific IP address
     27.TP
    2528.B -p PORT, --port=PORT
    2629Sets the port to be used for the webserver
    2730.TP