diff --git a/.github/push_nightly.sh b/.github/push_nightly.sh index fc452d40..9c55b01c 100644 --- a/.github/push_nightly.sh +++ b/.github/push_nightly.sh @@ -1,15 +1,14 @@ # This can be done in the dockerpush workflow itself +# Done manually for now since GHCR isn't being pushed to easily with the current Github action CI. Nightly = Latest IF we run hotfixes on latest + docker pull frikky/shuffle-backend:nightly docker pull frikky/shuffle-frontend:nightly -#docker tag frikky/shuffle-backend:nightly ghcr.io/frikky/shuffle-backend:nightly -#docker tag frikky/shuffle-frontend:nightly ghcr.io/frikky/shuffle-frontend:nightly -# -#docker push ghcr.io/frikky/shuffle-backend:nightly -#docker push ghcr.io/frikky/shuffle-frontend:nightly - -docker tag frikky/shuffle-backend:nightly ghcr.io/frikky/shuffle-backend:nightly -docker tag frikky/shuffle-frontend:nightly ghcr.io/frikky/shuffle-frontend:nightly +docker tag frikky/shuffle-backend:nightly ghcr.io/frikky/shuffle-backend:latest +docker tag frikky/shuffle-frontend:nightly ghcr.io/frikky/shuffle-frontend:latest docker push ghcr.io/frikky/shuffle-backend:nightly docker push ghcr.io/frikky/shuffle-frontend:nightly + +docker push ghcr.io/frikky/shuffle-backend:latest +docker push ghcr.io/frikky/shuffle-frontend:latest diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 7c57151a..b7742f12 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -1022,6 +1022,33 @@ class AppBase: self.logger.info("\nLOOP: %s\nRESULTS: %s" % (loop_wrapper, results)) return results + # Downloads all files from a namespace + # Currently only working on local version of Shuffle + def get_file_category_ids(self, category): + org_id = self.full_execution["workflow"]["execution_org"]["id"] + + get_path = "/api/v1/files/namespaces/%s?execution_id=%s&ids=true" % (category, self.full_execution["execution_id"]) + headers = { + "Authorization": "Bearer %s" % self.authorization + } + + ret = requests.get("%s%s" % (self.url, get_path), headers=headers) + return ret.json() + #if ret1.status_code != 200: + # return { + # "success": False, + # "reason": "Status code is %d from backend for category %s" % category, + # "list": [], + # } + + #return { + # "success": True, + # "ids": ret1.json(), + #} + + def get_file_namespace_ids(self, namespace): + return get_file_category_ids(self, namespace) + # Downloads all files from a namespace # Currently only working on local version of Shuffle def get_file_namespace(self, namespace): diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index a386bb9a..f4157487 100644 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -123,6 +123,7 @@ const openApiFieldDesc = "Generated by OpenAPI body example"; const ParsedAction = (props) => { const { workflow, + files, setWorkflow, setAction, setSelectedAction, @@ -1300,6 +1301,7 @@ const ParsedAction = (props) => { data.value = data.example; } + if (data.value.length === 0) { if (data.name.toLowerCase() === "headers") { console.log("Should show headers field instead with + and -!") @@ -1878,6 +1880,14 @@ const ParsedAction = (props) => { // Basic helpertext + if (data.name.toLowerCase() === "file_category") { + //selectedActionParameters[count].options.length > 0 + console.log("FileS: ", files) + if (files.namespaces !== undefined && files.namespaces !== null && files.namespaces.length > 0) { + data.options = files.namespaces + } + } + //const keywords = ["len", "lower", "upper", "trim", "split", "length", "number", "parse", "join"] if ( selectedActionParameters[count].schema !== undefined && @@ -1942,16 +1952,22 @@ const ParsedAction = (props) => { } */ } else if ( - selectedActionParameters[count].options !== undefined && + (data.options !== undefined && + data.options !== null && + data.options.length > 0) + || + (selectedActionParameters[count].options !== undefined && selectedActionParameters[count].options !== null && - selectedActionParameters[count].options.length > 0 + selectedActionParameters[count].options.length > 0) ) { + const parsedoptions = data.options !== undefined ? data.options : selectedActionParameters[count].options + if (selectedActionParameters[count].value === "") { // && selectedActionParameters[count].required) { // Rofl, dirty workaround :) const e = { target: { - value: selectedActionParameters[count].options[0], + value: parsedoptions.options[0], }, }; @@ -1982,7 +1998,7 @@ const ParsedAction = (props) => { borderRadius: theme.palette.borderRadius, }} > - {selectedActionParameters[count].options.map( + {parsedoptions.map( (data, index) => { const split_data = data.split("||"); var viewed_data = data; @@ -2014,6 +2030,7 @@ const ParsedAction = (props) => { return null; } + // Shows nested list of nodes > their JSON lists const ActionlistWrapper = (props) => { const handleMenuClose = () => { diff --git a/frontend/src/components/ShuffleCodeEditor.jsx b/frontend/src/components/ShuffleCodeEditor.jsx index 150cb8e2..ea0c3187 100644 --- a/frontend/src/components/ShuffleCodeEditor.jsx +++ b/frontend/src/components/ShuffleCodeEditor.jsx @@ -51,7 +51,7 @@ import { useNavigate, Link, useParams } from "react-router-dom"; const liquidFilters = [ {"name": "Size", "value": "size", "example": ""}, - {"name": "Date", "value": `date: "%Y%M%d"`, "example": `{{ "now" | date: "%s" }}`}, + {"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`}, {"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``}, {"name": "Flatten", "value": `flatten`, "example": `{{ [1, [1, 2], [2, 3, 4]] | flatten }}`}, ] diff --git a/frontend/src/components/WelcomeForm.jsx b/frontend/src/components/WelcomeForm.jsx index 65579798..4b91a5f2 100644 --- a/frontend/src/components/WelcomeForm.jsx +++ b/frontend/src/components/WelcomeForm.jsx @@ -513,7 +513,7 @@ const WelcomeForm = (props) => { }}> Phishing - } style={newButtonStyle} onClick={() => { + } style={newButtonStyle} onClick={() => { setDefaultSearch("Detection") setSelectionOpen(false) @@ -525,7 +525,7 @@ const WelcomeForm = (props) => { }}> Detection - } style={newButtonStyle} onClick={() => { + } style={newButtonStyle} onClick={() => { setDefaultSearch("Response") setSelectionOpen(false) diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 46d37baf..1a089902 100644 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -746,7 +746,7 @@ const Admin = (props) => { if (orgId.length === 0) { alert.error( - "Organization ID not defined. Please contact us on https://shuffler.io if this persists logout." + "Organization ID not defined (get deals). Please contact us on https://shuffler.io if this persists logout." ); return; } @@ -2693,6 +2693,22 @@ const Admin = (props) => { ) : (