From f8bc7c6242557a9d495845c30ff555196e7b9f2f Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Wed, 22 Jul 2015 01:15:39 -0500 Subject: [PATCH] Make HTTP address configurable --- .gitignore | 2 +- config.yml | 1 + server.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bd5bb21..eed2da3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# https://github.com/github/gitignor +# https://github.com/github/gitignore # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/config.yml b/config.yml index d7acc35..47eef4a 100644 --- a/config.yml +++ b/config.yml @@ -6,6 +6,7 @@ whitelist: - siacs.eu - gultsch.de max_file_size: 20971520 #20MiB +http_address: 127.0.0.1 http_port: 8080 get_url : http://upload.siacs.eu:8080 put_url : http://upload.siacs.eu:8080 diff --git a/server.py b/server.py index 619f5e0..1288a53 100755 --- a/server.py +++ b/server.py @@ -181,7 +181,7 @@ if __name__ == "__main__": logging.basicConfig(level=LOGLEVEL, format='%(asctime)-24s %(levelname)-8s %(message)s', filename=args.logfile) - server = ThreadedHTTPServer(('0.0.0.0', config['http_port']), HttpHandler) + server = ThreadedHTTPServer((config['http_address'], config['http_port']), HttpHandler) if 'keyfile' in config and 'certfile' in config: server.socket = ssl.wrap_socket(server.socket, keyfile=config['keyfile'], certfile=config['certfile']) xmpp = MissingComponent(config['jid'],config['secret'])