From b30660cd74401b32c63874042c5351461cb949dd Mon Sep 17 00:00:00 2001 From: motomux Date: Fri, 14 Jul 2017 12:49:31 -0700 Subject: [PATCH] Enable ssl flag to connect MongoDB --- init-shell.sh | 1 + kadira-rma/start.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/init-shell.sh b/init-shell.sh index 9b30d33..6f85d50 100644 --- a/init-shell.sh +++ b/init-shell.sh @@ -3,6 +3,7 @@ export APP_MONGO_URL="mongodb://app:password@candidate.53.mongolayer.com:10478,c export APP_MONGO_OPLOG_URL="mongodb://oplog:password@candidate.53.mongolayer.com:10478,candidate.54.mongolayer.com:10216/local?authSource=tkadira-app&replicaSet=set-56175e62147ca745d8000761" export DATA_MONGO_URL="mongodb://app:password@candidate.53.mongolayer.com:10478,candidate.54.mongolayer.com:10216/tkadira-data?replicaSet=set-56175e62147ca745d8000761" export MAIL_URL="smtp://postmaster%40kadira.io:9jx4fqhdfbg5@smtp.mailgun.org:587" +export MONGO_SSL=false # Engine settings export ENGINE_PORT=11011 diff --git a/kadira-rma/start.sh b/kadira-rma/start.sh index c064622..3a75cd0 100755 --- a/kadira-rma/start.sh +++ b/kadira-rma/start.sh @@ -27,6 +27,11 @@ if [[ -z $MONGO_SHARD ]]; then exit 1 fi +SSL_FLAG="" +if [[ $MONGO_SSL == true ]]; then + SSL_FLAG="--ssl" +fi + ENV_FILE_NAME="env-$PROFILE-$PROVIDER.js" dumpEnvVarsTo() { @@ -50,9 +55,9 @@ while [[ true ]]; do dumpEnvVarsTo $ENV_FILE_NAME set -x; if [ -z ${START_TIME+x} ] || [ -z ${END_TIME+x} ]; then - mongo $(pick-mongo-primary $MONGO_METRICS_URL) profiles/$PROFILE.js providers/$PROVIDER.js $ENV_FILE_NAME lib.js mapreduce.js incremental-aggregation.js; + mongo $(pick-mongo-primary $MONGO_METRICS_URL) $SSL_FLAG profiles/$PROFILE.js providers/$PROVIDER.js $ENV_FILE_NAME lib.js mapreduce.js incremental-aggregation.js; else - mongo $(pick-mongo-primary $MONGO_METRICS_URL) profiles/$PROFILE.js providers/$PROVIDER.js $ENV_FILE_NAME lib.js mapreduce.js batch-aggregation.js; + mongo $(pick-mongo-primary $MONGO_METRICS_URL) $SSL_FLAG profiles/$PROFILE.js providers/$PROVIDER.js $ENV_FILE_NAME lib.js mapreduce.js batch-aggregation.js; fi set +x; completedAt=$(date +%s)