From 25c72b299ef82094cdfae5165ed89d9ec97db517 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 18:35:19 +0800 Subject: [PATCH 001/121] update --- plugins/mongodb/versions/7.0/debian.sh | 2 +- plugins/mongodb/versions/7.0/opensuse.sh | 2 +- plugins/mongodb/versions/7.0/ubuntu.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index 32a41e735..fd6a99426 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl -VERSION=7.0.0 +VERSION=7.0.9 SYS_ARCH=`arch` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` SYS_NAME=${SYS_VERSION_ID/./} diff --git a/plugins/mongodb/versions/7.0/opensuse.sh b/plugins/mongodb/versions/7.0/opensuse.sh index 5f2b02f21..817833a65 100644 --- a/plugins/mongodb/versions/7.0/opensuse.sh +++ b/plugins/mongodb/versions/7.0/opensuse.sh @@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl -VERSION=7.0.0 +VERSION=7.0.9 SYS_ARCH=`arch` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}' | awk -F . '{print $1}'` diff --git a/plugins/mongodb/versions/7.0/ubuntu.sh b/plugins/mongodb/versions/7.0/ubuntu.sh index 908dfb565..cc26d7c66 100644 --- a/plugins/mongodb/versions/7.0/ubuntu.sh +++ b/plugins/mongodb/versions/7.0/ubuntu.sh @@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl -VERSION=7.0.0 +VERSION=7.0.9 SYS_ARCH=`arch` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` From e987c4d27eadc61aa470b6f8a58dfc0f1149b431 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 19:45:58 +0800 Subject: [PATCH 002/121] up --- plugins/mongodb/versions/7.0/centos.sh | 2 +- plugins/mongodb/versions/7.0/macos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mongodb/versions/7.0/centos.sh b/plugins/mongodb/versions/7.0/centos.sh index df224d9cb..e7db9272a 100644 --- a/plugins/mongodb/versions/7.0/centos.sh +++ b/plugins/mongodb/versions/7.0/centos.sh @@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl -VERSION=7.0.0 +VERSION=7.0.9 SYS_ARCH=`arch` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` diff --git a/plugins/mongodb/versions/7.0/macos.sh b/plugins/mongodb/versions/7.0/macos.sh index 632399216..0371f0895 100644 --- a/plugins/mongodb/versions/7.0/macos.sh +++ b/plugins/mongodb/versions/7.0/macos.sh @@ -9,7 +9,7 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl -VERSION=7.0.0 +VERSION=7.0.9 MG_DIR=$serverPath/source/mongodb mkdir -p $MG_DIR From 6950f0c7c9fa40062c60f180d4a2bdc9b98d22b4 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:18:04 +0800 Subject: [PATCH 003/121] Update index.py --- plugins/mongodb/index.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 893aac6f8..8bb6022e8 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -249,6 +249,21 @@ def runReplInfo(): return mw.returnJson(True, 'OK', result) +def testData: + import pymongo + from pymongo import ReadPreference + + port = getConfPort() + client = pymongo.MongoClient(host='127.0.0.1', port=int(port), directConnection=True) + db = client.test + col = db["demo"] + + rndStr = mw.getRandString() + mydict = { "name": "v1", "value": rndStr} + x = col.insert_one(mydict) + print(x) + + def test(): # https://pymongo.readthedocs.io/en/stable/examples/high_availability.html import pymongo @@ -393,5 +408,7 @@ if __name__ == "__main__": print(runLog()) elif func == 'test': print(test()) + elif func == 'test_data': + print(testData()) else: print('error') From fcef433ba386b7ae4d05ae8502ebf272e1642dc2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:20:14 +0800 Subject: [PATCH 004/121] Update index.py --- plugins/mongodb/index.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 8bb6022e8..14384f2ba 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -250,6 +250,9 @@ def runReplInfo(): return mw.returnJson(True, 'OK', result) def testData: + ''' + cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test_data + ''' import pymongo from pymongo import ReadPreference @@ -259,8 +262,8 @@ def testData: col = db["demo"] rndStr = mw.getRandString() - mydict = { "name": "v1", "value": rndStr} - x = col.insert_one(mydict) + insert_dict = { "name": "v1", "value": rndStr} + x = col.insert_one(insert_dict) print(x) From a1995772efc5e0a207d14e9cb86d2c7bfd90f705 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:20:34 +0800 Subject: [PATCH 005/121] Update index.py --- plugins/mongodb/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 14384f2ba..0a47eff12 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -249,7 +249,7 @@ def runReplInfo(): return mw.returnJson(True, 'OK', result) -def testData: +def testData(): ''' cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test_data ''' From 0b65f50b4b074fbe4d5e1e0dcfd90f9a4c64d449 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:21:35 +0800 Subject: [PATCH 006/121] Update index.py --- plugins/mongodb/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 0a47eff12..a28adb547 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -261,7 +261,7 @@ def testData(): db = client.test col = db["demo"] - rndStr = mw.getRandString() + rndStr = mw.getRandomString() insert_dict = { "name": "v1", "value": rndStr} x = col.insert_one(insert_dict) print(x) From 093bf3910b28e1af22994c63045aa606f638c050 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:22:31 +0800 Subject: [PATCH 007/121] Update index.py --- plugins/mongodb/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index a28adb547..fb7f94bfa 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -261,7 +261,7 @@ def testData(): db = client.test col = db["demo"] - rndStr = mw.getRandomString() + rndStr = mw.getRandomString(10) insert_dict = { "name": "v1", "value": rndStr} x = col.insert_one(insert_dict) print(x) From 54682ef02cf51344a5752c4b26c6d4ecb6959bf0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 21:47:53 +0800 Subject: [PATCH 008/121] Update index.py --- plugins/mongodb/index.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index fb7f94bfa..86b024f5e 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -170,6 +170,9 @@ def restart(): def runInfo(): + ''' + cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py run_info + ''' import pymongo port = getConfPort() @@ -268,6 +271,9 @@ def testData(): def test(): + ''' + cd /www/server/mdserver-web && source bin/activate && python3 /www/server/mdserver-web/plugins/mongodb/index.py test + ''' # https://pymongo.readthedocs.io/en/stable/examples/high_availability.html import pymongo from pymongo import ReadPreference @@ -276,17 +282,17 @@ def test(): client = pymongo.MongoClient(host='127.0.0.1', port=int(port), directConnection=True) db = client.admin - # config = { - # '_id': 'test', - # 'members': [ - # {'_id': 1, 'host': '127.0.0.1:27018','priority': 10 }, - # {'_id': 2, 'host': '127.0.0.1:27019','priority': 1 }, - # {'_id': 3, 'host': '127.0.0.1:27020','priority': 0 }, - # # {'_id': 2, 'host': 'localhost:27019'} - # ] - # } + config = { + '_id': 'test', + 'members': [ + # 'priority': 10 + {'_id': 0, 'host': '154.21.203.138:27014'}, + {'_id': 1, 'host': '154.12.53.216:27019'}, + ] + } - # rsStatus = client.admin.command("replSetInitiate", config) + rsStatus = client.admin.command('replSetInitiate',config) + print(rsStatus) # 需要通过命令行操作 # -> rs.initiate({ @@ -313,8 +319,8 @@ def test(): # > rs.add({"_id":3, "host":"127.0.0.1:27318","priority":0,"votes":0}); - serverStatus = db.command('serverStatus') - print(serverStatus) + # serverStatus = db.command('serverStatus') + # print(serverStatus) # return mw.returnJson(True, 'OK', result) From a262c6c0b790855f086d28ecfc5d2440cb7a4ad5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:24:59 +0800 Subject: [PATCH 009/121] update --- plugins/mongodb/install.sh | 2 +- plugins/mongodb/versions/7.0/debian.sh | 8 ++++++++ plugins/mongodb/versions/7.0/macos.sh | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/plugins/mongodb/install.sh b/plugins/mongodb/install.sh index c43af23d5..8d9cadb88 100755 --- a/plugins/mongodb/install.sh +++ b/plugins/mongodb/install.sh @@ -4,7 +4,7 @@ export PATH # https://www.mongodb.com/try/download/community -# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 5.0.4 +# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0 # cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0 # cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mongodb/index.py start diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index fd6a99426..515eed5a7 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -45,3 +45,11 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +TOOL_VERSION=2.2.5 + +if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then + wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz + echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz" +fi + diff --git a/plugins/mongodb/versions/7.0/macos.sh b/plugins/mongodb/versions/7.0/macos.sh index 0371f0895..c8618cc55 100644 --- a/plugins/mongodb/versions/7.0/macos.sh +++ b/plugins/mongodb/versions/7.0/macos.sh @@ -26,4 +26,12 @@ fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb -fi \ No newline at end of file +fi + +TOOL_VERSION=2.2.5 + +if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then + wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip + echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip" +fi + From 869788028cddcbcda7788f29ef0304d7f853310f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:32:01 +0800 Subject: [PATCH 010/121] Update debian.sh --- plugins/mongodb/versions/7.0/debian.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index 515eed5a7..870e2638c 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -47,9 +47,17 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} TOOL_VERSION=2.2.5 - +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${FILE_NAME}.tgz if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz" fi +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + From 56918a1ba230e8e381e40e6654ee1f86aa035f77 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:32:42 +0800 Subject: [PATCH 011/121] Update debian.sh --- plugins/mongodb/versions/7.0/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index 870e2638c..c93237d55 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -52,7 +52,7 @@ if [ "aarch64" == ${SYS_ARCH} ];then TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 fi TOOL_FILE_NAME_TGZ=${FILE_NAME}.tgz -if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz" fi From d1fc41682e2cb0f45361382c63d22df52607e1af Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:33:11 +0800 Subject: [PATCH 012/121] Update debian.sh --- plugins/mongodb/versions/7.0/debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index c93237d55..a01521ecf 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -53,8 +53,8 @@ if [ "aarch64" == ${SYS_ARCH} ];then fi TOOL_FILE_NAME_TGZ=${FILE_NAME}.tgz if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then - wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz - echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-linux-x64.tgz https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-linux-x64.tgz" + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" fi if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then From e2ce520041ddb6dccee986beb795ac82caa2cfaf Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:34:34 +0800 Subject: [PATCH 013/121] Update debian.sh --- plugins/mongodb/versions/7.0/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index a01521ecf..e11843450 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -51,7 +51,7 @@ TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 if [ "aarch64" == ${SYS_ARCH} ];then TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 fi -TOOL_FILE_NAME_TGZ=${FILE_NAME}.tgz +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" From a4e7be46fb6a5f03872c76b039a57a1bc8dd9a15 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:38:06 +0800 Subject: [PATCH 014/121] Update debian.sh --- plugins/mongodb/versions/7.0/debian.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index e11843450..faf7ff2eb 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -61,3 +61,6 @@ if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} fi +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + From 9605676dbe0d126bfd934bd2a8aa493cdb05ab6c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:40:15 +0800 Subject: [PATCH 015/121] update --- plugins/mongodb/versions/4.4/centos.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/4.4/debian.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/4.4/opensuse.sh | 21 ++++++++++++++++++++- plugins/mongodb/versions/4.4/rhel.sh | 21 ++++++++++++++++++++- plugins/mongodb/versions/4.4/ubuntu.sh | 21 ++++++++++++++++++++- plugins/mongodb/versions/5.0/centos.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/5.0/debian.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/5.0/opensuse.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/5.0/ubuntu.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/6.0/centos.sh | 22 +++++++++++++++++++++- plugins/mongodb/versions/6.0/debian.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/6.0/opensuse.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/6.0/ubuntu.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/7.0/centos.sh | 19 +++++++++++++++++++ plugins/mongodb/versions/7.0/debian.sh | 1 + plugins/mongodb/versions/7.0/opensuse.sh | 22 +++++++++++++++++++++- plugins/mongodb/versions/7.0/ubuntu.sh | 22 +++++++++++++++++++++- 17 files changed, 314 insertions(+), 6 deletions(-) diff --git a/plugins/mongodb/versions/4.4/centos.sh b/plugins/mongodb/versions/4.4/centos.sh index d14e129d4..3945886b3 100644 --- a/plugins/mongodb/versions/4.4/centos.sh +++ b/plugins/mongodb/versions/4.4/centos.sh @@ -67,3 +67,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/4.4/debian.sh b/plugins/mongodb/versions/4.4/debian.sh index a863b5f23..2802a2362 100644 --- a/plugins/mongodb/versions/4.4/debian.sh +++ b/plugins/mongodb/versions/4.4/debian.sh @@ -44,3 +44,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/4.4/opensuse.sh b/plugins/mongodb/versions/4.4/opensuse.sh index 56199ee12..4155f684f 100644 --- a/plugins/mongodb/versions/4.4/opensuse.sh +++ b/plugins/mongodb/versions/4.4/opensuse.sh @@ -46,4 +46,23 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/4.4/rhel.sh b/plugins/mongodb/versions/4.4/rhel.sh index bb2a59468..c28adbc8f 100644 --- a/plugins/mongodb/versions/4.4/rhel.sh +++ b/plugins/mongodb/versions/4.4/rhel.sh @@ -42,4 +42,23 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/4.4/ubuntu.sh b/plugins/mongodb/versions/4.4/ubuntu.sh index e1c986869..4aacb2a89 100644 --- a/plugins/mongodb/versions/4.4/ubuntu.sh +++ b/plugins/mongodb/versions/4.4/ubuntu.sh @@ -44,4 +44,23 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/5.0/centos.sh b/plugins/mongodb/versions/5.0/centos.sh index b8b94654b..0b6624935 100644 --- a/plugins/mongodb/versions/5.0/centos.sh +++ b/plugins/mongodb/versions/5.0/centos.sh @@ -54,3 +54,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/5.0/debian.sh b/plugins/mongodb/versions/5.0/debian.sh index 8ed4e968c..b329de64d 100644 --- a/plugins/mongodb/versions/5.0/debian.sh +++ b/plugins/mongodb/versions/5.0/debian.sh @@ -44,3 +44,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/5.0/opensuse.sh b/plugins/mongodb/versions/5.0/opensuse.sh index 130f991c9..f4fddcb2b 100644 --- a/plugins/mongodb/versions/5.0/opensuse.sh +++ b/plugins/mongodb/versions/5.0/opensuse.sh @@ -47,3 +47,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/5.0/ubuntu.sh b/plugins/mongodb/versions/5.0/ubuntu.sh index c174790f3..e6e3f45e3 100644 --- a/plugins/mongodb/versions/5.0/ubuntu.sh +++ b/plugins/mongodb/versions/5.0/ubuntu.sh @@ -46,3 +46,22 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + diff --git a/plugins/mongodb/versions/6.0/centos.sh b/plugins/mongodb/versions/6.0/centos.sh index fea79997f..d63684217 100644 --- a/plugins/mongodb/versions/6.0/centos.sh +++ b/plugins/mongodb/versions/6.0/centos.sh @@ -59,4 +59,24 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +rm -rf ${MG_DIR}/${FILE_NAME} + + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/6.0/debian.sh b/plugins/mongodb/versions/6.0/debian.sh index 0831e6111..85d4bfa66 100644 --- a/plugins/mongodb/versions/6.0/debian.sh +++ b/plugins/mongodb/versions/6.0/debian.sh @@ -45,3 +45,22 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + diff --git a/plugins/mongodb/versions/6.0/opensuse.sh b/plugins/mongodb/versions/6.0/opensuse.sh index 47c12dee8..ec4f2ae48 100644 --- a/plugins/mongodb/versions/6.0/opensuse.sh +++ b/plugins/mongodb/versions/6.0/opensuse.sh @@ -48,3 +48,22 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + diff --git a/plugins/mongodb/versions/6.0/ubuntu.sh b/plugins/mongodb/versions/6.0/ubuntu.sh index 9cf53b3e4..b16b48a9f 100644 --- a/plugins/mongodb/versions/6.0/ubuntu.sh +++ b/plugins/mongodb/versions/6.0/ubuntu.sh @@ -45,3 +45,22 @@ if [ ! -d $serverPath/mongodb/bin ];then fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} diff --git a/plugins/mongodb/versions/7.0/centos.sh b/plugins/mongodb/versions/7.0/centos.sh index e7db9272a..8218fb399 100644 --- a/plugins/mongodb/versions/7.0/centos.sh +++ b/plugins/mongodb/versions/7.0/centos.sh @@ -61,3 +61,22 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index faf7ff2eb..bf1467230 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -46,6 +46,7 @@ fi cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} +#--------------- mongosh tool install ------------------ # TOOL_VERSION=2.2.5 TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 if [ "aarch64" == ${SYS_ARCH} ];then diff --git a/plugins/mongodb/versions/7.0/opensuse.sh b/plugins/mongodb/versions/7.0/opensuse.sh index 817833a65..4febbb656 100644 --- a/plugins/mongodb/versions/7.0/opensuse.sh +++ b/plugins/mongodb/versions/7.0/opensuse.sh @@ -46,4 +46,24 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/7.0/ubuntu.sh b/plugins/mongodb/versions/7.0/ubuntu.sh index cc26d7c66..8a39101d7 100644 --- a/plugins/mongodb/versions/7.0/ubuntu.sh +++ b/plugins/mongodb/versions/7.0/ubuntu.sh @@ -44,4 +44,24 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb fi -cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} \ No newline at end of file +cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME} + + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-linux-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file From 2c6dea64ab4019bf401682b066f1a51c36c35c85 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 22:49:07 +0800 Subject: [PATCH 016/121] Update index.py --- plugins/mongodb/index.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 86b024f5e..aa92b6203 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -286,8 +286,8 @@ def test(): '_id': 'test', 'members': [ # 'priority': 10 - {'_id': 0, 'host': '154.21.203.138:27014'}, - {'_id': 1, 'host': '154.12.53.216:27019'}, + {'_id': 0, 'host': '154.21.203.138:27017'}, + {'_id': 1, 'host': '154.12.53.216:27017'}, ] } @@ -295,22 +295,22 @@ def test(): print(rsStatus) # 需要通过命令行操作 - # -> rs.initiate({ - # _id: 'test', - # members: [{ - # _id: 1, - # host: '127.0.0.1:27018', - # priority: 2 // 这个priority不设置为1,值越高,当主库故障的时候会优先被选举成主库 - # }, { - # _id: 2, - # host: '127.0.0.1:27019', - # priority: 0 //设置为0则不能成为主库 - # }, { - # _id: 3, - # host: '127.0.0.1:27020', - # priority: 1 - # }] - # }); + rs.initiate({ + _id: 'test', + members: [ + { + _id: 1, + host: '154.21.203.138:27017', + priority: 2 // 这个priority不设置为1,值越高,当主库故障的时候会优先被选举成主库 + }, + { + _id: 2, + host: '154.12.53.216:27017', + priority: 1 //设置为0则不能成为主库 + } + + ] + }); # > rs.status(); // 查询状态 # // "stateStr" : "PRIMARY", 主节点 From a0167e7cf29c8d1ce05715d5bd03bc639cb7e92f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:26:55 +0800 Subject: [PATCH 017/121] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index 4cbb9a158..07799e8fb 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -51,7 +51,7 @@ class nosqlMongodb(): # print(self.__DB_HOST,self.__DB_PORT, self.__DB_PASS) try: - self.__DB_CONN = pymongo.MongoClient(host=self.__DB_HOST, port=self.__DB_PORT, maxPoolSize=10) + self.__DB_CONN = pymongo.MongoClient(host=self.__DB_HOST, port=self.__DB_PORT, maxPoolSize=10,directConnection=True) self.__DB_CONN.admin.command('ping') return self.__DB_CONN except pymongo.errors.ConnectionFailure: From 716e39f9478aaa2fb2b04a240849f976bc249639 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:32:41 +0800 Subject: [PATCH 018/121] Update index.py --- plugins/mongodb/index.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index aa92b6203..40f8efdb8 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -295,22 +295,22 @@ def test(): print(rsStatus) # 需要通过命令行操作 - rs.initiate({ - _id: 'test', - members: [ - { - _id: 1, - host: '154.21.203.138:27017', - priority: 2 // 这个priority不设置为1,值越高,当主库故障的时候会优先被选举成主库 - }, - { - _id: 2, - host: '154.12.53.216:27017', - priority: 1 //设置为0则不能成为主库 - } - - ] - }); + # rs.initiate({ + # _id: 'test', + # members: [ + # { + # _id: 1, + # host: '154.21.203.138:27017', + # priority: 2 + # }, + # { + # _id: 2, + # host: '154.12.53.216:27017', + # priority: 1 + # } + + # ] + # }); # > rs.status(); // 查询状态 # // "stateStr" : "PRIMARY", 主节点 From 129b244ea991fa0597792a32eef161cf3d87fe46 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:36:17 +0800 Subject: [PATCH 019/121] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index 07799e8fb..b7b4fb115 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -164,7 +164,8 @@ class nosqlMongodbCtr(): where[mg_field] = re.compile(mg_value) # print(where) - result = collection_instance.find(where).skip(start_index).limit(size).sort({'_id':-1}) + # .sort({'_id':-1}) + result = collection_instance.find(where).skip(start_index).limit(size) count = collection_instance.count_documents(where) d = [] for document in result: From ccd7468ffea55aeb31e14adbbe5b1e159a56d810 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:37:41 +0800 Subject: [PATCH 020/121] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index b7b4fb115..f4d553234 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -164,8 +164,7 @@ class nosqlMongodbCtr(): where[mg_field] = re.compile(mg_value) # print(where) - # .sort({'_id':-1}) - result = collection_instance.find(where).skip(start_index).limit(size) + result = collection_instance.find(where).skip(start_index).limit(size).sort([{'_id':-1}]) count = collection_instance.count_documents(where) d = [] for document in result: From 36c96286956dc3c2f99f965b5e4a978411e01933 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:38:59 +0800 Subject: [PATCH 021/121] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index f4d553234..4d1aa221d 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -164,7 +164,8 @@ class nosqlMongodbCtr(): where[mg_field] = re.compile(mg_value) # print(where) - result = collection_instance.find(where).skip(start_index).limit(size).sort([{'_id':-1}]) + # .sort([{'_id':-1}]) + result = collection_instance.find(where).skip(start_index).limit(size) count = collection_instance.count_documents(where) d = [] for document in result: From b99a9d7d2fc95c150a8833ce9779e41711876672 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:40:01 +0800 Subject: [PATCH 022/121] Update nosql_mongodb.py --- plugins/data_query/nosql_mongodb.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/data_query/nosql_mongodb.py b/plugins/data_query/nosql_mongodb.py index 4d1aa221d..5d33ab1ff 100755 --- a/plugins/data_query/nosql_mongodb.py +++ b/plugins/data_query/nosql_mongodb.py @@ -164,8 +164,7 @@ class nosqlMongodbCtr(): where[mg_field] = re.compile(mg_value) # print(where) - # .sort([{'_id':-1}]) - result = collection_instance.find(where).skip(start_index).limit(size) + result = collection_instance.find(where).skip(start_index).limit(size).sort('_id',-1) count = collection_instance.count_documents(where) d = [] for document in result: From 78a032a18bd7cc73a31a54255cd7afbffdceb362 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 30 Apr 2024 11:15:00 +0800 Subject: [PATCH 023/121] upda --- class/core/mw.py | 5 +++++ plugins/mongodb/index.py | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/class/core/mw.py b/class/core/mw.py index 181e52c75..b54ad11dd 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -908,6 +908,11 @@ def aesDecrypt_Crypto(data, key, vi): text_decrypted = text_decrypted.decode('utf8').rstrip() # 去掉补位的右侧空格 return text_decrypted +def getDefault(data,val,def_val=''): + if val in data: + return data[val] + return def_val + def encodeImage(imgsrc, newsrc): # 图片加密 import struct diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index 40f8efdb8..2faa3efa6 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -220,7 +220,6 @@ def runDocInfo(): result["dbs"] = showDbList return mw.getJson(result) - def runReplInfo(): import pymongo @@ -242,11 +241,11 @@ def runReplInfo(): if 'secondary' in repl and not repl['secondary']: result['status'] = '主' - result['setName'] = repl['setName'] - result['primary'] = repl['primary'] - result['me'] = repl['me'] + result['setName'] = mw.getDefault(repl,'setName', '') + result['primary'] = mw.getDefault(repl,'primary', '') + result['me'] = mw.getDefault(repl,'me', '') - hosts = repl['hosts'] + hosts = mw.getDefault(repl,'hosts', '') result['hosts'] = ','.join(hosts) From 9a5cd7e834989581de5a8270870948aa4c859136 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 30 Apr 2024 14:49:37 +0800 Subject: [PATCH 024/121] Update mongodb.conf --- plugins/mongodb/config/mongodb.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mongodb/config/mongodb.conf b/plugins/mongodb/config/mongodb.conf index 1b500a7d1..2e1ecfdf6 100644 --- a/plugins/mongodb/config/mongodb.conf +++ b/plugins/mongodb/config/mongodb.conf @@ -1,3 +1,4 @@ +directoryperdb = true dbpath = {$SERVER_PATH}/mongodb/data logpath = {$SERVER_PATH}/mongodb/logs/mongodb.log logappend = true From 5c1fe49e1b3d0efb509f2137a424dd517adf0d5f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 30 Apr 2024 17:18:17 +0800 Subject: [PATCH 025/121] update --- plugins/tgbot/startup/extend/push_ad.py | 2 +- plugins/tgbot/startup/extend/push_notice_msg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tgbot/startup/extend/push_ad.py b/plugins/tgbot/startup/extend/push_ad.py index a90075841..5e0c9959e 100644 --- a/plugins/tgbot/startup/extend/push_ad.py +++ b/plugins/tgbot/startup/extend/push_ad.py @@ -43,7 +43,7 @@ def send_msg(bot, tag='ad', trigger_time=300): # https://t.me/gjgzs2022 | 22/m | @GJ_gzs # https://zhaoziyuan1.cc | web | 15/m | 2m | next,5/15 | @baleite - # 综合包网/NG接口开户 | 28/m | 3m | next,4/28 | @aabbcx888 + # 综合包网/NG接口开户 | 28/m | 6m | next,10/28 | @aabbcx888 # 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs ## 海外服务器 高防CDN 解决移动屏蔽 | 19/m | next,4/19 | @YYCDNFW keyboard = [ diff --git a/plugins/tgbot/startup/extend/push_notice_msg.py b/plugins/tgbot/startup/extend/push_notice_msg.py index 79bb78f0e..c5c922109 100644 --- a/plugins/tgbot/startup/extend/push_notice_msg.py +++ b/plugins/tgbot/startup/extend/push_notice_msg.py @@ -52,7 +52,7 @@ def send_msg(bot, tag='ad', trigger_time=300): # https://t.me/gjgzs2022 | 22/m | @GJ_gzs # https://zhaoziyuan1.cc | web | 15/m | 2m | next,5/15 | @baleite - # 综合包网/NG接口开户 | 28/m | 3m | next,4/28 | @aabbcx888 + # 综合包网/NG接口开户 | 28/m | 6m | next,10/28 | @aabbcx888 # 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs ## 海外服务器 高防CDN 解决移动屏蔽 | 19/m | next,4/19 | @YYCDNFW # 群内置顶AD| 16/m | @YYCDNFW From 2dad4189c8440f76b375121772131fa7acf675fc Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 30 Apr 2024 17:18:30 +0800 Subject: [PATCH 026/121] up --- plugins/mongodb/versions/4.4/macos.sh | 25 ++++++++++++++++++++++++- plugins/mongodb/versions/5.0/macos.sh | 25 ++++++++++++++++++++++++- plugins/mongodb/versions/7.0/macos.sh | 25 ++++++++++++++++++++++--- 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/plugins/mongodb/versions/4.4/macos.sh b/plugins/mongodb/versions/4.4/macos.sh index 38fcefb6b..65a50ef62 100644 --- a/plugins/mongodb/versions/4.4/macos.sh +++ b/plugins/mongodb/versions/4.4/macos.sh @@ -26,4 +26,27 @@ fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb -fi \ No newline at end of file +fi + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi + +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/5.0/macos.sh b/plugins/mongodb/versions/5.0/macos.sh index dc41a9517..078967d47 100644 --- a/plugins/mongodb/versions/5.0/macos.sh +++ b/plugins/mongodb/versions/5.0/macos.sh @@ -26,4 +26,27 @@ fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb -fi \ No newline at end of file +fi + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi + +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/7.0/macos.sh b/plugins/mongodb/versions/7.0/macos.sh index c8618cc55..25d7e3ec7 100644 --- a/plugins/mongodb/versions/7.0/macos.sh +++ b/plugins/mongodb/versions/7.0/macos.sh @@ -7,6 +7,7 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") +SYS_ARCH=`arch` install_tmp=${rootPath}/tmp/mw_install.pl VERSION=7.0.9 @@ -28,10 +29,28 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb fi +# https://downloads.mongodb.com/compass/mongosh-2.2.5-darwin-x64.zip +# https://downloads.mongodb.com/compass/mongosh-2.2.5-darwin-arm64.zip +#--------------- mongosh tool install ------------------ # TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi -if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then - wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip - echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip" +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" fi +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} + From 7bac4e0a6b11a26e99ad48f252baafe991bb8692 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 1 May 2024 03:13:28 +0800 Subject: [PATCH 027/121] Update setting.py --- setting.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setting.py b/setting.py index ceb10c2ac..cf91aeb78 100755 --- a/setting.py +++ b/setting.py @@ -59,6 +59,11 @@ if os.path.exists('data/ipv6.pl'): else: bind.append('0.0.0.0:%s' % mw_port) +# if os.path.exists('data/ssl.pl'): +# certfile = 'ssl/certificate.pem' +# keyfile = 'ssl/privateKey.pem' +# ciphers = 'TLSv1 TLSv1.1 TLSv1.2 TLSv1.3' +# ssl_version = 2 # 初始安装时,自动生成安全路径 if not os.path.exists('data/admin_path.pl'): From 2f005cbadd5d4f8c73ee2f63b9625847833111c1 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 1 May 2024 03:36:34 +0800 Subject: [PATCH 028/121] update --- plugins/mongodb/config/mongodb.bak.conf | 18 +++++++++++++ plugins/mongodb/config/mongodb.conf | 34 ++++++++++++------------- 2 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 plugins/mongodb/config/mongodb.bak.conf diff --git a/plugins/mongodb/config/mongodb.bak.conf b/plugins/mongodb/config/mongodb.bak.conf new file mode 100644 index 000000000..2e1ecfdf6 --- /dev/null +++ b/plugins/mongodb/config/mongodb.bak.conf @@ -0,0 +1,18 @@ +directoryperdb = true +dbpath = {$SERVER_PATH}/mongodb/data +logpath = {$SERVER_PATH}/mongodb/logs/mongodb.log +logappend = true +bind_ip = 127.0.0.1 +port = 27017 +fork = true +auth = false +#smallfiles = true + +oplogSize=100 + +# Master/slave replication is no longer supported +#master = true + +#replSet = test + +pidfilepath = {$SERVER_PATH}/mongodb/mongodb.pid diff --git a/plugins/mongodb/config/mongodb.conf b/plugins/mongodb/config/mongodb.conf index 2e1ecfdf6..b5df7a37a 100644 --- a/plugins/mongodb/config/mongodb.conf +++ b/plugins/mongodb/config/mongodb.conf @@ -1,18 +1,16 @@ -directoryperdb = true -dbpath = {$SERVER_PATH}/mongodb/data -logpath = {$SERVER_PATH}/mongodb/logs/mongodb.log -logappend = true -bind_ip = 127.0.0.1 -port = 27017 -fork = true -auth = false -#smallfiles = true - -oplogSize=100 - -# Master/slave replication is no longer supported -#master = true - -#replSet = test - -pidfilepath = {$SERVER_PATH}/mongodb/mongodb.pid +net: + bindIp: 127.0.0.1 + port: 27017 +processManagement: + fork: true + pidFilePath: {$SERVER_PATH}/mongodb/mongodb.pid +security: + authorization: disabled + javascriptEnabled: false +storage: + dbPath: {$SERVER_PATH}/mongodb/data + directoryPerDB: true +systemLog: + destination: file + logAppend: true + path: {$SERVER_PATH}/mongodb/logs/mongodb.log \ No newline at end of file From ed0afb6b8617bcd7c8496bf8754c1f9c275e75e7 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 1 May 2024 11:22:59 +0800 Subject: [PATCH 029/121] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b747f00e1..6bad5fdb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,4 +34,5 @@ whitenoise==5.3.0 pyotp pytz pyTelegramBotAPI -telebot \ No newline at end of file +telebot +pyyaml \ No newline at end of file From 99a57d29afde1d32a134628e6efe714b15691572 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 1 May 2024 17:54:17 +0800 Subject: [PATCH 030/121] Update php.js --- plugins/php/js/php.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 777c5b995..5c369d2ba 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -79,7 +79,7 @@ function phpSetConfig(version) { ibody = '' break; } - mlist += '

