Fixed docker compose with :z instead

This commit is contained in:
frikky
2022-04-04 14:32:00 +02:00
parent 5b78366191
commit c89817a717
11 changed files with 78 additions and 58 deletions
+13 -10
View File
@@ -1985,7 +1985,7 @@ class AppBase:
errors = False
error_msg = ""
try:
self.logger.info("In liquid")
#self.logger.info("In liquid")
if len(template) > 10000000:
self.logger.info("[DEBUG] Skipping liquid - size too big (%d)" % len(template))
return template
@@ -2197,9 +2197,9 @@ class AppBase:
actualitem = re.findall(match, data, re.MULTILINE)
#self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
#self.logger.info("STATIC PARSED: %s" % actualitem)
self.logger.info("[INFO] Done with regex matching")
#self.logger.info("[INFO] Done with regex matching")
if len(actualitem) > 0:
self.logger.info("[DEBUG] Matches: ", actualitem)
#self.logger.info("[DEBUG] Matches: ", actualitem)
for replace in actualitem:
try:
to_be_replaced = replace[0]
@@ -3078,7 +3078,7 @@ class AppBase:
found_error = ""
while True:
iteration_count += 1
if iteration_count > 10:
if iteration_count >= 10:
newres = {
"success": False,
"reason": "Iteration count more than 10. This happens if the input to the action is wrong. Try remaking the action, and contact support@shuffler.io if this persists.",
@@ -3091,7 +3091,7 @@ class AppBase:
break
except TypeError as e:
newres = ""
self.logger.info(f"[DEBUG] Got exec error: {e}")
self.logger.info(f"[DEBUG] Got exec type error: {e}")
try:
e = json.loads(f"{e}")
except:
@@ -3107,11 +3107,12 @@ class AppBase:
except:
e = f"{e}"
raise Exception(json.dumps({
newres = json.dumps({
"success": False,
"reason": "An exception occurred while running this function. See exception for more details and contact support if this persists (support@shuffler.io)",
"exception": e,
}))
})
break
elif "got an unexpected keyword argument" in errorstring:
fieldsplit = errorstring.split("'")
if len(fieldsplit) > 1:
@@ -3125,9 +3126,10 @@ class AppBase:
else:
newres = json.dumps({
"success": False,
"reason": "You may be running an old version of this action. Please delete and remake the node.",
"reason": "You may be running an old version of this action. Try remaking the node, then contact us at support@shuffler.io if it doesn't work with all these details.",
"exception": f"TypeError: {e}",
})
break
except Exception as e:
self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly?")
@@ -3136,11 +3138,12 @@ class AppBase:
except:
e = f"{e}"
raise Exception(json.dumps({
newres = json.dumps({
"success": False,
"reason": "An exception occurred while running this function. See exception for more details and contact support if this persists (support@shuffler.io)",
"exception": e,
}))
})
break
# Forcing async wait in case of old apps that use async (backwards compatibility)
try:
+1 -1
View File
@@ -1224,7 +1224,7 @@ func checkAdminLogin(resp http.ResponseWriter, request *http.Request) {
// Should run calculations
if len(org.SSOConfig.OpenIdAuthorization) > 0 {
log.Printf("[DEBUG] Found OpenID url (PKCE). Extra redirect check: %s", request.URL.String())
log.Printf("[DEBUG] Found OpenID url (PKCE!!). Extra redirect check: %s", request.URL.String())
baseSSOUrl = org.SSOConfig.OpenIdAuthorization
codeChallenge := uuid.NewV4().String()
+4 -4
View File
@@ -1,7 +1,7 @@
version: '3'
services:
frontend:
build: ./frontend
#build: ./frontend
image: ghcr.io/frikky/shuffle-frontend:nightly
container_name: shuffle-frontend
hostname: shuffle-frontend
@@ -16,7 +16,7 @@ services:
depends_on:
- backend
backend:
build: ./backend
#build: ./backend
image: ghcr.io/frikky/shuffle-backend:nightly
container_name: shuffle-backend
hostname: ${BACKEND_HOSTNAME}
@@ -49,7 +49,7 @@ services:
environment:
- SHUFFLE_WORKER_VERSION=nightly
- ENVIRONMENT_NAME=${ENVIRONMENT_NAME}
- BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT}
- BASE_URL=http://${OUTER_HOSTNAME}:5001
- DOCKER_API_VERSION=1.40
- SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME}
- SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY}
@@ -86,7 +86,7 @@ services:
soft: 65536
hard: 65536
volumes:
- ${DB_LOCATION}:/usr/share/opensearch/data:rw
- ${DB_LOCATION}:/usr/share/opensearch/data:z
ports:
- 9200:9200
networks:
+8 -4
View File
@@ -2687,9 +2687,9 @@ const ParsedAction = (props) => {
disableScrollLock: true,
}}
value={
selectedActionEnvironment === undefined ||
selectedActionEnvironment.Name === undefined
? ""
selectedActionEnvironment === undefined || selectedActionEnvironment === null ||
selectedActionEnvironment.Name === undefined || selectedActionEnvironment.Name === null
? isCloud ? "Cloud" : "Shuffle"
: selectedActionEnvironment.Name
}
SelectDisplayProps={{
@@ -2738,13 +2738,17 @@ const ParsedAction = (props) => {
workflow.execution_variables !== null &&
workflow.execution_variables.length > 0 ? (
<div style={{ marginTop: "20px" }}>
<Typography>Set execution variable (optional)</Typography>
<Typography>Execution variable (optional)</Typography>
<Select
MenuProps={{
disableScrollLock: true,
}}
value={
selectedAction.execution_variable !== undefined
&& selectedAction.execution_variable !== null
&& selectedAction.execution_variable.name !== undefined
&& selectedAction.execution_variable.name !== null
&& selectedAction.execution_variable.name.length > 0
? selectedAction.execution_variable.name
: "No selection"
}
+28 -11
View File
@@ -1079,6 +1079,10 @@ const AngularWorkflow = (defaultprops) => {
curworkflowAction.parameters = newparams;
newActions.push(curworkflowAction);
} else if (type === "TRIGGER") {
if (useworkflow.triggers === undefined || useworkflow.triggers === null) {
useworkflow.triggers = [];
}
var curworkflowTrigger = useworkflow.triggers.find(
(a) => a.id === cyelements[key].data()["id"]
);
@@ -1090,7 +1094,7 @@ const AngularWorkflow = (defaultprops) => {
newTriggers.push(curworkflowTrigger);
} else if (type === "COMMENT") {
if (useworkflow.comments === undefined) {
if (useworkflow.comments === undefined || useworkflow.comments === null) {
useworkflow.comments = [];
}
@@ -2567,6 +2571,7 @@ const AngularWorkflow = (defaultprops) => {
}
}
console.log("ACTION: ", curaction)
setSelectedApp(curapp);
setSelectedAction(curaction);
@@ -8544,22 +8549,34 @@ const AngularWorkflow = (defaultprops) => {
onChange={(event, newValue) => {
handleWorkflowSelectionUpdate({ target: { value: newValue} })
}}
renderOption={(data) => {
renderOption={(data, index) => {
if (data.id === workflow.id) {
data = workflow;
}
//key={index}
return (
<MenuItem
style={{
backgroundColor: theme.palette.inputColor,
color: data.id === workflow.id ? "red" : "white",
}}
value={data}
>
{data.name}
</MenuItem>
<Tooltip arrow placement="left" title={
<span style={{}}>
{data.image !== undefined && data.image !== null && data.image.length > 0 ?
<img src={data.image} alt={data.name} style={{backgroundColor: theme.palette.surfaceColor, maxHeight: 200, minHeigth: 200, borderRadius: theme.palette.borderRadius, }} />
: null}
<Typography>
Choose {data.name}
</Typography>
</span>
} placement="bottom">
<MenuItem
style={{
backgroundColor: theme.palette.inputColor,
color: data.id === workflow.id ? "red" : "white",
}}
key={index}
value={data}
>
{data.name}
</MenuItem>
</Tooltip>
)
}}
renderInput={(params) => {
+14 -14
View File
@@ -544,7 +544,6 @@ const Apps = (props) => {
data.name = newAppname;
setSelectedApp(data);
console.log(data);
if (
data.actions !== undefined &&
data.actions !== null &&
@@ -747,20 +746,21 @@ const Apps = (props) => {
) : null;
//var editNewButton = editButton === null ?
console.log("User, & genrrated, activate: ", props.userdata, selectedApp.generated, selectedApp.activated)
var editNewButton = selectedApp.generated && selectedApp.activated && props.userdata.id !== selectedApp.owner ?
<Link to={activateUrl} style={{ textDecoration: "none" }}>
<Tooltip title={"Edit this public app to your liking"}>
<Button
variant="contained"
component="label"
color="primary"
style={{ marginTop: 10, marginRight: 10 }}
>
<EditIcon />
</Button>
</Tooltip>
</Link>
isCloud ?
<Link to={activateUrl} style={{ textDecoration: "none" }}>
<Tooltip title={"Edit this public app to your liking"}>
<Button
variant="contained"
component="label"
color="primary"
style={{ marginTop: 10, marginRight: 10 }}
>
<EditIcon />
</Button>
</Tooltip>
</Link>
: null
: null
const activateButton =
-6
View File
@@ -460,9 +460,7 @@ export const validateJson = (showResult) => {
try {
for (const [key, value] of Object.entries(result)) {
if (typeof value === "string" && (value.startsWith("{") || value.startsWith("["))) {
console.log("INSIDE: ", key, value);
const inside_result = validateJson(value)
console.log("Inside: ", inside_result)
if (inside_result.valid) {
console.log("Replacing value since it's valid JSON!")
if (typeof inside_result.result === "string") {
@@ -970,7 +968,6 @@ const Workflows = (props) => {
};
const handleKeysetting = (categorydata, workflows) => {
console.log("Workflows: ", workflows)
//workflows[0].category = ["detect"]
//workflows[0].usecase_ids = ["Correlate tickets"]
@@ -1011,7 +1008,6 @@ const Workflows = (props) => {
newcategories.push(category)
}
console.log("Categories: ", newcategories)
setUsecases(newcategories)
} else {
setUsecases(categorydata)
@@ -1036,7 +1032,6 @@ const Workflows = (props) => {
})
.then((responseJson) => {
if (responseJson.success !== false) {
console.log("Usecases: ", responseJson)
handleKeysetting(responseJson, workflows)
}
})
@@ -1976,7 +1971,6 @@ const Workflows = (props) => {
}
const new_url = `${globalUrl}/api/v1/workflows${extraData}`
console.log("Got new url: ", new_url)
return fetch(new_url, {
method: method,
headers: {
+1 -1
View File
@@ -1,5 +1,5 @@
NAME=shuffle-worker
VERSION=0.9.65
VERSION=0.9.66
echo "Running docker build with $NAME:$VERSION"
#CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
+1 -1
View File
@@ -10,6 +10,6 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/gorilla/mux v1.8.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/shuffle/shuffle-shared v0.2.9
github.com/shuffle/shuffle-shared v0.2.22
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
)
+2
View File
@@ -599,6 +599,8 @@ github.com/shuffle/shuffle-shared v0.1.83 h1:xfmcqceBGXJVUyZNBmI+c6RKndrtKJyBIqd
github.com/shuffle/shuffle-shared v0.1.83/go.mod h1:cW8LBv8P24rCPyJqGV6czxqrpnrv/R1d97EOqNgIvSk=
github.com/shuffle/shuffle-shared v0.2.9 h1:fh2eOD7olifW2uyC3Vlp8u3dqhgIxtYaDVjaYaNMXgA=
github.com/shuffle/shuffle-shared v0.2.9/go.mod h1:YuMle0RjwXb3hxR5PdaOOD9e+hUyK34OABS0UbrT/Sk=
github.com/shuffle/shuffle-shared v0.2.20 h1:1f0oBOKYk1Yteve6e9zaXRfd0iHO3EWAAbC7g3o1Vjs=
github.com/shuffle/shuffle-shared v0.2.20/go.mod h1:YuMle0RjwXb3hxR5PdaOOD9e+hUyK34OABS0UbrT/Sk=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
+6 -6
View File
@@ -77,8 +77,8 @@ var downloadedImages []string
// Images to be autodeployed in the latest version of Shuffle.
var autoDeploy = map[string]string{
"shuffle-subflow:1.0.0": "frikky/shuffle:shuffle-subflow_1.0.0",
"http:1.1.0": "frikky/shuffle:http_1.1.0",
"shuffle-tools:1.1.0": "frikky/shuffle:shuffle-tools_1.1.0",
"http:1.3.0": "frikky/shuffle:http_1.3.0",
"shuffle-tools:1.2.0": "frikky/shuffle:shuffle-tools_1.2.0",
"testing:1.0.0": "frikky/shuffle:testing_1.0.0",
}
@@ -1549,10 +1549,10 @@ func executionInit(workflowExecution shuffle.WorkflowExecution) error {
}
if trigger.ID == branch.SourceID {
log.Printf("[INFO] shuffle.Trigger %s is the source!", trigger.AppName)
//log.Printf("[INFO] shuffle.Trigger %s is the source!", trigger.AppName)
sourceFound = true
} else if trigger.ID == branch.DestinationID {
log.Printf("[INFO] shuffle.Trigger %s is the destination!", trigger.AppName)
//log.Printf("[INFO] shuffle.Trigger %s is the destination!", trigger.AppName)
destinationFound = true
}
}
@@ -2824,8 +2824,8 @@ func findAppInfo(image, name string) (int, error) {
exposedPort = highest
if appsInitialized {
log.Printf("[DEBUG] Waiting 10 seconds before moving on to let app start")
time.Sleep(time.Duration(10) * time.Second)
log.Printf("[DEBUG] Waiting 30 seconds before moving on to let app start")
time.Sleep(time.Duration(30) * time.Second)
}
}