From c2998750dbb3d79b7455a079aa3f3d243715a15f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 7 Sep 2012 13:26:38 +0100 Subject: Support running on a different port from 8080 In order to allow multiple morph-cache-server instances to run on a single system, we need to support running on different ports. --- morph-cache-server | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'morph-cache-server') diff --git a/morph-cache-server b/morph-cache-server index 3a121d4..827da10 100755 --- a/morph-cache-server +++ b/morph-cache-server @@ -30,12 +30,17 @@ defaults = { 'repo-dir': '/var/cache/morph-cache-server/gits', 'bundle-dir': '/var/cache/morph-cache-server/bundles', 'artifact-dir': '/var/cache/morph-cache-server/artifacts', + 'port': 8080, } class MorphCacheServer(cliapp.Application): def add_settings(self): + self.settings.integer(['port'], + 'port to listen on', + metavar='PORTNUM', + default=defaults['port']) self.settings.string(['repo-dir'], 'path to the repository cache directory', metavar='PATH', @@ -128,7 +133,7 @@ class MorphCacheServer(cliapp.Application): root = Bottle() root.mount(app, '/1.0') - run(root, host='0.0.0.0', port=8080, reloader=True) + run(root, host='0.0.0.0', port=self.settings['port'], reloader=True) def _unescape_parameter(self, param): return urllib.unquote(param) -- cgit v1.2.1