GithubHelp home page GithubHelp logo

mongotest's Introduction

Mongo Connection Testing

About

This repository is designed to test out the connection to the mongodb database in a way similar to how the form.io enterprise server connects. The full source code is available so that the connection can be tested and tweaked until the connection is successful.

Usage

First, run npm install to install all dependencies. Then, Set some environment variables the same as you would with the form.io server. You can set these by preceding the node command like this:

MONGO=mongodb://localhost:27017 node index

Then run the node index command to run the index.js file. You should see some logs about the progress of connecting to the database.

Variables

Variable Default Description
MONGO The connection string to mongodb.
MONGO_CONFIG JSON string of mongo config.
MONGO_SA A remote security certificate that can be loaded via fetch.
MONGO_SSL The file directory where SSL certs can be found.
MONGO_SSL_VALIDATE Whether to set sslValidate in mongo config.
MONGO_SSL_PASSWORD The password to the SSL cert used to encrypt it.

Troubleshooting

When attempting to run this program, if you do not see Connection successful, you can debug what is going wrong and make modifications to test out alternative configurations.

First, you can modify the MONGO_CONFIG variable to change almost any setting being sent to the mongodb drivers. The final output is logged in the output logs so you can check exactly what is being sent to mongodb. If this doesn't work, you can manually change the config in the mongodb.js file and make any modifications you want until it can connect.

Second, if you are using self signed certs, each cert loaded will list itself as being loaded after you set the MONGO_SSL variable. Make sure all of your expected certs are being loaded.

Third, if you are still unable to connect, make any tweaks to the mongodb.js file to get it to connect.

Let us know what changes were required to connect successfully.

Docker

This can also be test in docker by doing a docker build of the files. To do this, run docker build . and wait for the build to complete. Then you can run docker run -e "MONGO=mongodb://localhost:27017" {sha_from_build} to test out the docker image.

mongotest's People

Contributors

randallknutson avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.