From c6afe5d6597d3648bc1c6bc2e25102cad05b2227 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 18 Apr 2019 13:39:14 -0500 Subject: Add: optional port config setting for port to listen on Defaults to the old 12765 port number. --- muck_poc | 6 ++++-- yarns/lib.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/muck_poc b/muck_poc index 0e37c41..e0b1729 100755 --- a/muck_poc +++ b/muck_poc @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (C) 2018 Lars Wirzenius +# Copyright (C) 2018-2019 Lars Wirzenius # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -250,6 +250,8 @@ if config.get('pid'): with open(config['pid'], 'w') as f: f.write(str(pid)) +port = config.get('port', 12765) + app = bottle.default_app() api = MuckAPI(app, store, signing_key_text) -bottle.run(host='127.0.0.1', port=12765) +bottle.run(host='127.0.0.1', port=port) diff --git a/yarns/lib.py b/yarns/lib.py index f64af8d..3293a5d 100644 --- a/yarns/lib.py +++ b/yarns/lib.py @@ -41,6 +41,7 @@ def start_muck(): config = { 'pid': 'muck.pid', + 'port': 9999, 'log': 'muck.log', 'store': datadir, 'signing-key-filename': pubkey, @@ -58,7 +59,7 @@ def start_muck(): ] subprocess.check_call(argv) time.sleep(2) - V['base_url'] = 'http://127.0.0.1:{}'.format(12765) + V['base_url'] = 'http://127.0.0.1:{}'.format(config['port']) def stop_muck(): -- cgit v1.2.1