From 705a1c4b24f034c32bc67de6f9fb996f986e805f Mon Sep 17 00:00:00 2001 From: monilprajapati Date: Tue, 12 Nov 2024 16:03:55 +0530 Subject: [PATCH 1/6] Page breaking fixes --- frontend/package.json | 3 ++- frontend/src/App.jsx | 2 +- frontend/src/components/HealthBarChart.jsx | 3 +++ frontend/src/context/{contextApi.jsx => ContextApi.jsx} | 0 frontend/src/views/Docs.jsx | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) rename frontend/src/context/{contextApi.jsx => ContextApi.jsx} (100%) diff --git a/frontend/package.json b/frontend/package.json index 41c0790d..f71c766d 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,6 +21,7 @@ "@uiw/codemirror-themes": "^4.21.9", "@uiw/react-codemirror": "^4.21.21", "algoliasearch": "^4.8.3", + "chart.js": "^3.0.0", "class-transformer": "^0.2.0", "codemirror": "^6.0.1", "cpx": "^1.5.0", @@ -60,7 +61,7 @@ "react-alice-carousel": "^2.6.4", "react-avatar-editor": "^11.1.0", "react-beforeunload": "^2.2.1", - "react-chartjs-2": "^5.2.0", + "react-chartjs-2": "^5.0.0", "react-cookie": "^4.0.1", "react-cytoscapejs": "^2.0.0", "react-device-detect": "^2.2.3", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index a2aec50c..7349952b 100755 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -48,7 +48,7 @@ import 'react-toastify/dist/ReactToastify.css'; import Drift from "react-driftjs"; -import { AppContext } from './context/contextApi.jsx'; +import { AppContext } from './context/ContextApi.jsx'; // Production - backend proxy forwarding in nginx var globalUrl = window.location.origin; diff --git a/frontend/src/components/HealthBarChart.jsx b/frontend/src/components/HealthBarChart.jsx index a4f05273..8f95c0c6 100644 --- a/frontend/src/components/HealthBarChart.jsx +++ b/frontend/src/components/HealthBarChart.jsx @@ -1,5 +1,8 @@ import React from 'react'; import { Bar } from 'react-chartjs-2'; +import { Chart, registerables } from 'chart.js'; + +Chart.register(...registerables); const HealthBarChart = (props) => { const { globalUrl, filteredData, options, onBarClick } = props; diff --git a/frontend/src/context/contextApi.jsx b/frontend/src/context/ContextApi.jsx similarity index 100% rename from frontend/src/context/contextApi.jsx rename to frontend/src/context/ContextApi.jsx diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index b5046a7f..8062408f 100755 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -1294,7 +1294,7 @@ const DocsWrapper = memo(({userdata, children })=>{ return (
Date: Tue, 12 Nov 2024 11:49:47 +0100 Subject: [PATCH 2/6] No more files in the main repo. --- startup.sh | 83 ------------------------------------------------------ 1 file changed, 83 deletions(-) delete mode 100644 startup.sh diff --git a/startup.sh b/startup.sh deleted file mode 100644 index 4fac7596..00000000 --- a/startup.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Update and install dependencies -apt-get update -apt-get install -y docker.io docker-compose curl git - -# Start and enable Docker -systemctl start docker -systemctl enable docker - -# Clone Shuffle repository -git clone --branch 2.0.0 https://github.com/Shuffle/Shuffle.git -cd Shuffle - -# Setup directories and permissions -mkdir shuffle-database && chmod -R 777 shuffle-database - -# Start services -docker-compose up -d - -# Wait for initial startup -echo "Waiting 30 seconds for initial startup..." -sleep 30 - -# Check for restarting containers -echo "Checking for restarting containers..." -ATTEMPTS=30 -for i in $(seq 1 $ATTEMPTS); do - RESTARTING_CONTAINERS=$(docker ps --filter "status=restarting" --format "{{.Names}}") - if [ -n "$RESTARTING_CONTAINERS" ]; then - echo "The following containers are restarting:" - echo "$RESTARTING_CONTAINERS" - exit 1 - fi - echo "No containers are restarting. Attempt $i/$ATTEMPTS." - sleep 1 -done -echo "No containers were found in a restarting state after $ATTEMPTS checks." - -# Check frontend response -echo "Checking frontend response..." -RESPONSE=$(curl -s http://localhost:3001) -if echo "$RESPONSE" | grep -q "Shuffle"; then - echo "The word 'Shuffle' was found in the response." -else - echo "The word 'Shuffle' was not found in the response." - exit 1 -fi - -# Register user -echo "Attempting to register user..." -MAX_RETRIES=30 -RETRY_INTERVAL=10 -CONTAINER_NAME="shuffle-backend" - -for (( i=1; i<=$MAX_RETRIES; i++ )) -do - STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" 'http://localhost:3001/api/v1/register' \ - -H 'Accept: */*' \ - -H 'Accept-Language: en-US,en;q=0.9' \ - -H 'Connection: keep-alive' \ - -H 'Content-Type: application/json' \ - --data-raw '{"username":"demo@demo.io","password":"supercoolpassword"}') - - if [ "$STATUS_CODE" -eq 200 ]; then - echo "User registration was successful with status code 200." - exit 0 - elif [ "$STATUS_CODE" -ne 502 ]; then - echo "User registration failed with status code $STATUS_CODE." - exit 1 - fi - - echo "Received status code $STATUS_CODE. Retrying in $RETRY_INTERVAL seconds... ($i/$MAX_RETRIES)" - echo "Fetching last 30 lines of logs from container $CONTAINER_NAME..." - docker logs --tail 30 "$CONTAINER_NAME" - echo "Fetching last 30 lines of logs from container shuffle-opensearch..." - docker logs --tail 30 shuffle-opensearch - - sleep $RETRY_INTERVAL -done - -echo "User registration failed after $MAX_RETRIES attempts." -exit 1 \ No newline at end of file From 13800b0ecac6b9aef7e0f5fae8ffbb48bfc93d59 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 12 Nov 2024 11:50:01 +0100 Subject: [PATCH 3/6] No random files in the main repo --- app.json | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 app.json diff --git a/app.json b/app.json deleted file mode 100644 index e8cd75ca..00000000 --- a/app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Shuffle", - "description": "Security Automation Platform", - "repository": "https://github.com/0x0elliot/Shuffle", - "ref": "2.0.0", - "scripts": { - "postclone": "chmod +x startup.sh && ./startup.sh" - } - } \ No newline at end of file From 38747fb3dcb0e1a44a964644620c149530fc78a3 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 12 Nov 2024 11:50:16 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1ffc0c29..c1a214e2 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Shuffle Automation [![CodeQL](https://github.com/Shuffle/Shuffle/actions/workflows/codeql-analysis.yml/badge.svg?branch=launch)](https://github.com/Shuffle/Shuffle/actions/workflows/codeql-analysis.yml) [![Autobuild](https://github.com/Shuffle/Shuffle/actions/workflows/dockerbuild.yaml/badge.svg?branch=launch)](https://github.com/Shuffle/Shuffle/actions/workflows/dockerbuild.yaml) -[![Deploy to Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run/?git_repo=https://github.com/0x0elliot/Shuffle&ref=2.0.0)

From ea8a958e2a4e84aa48d7cfd63c72911d9fcae861 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 12 Nov 2024 11:50:30 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index c1a214e2..90d6e6ca 100755 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ Shuffle Automation -[![CodeQL](https://github.com/Shuffle/Shuffle/actions/workflows/codeql-analysis.yml/badge.svg?branch=launch)](https://github.com/Shuffle/Shuffle/actions/workflows/codeql-analysis.yml) -[![Autobuild](https://github.com/Shuffle/Shuffle/actions/workflows/dockerbuild.yaml/badge.svg?branch=launch)](https://github.com/Shuffle/Shuffle/actions/workflows/dockerbuild.yaml) -

[Shuffle](https://shuffler.io) is an automation platform for and by the community, focusing on accessibility for anyone to automate. Security operations is complex, but it doesn't have to be. From 64f481db21d7bd1484028ded95b50546abc149f7 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 12 Nov 2024 12:22:45 +0100 Subject: [PATCH 6/6] Delete .github/workflows/release-please.yml --- .github/workflows/release-please.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index b3d1927e..00000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: - push: - branches: - - launch -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - release-type: node - package-name: release-please-action