Skip to content

Commit

Permalink
docker_setup.py does not append new public port to flask.server_name …
Browse files Browse the repository at this point in the history
…and instead warns user
  • Loading branch information
dale-wahl committed Nov 2, 2023
1 parent 3e5cf61 commit 0c179e9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions docker/docker_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,9 @@ def update_config_from_environment(CONFIG_FILE, config_parser):
frontend_servername = config.get('flask.server_name').split(":")[0]
# Check if port changed
if frontend_port != public_port:
if public_port == 80:
# Set flask.server to existing frontend_servername with no port
config.set('flask.server_name', f"{frontend_servername}")
print(f"Updated flask.server_name: {frontend_servername}")
else:
# Set flask.server to existing frontend_servername with the new public_port
config.set('flask.server_name', f"{frontend_servername}:{public_port}")
print(f"Updated flask.server_name with new public port: {frontend_servername}:{public_port}")
print(f"Exposed PUBLIC_PORT {public_port} from .env file not included in Server Name; if you are not using a reverse proxy, you may need to update the Server Name variable.")
print(f"You can do so by running the following command if you do not have access to the 4CAT frontend Control Panel:\n"
f"docker exec 4cat_backend python -c \"from common.config_manager import config;config.set('flask.server_name', '{frontend_servername}:{public_port}');\"")

print(f"\nStarting app\n"
f"4CAT is accessible at:\n"
Expand Down

0 comments on commit 0c179e9

Please sign in to comment.