' + rdata[i].name + '' + ibody + ', ' + rdata[i].ps + '

' + mlist += '

' + rdata[i].name + '' + ibody + ', ' + rdata[i].ps + '

'; } var phpCon = '
\ ' + mlist + '\ From eb2c476b288dc0fba7ac6413251fd156f8323319 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 1 May 2024 20:33:36 +0800 Subject: [PATCH 031/121] update --- plugins/mongodb/config/mongodb.sql | 16 ++ plugins/mongodb/index.html | 15 +- plugins/mongodb/index.py | 230 ++++++++++++++++++++++++----- plugins/mongodb/js/mongodb.js | 59 ++++++++ 4 files changed, 283 insertions(+), 37 deletions(-) create mode 100644 plugins/mongodb/config/mongodb.sql diff --git a/plugins/mongodb/config/mongodb.sql b/plugins/mongodb/config/mongodb.sql new file mode 100644 index 000000000..2ad30f232 --- /dev/null +++ b/plugins/mongodb/config/mongodb.sql @@ -0,0 +1,16 @@ +CREATE TABLE IF NOT EXISTS `config` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `mg_root` TEXT +); + +INSERT INTO `config` (`id`, `mg_root`) VALUES (1, 'mg_root'); + +CREATE TABLE IF NOT EXISTS `users` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `username` TEXT, + `password` TEXT, + `role` TEXT DEFAULT '', + `ps` TEXT, + `addtime` TEXT +); + diff --git a/plugins/mongodb/index.html b/plugins/mongodb/index.html index 68bd81ae6..2bfac6ae7 100755 --- a/plugins/mongodb/index.html +++ b/plugins/mongodb/index.html @@ -6,7 +6,15 @@ white-space: nowrap; display: inline-block; vertical-align: middle; -} +} + +.bingfa .bt-input-text { + width: 200px; +} + +.inlineBlock { + display: inline-block; +}
@@ -14,7 +22,8 @@

服务

自启动

-

配置修改

+

配置修改

+

配置文件

负载状态

文档状态

复制状态

@@ -25,6 +34,8 @@
+ +