diff --git a/README.md b/README.md index cf4b70d6..f3412b9d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Shuffle [Shuffle](https://shuffler.io) is an automation platform for your security stack. It leverages docker for scaling and OpenAPI for integrations. It has the possibility to run across multiple isolated environments, and gives you powerful tools to track progress. +**It's in BETA, so be careful** ![Example Shuffle webhook integration](shuffle_webhook.png) @@ -100,6 +101,10 @@ There will be a major overhaul to the backend specifically. I'm currently moving ``` * Mail: Use appengine and connect to sendmail +# Update for users: +* Build from scratch (docker-compose) +* Push stable builds to Dockerhub + ### Migration issues: * Some workflows where items have multiple parents don't work. * Fix dummy.json (GCP config) - bypass this somehow. diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 8eea1b16..591d8a84 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -5580,18 +5580,9 @@ func healthCheckHandler(resp http.ResponseWriter, request *http.Request) { fmt.Fprint(resp, "OK") } -func init() { - var err error - ctx := context.Background() - - log.Printf("Running INIT process") - dbclient, err = datastore.NewClient(ctx, gceProject) - if err != nil { - log.Fatalf("DBclient error during init: %s", err) - } - +func runInit(ctx context.Context) { // Setting stats for backend starts (failure count as well) - err = increaseStatisticsField(ctx, "backend_executions", "", 1) + err := increaseStatisticsField(ctx, "backend_executions", "", 1) if err != nil { log.Printf("Failed increasing local stats: %s", err) } @@ -5664,6 +5655,19 @@ func init() { } log.Printf("Finished INIT") +} + +func init() { + var err error + ctx := context.Background() + + log.Printf("Running INIT process") + dbclient, err = datastore.NewClient(ctx, gceProject) + if err != nil { + log.Printf("DBclient error during init: %s", err) + } + + go runInit(ctx) r := mux.NewRouter() r.HandleFunc("/api/v1/_ah/health", healthCheckHandler) diff --git a/docker-compose.yml b/docker-compose.yml index c15f481d..80f16c27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,7 @@ version: '3' -# Remove database port -# Remove backend port services: frontend: - build: ./frontend + #build: ./frontend image: frikky/shuffle:frontend container_name: shuffle-frontend hostname: shuffle-frontend @@ -12,25 +10,26 @@ services: networks: - shuffle restart: unless-stopped + depends_on: + - backend database: - build: ./backend/database + #build: ./backend/database image: frikky/shuffle:database container_name: shuffle-database hostname: shuffle-database - ports: - - "8000:8000" networks: - shuffle restart: unless-stopped volumes: - /etc/shuffle:/etc/shuffle backend: - build: ./backend + #build: ./backend image: frikky/shuffle:backend container_name: shuffle-backend hostname: ${BACKEND_HOSTNAME} + # Here for debugging: ports: - - "${BACKEND_PORT}:${BACKEND_PORT}" + - "${BACKEND_PORT}:5001" networks: - shuffle volumes: @@ -38,13 +37,11 @@ services: environment: - ORG_ID=${ORG_ID} - DATASTORE_EMULATOR_HOST=shuffle-database:8000 - - BACKEND_PORT=${BACKEND_PORT} restart: unless-stopped depends_on: - database - - frontend orborus: - build: ./functions/onprem/orborus + #build: ./functions/onprem/orborus image: frikky/shuffle:orborus container_name: shuffle-orborus hostname: shuffle-orborus @@ -58,10 +55,10 @@ services: - BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT} restart: unless-stopped app_sdk: - build: ./functions/onprem/app_sdk + #build: ./functions/onprem/app_sdk image: frikky/shuffle:app_sdk worker: - build: ./functions/onprem/worker + #build: ./functions/onprem/worker image: frikky/shuffle:worker networks: shuffle: diff --git a/frontend/src/App.js b/frontend/src/App.js index a0ffb745..26586734 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -38,12 +38,12 @@ import AlertTemplate from "react-alert-template-basic"; import { positions, Provider } from "react-alert"; // Testing - localhost -//const globalUrl = "http://192.168.3.6:5001" +const globalUrl = "http://192.168.3.6:5001" //console.log("HOST: ", process.env) // Production - backend proxy forwarding in nginx -const globalUrl = window.location.origin +//const globalUrl = window.location.origin const surfaceColor = "#27292D" const inputColor = "#383B40"