Skip to content

Commit

Permalink
Uses a dedicated setting to generate the magma VITE_CALDERA_URL variable
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jbaptperez committed Jun 17, 2024
1 parent a6c3d7c commit 3784390
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions conf/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 3784390

Please sign in to comment.