diff --git a/.github/install-guide.md b/.github/install-guide.md index 069b09a0..697759ce 100644 --- a/.github/install-guide.md +++ b/.github/install-guide.md @@ -81,8 +81,12 @@ https://shuffler.io/docs/configuration # Local development installation Local development is pretty straight forward with **ReactJS** and **Golang**. This part is intended to help you run the code for development purposes. -**PS: You have to stop the Backend Docker container to get this one working** -**PPS: Use the "Launch" branch when developing to get it set up easier** +1. Fork the project! This allows for pull-requests to Shuffle. +2. Find the part below that matches what you want to change (e.g. frontend) +3. Run that part locally - NOT in Docker + +**PS: You have to stop the Backend Docker container to get the backend running** +**PPS: Use the "launch" branch when developing to get it set up easier** ## Frontend - ReactJS /w cytoscape http://localhost:3000 - Requires [npm](https://nodejs.org/en/download/)/[yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable)/your preferred manager. Runs independently from backend. diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 26ffa5d9..6cd797f0 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module shuffle go 1.13 -replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared +//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi @@ -22,7 +22,7 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.13.1 // indirect github.com/frikky/kin-openapi v0.40.0 - github.com/frikky/shuffle-shared v0.0.82 + github.com/frikky/shuffle-shared v0.0.83 github.com/fsouza/go-dockerclient v1.7.2 github.com/ghodss/yaml v1.0.0 github.com/go-git/go-billy/v5 v5.0.0 diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 0e6db708..6112eaba 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -3361,9 +3361,12 @@ func buildSwaggerApp(resp http.ResponseWriter, body []byte, user shuffle.User) { log.Printf("[ERROR] Failed saving app %s to database: %s", newmd5, err) resp.WriteHeader(500) resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "%"}`, err))) + return } shuffle.SetOpenApiDatastore(ctx, api.ID, parsed) + } else { + //log.Printf(" } // Backup every single one @@ -3388,6 +3391,7 @@ func buildSwaggerApp(resp http.ResponseWriter, body []byte, user shuffle.User) { shuffle.DeleteCache(ctx, cacheKey) shuffle.DeleteCache(ctx, fmt.Sprintf("apps_%s", user.Id)) + log.Printf("[DEBUG] Successfully built app %s (%s)", api.Name, api.ID) if len(user.Id) > 0 { resp.WriteHeader(200) resp.Write([]byte(fmt.Sprintf(`{"success": true, "id": "%s"}`, api.ID))) @@ -3871,6 +3875,15 @@ func runInitCloudSetup() { func runInitEs(ctx context.Context) { log.Printf("[DEBUG] Starting INIT setup (ES)") + httpProxy := os.Getenv("HTTP_PROXY") + if len(httpProxy) > 0 { + log.Printf("Running with HTTP proxy %s (env: HTTP_PROXY)", httpProxy) + } + httpsProxy := os.Getenv("HTTPS_PROXY") + if len(httpsProxy) > 0 { + log.Printf("Running with HTTPS proxy %s (env: HTTPS_PROXY)", httpsProxy) + } + defaultEnv := os.Getenv("ORG_ID") if len(defaultEnv) == 0 { defaultEnv = "Shuffle" diff --git a/docker-compose.yml b/docker-compose.yml index eec29471..513fd4a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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} diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 0825aaf4..98ef2984 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -2,7 +2,7 @@ import React, {useRef, useState, useEffect, useLayoutEffect} from 'react'; import { useInterval } from 'react-powerhooks'; import { useTheme } from '@material-ui/core/styles'; -import uuid from "uuid"; +import { v4 as uuidv4 } from 'uuid'; import {Link} from 'react-router-dom'; import { Prompt } from 'react-router' import { useBeforeunload } from 'react-beforeunload'; @@ -1336,7 +1336,7 @@ const AngularWorkflow = (props) => { cy.add(edges) if (nodefound === true) { - const newId = uuid.v4() + const newId = uuidv4() cy.add({ group: "edges", data: { @@ -1803,7 +1803,7 @@ const AngularWorkflow = (props) => { if (parentNode !== null && parentNode !== undefined) { //parentNode.data() var newNodeData = JSON.parse(JSON.stringify(parentNode.data())) - newNodeData.id = uuid.v4() + newNodeData.id = uuidv4.v4() if (newNodeData.position !== undefined) { newNodeData.position = { "x": newNodeData.position.x+100, @@ -1859,7 +1859,7 @@ const AngularWorkflow = (props) => { //for (var key in sourcebranches) { // var newbranch = JSON.parse(JSON.stringify(sourcebranches[key])) - // newbranch.id = uuid.v4() + // newbranch.id = uuidv4() // newbranch.source_id = newNodeData.id // cy.add({ // group: "edges", @@ -1869,7 +1869,7 @@ const AngularWorkflow = (props) => { for (var key in sourcebranches) { var newbranch = JSON.parse(JSON.stringify(sourcebranches[key])) - newbranch.id = uuid.v4() + newbranch.id = uuidv4() newbranch.source_id = newNodeData.id newbranch._id = newbranch.id @@ -1883,7 +1883,7 @@ const AngularWorkflow = (props) => { for (var key in destinationbranches) { var newbranch = JSON.parse(JSON.stringify(destinationbranches[key])) - newbranch.id = uuid.v4() + newbranch.id = uuidv4() newbranch.destination_id = newNodeData.id newbranch._id = newbranch.id @@ -2503,7 +2503,7 @@ const AngularWorkflow = (props) => { if (nodedata.type === "ACTION") { if (workflow.actions.length === 1 && workflow.actions[0].id === workflow.start) { - const newEdgeUuid = uuid.v4() + const newEdgeUuid = uuidv4() const newcybranch = { "source": workflow.start, "target": nodedata.id, @@ -2549,7 +2549,7 @@ const AngularWorkflow = (props) => { workflow.triggers.push(nodedata) } - const newEdgeUuid = uuid.v4() + const newEdgeUuid = uuidv4() const newcybranch = { "source": nodedata.id, "target": workflow.start, @@ -3115,7 +3115,7 @@ const AngularWorkflow = (props) => { //parentNode.lock() const px = parentNode.position('x') - 65 const py = parentNode.position('y') - 25 - const circleId = newNodeId = uuid.v4() + const circleId = newNodeId = uuidv4() parentNode.data('circleId', circleId) @@ -3155,7 +3155,7 @@ const AngularWorkflow = (props) => { //parentNode.lock() const px = parentNode.position('x') - 65 const py = parentNode.position('y') + 25 - const circleId = newNodeId = uuid.v4() + const circleId = newNodeId = uuidv4() parentNode.data('circleId', circleId) @@ -4030,7 +4030,7 @@ const AngularWorkflow = (props) => { const triggerLabel = getNextActionName(data.name) - newNodeId = uuid.v4() + newNodeId = uuidv4() const newposition = { "x": e.pageX-cycontainer.offsetLeft, "y": e.pageY-cycontainer.offsetTop, @@ -4197,7 +4197,7 @@ const AngularWorkflow = (props) => { return } - newNodeId = uuid.v4() + newNodeId = uuidv4() const actionType = "ACTION" const actionLabel = getNextActionName(app.name) var parameters = null @@ -5234,7 +5234,7 @@ const AngularWorkflow = (props) => { const duplicateCondition = (conditionIndex) => { var newEdge = JSON.parse(JSON.stringify(selectedEdge.conditions[conditionIndex])) - const newUuid = uuid.v4() + const newUuid = uuidv4() newEdge.condition.id = newUuid newEdge.source.id = newUuid newEdge.destination.id = newUuid @@ -5346,7 +5346,7 @@ const AngularWorkflow = (props) => { } // FIXME - remove index - const conditionId = uuid.v4() + const conditionId = uuidv4() return(
@@ -6143,7 +6143,7 @@ const AngularWorkflow = (props) => { setSubworkflowStartnode(e.target.value) //console.log("WF: ", workflow) - const branchId = uuid.v4() + const branchId = uuidv4() const newbranch = { "source_id": workflow.triggers[selectedTriggerIndex].id, "destination_id": e.target.value.id, @@ -8474,7 +8474,7 @@ const AngularWorkflow = (props) => { "name": newVariableName, "description": "An execution variable", "value": "", - "id": uuid.v4(), + "id": uuidv4(), }) } @@ -8607,7 +8607,7 @@ const AngularWorkflow = (props) => { "name": newVariableName, "description": newVariableDescription, "value": newVariableValue, - "id": uuid.v4(), + "id": uuidv4(), }) } @@ -8635,7 +8635,7 @@ const AngularWorkflow = (props) => { usage: [{ workflow_id: workflow.id, }], - id: uuid.v4(), + id: uuidv4(), active: true, }) diff --git a/frontend/src/views/Workflows.jsx b/frontend/src/views/Workflows.jsx index face1f82..c7b2dcb0 100644 --- a/frontend/src/views/Workflows.jsx +++ b/frontend/src/views/Workflows.jsx @@ -18,7 +18,7 @@ import Dropzone from '../components/Dropzone'; import {Link} from 'react-router-dom'; import { useAlert } from "react-alert"; import ChipInput from 'material-ui-chip-input' -import uuid from "uuid" +import { v4 as uuidv4 } from 'uuid'; import CytoscapeWrapper from '../components/RenderCytoscape' //import mobileImage from '../assets/img/mobile.svg'; @@ -783,7 +783,7 @@ const Workflows = (props) => { trigger.status = "stopped" } - const newId = uuid.v4() + const newId = uuidv4() if (trigger.trigger_type === "WEBHOOK") { const hookname = "webhook_"+newId if (trigger.parameters !== undefined && trigger.parameters !== null && trigger.parameters.length === 2) { @@ -831,7 +831,7 @@ const Workflows = (props) => { } } - const newId = uuid.v4() + const newId = uuidv4() for (var branchkey in data.branches) { const branch = data.branches[branchkey] if (branch.source_id === data.actions[key].id) {