appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.74k stars 3.76k forks source link

[Feature]: Support for MongoDB tlsCertificateKeyFile for clients rts, backend server, entrypoint.sh #18409

Open sum35h opened 2 years ago

sum35h commented 2 years ago

Is there an existing issue for this?

Summary

Currently Appsmith does not support connection to custom mongoDB with the SSL since the java driver does not support the tls keys specified in the MongoDB URI. APPSMITH_MONGODB_URI="mongodb://<usr>:<pwd>@sandbox-mongo.appsmith.com/appsmith?authSource=admin&tls=true&tlsCAFile=/appsmith-stacks/rootCA.pem&tlsCertificateKeyFile=/appsmith-stacks/mongodb.pem"

logs



test-backup-restore-atlas | backend stdout | [2022-11-24 04:55:33,394]  - Connection string contains unsupported option 'tlscertificatekeyfile'.
test-backup-restore-atlas | backend stdout |
test-backup-restore-atlas | backend stdout | [2022-11-24 04:55:33,397]  - Cluster created with settings {hosts=[sandbox-mongo.appsmith.com:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
test-backup-restore-atlas | backend stdout |
test-backup-restore-atlas | backend stdout | [2022-11-24 04:55:33,402]  - Connection string contains unsupported option 'tlscertificatekeyfile'.```

Add support to specify the mongoDB client  tlscertificatekeyfile for rts, backend server and the entrypoint script
### Why should this be worked on?

To support TLS/SSL connection on custom MongoDB.

<img src="https://front.com/assets/img/favicons/favicon-32x32.png" height="16" width="16" alt="Front logo" /> [Front conversations](https://app.frontapp.com/open/top_5zkss)
sum35h commented 2 years ago

FYI, I tweaked the entrypoint.sh with the below line to get it to work. mongo_state="$(mongo --host mongodb://<usr>:<pwd>@<host>appsmith?authSource=admin --tls --tlsCAFile /appsmith-stacks/rootCA.pem --tlsCertificateKeyFile /appsmith-stacks/mongodb.pem --quiet --eval "rs.status().ok")"

santanu-tft commented 1 year ago

ok