Make built-in server actually use the "host" config field

This commit is contained in:
flan 2017-11-06 17:35:29 +01:00
parent ca106e6136
commit 354354ca72
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
[sync_app]
host = 127.0.0.1
# change to 127.0.0.1 if you don't want the server to be accessible from the internet
host = 0.0.0.0
port = 27701
data_root = ./collections
base_url = /sync/

View File

@ -692,7 +692,7 @@ def main():
config.read("ankisyncd.conf")
ankiserver = SyncApp(config)
httpd = make_server('', config.getint("sync_app", "port"), ankiserver)
httpd = make_server(config.get("sync_app", "host"), config.getint("sync_app", "port"), ankiserver)
try:
print("Serving HTTP on {} port {}...".format(*httpd.server_address))