From 43f46756ba89bbf3f96038a609a784211748030a Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:33:10 +0530 Subject: [PATCH 01/11] fix: downgrading versions --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 11838a86..6cb8ed8d 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: frontend: - image: ghcr.io/shuffle/shuffle-frontend:1.4.2 + image: ghcr.io/shuffle/shuffle-frontend:1.4.1 container_name: shuffle-frontend hostname: shuffle-frontend ports: @@ -14,7 +14,7 @@ services: depends_on: - backend backend: - image: ghcr.io/shuffle/shuffle-backend:1.4.2 + image: ghcr.io/shuffle/shuffle-backend:1.4.1 container_name: shuffle-backend hostname: ${BACKEND_HOSTNAME} # Here for debugging: @@ -55,7 +55,7 @@ services: - SHUFFLE_STATS_DISABLED=true - SHUFFLE_SWARM_CONFIG=run - SHUFFLE_LOGS_DISABLED=true - - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:1.4.2 + - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:1.4.1 env_file: .env restart: unless-stopped security_opt: From 58f10d29afc399e06e4667b88205df027492cb2d Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:41:48 +0530 Subject: [PATCH 02/11] fix: downgrading again to the most basic --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6cb8ed8d..88d9fdae 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: frontend: - image: ghcr.io/shuffle/shuffle-frontend:1.4.1 + image: ghcr.io/shuffle/shuffle-frontend:1.4.0 container_name: shuffle-frontend hostname: shuffle-frontend ports: @@ -14,7 +14,7 @@ services: depends_on: - backend backend: - image: ghcr.io/shuffle/shuffle-backend:1.4.1 + image: ghcr.io/shuffle/shuffle-backend:1.4.0 container_name: shuffle-backend hostname: ${BACKEND_HOSTNAME} # Here for debugging: @@ -55,7 +55,7 @@ services: - SHUFFLE_STATS_DISABLED=true - SHUFFLE_SWARM_CONFIG=run - SHUFFLE_LOGS_DISABLED=true - - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:1.4.1 + - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:1.4.0 env_file: .env restart: unless-stopped security_opt: From 83dc5fd99345d7f70f7fa702f42dafb25d06a4ee Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:02:58 +0530 Subject: [PATCH 03/11] fix: disabling swarm by default --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 88d9fdae..e5bd604c 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,7 +53,7 @@ services: - SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY} - SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY} - SHUFFLE_STATS_DISABLED=true - - SHUFFLE_SWARM_CONFIG=run + # - SHUFFLE_SWARM_CONFIG=run - SHUFFLE_LOGS_DISABLED=true - SHUFFLE_WORKER_IMAGE=ghcr.io/shuffle/shuffle-worker:1.4.0 env_file: .env From b776d90c304cf065433d8baa150564fbe2d8abb9 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:35:49 +0530 Subject: [PATCH 04/11] fix: adding workflow_dispatch for easy image building --- .github/workflows/dockerbuild.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerbuild.yaml b/.github/workflows/dockerbuild.yaml index 3d752c6a..790202eb 100644 --- a/.github/workflows/dockerbuild.yaml +++ b/.github/workflows/dockerbuild.yaml @@ -1,6 +1,7 @@ name: dockerbuild on: + workflow_dispatch: push: branches: - main From 9137331b8f50f2e61130726e8126bc2bfadf0d0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:13:47 +0000 Subject: [PATCH 05/11] build(deps): bump golang.org/x/crypto in /backend/go-app Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.22.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.22.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- backend/go-app/go.mod | 16 ++++++++-------- backend/go-app/go.sum | 34 ++++++++++++++++------------------ 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 11ecca3f..b62c598d 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -21,7 +21,7 @@ require ( github.com/h2non/filetype v1.1.3 github.com/satori/go.uuid v1.2.0 github.com/shuffle/shuffle-shared v0.6.90 - golang.org/x/crypto v0.22.0 + golang.org/x/crypto v0.31.0 google.golang.org/api v0.176.1 google.golang.org/grpc v1.63.2 gopkg.in/src-d/go-git.v4 v4.13.1 @@ -116,15 +116,15 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.19.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect diff --git a/backend/go-app/go.sum b/backend/go-app/go.sum index eb35434b..2210d186 100644 --- a/backend/go-app/go.sum +++ b/backend/go-app/go.sum @@ -334,8 +334,6 @@ github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdR github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/shuffle/shuffle-shared v0.6.77 h1:KKtM50xW2DLuRHINxhp3uXrNH0AhiwkeiiU93a8fB3A= -github.com/shuffle/shuffle-shared v0.6.77/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= github.com/shuffle/shuffle-shared v0.6.90 h1:FzIYtEt44eWgEsW/9tj2ki7qq8FEm/HWXUok+THp72M= github.com/shuffle/shuffle-shared v0.6.90/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -410,8 +408,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -440,8 +438,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -468,8 +466,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -486,8 +484,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -517,16 +515,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -538,8 +536,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -574,8 +572,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 1a89ebd37eb2ac66633169eea8687256bbc59c15 Mon Sep 17 00:00:00 2001 From: Frikky Date: Thu, 12 Dec 2024 16:02:22 +0100 Subject: [PATCH 06/11] Minor orborus fix? --- functions/onprem/orborus/orborus.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 582e555c..39aceaab 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -608,7 +608,8 @@ func deployServiceWorkers(image string) { Condition: swarm.RestartPolicyConditionOnFailure, }, Placement: &swarm.Placement{ - Constraints: []string{}, + Constraints: []string{ + }, }, }, } From 7d0c5692939274f6ef6a2628a4161fcc5c51281e Mon Sep 17 00:00:00 2001 From: Frikky Date: Thu, 12 Dec 2024 16:02:57 +0100 Subject: [PATCH 07/11] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b90944bf..9e5eae2d 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 AWS](https://d1.awsstatic.com/cloudformation-deploy-to-aws-button.png)](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=Shuffle-Instance&templateURL=https://shuffle-public-amis.s3.eu-north-1.amazonaws.com/template.yaml)

