euberdeveloper / mongoback

The most powerful npm module to export and make backups of your MongoDB
https://mongoback.euber.dev
GNU General Public License v3.0
8 stars 1 forks source link

Fixed not handling additional SSL options #14

Closed www-chique closed 2 years ago

www-chique commented 2 years ago

File: source/utils/connection/index.ts Additional SSL options like sslCAFile, sslAllowInvalidCertificates, and others were not being passed to MongoScanner, resulting in MongoScanner failing to connect to the database, even though you set these options in the main config of MongoBack.

File: source/utils/exportCollections/getCommand.ts When using uri string which contains slashes and additional parameters, the export was failing due to incorrectly parsing the uri string. Example: mongodb://127.0.0.1:27017/test-db?authSource=admin&replicaSet=test-db-set&tls=true&tlsCAFile=./.cert/sslCA.txt Additionally, added double quotes around the --uri option to correctly pass the uri string if it contains symbols like & which would break the mongoexport command otherwise.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

mongoback-dev – ./

🔍 Inspect: https://vercel.com/euberdeveloper/mongoback-dev/6RpSbnkt6uF3kah979oQaydTvpDS
✅ Preview: https://mongoback-dev-git-fork-www-chique-master-euberdeveloper.vercel.app

mongoback – ./

🔍 Inspect: https://vercel.com/euberdeveloper/mongoback/8zqrENfJEyAne1Utjq4vxNTGM4LA
✅ Preview: https://mongoback-git-fork-www-chique-master-euberdeveloper.vercel.app

euberdeveloper commented 2 years ago

Very cool, I don't have much time these days, but next Thursday I'll take a look and merge it.

euberdeveloper commented 2 years ago

Maybe, could you also add a testcase? Or I can do it after reading your issue

www-chique commented 2 years ago

Hey! Thanks for your response. I have added the example tests for the code which I have modified, and tested if they pass.

euberdeveloper commented 2 years ago

On version 2.1.1 there is your pull request, everything seems working. On version 3 there is a refactor with all the dependencies updated and minor changes on errors (that are not retrocompatible)