From 261eb3828e6cb04a18bc8bb73f3b00a295489296 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 21 Jul 2022 15:01:43 +0200 Subject: [PATCH] UI: Simplify configuraton exporting --- monkey/monkey_island/cc/ui/package.json | 2 +- .../ExportConfigModal.tsx | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/monkey/monkey_island/cc/ui/package.json b/monkey/monkey_island/cc/ui/package.json index b18bda191..f3ccd708a 100644 --- a/monkey/monkey_island/cc/ui/package.json +++ b/monkey/monkey_island/cc/ui/package.json @@ -15,7 +15,7 @@ "release:patch": "npm version patch && npm publish && git push --follow-tags", "serve": "node server.js --env=dev", "serve:dist": "node server.js --env=dist", - "start": "webpack-dev-server --mode development --open --history-api-fallback --port 8000 --host local-ip" + "start": "webpack-dev-server --mode development --open --history-api-fallback --port 8000 --host 192.168.56.103" }, "repository": "", "keywords": [], diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx b/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx index 159013e85..c56ccb4f1 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx @@ -23,20 +23,17 @@ const ConfigExportModal = (props: Props) => { } function onSubmit() { - let config = reformatConfig(props.configuration, true); + let configuration = reformatConfig(props.configuration, true); let credentials = props.credentials; - let config_export = {'metadata': {}, 'configuration': null, 'credentials': null}; + let metadata = {'encrypted': false}; if (radioValue === 'password') { - config_export.configuration = encryptText(JSON.stringify(config), pass); - config_export.credentials = encryptText(JSON.stringify(credentials), pass); - config_export.metadata = {'encrypted': true}; - } else { - config_export.configuration = config; - config_export.credentials = credentials; - config_export.metadata = {'encrypted': false}; + configuration = encryptText(JSON.stringify(configuration), pass); + credentials = encryptText(JSON.stringify(credentials), pass); + metadata = {'encrypted': true}; } + let config_export = {'metadata': metadata, 'configuration': configuration, 'credentials': credentials}; let export_json = JSON.stringify(config_export, null, 2); let export_blob = new Blob( [export_json],