From f16d31c4e3e2c00ef00f24ba5689821b63786806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:06:33 +0000 Subject: [PATCH 08/11] build(deps): bump golang.org/x/crypto in /functions/onprem/orborus Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] --- functions/onprem/orborus/go.mod | 10 +++++----- functions/onprem/orborus/go.sum | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/functions/onprem/orborus/go.mod b/functions/onprem/orborus/go.mod index 33577275..9cf9229f 100644 --- a/functions/onprem/orborus/go.mod +++ b/functions/onprem/orborus/go.mod @@ -95,14 +95,14 @@ require ( go.opentelemetry.io/otel/sdk v1.30.0 // indirect go.opentelemetry.io/otel/trace v1.30.0 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/functions/onprem/orborus/go.sum b/functions/onprem/orborus/go.sum index 02b90f14..de1d6e82 100644 --- a/functions/onprem/orborus/go.sum +++ b/functions/onprem/orborus/go.sum @@ -301,12 +301,6 @@ github.com/sendgrid/sendgrid-go v3.14.0+incompatible h1:KDSasSTktAqMJCYClHVE94Fc github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8= 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/shuffle/shuffle-shared v0.6.74 h1:os3BDSFZnl4U8ZgsTAY8IsTDADcMXhbc1rS9UMa0BIY= -github.com/shuffle/shuffle-shared v0.6.74/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= -github.com/shuffle/shuffle-shared v0.6.79 h1:MIy5kcShHYN05ov/50YJ+la1C2v1rL8IENapOvX9I8U= -github.com/shuffle/shuffle-shared v0.6.79/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= -github.com/shuffle/shuffle-shared v0.6.83 h1:gceT91WtFqh3h9juzTipDhWpxZLfrdtbcsnK+XNj57g= -github.com/shuffle/shuffle-shared v0.6.83/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= github.com/shuffle/shuffle-shared v0.6.90 h1:FzIYtEt44eWgEsW/9tj2ki7qq8FEm/HWXUok+THp72M= github.com/shuffle/shuffle-shared v0.6.90/go.mod h1:RAJiSFjmuKmijKTbbEf9A6Ojb+3/te7g71lED7JjPus= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -372,8 +366,8 @@ golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -449,8 +443,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -479,16 +473,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -500,8 +494,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= From cd38b266f81dcabe55983846768952479666b8cd Mon Sep 17 00:00:00 2001 From: Frikky Date: Thu, 12 Dec 2024 23:56:19 +0100 Subject: [PATCH 09/11] Removed deletion systems --- functions/onprem/worker/worker.go | 65 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index 189a619e..d61bb4fa 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -27,13 +27,13 @@ import ( dockerclient "github.com/docker/docker/client" // This is for automatic removal of certain code :) - /*** STARTREMOVE ***/ + /*** ***/ "math/rand" "github.com/docker/docker/api/types/swarm" uuid "github.com/satori/go.uuid" - /*** ENDREMOVE ***/ + /*** ***/ "github.com/gorilla/mux" @@ -321,11 +321,11 @@ func shutdown(workflowExecution shuffle.WorkflowExecution, nodeId string, reason */ } else { - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm" { log.Printf("[DEBUG][%s] NOT cleaning up containers. IDS: %d, CLEANUP env: %s", workflowExecution.ExecutionId, 0, cleanupEnv) } - /*** ENDREMOVE ***/ + /*** ***/ } if len(reason) > 0 && len(nodeId) > 0 { @@ -393,7 +393,7 @@ func shutdown(workflowExecution shuffle.WorkflowExecution, nodeId string, reason func int32Ptr(i int32) *int32 { return &i } -// ** STARTREMOVE ***/ +// ** ***/ func deployk8sApp(image string, identifier string, env []string) error { if len(os.Getenv("KUBERNETES_NAMESPACE")) > 0 { kubernetesNamespace = os.Getenv("KUBERNETES_NAMESPACE") @@ -631,7 +631,7 @@ func deployk8sApp(image string, identifier string, env []string) error { return nil } -//** ENDREMOVE ***/ +//** ***/ // Deploys the internal worker whenever something happens func deployApp(cli *dockerclient.Client, image string, identifier string, env []string, workflowExecution shuffle.WorkflowExecution, action shuffle.Action) error { @@ -772,7 +772,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] } } - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" { appName := strings.Replace(identifier, fmt.Sprintf("_%s", action.ID), "", -1) @@ -802,14 +802,14 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] return err } } else { - // ** STARTREMOVE ***/ + // ** ***/ exposedPort = 80 err = findAppInfoKubernetes(image, appName, env) if err != nil { log.Printf("[ERROR] Failed finding and creating port for %s: %s", appName, err) return err } - // ** ENDREMOVE ***/ + // ** ***/ } /* @@ -852,7 +852,7 @@ func deployApp(cli *dockerclient.Client, image string, identifier string, env [] return nil } - /*** ENDREMOVE ***/ + /*** ***/ // Max 10% CPU every second //CPUShares: 128, @@ -2404,7 +2404,7 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl return } - /*** STARTREMOVE ***/ + /*** ***/ if workflowExecution.Status == "WAITING" && (os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm") { log.Printf("[INFO][%s] Workflow execution is waiting while in swarm. Sending info to backend to ensure execution stops.", workflowExecution.ExecutionId) @@ -2416,7 +2416,7 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl shutdown(*workflowExecution, "", "", false) } } - /*** ENDREMOVE ***/ + /*** ***/ } else { if strings.Contains(strings.ToLower(fmt.Sprintf("%s", err)), "already been ran") || strings.Contains(strings.ToLower(fmt.Sprintf("%s", err)), "already finished") { log.Printf("[ERROR][%s] Skipping rerun of action result as it's already been ran: %s", workflowExecution.ExecutionId) @@ -2501,7 +2501,7 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl return } - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" { finished := shuffle.ValidateFinished(ctx, -1, *workflowExecution) if !finished { @@ -2516,7 +2516,7 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl sendResult(*workflowExecution, shutdownData) } } - /*** ENDREMOVE ***/ + /*** ***/ } else { log.Printf("[INFO][%s] Skipping setexec with status %s", workflowExecution.ExecutionId, workflowExecution.Status) @@ -2536,12 +2536,12 @@ func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workfl func sendSelfRequest(actionResult shuffle.ActionResult) { - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm" { log.Printf("[INFO][%s] Not sending self request info since source is default (not swarm)", actionResult.ExecutionId) return } - /*** ENDREMOVE ***/ + /*** ***/ data, err := json.Marshal(actionResult) if err != nil { @@ -2680,11 +2680,11 @@ func validateFinished(workflowExecution shuffle.WorkflowExecution) bool { } } - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") != "run" && os.Getenv("SHUFFLE_SWARM_CONFIG") != "swarm" { requestsSent += 1 } - /*** ENDREMOVE ***/ + /*** ***/ log.Printf("[DEBUG][%s] Should send full result to %s", workflowExecution.ExecutionId, baseUrl) @@ -2769,7 +2769,7 @@ func handleGetStreamResults(resp http.ResponseWriter, request *http.Request) { // GetLocalIP returns the non loopback local IP of the host func getLocalIP() string { - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("IS_KUBERNETES") == "true" { return "shuffle-workers" } @@ -2836,7 +2836,7 @@ func getLocalIP() string { return foundIP } } - /*** ENDREMOVE ***/ + /*** ***/ addrs, err := net.InterfaceAddrs() if err != nil { @@ -2887,7 +2887,7 @@ func webserverSetup(workflowExecution shuffle.WorkflowExecution) net.Listener { log.Printf("[DEBUG] OLD HOSTNAME: %s", appCallbackUrl) - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" { log.Printf("[DEBUG] Starting webserver (1) on port %d with hostname: %s", baseport, hostname) @@ -2907,7 +2907,7 @@ func webserverSetup(workflowExecution shuffle.WorkflowExecution) net.Listener { return listener } - /*** ENDREMOVE ***/ + /*** ***/ port := listener.Addr().(*net.TCPAddr).Port // Set the port environment variable @@ -2958,7 +2958,7 @@ func findActiveSwarmNodes(dockercli *dockerclient.Client) (int64, error) { */ } -/*** STARTREMOVE ***/ +/*** ***/ func deploySwarmService(dockercli *dockerclient.Client, name, image string, deployport int) error { log.Printf("[DEBUG] Deploying service for %s to swarm on port %d", name, deployport) //containerName := fmt.Sprintf("shuffle-worker-%s", parsedUuid) @@ -3128,10 +3128,10 @@ func deploySwarmService(dockercli *dockerclient.Client, name, image string, depl return nil } -/*** ENDREMOVE ***/ +/*** ***/ // Runs data discovery -/*** STARTREMOVE ***/ +/*** ***/ func findAppInfoKubernetes(image, name string, env []string) error { clientset, _, err := shuffle.GetKubernetesClient() @@ -3291,7 +3291,7 @@ func findAppInfo(image, name string) (int, error) { return exposedPort, nil } -/*** ENDREMOVE ***/ +/*** ***/ func sendAppRequest(ctx context.Context, incomingUrl, appName string, port int, action *shuffle.Action, workflowExecution *shuffle.WorkflowExecution) error { parsedRequest := shuffle.OrborusExecutionRequest{ @@ -3691,11 +3691,11 @@ func getStreamResultsWrapper(client *http.Client, req *http.Request, workflowExe // Initial loop etc func main() { - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" { logsDisabled = "true" } - /*** ENDREMOVE ***/ + /*** ***/ // Elasticsearch necessary to ensure we'ren ot running with Datastore configurations for minimal/maximal data sizes // Recursive import kind of :) _, err := shuffle.RunInit(*shuffle.GetDatastore(), *shuffle.GetStorage(), "", "worker", true, "elasticsearch", false, 0) @@ -3729,7 +3729,7 @@ func main() { swarmConfig := os.Getenv("SHUFFLE_SWARM_CONFIG") log.Printf("[INFO] Running with timezone %s and swarm config %#v", timezone, swarmConfig) - /*** STARTREMOVE ***/ + /*** ***/ if swarmConfig == "run" || swarmConfig == "swarm" { // Forcing download just in case on the first iteration. log.Printf("[INFO] Running in swarm mode - forcing download of apps") @@ -3744,7 +3744,7 @@ func main() { log.Printf("[ERROR] Stopped listener %#v - exiting.", listener) os.Exit(3) } - /*** ENDREMOVE ***/ + /*** ***/ authorization := "" executionId := "" @@ -4097,11 +4097,12 @@ func runWebserver(listener net.Listener) { // What would be require to run a workflow otherwise? // Maybe directly /workflow/run - /*** STARTREMOVE ***/ + /*** ***/ if os.Getenv("SHUFFLE_SWARM_CONFIG") == "run" || os.Getenv("SHUFFLE_SWARM_CONFIG") == "swarm" { log.Printf("[DEBUG] Running webserver config for SWARM and K8s") } - /*** ENDREMOVE ***/ + + /*** ***/ var dockercli *dockerclient.Client ctx := context.Background() scaleReplicas := os.Getenv("SHUFFLE_APP_REPLICAS") From bb0fd583bc5a846ca82b898863e97ef4fa46f6b2 Mon Sep 17 00:00:00 2001 From: Frikky Date: Fri, 13 Dec 2024 00:04:57 +0100 Subject: [PATCH 10/11] Gah --- functions/onprem/worker/worker.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index d61bb4fa..cc83c4f8 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -4104,7 +4104,7 @@ func runWebserver(listener net.Listener) { /*** ***/ var dockercli *dockerclient.Client - ctx := context.Background() + defer dockercli.Close() scaleReplicas := os.Getenv("SHUFFLE_APP_REPLICAS") if len(scaleReplicas) > 0 { tmpInt, err := strconv.Atoi(scaleReplicas) @@ -4130,9 +4130,13 @@ func runWebserver(listener net.Listener) { log.Printf("[DEBUG] SHUFFLE_APP_EXECUTIONS_PER_MINUTE set to value %s. Trying to overwrite default (%d)", os.Getenv("SHUFFLE_APP_EXECUTIONS_PER_MINUTE"), maxExecutionsPerMinute) } + /* + ctx := context.Background() if strings.ToLower(os.Getenv("SHUFFLE_SWARM_CONFIG")) == "run" || strings.ToLower(os.Getenv("SHUFFLE_APP_REPLICAS")) == "" { go AutoScaleApps(ctx, dockercli, maxExecutionsPerMinute) } + */ + if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" { r.HandleFunc("/debug/pprof/", pprof.Index) r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP) @@ -4178,12 +4182,14 @@ func AutoScaleApps(ctx context.Context, client *dockerclient.Client, maxExecutio case <-ticker.C: count := window.CountEvents(time.Now()) - j := numberOfApps(ctx, client) + + appNumber := numberOfApps(ctx, client) workers := numberOfWorkers(ctx, client) + execPerMin := maxExecutionsPerMinute / workers if count >= execPerMin { log.Printf("[DEBUG] Too many executions per minute (%d). Scaling down to %d", count, execPerMin) - scaleApps(ctx, client, uint64(j+1)) + scaleApps(ctx, client, uint64(appNumber+1)) } } } From 75e99e223225361245bf2da9f3cb802b25b821a5 Mon Sep 17 00:00:00 2001 From: Frikky Date: Fri, 13 Dec 2024 00:10:38 +0100 Subject: [PATCH 11/11] Synced files across admin systems --- frontend/src/components/AppCreationModal.jsx | 64 +- frontend/src/components/AppModal.jsx | 39 +- frontend/src/components/AppSelection.jsx | 10 +- frontend/src/components/Billing.jsx | 376 ++++--- frontend/src/components/BillingStats.jsx | 152 ++- frontend/src/components/CacheView.jsx | 21 +- frontend/src/components/Files.jsx | 60 +- frontend/src/components/LeftSideBar.jsx | 69 +- frontend/src/components/LicencePopup.jsx | 241 +++- frontend/src/components/Priorities.jsx | 176 ++- frontend/src/components/Priority.jsx | 2 +- frontend/src/views/Admin2.jsx | 5 +- frontend/src/views/Apps2.jsx | 181 +-- frontend/src/views/Workflows2.jsx | 1053 +++++++++++------- 14 files changed, 1620 insertions(+), 829 deletions(-) diff --git a/frontend/src/components/AppCreationModal.jsx b/frontend/src/components/AppCreationModal.jsx index 7b650fbd..f5a25169 100644 --- a/frontend/src/components/AppCreationModal.jsx +++ b/frontend/src/components/AppCreationModal.jsx @@ -57,7 +57,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { : hover ? "" : "1px solid rgba(255,255,255,0.3)", - borderImage: makeFancy ? "linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) 1" : "none", + borderImage: makeFancy ? "linear-gradient(to right, #ff8544 0%, #ec517c 50%, #9c5af2 100%) 1" : "none", transition: 'all 0.2s ease-in-out', } @@ -340,7 +340,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { const circularLoader = validation ? : null - const errorText = openApiError?.length > 0 ?
Error: {openApiError}
: null + const errorText = openApiError?.length > 0 ?
Error: {openApiError}
: null // Common dialog styles const dialogStyle = { @@ -400,7 +400,13 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { Create New App { + setOpenApi("") + setOpenApiError("") + setAppValidation("") + setValidation(false) + onClose() + }} sx={{ color: 'rgba(255, 255, 255, 0.7)', '&:hover': { bgcolor: 'rgba(255, 255, 255, 0.1)' } @@ -477,7 +483,14 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { Create New App from Open API or Swagger setOpenApiModal(false)} + onClick={() => { + setOpenApiModal(false) + setGenerateAppModal(false) + setOpenApi("") + setOpenApiError("") + setAppValidation("") + setValidation(false) + }} sx={{ color: 'rgba(255,255,255,0.7)', '&:hover': { bgcolor: 'rgba(255,255,255,0.1)' } @@ -487,14 +500,16 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { -
- +
+ Paste in the URI for the OpenAPI or find out How to find URI for openAPI? @@ -506,12 +521,13 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { fullWidth variant="outlined" placeholder="Open API URI" + style={{ fontFamily: theme?.typography?.fontFamily, fontSize: '16px' }} sx={{ '& .MuiOutlinedInput-root': { - height: '40px' + height: '40px', }, '& .MuiOutlinedInput-input::placeholder': { - fontSize: '14px' + fontSize: '16px' } }} onChange={(e) => setOpenApi(e.target.value)} @@ -526,7 +542,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { px: 3, textTransform: 'none', height: '40px', - fontSize: '14px', + fontSize: '16px', fontFamily: theme?.typography?.fontFamily, cursor: 'pointer' }} @@ -562,7 +578,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { sx={{ color: '#FF8544', borderColor: '#FF8544', - px: 3, + px: 5, py: 1, '&:hover': { borderColor: '#FF8544', @@ -570,7 +586,8 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { }, textTransform: 'none', fontSize: '14px', - fontFamily: theme?.typography?.fontFamily + fontFamily: theme?.typography?.fontFamily, + height: '40px' }} > Upload @@ -605,7 +622,8 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { }, textTransform: 'none', py: 1.5, - fontSize: '14px', + mb: 1.5, + fontSize: '16px', fontWeight: 500, width: '100%', maxWidth: '300px', @@ -648,7 +666,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { Generate an app based on documentation (beta) @@ -656,6 +674,10 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { onClick={() => { setGenerateAppModal(false) setOpenApiModal(false) + setOpenApi("") + setOpenApiError("") + setAppValidation("") + setValidation(false) }} sx={{ color: 'rgba(255,255,255,0.7)', @@ -668,9 +690,9 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { Paste in a URL, and we will make it into an app for you. @@ -689,18 +711,15 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { color: 'white', '& fieldset': { borderWidth: '1px', - borderImage: 'linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) 1', - borderImageSlice: 1, + borderImage: "linear-gradient(to right, #ff8544 0%, #ec517c 50%, #9c5af2 100%) 1", }, '&:hover fieldset': { borderWidth: '1px', - borderImage: 'linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) 1', - borderImageSlice: 1, + borderImage: "linear-gradient(to right, #ff8544 0%, #ec517c 50%, #9c5af2 100%) 1", }, '&.Mui-focused fieldset': { borderWidth: '2px', - borderImage: 'linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) 1', - borderImageSlice: 1, + borderImage: "linear-gradient(to right, #ff8544 0%, #ec517c 50%, #9c5af2 100%) 1", } }, '& .MuiOutlinedInput-input::placeholder': { @@ -727,6 +746,7 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => { { {circularLoader} { !validation && - + This may take multiple minutes based on the size of the documentation. } diff --git a/frontend/src/components/AppModal.jsx b/frontend/src/components/AppModal.jsx index 4fcc5d07..546111ab 100644 --- a/frontend/src/components/AppModal.jsx +++ b/frontend/src/components/AppModal.jsx @@ -433,7 +433,7 @@ const AppModal = ({ open, onClose, app, globalUrl }) => { fontFamily: theme?.typography?.fontFamily }} > - + About {app?.name.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase())} { boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.2)" }} /> -
+
{newAppname} - { - isCloud && ( - - - - - - ) - } + + + + +
{ if (canEditApp) { const editUrl = "/apps/edit/" + (app?.id || app?.objectID); navigate(editUrl) - }else{ + } else { const forkUrl = "/apps/new?id=" + (app?.id || app?.objectID); navigate(forkUrl) } @@ -735,7 +732,7 @@ const AppModal = ({ open, onClose, app, globalUrl }) => { bgcolor: '#FF8544', '&:hover': { bgcolor: '#FF8544' }, textTransform: 'none', - borderRadius: 1, + borderRadius: "4px", py: 1, px: 7, fontSize: "14px", diff --git a/frontend/src/components/AppSelection.jsx b/frontend/src/components/AppSelection.jsx index e9539eeb..73528ec2 100644 --- a/frontend/src/components/AppSelection.jsx +++ b/frontend/src/components/AppSelection.jsx @@ -466,14 +466,16 @@ const AppSelection = props => { fontSize: 16, color: "rgba(158, 158, 158, 1)", fontFamily: theme?.typography?.fontFamily, + lineHeight: "24px" }} > - Your organization has no apps yet, select your starting apps here - or discover more apps using the { - navigate("/apps2?tab=all_apps") + navigate("/apps?tab=all_apps") }} - style={{ color: "#FF8444", fontWeight: "medium", fontSize: 16, cursor:"pointer" }}>App Library + style={{ color: "#FF8444", fontWeight: "medium", fontSize: 16, cursor:"pointer", marginLeft: 6 }}>App Library
) diff --git a/frontend/src/components/Billing.jsx b/frontend/src/components/Billing.jsx index c1ce38a3..1bafe19b 100644 --- a/frontend/src/components/Billing.jsx +++ b/frontend/src/components/Billing.jsx @@ -51,11 +51,13 @@ import BillingStats from "./BillingStats.jsx"; import { handlePayasyougo } from "../views/HandlePaymentNew.jsx" import DeleteIcon from '@mui/icons-material/Delete'; import { Context } from "../context/ContextApi.jsx"; +import LicencePopup from "./LicencePopup.jsx"; const Billing = memo((props) => { - const { globalUrl, userdata, serverside, billingInfo, stripeKey, selectedOrganization, handleGetOrg, clickedFromOrgTab } = props; + const { globalUrl, userdata, serverside, billingInfo, stripeKey,isLoaded, selectedOrganization, handleGetOrg, clickedFromOrgTab, removeCookie} = props; //const alert = useAlert(); let navigate = useNavigate(); + const [isLoggedIn, setIsLoggedIn] = useState(false) const [selectedDealModalOpen, setSelectedDealModalOpen] = React.useState(false); const [dealList, setDealList] = React.useState([]); const [dealName, setDealName] = React.useState(""); @@ -73,14 +75,17 @@ const Billing = memo((props) => { const [currentAppRunsInNumber, setCurrentAppRunsInNumber] = useState(0); const [alertThresholds, setAlertThresholds] = useState(selectedOrganization.Billing !== undefined && selectedOrganization.Billing.AlertThreshold !== undefined && selectedOrganization.Billing.AlertThreshold !== null ? selectedOrganization.Billing.AlertThreshold : [{ percentage: '', count: '', Email_send: false }]); const [currentIndex, setCurrentIndex] = useState(0); + const [deleteAlertIndex, setDeleteAlertIndex] = useState(-1); const [deleteAlertVerification, setDeleteAlertVerification] = useState(false); - useEffect(() => { if (userdata.app_execution_limit !== undefined && userdata.app_execution_usage !== undefined) { const percentage = (userdata.app_execution_usage / userdata.app_execution_limit) * 100; setCurrentAppRunsInPercentage(Math.round(percentage)); setCurrentAppRunsInNumber(userdata.app_execution_limit - userdata.app_execution_usage); } + if (userdata?.id?.length > 0 && isLoggedIn === false){ + setIsLoggedIn(true) + } }, [userdata]); const [BillingEmail, setBillingEmail] = useState(selectedOrganization?.Billing?.Email); @@ -182,7 +187,8 @@ const Billing = memo((props) => { const isCloud = window.location.host === "localhost:3002" || - window.location.host === "shuffler.io"; + window.location.host === "shuffler.io" || + window.location.host === "sandbox.shuffler.io"; billingInfo.subscription = { "active": true, @@ -419,8 +425,16 @@ const Billing = memo((props) => { const data = { org_id: orgId, email: newBillingEmail, + name: selectedOrganization.name, + description: selectedOrganization.description, + image: selectedOrganization.image, + defaults: selectedOrganization.defaults, + sso_config: selectedOrganization.sso_config, + mfa_required: selectedOrganization.mfa_required, billing: { email: newBillingEmail, + AlertThreshold: selectedOrganization?.Billing?.AlertThreshold, + Consultation: selectedOrganization?.Billing?.Consultation, }, }; @@ -747,13 +761,21 @@ const Billing = memo((props) => { open={openChangeEmailBox} onClose={handleCloseChangeEmailBox} PaperProps={{ - style: { - padding: '20px', - borderRadius: '8px', - maxWidth: '500px', - width: '100%' + sx: { + borderRadius: theme?.palette?.DialogStyle?.borderRadius, + border: theme?.palette?.DialogStyle?.border, + minWidth: '440px', + fontFamily: theme?.typography?.fontFamily, + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + zIndex: 1000, + '& .MuiDialogContent-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + '& .MuiDialogTitle-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, } - }} + }} > Change Billing Email @@ -810,7 +832,7 @@ const Billing = memo((props) => { color="primary" style={{ marginTop: !userdata.has_card_available ? 20 : 10, - borderRadius: 8, + borderRadius: 4, height: 40, fontSize: 16, color: userdata.has_card_available ? "#ff8544" : "#1a1a1a", @@ -843,7 +865,7 @@ const Billing = memo((props) => { color="primary" style={{ marginTop: 10, - borderRadius: 8, + borderRadius: 4, height: 40, fontSize: 16, color: "#1a1a1a", @@ -933,11 +955,19 @@ const Billing = memo((props) => { const url = `${globalUrl}/api/v1/orgs/${selectedOrganization.id}`; const data = { org_id: selectedOrganization.id, + name: selectedOrganization.name, + description: selectedOrganization.description, + image: selectedOrganization.image, + defaults: selectedOrganization.defaults, + sso_config: selectedOrganization.sso_config, + mfa_required: selectedOrganization.mfa_required, Billing: { Consultation: { hours: String(inputHour), minutes: String(inputMinutes), }, + AlertThreshold: selectedOrganization.Billing.AlertThreshold, + email: selectedOrganization.Billing.email, } }; @@ -1030,9 +1060,9 @@ const Billing = memo((props) => {
{ color="primary" style={{ marginTop: userdata.support ? 0 : 10, - borderRadius: 8, + borderRadius: 4, height: 40, fontSize: 16, color: "#1A1A1A", @@ -1142,8 +1172,23 @@ const Billing = memo((props) => { > Buy - { setClickOnBuy(false) }} PaperProps={{style: {backgroundColor: "rgb(26, 26, 26)"}}}> - + { setClickOnBuy(false) }} PaperProps={{ + sx: { + borderRadius: theme?.palette?.DialogStyle?.borderRadius, + border: theme?.palette?.DialogStyle?.border, + minWidth: '440px', + fontFamily: theme?.typography?.fontFamily, + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + zIndex: 1000, + '& .MuiDialogContent-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + '& .MuiDialogTitle-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + } + }}> + You will be taken to Stripe to book professional service hours. You can adjust the number of hours on the left side of the Stripe page. @@ -1178,10 +1223,9 @@ const Billing = memo((props) => { color="primary" style={{ marginTop: userdata.support ? 5 : 10, - borderRadius: 8, + borderRadius: 4, height: 40, fontSize: 16, - color: "#ff8544", textTransform: 'none', cursor: getProfessionalServices ? 'pointer' : 'not-allowed', opacity: getProfessionalServices ? 1 : 0.6, @@ -1202,13 +1246,23 @@ const Billing = memo((props) => { fullWidth style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }} PaperProps={{ - style: { - width: 500, - margin: 0, + sx: { + borderRadius: theme?.palette?.DialogStyle?.borderRadius, + border: theme?.palette?.DialogStyle?.border, + minWidth: '440px', + fontFamily: theme?.typography?.fontFamily, + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + zIndex: 1000, + '& .MuiDialogContent-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + '& .MuiDialogTitle-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, } - }} + }} > - + Upgrade Consultation Plan @@ -1244,7 +1298,7 @@ const Billing = memo((props) => {
-
+
- ) - } - setDeleteAlertVerification(false)} sx={{ '& .MuiBackdrop-root': { backgroundColor: 'rgba(0, 0, 0, 0.3)', }, }}> - Are you sure you want to delete this threshold? - - - - - -
+ + {alertThresholds[index].Email_send === true && ( + + + + )} + + {alertThresholds.length > 1 && ( + + )} + setDeleteAlertVerification(false)} + sx={{ + '& .MuiBackdrop-root': { backgroundColor: 'rgba(0, 0, 0, 0.3)' }, + }} + > + Are you sure you want to delete this threshold? + + + + + +
+ + ))}
@@ -2449,10 +2575,8 @@ const PaddingWrapper = memo(({ clickedFromOrgTab, children }) => { : "auto", padding: "27px 10px 19px 27px", backgroundColor: '#212121', - borderRadius: '16px', height: '100%', boxSizing: 'border-box', - borderLeft: '1px solid #494949', overflow: 'hidden', maxHeight: "1700px", overflowY: "auto",scrollbarColor: '#494949 transparent', scrollbarWidth: 'thin' }), [clickedFromOrgTab]); diff --git a/frontend/src/components/BillingStats.jsx b/frontend/src/components/BillingStats.jsx index 8b5d4a1c..231b5686 100644 --- a/frontend/src/components/BillingStats.jsx +++ b/frontend/src/components/BillingStats.jsx @@ -648,12 +648,13 @@ const AppStats = (defaultprops) => { All shown statistics are gathered from Your Organisation Statistics. It exists to give you more insight into your workflows, and to understand your utilization of the Shuffle platform. The billing tracker is in Beta, and is always calculated manually before being invoiced.
-
+
+
{filteredStatistics !== undefined ?
{
: null} +
+ {clickedFromOrgTab? ( -
-
+
+
+ + Search from + } + slotProps={{ + textField: { + sx: { + "& .MuiOutlinedInput-root": { + "& fieldset": { + borderColor: "#494949 !important", + borderWidth: "1px !important", + }, + "&:hover fieldset": { + borderColor: "#FFFFFF !important", + }, + "&.Mui-focused fieldset": { + borderColor: "#FFFFFF !important", + }, + height: "35px", + fontSize: 16, + color: "#c8c8c8", + }, + }, + }, + }} + sx={{ + "& .MuiInputBase-root": { + height: "35px", + minHeight: "35px", + }, + "& .MuiInputBase-input": { + height: "35px", + padding: "0 14px", + boxSizing: "border-box", + color: "#c8c8c8", + fontSize: 16, + } + }} + ampm={false} + format="YYYY-MM-DD HH:mm:ss" + value={startTime} + onChange={handleStartTimeChange} /> -
-
+
+
+ + Search until + } + "& .MuiInputBase-root": { + height: "35px", + minHeight: "35px", + }, + "& .MuiInputBase-input": { + height: "35px", + padding: "0 14px", + boxSizing: "border-box", + color: "#c8c8c8", + fontSize: 16, + } + }} + ampm={false} + format="YYYY-MM-DD HH:mm:ss" + value={endTime} + onChange={handleEndTimeChange} /> -
+
- + ):(
@@ -794,8 +890,6 @@ const AppStats = (defaultprops) => {
)} - -
{appRuns === undefined ? diff --git a/frontend/src/components/CacheView.jsx b/frontend/src/components/CacheView.jsx index 4e8c6c24..636509eb 100644 --- a/frontend/src/components/CacheView.jsx +++ b/frontend/src/components/CacheView.jsx @@ -412,7 +412,7 @@ const CacheView = memo((props) => {
@@ -711,7 +711,7 @@ const Files = memo((props) => { }} /> + {setOpenChangeEmailBox(false)}} + PaperProps={{ + sx: { + borderRadius: theme?.palette?.DialogStyle?.borderRadius, + border: theme?.palette?.DialogStyle?.border, + minWidth: '440px', + fontFamily: theme?.typography?.fontFamily, + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + zIndex: 1000, + '& .MuiDialogContent-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + '& .MuiDialogTitle-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + '& .MuiDialogActions-root': { + backgroundColor: theme?.palette?.DialogStyle?.backgroundColor, + }, + } + }} + > + Change Billing Email + + + Enter the new billing email address. + + { if (event.key === 'Enter') HandleChangeBillingEmail(selectedOrganization.id) }} + onChange={(e) => setNewBillingEmail(e.target.value)} + /> + + + + + + +
: null}
- + - - + {/*
@@ -736,7 +914,7 @@ const LicencePopup = (props) => { return (
- + {isCloud && billingInfo.subscription !== undefined && billingInfo.subscription !== null ? {
- - - - - + +
+
+ + + +
) } diff --git a/frontend/src/components/Priorities.jsx b/frontend/src/components/Priorities.jsx index 29078a6a..a78e8306 100644 --- a/frontend/src/components/Priorities.jsx +++ b/frontend/src/components/Priorities.jsx @@ -255,7 +255,7 @@ const Priorities = memo((props) => { onClick={() => { clearNotifications() }} - style={{marginLeft: 50, }} + style={{marginLeft: 50, textTransform: "none", fontSize: 16}} > Mark all as read @@ -265,7 +265,7 @@ const Priorities = memo((props) => { {clickedFromOrgTab? null : }

Suggestions

- + Suggestions are tasks identified by Shuffle to help you discover ways to protect your and customers' company.
These range from simple configurations in Shuffle to Usecases you may have missed.  { : null } - + {data.description}
- - - {data.read === false ? ( - - ) : null} - - - - + - - First seen: {new Date(data.created_at * 1000).toISOString().slice(0, 19)} - + {data.read === false ? ( + + ) : null} - - Last seen: {new Date(data.updated_at * 1000).toISOString().slice(0, 19)} - + + + + + + First seen:{" "} + {new Date(data.created_at * 1000).toISOString().slice(0, 19)} + + + + Last seen:{" "} + {new Date(data.updated_at * 1000).toISOString().slice(0, 19)} + + + + Times seen: {data.amount} + +
- - Times seen: {data.amount} - - ); }) diff --git a/frontend/src/components/Priority.jsx b/frontend/src/components/Priority.jsx index 4d37142f..4bd3a6f2 100644 --- a/frontend/src/components/Priority.jsx +++ b/frontend/src/components/Priority.jsx @@ -154,7 +154,7 @@ const Priority = (props) => { }
- @@ -2062,6 +2079,7 @@ const Apps2 = (props) => { handleAppClick={handleAppClick} leftSideBarOpenByClick={leftSideBarOpenByClick} userdata={userdata} + fetchApps={fetchApps} /> ))}
@@ -2106,6 +2124,7 @@ const Apps2 = (props) => { {appsToShow.map((data, index) => ( ))} diff --git a/frontend/src/views/Workflows2.jsx b/frontend/src/views/Workflows2.jsx index aa5bd735..80ef805a 100644 --- a/frontend/src/views/Workflows2.jsx +++ b/frontend/src/views/Workflows2.jsx @@ -1,5 +1,5 @@ // React & Core imports -import React, { useEffect, useContext, memo, useState } from "react"; +import React, { useEffect, useContext, memo, useState, useRef } from "react"; import { useLocation, useNavigate, Link } from "react-router-dom"; import ReactDOM from "react-dom" @@ -104,7 +104,10 @@ import { MuiChipsInput } from "mui-chips-input"; import { v4 as uuidv4 } from "uuid"; import theme from "../theme.jsx"; import algoliasearch from 'algoliasearch/lite'; -import { InstantSearch, Configure, connectHits } from 'react-instantsearch-dom'; +import { InstantSearch, Configure, connectHits, connectSearchBox, connectRefinementList } from 'react-instantsearch-dom'; +import { debounce } from "lodash"; +import { removeQuery } from "../components/ScrollToTop.jsx"; + const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240"); @@ -668,6 +671,8 @@ const Workflows2 = (props) => { const [_, setUpdate] = React.useState(""); // Used for rendering, don't remove const [selectedUsecases, setSelectedUsecases] = React.useState([]); const [filteredWorkflows, setFilteredWorkflows] = React.useState([]); + const [orgWorkflows, setOrgWorkflows] = React.useState([]); + const [myWorkflows, setMyWorkflows] = React.useState([]); const [selectedWorkflow, setSelectedWorkflow] = React.useState({}); const [workflowDone, setWorkflowDone] = React.useState(false); const [selectedWorkflowId, setSelectedWorkflowId] = React.useState(""); @@ -716,18 +721,47 @@ const Workflows2 = (props) => { const [apps, setApps] = React.useState([]); document.title = "Shuffle - Workflows"; + + useEffect(() => { + const queryParams = new URLSearchParams(location.search); + const tabParam = queryParams.get('tab'); + if (tabParam !== null && tabParam !== undefined) { + if (tabParam === 'org_workflows' && currTab !== 0) { + setCurrTab(0); + } else if (tabParam === 'my_workflows' && currTab !== 1) { + setCurrTab(1); + } else if (tabParam === 'all_workflows' && currTab !== 2) { + setCurrTab(2); + } + } + }, [location.search]); + const handleTabChange = (event, newValue) => { - // Set loading when switching to public workflows tab - if (newValue === 2) { + setCurrTab(newValue); + // Update URL query params based on tab index + const tabMapping = { + 0: 'org_workflows', + 1: 'my_workflows', + 2: 'all_workflows' + }; + const queryParams = new URLSearchParams(location.search); + queryParams.set('tab', tabMapping[newValue]); + + + navigate(`${location.pathname}?${queryParams.toString()}`); + }; + + useEffect(() => { + if (currTab === 2) { setIsLoadingPublicWorkflow(true); // Simulate loading time for the Algolia search results setTimeout(() => { setIsLoadingPublicWorkflow(false); - }, 2000); + }, 2500); } + }, [currTab]) + - setCurrTab(newValue); - }; const handleCreateWorkflow = () => { setModalOpen(true) @@ -1203,6 +1237,7 @@ const Workflows2 = (props) => { }, [isDropzone]); + const getFramework = () => { fetch(globalUrl + "/api/v1/apps/frameworkConfiguration", { method: "GET", @@ -1240,6 +1275,7 @@ const Workflows2 = (props) => { const getAvailableWorkflows = (amount) => { var storageWorkflows = [] + setIsLoadingWorkflow(true) try { const storagewf = localStorage.getItem("workflows") storageWorkflows = JSON.parse(storagewf) @@ -1527,13 +1563,13 @@ const Workflows2 = (props) => { overflow: "hidden", width: "100%", color: "white", - padding: "12px 12px 0px 15px", display: "flex", fontFamily: theme?.typography?.fontFamily, boxSizing: "border-box", position: "relative", borderRadius: "8px", // backgroundColor: "#212121", + padding: "15px 15px 0px 20px", }; const gridContainer = { @@ -2169,7 +2205,6 @@ const Workflows2 = (props) => { ); }; - // Replace the loading sections in the main component with this const LoadingWorkflowGrid = () => { return (
{ if ( parsedName !== undefined && parsedName !== null && - parsedName.length > 20 + parsedName.length > 35 ) { - parsedName = parsedName.slice(0, 21) + ".."; + parsedName = parsedName.slice(0, 34) + ".."; } const actions = data.actions !== null ? data.actions.length : 0; @@ -2442,7 +2477,7 @@ const Workflows2 = (props) => { } return ( -
+
{selectedCategory !== "" ? @@ -3906,59 +3941,25 @@ const Workflows2 = (props) => { // } useEffect(() => { - if (userdata !== undefined && userdata !== null && currTab !== 2) { - setIsLoadingWorkflow(true); - var filteredWorkflows = [] + if (currTab === 2) return; + if (userdata !== undefined && userdata !== null && filteredWorkflows.length > 0) { + var categoryWorkflows = [] if (currTab === 0) { - filteredWorkflows = workflows.filter(workflow => workflow?.org_id === userdata?.active_org?.id) + categoryWorkflows = filteredWorkflows.filter(workflow => workflow?.org_id === userdata?.active_org?.id) + setOrgWorkflows(categoryWorkflows) } else if (currTab === 1) { - filteredWorkflows = workflows.filter(workflow => workflow?.org_id === userdata?.active_org?.id && workflow?.owner === userdata?.id) + categoryWorkflows = filteredWorkflows.filter(workflow => workflow?.org_id === userdata?.active_org?.id && workflow?.owner === userdata?.id) + setMyWorkflows(categoryWorkflows) } - setFilteredWorkflows(filteredWorkflows) - setTimeout(() => { - setIsLoadingWorkflow(false); - }, 500); + setIsLoadingWorkflow(false); } - }, [currTab, workflows, userdata]) + }, [currTab, workflows, userdata, filteredWorkflows]) - useEffect(() => { - console.log("SearchQuery: ", searchQuery) - }, [searchQuery]) - const Hits = ({ hits }) => { - var counted = 0 - console.log("Public workflows", hits) - return ( - isLoadingPublicWorkflow ? - ( - - ) : ( - -
- {hits.map((data, index) => { - return - })} -
- ) - - ) - } - - const CustomHits = connectHits(Hits) const handleCategoryChange = (e) => { @@ -3972,7 +3973,7 @@ const Workflows2 = (props) => { borderRadius: '4px', padding: "12px 16px", cursor: 'pointer', - minWidth: '40px', + minWidth: '40px', height: 'auto', display: 'flex', alignItems: 'center', @@ -3980,6 +3981,210 @@ const Workflows2 = (props) => { } + const Hits = ({ hits, isSearchStalled, searchQuery }) => { + + return ( + isLoadingPublicWorkflow ? ( + + ) : ( +
+ {hits.map((data, index) => { + return + })} +
+ ) + ) + }; + + const SearchBox = ({ refine, searchQuery, setSearchQuery }) => { + + const inputRef = useRef(null); + const [localQuery, setLocalQuery] = useState(searchQuery); + const location = useLocation(); + + + useEffect(() => { + if (searchQuery) { + setLocalQuery(searchQuery); + refine(searchQuery); + } + }, [searchQuery, refine]); + + // Debounced function to refine search + const debouncedRefine = useRef( + debounce((value) => { + setSearchQuery(value); + removeQuery("q"); + refine(value); + }, 300) + ).current; + + useEffect(() => { + const urlSearchParams = new URLSearchParams(window.location.search); + const params = Object.fromEntries(urlSearchParams.entries()); + const foundQuery = params["q"]; + if (foundQuery) { + setLocalQuery(foundQuery); + debouncedRefine(foundQuery); + } + }, [debouncedRefine]); + + useEffect(() => { + if (searchQuery === "") { + return; + } + if (inputRef.current) { + inputRef.current.focus(); + } + }, [searchQuery]); + + const handleChange = (event) => { + const value = event.target.value; + setLocalQuery(value); + debouncedRefine(value); + }; + + return ( + { + if (event.key === "Enter") { + event.preventDefault(); + } + }} + limit={5} + variant="outlined" + placeholder="Search Workflows" + /> + ) + } + + const CustomSearchBox = connectSearchBox(SearchBox) + const CustomHits = connectHits(Hits) + + const CategoryDropdown = ({ refine, currentRefinement, items }) => { + + const handleChange = (event) => { + // Get the selected values array from the event + const selectedValues = event.target.value; + refine(selectedValues); + }; + + return ( + + ); + }; + const CustomCategoryDropdown = connectRefinementList(CategoryDropdown) + + + const WorkflowView = memo(() => { if (workflows.length === 0) { } @@ -3990,363 +4195,413 @@ const Workflows2 = (props) => { const foundPriority = userdata === undefined || userdata === null || userdata.priorities === undefined || userdata.priorities === null ? null : userdata.priorities.find(prio => prio.type === "usecase" && prio.active === true) return ( <> -
- - Workflows - + +
+ + Workflows + -
- - - - - -
- - -
- - - - // - // - // ), - onKeyDown: (e) => { - // Prevent default behavior for Enter and Backspace - if (e.key === 'Enter' || e.key === 'Backspace') { - e.preventDefault(); - e.stopPropagation(); - e.target.focus(); - } - }, - }} - clearInputOnBlur={false} - sx={{ - // Container styling - '& .MuiOutlinedInput-root': { - height: "fit-content", - borderRadius: '4px', - backgroundColor: '#212121', - '& fieldset': { - borderColor: 'rgba(255, 255, 255, 0.23)', - }, - '&:hover fieldset': { - borderColor: 'rgba(255, 255, 255, 0.4)', - }, - }, - - // Adjust chip container to center vertically - '& .MuiInputBase-root': { - display: 'flex', - flexWrap: 'wrap', - gap: '4px', - padding: '4px 8px', - alignItems: 'center', - height: "fit-content", // Match height - }, - - // Rest of the styling remains the same... - }} - value={filters} - onChange={(chips) => { - setFilters(chips); - findWorkflow(chips); - }} - //onAdd={(chip) => { - // console.log("ADd: ", chip); - // addFilter(chip); - //}} - //onDelete={(_, index) => { - // console.log("Remove: ", index); - // removeFilter(index); - //}} - /> - - - - -
-
- - navigate("/workflows/debug")} - disabled={currTab === 2} - > - - - - - - { - const newView = view === "grid" ? "list" : "grid"; - localStorage.setItem("workflowView", newView); - setView(newView); - }} - disabled={currTab === 2} - > - {view === "grid" ? : } - - - - - upload.click()} - disabled={currTab === 2} - > - {submitLoading ? : } - - - - (upload = ref)} - onChange={importFiles} - /> - - - exportAllWorkflows(workflows)} - > - - - -
- + + + +
-
-
- { - isLoadingWorkflow ? ( - +
+ + {currTab === 2 ? ( + ) : ( - view === "grid" && currTab !== 2 ? ( - <> -
+ + // + // + // ), + onKeyDown: (e) => { + // Prevent default behavior for Enter and Backspace + if (e.key === 'Enter' || e.key === 'Backspace') { + e.preventDefault(); + e.stopPropagation(); + e.target.focus(); + } + }, + }} + clearInputOnBlur={false} + sx={{ + // Container styling + '& .MuiOutlinedInput-root': { + height: "fit-content", + borderRadius: '4px', + backgroundColor: '#212121', + '& fieldset': { + borderColor: 'rgba(255, 255, 255, 0.23)', + }, + '&:hover fieldset': { + borderColor: 'rgba(255, 255, 255, 0.4)', + }, + }, + // Adjust chip container to center vertically + '& .MuiInputBase-root': { + display: 'flex', + flexWrap: 'wrap', + gap: '4px', + padding: '4px 8px', + alignItems: 'center', + height: "fit-content", // Match height + backgroundColor: "#212121", + }, + // Rest of the styling remains the same... + }} + value={filters} + onChange={(chips) => { + setFilters(chips); + const remainingCategories = chips.map(chip => { + const match = chip.match(/\d+\.\s+(\w+)/i); + return match ? match[1] : chip; + }).filter(category => { + return usecases.some(usecase => + usecase.name.toLowerCase().includes(category.toLowerCase()) + ); + }); - {filteredWorkflows.map((data, index) => { - // Shouldn't be a part of this list - if (data.public === true) { - return null - } + setSelectedCategory(remainingCategories); + findWorkflow(chips); + + }} + //onAdd={(chip) => { + // console.log("ADd: ", chip); + // addFilter(chip); + //}} + //onDelete={(_, index) => { + // console.log("Remove: ", index); + // removeFilter(index); + //}} + /> + )} - if (firstLoad) { - workflowDelay += 75 - } else { - return - } + { + currTab !== 2 && ( + ) - ) - } + } + { + currTab === 2 && ( + + ) + } - { - currTab === 2 && - ( - - - - - ) - } +
+
+ + navigate("/workflows/debug")} + disabled={currTab === 2} + > + + + + + { + const newView = view === "grid" ? "list" : "grid"; + localStorage.setItem("workflowView", newView); + setView(newView); + }} + disabled={currTab === 2} + > + {view === "grid" ? : } + + + + + upload.click()} + disabled={currTab === 2} + > + {submitLoading ? : } + + + + (upload = ref)} + onChange={importFiles} + /> + + + exportAllWorkflows(workflows)} + > + + + +
+ +
+ + +
+
+ { + (isLoadingWorkflow && currTab !== 2) ? ( + + ) : ( + view === "grid" && currTab !== 2 ? ( + <> +
+ + + + {currTab === 0 && orgWorkflows.map((data, index) => { + // Shouldn't be a part of this list + if (data.public === true) { + return null + } + + // if (firstLoad) { + // workflowDelay += 75 + // } else { + // return + // } + + return ( + + {/**/} + + {/**/} + + ) + })} + + { + currTab === 1 && myWorkflows.map((data, index) => { + if (data.public === true) { + return null + } + + // if (firstLoad) { + // workflowDelay += 75 + // } else { + // return + // } + + return ( + + {/**/} + + {/**/} + + ) + }) + } +
+ + ) : ( + currTab !== 2 && + ) + ) + } + + { + currTab === 2 && + ( + + ) + } + +
-
- + + ); @@ -4756,7 +5011,7 @@ const Workflows2 = (props) => { ); // Maybe use gridview or something, idk - return
{loadedCheck}
; + return
{loadedCheck}
; };