From ecfb827446eda392b84b8fecfe1b95fdd55c5f8b Mon Sep 17 00:00:00 2001 From: daw1012345 Date: Thu, 26 Dec 2024 18:57:19 +0100 Subject: [PATCH] Remove references to VITE_CALDERA_URL Related to the removal for VITE_CALDRA_URL in the magma repository in favor of using window.location.origin --- README.md | 4 +--- conf/default.yml | 1 - server.py | 8 -------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index a5e813263..de17ff756 100644 --- a/README.md +++ b/README.md @@ -88,11 +88,9 @@ Finally, start the server. ```Bash python3 server.py --insecure --build ``` -The --build flag automatically installs any VueJS UI dependencies, bundles the UI into a dist directory, writes the Magma plugin's `.env` file, and is served by the Caldera server. You will only have to use the --build flag again if you add any plugins or make any changes to the UI. +The --build flag automatically installs any VueJS UI dependencies, bundles the UI into a dist directory and is served by the Caldera server. You will only have to use the --build flag again if you add any plugins or make any changes to the UI. Once started, log into http://localhost:8888 using the default credentials red/admin. Then go into Plugins -> Training and complete the capture-the-flag style training course to learn how to use Caldera. -In some situations the default configuration values can cause the UI to appear unresponsive due to misrouted requests. Modify the `app.frontend.api_base_url` config value and start the server using the --build flag to update the UI's request URL environment variable. - If you prefer to not use the new VueJS UI, revert to Caldera v4.2.0. Correspondingly, do not use the `--build` flag for earlier versions as not required. ### User Interface Development diff --git a/conf/default.yml b/conf/default.yml index 4e3e45488..afae89d9d 100644 --- a/conf/default.yml +++ b/conf/default.yml @@ -22,7 +22,6 @@ 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 7fc4d5b40..5e51d4f4f 100644 --- a/server.py +++ b/server.py @@ -147,13 +147,6 @@ async def start_vue_dev_server(): logging.info("VueJS development server is live.") -def configure_magma_env_file(): - logging.info("Setting VueJS environment file.") - url = BaseWorld.get_config("app.frontend.api_base_url") - with open(f"{MAGMA_PATH}/.env", "w") as fp: - fp.write(f"VITE_CALDERA_URL={url}") - - def _get_parser(): def list_str(values): @@ -269,7 +262,6 @@ def list_str(values): if args.build: if len(os.listdir(MAGMA_PATH)) > 0: - configure_magma_env_file() logging.info("Building VueJS front-end.") subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True) subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)