Skip to content

Commit

Permalink
Remove references to VITE_CALDERA_URL
Browse files Browse the repository at this point in the history
Related to the removal for VITE_CALDRA_URL in the magma repository in favor of using window.location.origin
  • Loading branch information
daw1012345 committed Dec 26, 2024
1 parent 4b57658 commit ecfb827
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion conf/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ecfb827

Please sign in to comment.