Fixed minor schedule location issues and app build revisions

This commit is contained in:
Frikky
2024-02-28 23:09:50 +01:00
parent d65e9215ff
commit fb626a7c21
7 changed files with 104 additions and 33 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ require (
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
github.com/h2non/filetype v1.1.3 github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.5.78 github.com/shuffle/shuffle-shared v0.5.81
golang.org/x/crypto v0.16.0 golang.org/x/crypto v0.16.0
google.golang.org/api v0.125.0 google.golang.org/api v0.125.0
google.golang.org/grpc v1.55.0 google.golang.org/grpc v1.55.0
+2
View File
@@ -457,6 +457,8 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shuffle/shuffle-shared v0.5.78 h1:emHTEu+WboTZQUUcPDrxMx70RtVuZ1LtkYjG2KzncBE= github.com/shuffle/shuffle-shared v0.5.78 h1:emHTEu+WboTZQUUcPDrxMx70RtVuZ1LtkYjG2KzncBE=
github.com/shuffle/shuffle-shared v0.5.78/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk= github.com/shuffle/shuffle-shared v0.5.78/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shuffle/shuffle-shared v0.5.81 h1:pt4lT42FrXN/kd/vlYtm7nXShZI0mOamXUMjpWLH7qI=
github.com/shuffle/shuffle-shared v0.5.81/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+2 -2
View File
@@ -3183,8 +3183,8 @@ func setNewWorkflowApp(resp http.ResponseWriter, request *http.Request) {
workflowapp.Generated = false workflowapp.Generated = false
workflowapp.Activated = true workflowapp.Activated = true
if !shuffle.ArrayContains(api.Contributors, user.Id) { if !shuffle.ArrayContains(workflowapp.Contributors, user.Id) {
api.Contributors = append(api.Contributors, user.Id) workflowapp.Contributors = append(workflowapp.Contributors, user.Id)
} }
shuffle.SetAppRevision(ctx, workflowapp) shuffle.SetAppRevision(ctx, workflowapp)
+16 -6
View File
@@ -874,10 +874,11 @@ const Billing = (props) => {
}); });
}; };
const isChildOrg = userdata.active_org.creator_org !== "" && userdata.active_org.creator_org !== undefined && userdata.active_org.creator_org !== null
return ( return (
<div> <div>
{addDealModal} {addDealModal}
<Typography variant="h6" style={{ marginTop: 20, marginBottom: 10 }}> <Typography variant="h4" style={{ marginTop: 20, marginBottom: 10 }}>
Billing Billing
</Typography> </Typography>
<Typography variant="body1" color="textSecondary" style={{ marginTop: 0, marginBottom: 10}}> <Typography variant="body1" color="textSecondary" style={{ marginTop: 0, marginBottom: 10}}>
@@ -912,8 +913,16 @@ const Billing = (props) => {
: :
null null
} }
{isChildOrg ?
<Typography variant="h6" style={{marginBottom: 50, }}>
Billing is handled by your parent organisation. Reach out to support@shuffler.io if you have questions about this.
</Typography>
: null}
<div style={{display: "flex", maxWidth: 768, minWidth: 768, }}> <div style={{display: "flex", maxWidth: 768, minWidth: 768, }}>
{isCloud && billingInfo.subscription !== undefined && billingInfo.subscription !== null ? {isCloud && billingInfo.subscription !== undefined && billingInfo.subscription !== null ? isChildOrg ? null :
<SubscriptionObject <SubscriptionObject
index={0} index={0}
globalUrl={globalUrl} globalUrl={globalUrl}
@@ -967,11 +976,12 @@ const Billing = (props) => {
/> />
</span> </span>
: null} : null}
{isCloud && {isCloud &&
selectedOrganization.subscriptions !== undefined && selectedOrganization.subscriptions !== undefined &&
selectedOrganization.subscriptions !== null && selectedOrganization.subscriptions !== null &&
selectedOrganization.subscriptions.length > 0 ? selectedOrganization.subscriptions.length > 0 &&
!isChildOrg ?
selectedOrganization.subscriptions selectedOrganization.subscriptions
.reverse() .reverse()
.map((sub, index) => { .map((sub, index) => {
@@ -1224,9 +1234,9 @@ const Billing = (props) => {
<div style={{ marginTop: 30, }}> <div style={{ marginTop: 30, }}>
<Typography <Typography
style={{ marginTop: 40, marginLeft: 10, marginBottom: 5 }} style={{ marginTop: 40, marginLeft: 10, marginBottom: 5 }}
variant="h6" variant="h4"
> >
Shuffle Utilization Utilization & Stats
</Typography> </Typography>
</div> </div>
<BillingStats <BillingStats
+27
View File
@@ -24,6 +24,7 @@ import {
} from "@mui/material"; } from "@mui/material";
import { import {
Link as LinkIcon,
OpenInNew as OpenInNewIcon, OpenInNew as OpenInNewIcon,
Edit as EditIcon, Edit as EditIcon,
CloudDownload as CloudDownloadIcon, CloudDownload as CloudDownloadIcon,
@@ -972,6 +973,32 @@ const Files = (props) => {
</IconButton> </IconButton>
</span> </span>
</Tooltip> </Tooltip>
{/*
<Tooltip
title={"Public URL"}
style={{}}
>
<span>
<IconButton
style = {{padding: "6px"}}
disabled={file.status !== "active"}
onClick={() => {
// Open the file, without downloading it
window.open(`${globalUrl}/api/v1/files/${file.id}/content?type=text&authorization=${file.public_authorization}`, "_blank noreferrer noopener")
}}
>
<LinkIcon
style={{
color:
file.status === "active"
? "white"
: "grey",
}}
/>
</IconButton>
</span>
</Tooltip>
*/}
<Tooltip <Tooltip
title={"Download file"} title={"Download file"}
style={{}} style={{}}
+44 -14
View File
@@ -3098,17 +3098,20 @@ const AngularWorkflow = (defaultprops) => {
ReactDOM.unstable_batchedUpdates(() => { ReactDOM.unstable_batchedUpdates(() => {
setSelectedAction({}); setSelectedAction({});
setSelectedApp({}); setSelectedApp({});
setSelectedTrigger({});
setSelectedComment({}) setSelectedComment({})
setSelectedEdge({}); setSelectedEdge({});
setSelectedEdge({}) setSelectedEdge({})
setSelectedActionEnvironment({}) setSelectedActionEnvironment({})
setTriggerAuthentication({}) setTriggerAuthentication({})
setSelectedTriggerIndex(-1)
setTriggerFolders([]) setTriggerFolders([])
setLocalFirstrequest(true) setLocalFirstrequest(true)
setSelectedTrigger({});
setSelectedTriggerIndex(-1)
setUpdate(Math.random())
// Can be used for right side view // Can be used for right side view
setRightSideBarOpen(false); setRightSideBarOpen(false);
setScrollConfig({ setScrollConfig({
@@ -3551,7 +3554,9 @@ const AngularWorkflow = (defaultprops) => {
const onNodeSelect = (event, newAppAuth) => { const onNodeSelect = (event, newAppAuth) => {
// Forces all states to update at the same time, // Forces all states to update at the same time,
// Otherwise everything is SUPER slow // Otherwise everything is SUPER slow
const data = event.target.data();
//const data = JSON.parse(JSON.stringify(event.target.data()))
const data = event.target.data()
if (data.isSuggestion === true) { if (data.isSuggestion === true) {
console.log("Suggestion! Replace with a real action.") console.log("Suggestion! Replace with a real action.")
@@ -4171,9 +4176,11 @@ const AngularWorkflow = (defaultprops) => {
console.log("TRIGGER: ", data) console.log("TRIGGER: ", data)
setTimeout(() => {
setSelectedTriggerIndex(trigger_index); setSelectedTriggerIndex(trigger_index);
setSelectedTrigger(data); setSelectedTrigger(data)
setSelectedActionEnvironment(data.env); setSelectedActionEnvironment(data.env)
}, 25)
} else if (data.type === "COMMENT") { } else if (data.type === "COMMENT") {
setSelectedComment(data); setSelectedComment(data);
} else { } else {
@@ -6993,13 +7000,14 @@ const AngularWorkflow = (defaultprops) => {
}); });
}; };
const parsedHeight = isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 50
const appViewStyle = { const appViewStyle = {
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
minHeight: isMobile ? bodyHeight - appBarSize * 4 : "100%", minHeight: isMobile ? bodyHeight - appBarSize * 4 : parsedHeight,
maxHeight: isMobile ? bodyHeight - appBarSize * 4 : "100%", maxHeight: isMobile ? bodyHeight - appBarSize * 4 : parsedHeight,
}; };
const paperAppStyle = { const paperAppStyle = {
@@ -7321,7 +7329,6 @@ const AngularWorkflow = (defaultprops) => {
marginRight: 5, marginRight: 5,
}; };
const parsedHeight = isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 50
return ( return (
<div> <div>
<div <div
@@ -8972,7 +8979,7 @@ const AngularWorkflow = (defaultprops) => {
workflow.triggers[selectedTriggerIndex].parameters[0] = { workflow.triggers[selectedTriggerIndex].parameters[0] = {
value: value, value: value,
name: "cron", name: "cron",
}; }
} }
workflow.triggers[selectedTriggerIndex].parameters[1] = { workflow.triggers[selectedTriggerIndex].parameters[1] = {
@@ -13289,7 +13296,7 @@ const AngularWorkflow = (defaultprops) => {
const pipelineConfig = { const pipelineConfig = {
"name": selectedTrigger.label, "name": selectedTrigger.label,
"type": "create", "type": "create",
"command": "load tcp://0.0.0.0:514 | read syslog | to http://api.com X-Token:Secret", "command": "load tcp://0.0.0.0:514 | read syslog | export",
"environment": selectedTrigger.environment, "environment": selectedTrigger.environment,
} }
@@ -13299,6 +13306,29 @@ const AngularWorkflow = (defaultprops) => {
Start Syslog listener Start Syslog listener
</div> </div>
<div
style={{
border: "1px solid rgba(255,255,255,0.3)",
borderRadius: theme.palette.borderRadius,
padding: 10,
cursor: "pointer",
marginTop: 5,
}}
onClick={() => {
const pipelineConfig = {
"name": selectedTrigger.label,
"type": "create",
"command": "export --live | sigma /path/to/rules | to http://192.168.86.44:5002/api/v1/hooks/webhook_665ace5f-f27b-496a-a365-6e07eb61078c write lines",
"environment": selectedTrigger.environment,
}
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig)
}}
>
Run Sigma Rulesearch
</div>
<div <div
style={{ style={{
border: "1px solid rgba(255,255,255,0.3)", border: "1px solid rgba(255,255,255,0.3)",
@@ -13488,10 +13518,10 @@ const AngularWorkflow = (defaultprops) => {
}} }}
fullWidth fullWidth
disabled={ disabled={
workflow.triggers[selectedTriggerIndex].status === "running" selectedTrigger.status === "running"
} }
defaultValue={ defaultValue={
workflow.triggers[selectedTriggerIndex].parameters === undefined ? "" : workflow.triggers[selectedTriggerIndex].parameters[0].value selectedTrigger.parameters === undefined ? "" : selectedTrigger.parameters[0].value
} }
color="primary" color="primary"
placeholder="" placeholder=""
@@ -14022,8 +14052,8 @@ const AngularWorkflow = (defaultprops) => {
}} }}
> >
<Typography variant="body22"> <Typography variant="body22">
<WarningIcon style={{marginRight: 5, height: 15, width: 15, }} /> {/*<WarningIcon style={{marginRight: 5, height: 15, width: 15, }} />*/}
<b>{workflow.errors.length} Workflow Issue{workflow.errors.length > 1 ? "s" : ""}</b> <b>Workflow Issues:</b> {workflow.errors.length}
</Typography> </Typography>
<Typography <Typography
variant="body2" variant="body2"
+3 -1
View File
@@ -1242,7 +1242,9 @@ const Apps = (props) => {
})} })}
</Select> </Select>
{isCloud && (selectedApp.sharing === true || selectedApp.public === true || creatorProfile.github_avatar !== undefined) && !internalIds.includes(selectedApp.name.toLowerCase()) ? {/*isCloud && (selectedApp.sharing === true || selectedApp.public === true || creatorProfile.github_avatar !== undefined) && !internalIds.includes(selectedApp.name.toLowerCase()) */}
{isCloud && !internalIds.includes(selectedApp.name.toLowerCase()) ?
<Tooltip title="Deactivates this app for the current organisation. This means the app will not be usable again until you re-activate it." placement="top"> <Tooltip title="Deactivates this app for the current organisation. This means the app will not be usable again until you re-activate it." placement="top">
<Button <Button
variant="contained" variant="contained"