From d0ff6e7b5f37e6a2b21462839728d792e4ddf687 Mon Sep 17 00:00:00 2001 From: kmpepper Date: Fri, 13 Feb 2026 18:14:13 +0000 Subject: [PATCH 1/3] Updating caldera server to launch without magma plugin --- server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index b420c6045..37c4ba677 100644 --- a/server.py +++ b/server.py @@ -269,10 +269,16 @@ def list_str(values): app_svc.register_subapp("/api/v2", app.api.v2.make_app(app_svc.get_services())) init_swagger_documentation(app_svc.application) if args.uiDevHost: - if not os.path.exists(f"{MAGMA_PATH}/dist"): + if not os.path.exists(f"{MAGMA_PATH}/dist") and (os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0): logging.info("Building VueJS front-end.") subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True) logging.info("VueJS front-end build complete.") + else: + logging.warning( + f"[bright_yellow]The `--uidev` flag was supplied, but the Caldera v5 Vue UI is not present." + f" The Vue UI should be located in {MAGMA_PATH}. Use `--recursive` when cloning Caldera.[/bright_yellow]" + ) + args.uiDevHost = False app_svc.application.on_response_prepare.append(enable_cors) if args.build: @@ -287,7 +293,7 @@ def list_str(values): f" The Vue UI should be located in {MAGMA_PATH}. Use `--recursive` when cloning Caldera.[/bright_yellow]" ) else: - if not os.path.exists(f"{MAGMA_PATH}/dist"): + if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0: logging.warning( "[bright_yellow]Built Caldera v5 Vue components not detected, and `--build` flag not supplied." " If attempting to start Caldera v5 for the first time, the `--build` flag must be" From bf53c7dda76fd7687610a1c099c5ad6ded093fa8 Mon Sep 17 00:00:00 2001 From: kmpepper Date: Mon, 23 Feb 2026 19:34:09 +0000 Subject: [PATCH 2/3] Updating warning messages and fixing directory check for build flag --- server.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 37c4ba677..7db4c521f 100644 --- a/server.py +++ b/server.py @@ -276,13 +276,14 @@ def list_str(values): else: logging.warning( f"[bright_yellow]The `--uidev` flag was supplied, but the Caldera v5 Vue UI is not present." - f" The Vue UI should be located in {MAGMA_PATH}. Use `--recursive` when cloning Caldera.[/bright_yellow]" + f" The Vue UI should be located in {MAGMA_PATH}. Use `--recursive` when cloning Caldera." + f" Flag ignored; continuing with default server startup.[/bright_yellow]" ) args.uiDevHost = False app_svc.application.on_response_prepare.append(enable_cors) if args.build: - if len(os.listdir(MAGMA_PATH)) > 0: + if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0: 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) @@ -295,10 +296,16 @@ def list_str(values): else: if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0: logging.warning( - "[bright_yellow]Built Caldera v5 Vue components not detected, and `--build` flag not supplied." - " If attempting to start Caldera v5 for the first time, the `--build` flag must be" + "[bright_yellow]Built Caldera v5 Vue components detected, but `--build` flag not supplied." + " If attempting to start Caldera v5 with the UI for the first time, the `--build` flag must be" " supplied to trigger the building of the Vue source components.[/bright_yellow]" ) + elif not os.path.exists(f"{MAGMA_PATH}/dist"): + logging.warning( + f"[bright_yellow]Built Caldera v5 Vue components not detected, and `--build` flag not supplied." + f" If attempting to start Caldera v5 with the UI for the first time, the `--build` flag and" + f" Magma plugin (located in {MAGMA_PATH}) must be supplied to trigger the building of the Vue source components.[/bright_yellow]" + ) if args.fresh: logging.info( From 35d75063aabe5e037f9ff2cadabfec19078f2586 Mon Sep 17 00:00:00 2001 From: kmpepper Date: Wed, 25 Feb 2026 22:19:55 +0000 Subject: [PATCH 3/3] Updating logic to account for rebuilds of server without build flag --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 7db4c521f..2c2d0702d 100644 --- a/server.py +++ b/server.py @@ -294,9 +294,9 @@ def list_str(values): f" The Vue UI should be located in {MAGMA_PATH}. Use `--recursive` when cloning Caldera.[/bright_yellow]" ) else: - if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0: + if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0 and not os.path.exists(f"{MAGMA_PATH}/dist"): logging.warning( - "[bright_yellow]Built Caldera v5 Vue components detected, but `--build` flag not supplied." + "[bright_yellow]Caldera v5 Vue UI source detected, but not built components, and `--build` flag not supplied." " If attempting to start Caldera v5 with the UI for the first time, the `--build` flag must be" " supplied to trigger the building of the Vue source components.[/bright_yellow]" )