From 37843904f9f9b87fdfdc65af464247e9b0433cff Mon Sep 17 00:00:00 2001 From: jean-baptiste-perez-bib Date: Tue, 4 Jun 2024 17:39:16 +0200 Subject: [PATCH] Uses a dedicated setting to generate the magma VITE_CALDERA_URL variable The generated .env file used "host" and "port" settings which were not suitable for client URL generation (they are HTTP server listening settings, not client URL components). --- conf/default.yml | 1 + server.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/default.yml b/conf/default.yml index afae89d9db..4e3e454883 100644 --- a/conf/default.yml +++ b/conf/default.yml @@ -22,6 +22,7 @@ app.contact.ftp.user: caldera_user app.contact.tcp: 0.0.0.0:7010 app.contact.udp: 0.0.0.0:7011 app.contact.websocket: 0.0.0.0:7012 +app.frontend.api_base_url: http://localhost:8888 objects.planners.default: atomic crypt_salt: REPLACE_WITH_RANDOM_VALUE encryption_key: ADMIN123 diff --git a/server.py b/server.py index a759e7f552..7fc4d5b401 100644 --- a/server.py +++ b/server.py @@ -149,10 +149,9 @@ async def start_vue_dev_server(): def configure_magma_env_file(): logging.info("Setting VueJS environment file.") - host = BaseWorld.get_config("host") - port = BaseWorld.get_config("port") + url = BaseWorld.get_config("app.frontend.api_base_url") with open(f"{MAGMA_PATH}/.env", "w") as fp: - fp.write(f"VITE_CALDERA_URL=http://{host}:{port}") + fp.write(f"VITE_CALDERA_URL={url}") def _get_parser():