From 3ef8e8bbc25854a699b386d57497dd5c93f20c20 Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Sun, 23 Sep 2012 18:32:16 -0500 Subject: [PATCH] Customize host in cfg.py. We start with a default of 127.0.0.1, because anything else is stupid. Change to 0.0.0.0 to serve to everybody. --- cfg.sample.py | 1 + plinth.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cfg.sample.py b/cfg.sample.py index 799984a86..ee57bb6e0 100644 --- a/cfg.sample.py +++ b/cfg.sample.py @@ -12,6 +12,7 @@ users_dir = os.path.join(data_dir, "users") product_name = "Plinth" box_name = "FreedomBox" +host = 127.0.0.1 port = 8000 ## Do not edit below this line ## diff --git a/plinth.py b/plinth.py index adab11012..5cdce88e2 100755 --- a/plinth.py +++ b/plinth.py @@ -54,7 +54,7 @@ class Root(plugin_mount.PagePlugin): raise cherrypy.InternalRedirect('/router') else: raise cherrypy.InternalRedirect('/help/about') - + def load_modules(): """Import all the symlinked .py files in the modules directory and all the .py files in directories linked in the modules directory @@ -121,7 +121,7 @@ def setup(): server.subscribe() # Configure default server - cherrypy.config.update({'server.socket_host': '127.0.0.1', + cherrypy.config.update({'server.socket_host': cfg.host, 'server.socket_port': cfg.port, 'server.thread_pool':10, 'tools.staticdir.root': cfg.file_root, @@ -130,7 +130,7 @@ def setup(): 'tools.sessions.storage_type':"file", 'tools.sessions.timeout':90, 'tools.sessions.storage_path':"%s/data/cherrypy_sessions" % cfg.file_root, - + }) config = {'/': {'tools.staticdir.root': '%s/static' % cfg.file_root, @@ -142,7 +142,7 @@ def setup(): } cherrypy.tree.mount(cfg.html_root, '/', config=config) cherrypy.engine.signal_handler.subscribe() - + def main(): setup()