Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: mongosh update (#7347)

Danny Xud0d4baf1d6ef
diff --git a/backend/resources/README.md b/backend/resources/README.md
index 89486f363c..e6075aaf20 100644
--- a/backend/resources/README.md
+++ b/backend/resources/README.md
@@ -33,8 +33,10 @@ macos13-x86_64 used for MacOS Intel processor: https://cdn.mysql.com/archives/my
We embed mongoutil to execute the MongoDB commands input by users. It only contains the mongosh executable and the depending libs.
-monogoutil-linux-x86_64 used for Linux x86_64 (MD5 39aceeced14007e62d729ff0c2db74b9): https://downloads.mongodb.com/compass/mongosh-1.6.1-linux-x64.tgz, extract bin/mongosh, bin/mongosh_crypt_v1.so.
+monogoutil-linux-arm64 used for Linux x86_64: https://downloads.mongodb.com/compass/mongosh-1.6.1-linux-arm64.tgz, extract bin/mongosh, bin/mongosh_crypt_v1.so.
-monogoutil-darwin-arm64 used for MacOS Apple Silicon development (MD5 bea4e6d46e904773e6145d929fe65146): https://downloads.mongodb.com/compass/mongosh-1.6.1-darwin-arm64.zip, extract bin/mongosh, bin/mongosh_crypt_v1.dylib.
+monogoutil-linux-x86_64 used for Linux x86_64: https://downloads.mongodb.com/compass/mongosh-1.6.1-linux-x64.tgz, extract bin/mongosh, bin/mongosh_crypt_v1.so.
-monogoutil-darwin-x86_64 used for MacOS Intel Silicon development (MD5 80bd2b3c453d3c80dc6896db3e0d9436): https://downloads.mongodb.com/compass/mongosh-1.6.1-darwin-x64.zip, extract bin/mongosh, bin/mongosh_crypt_v1.dylib.
+monogoutil-darwin-arm64 used for MacOS Apple Silicon: https://downloads.mongodb.com/compass/mongosh-1.6.1-darwin-arm64.zip, extract bin/mongosh, bin/mongosh_crypt_v1.dylib.
+
+monogoutil-darwin-x86_64 used for MacOS Intel Silicon: https://downloads.mongodb.com/compass/mongosh-1.6.1-darwin-x64.zip, extract bin/mongosh, bin/mongosh_crypt_v1.dylib.
diff --git a/backend/resources/mongoutil/build_mongoutil.sh b/backend/resources/mongoutil/build_mongoutil.sh
new file mode 100755
index 0000000000..bebe61e86a
--- /dev/null
+++ b/backend/resources/mongoutil/build_mongoutil.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+
+OUT_PREFIX="mongoutil-1.6.1"
+
+pack(){
+ if [[ ! -e $1 ]]; then
+ echo "Downloading $1..."
+ curl -o $1.tmp https://downloads.mongodb.com/compass/$1
+ mv $1.tmp $1
+ fi
+
+ path=$1
+ dir=${path%.*}
+ case $2 in
+ linux)
+ tar -xzvf $1
+ cd $dir
+ tar -cJf ../${OUT_PREFIX}-$2-$3.txz bin/mongosh bin/mongosh_crypt_v1.so
+ ;;
+ darwin)
+ unzip -o $1
+ cd $dir
+ tar -cJf ../${OUT_PREFIX}-$2-$3.txz bin/mongosh bin/mongosh_crypt_v1.dylib
+ ;;
+ esac
+ cd ..
+ rm -rf $dir
+ rm $1
+}
+
+pack mongosh-1.6.1-darwin-x64.zip darwin amd64
+pack mongosh-1.6.1-darwin-arm64.zip darwin arm64
+pack mongosh-1.6.1-linux-x64.tgz linux amd64
+pack mongosh-1.6.1-linux-arm64.tgz linux arm64
diff --git a/backend/resources/mongoutil/mongoutil.go b/backend/resources/mongoutil/mongoutil.go
index c65aeaa7aa..988c2d9cbb 100644
--- a/backend/resources/mongoutil/mongoutil.go
+++ b/backend/resources/mongoutil/mongoutil.go
@@ -24,12 +24,14 @@ func GetMongoshPath(binDir string) string {
func getTarNameAndVersion() (tarname string, version string, err error) {
var tarName string
switch {
- case runtime.GOOS == "darwin" && runtime.GOARCH == "arm64":
- tarName = "mongoutil-darwin-arm64.txz"
case runtime.GOOS == "darwin" && runtime.GOARCH == "amd64":
- tarName = "mongoutil-darwin-x86_64.txz"
+ tarName = "mongoutil-1.6.1-darwin-amd64.txz"
+ case runtime.GOOS == "darwin" && runtime.GOARCH == "arm64":
+ tarName = "mongoutil-1.6.1-darwin-arm64.txz"
case runtime.GOOS == "linux" && runtime.GOARCH == "amd64":
- tarName = "mongoutil-linux-x86_64.txz"
+ tarName = "mongoutil-1.6.1-linux-amd64.txz"
+ case runtime.GOOS == "linux" && runtime.GOARCH == "arm64":
+ tarName = "mongoutil-1.6.1-linux-arm64.txz"
default:
return "", "", errors.Errorf("unsupported platform: %s/%s", runtime.GOOS, runtime.GOARCH)
}
diff --git a/backend/resources/mongoutil/resources_darwin_amd64.go b/backend/resources/mongoutil/resources_darwin_amd64.go
index e378b6c3c1..795459e65f 100644
--- a/backend/resources/mongoutil/resources_darwin_amd64.go
+++ b/backend/resources/mongoutil/resources_darwin_amd64.go
@@ -2,5 +2,5 @@ package mongoutil
import "embed"
-//go:embed mongoutil-darwin-x86_64.txz
+//go:embed mongoutil-1.6.1-darwin-amd64.txz
var resources embed.FS
diff --git a/backend/resources/mongoutil/resources_darwin_arm64.go b/backend/resources/mongoutil/resources_darwin_arm64.go
index 8ba722418d..472831d32f 100644
--- a/backend/resources/mongoutil/resources_darwin_arm64.go
+++ b/backend/resources/mongoutil/resources_darwin_arm64.go
@@ -2,5 +2,5 @@ package mongoutil
import "embed"
-//go:embed mongoutil-darwin-arm64.txz
+//go:embed mongoutil-1.6.1-darwin-arm64.txz
var resources embed.FS
diff --git a/backend/resources/mongoutil/resources_linux_amd64.go b/backend/resources/mongoutil/resources_linux_amd64.go
index 8552ede587..6d02f4ed25 100644
--- a/backend/resources/mongoutil/resources_linux_amd64.go
+++ b/backend/resources/mongoutil/resources_linux_amd64.go
@@ -2,5 +2,5 @@ package mongoutil
import "embed"
-//go:embed mongoutil-linux-x86_64.txz
+//go:embed mongoutil-1.6.1-linux-amd64.txz
var resources embed.FS
diff --git a/backend/resources/mongoutil/resources_linux_arm64.go b/backend/resources/mongoutil/resources_linux_arm64.go
new file mode 100644
index 0000000000..fa879d281a
--- /dev/null
+++ b/backend/resources/mongoutil/resources_linux_arm64.go
@@ -0,0 +1,6 @@
+package mongoutil
+
+import "embed"
+
+//go:embed mongoutil-1.6.1-linux-arm64.txz
+var resources embed.FS
diff --git a/backend/resources/mysqlutil/build_mysqlutil.sh b/backend/resources/mysqlutil/build_mysqlutil.sh
index 2556771e71..471b743a22 100755
--- a/backend/resources/mysqlutil/build_mysqlutil.sh
+++ b/backend/resources/mysqlutil/build_mysqlutil.sh
@@ -3,7 +3,6 @@ set -e
OUT_PREFIX="mysqlutil-8.0.33"
pack(){
- echo $1
tar xvf $1
FILENAME=$(basename $1)
FILENAME_NOEXT="${FILENAME%.*.*}"