Make HTTP address configurable

This commit is contained in:
Sam Whited 2015-07-22 01:15:39 -05:00
parent 4dde390ae5
commit f8bc7c6242
3 changed files with 3 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
# https://github.com/github/gitignor
# https://github.com/github/gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

View File

@ -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

View File

@ -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'])