Merge pull request #84 from ranlo/ranlo-patch-1

Make the frontend port configurable
This commit is contained in:
Félix Aimé 2022-06-04 22:04:32 +02:00 committed by GitHub
commit 4059562f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -52,6 +52,7 @@ frontend:
user_lang: userlang
update: updateoption
choose_net: false
http_port: 80
# NETWORK -
# Some elements related to the network configuration, such as

View File

@ -46,7 +46,12 @@ app.register_blueprint(misc_bp, url_prefix='/api/misc')
app.register_blueprint(update_bp, url_prefix='/api/update')
if __name__ == '__main__':
port = ""
try:
port = int(read_config(("frontend", "http_port")))
except:
port = 80
if read_config(("frontend", "remote_access")):
app.run(host="0.0.0.0", port=80)
app.run(host="0.0.0.0", port=port)
else:
app.run(port=80)
app.run(port=port)