Skip to content

Commit

Permalink
Merge pull request #197 from razee-io/mongo_cert_update
Browse files Browse the repository at this point in the history
don't use env variable for mongo_cert
  • Loading branch information
dalehille committed Mar 4, 2020
2 parents 54e66ae + 287fffe commit 3ecc6e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const conf = {
mongo: {
url: process.env.MONGO_URL || 'mongodb://localhost:3001/meteor',
dbName: process.env.MONGO_DB_NAME || 'meteor',
cert: process.env.MONGO_CERT
cert: '/var/run/secrets/razeeio/razeedash-secret/mongo_cert'
},
s3: {
endpoint: process.env.S3_ENDPOINT,
Expand Down
3 changes: 2 additions & 1 deletion app/mongo/mongoClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const clone = require('clone');
const MongoDBClient = require('mongodb').MongoClient;
const pLimit = require('p-limit');
const objectPath = require('object-path');
const fs = require('fs');

module.exports = class MongoClient {
constructor(options) {
Expand Down Expand Up @@ -124,7 +125,7 @@ module.exports = class MongoClient {
async _clientConnect(){
if (!this._client) {
const options = {useNewUrlParser: true};
if(this._mongo.cert) {
if(fs.existsSync(this._mongo.cert)) {
options['tlsCAFile'] = this._mongo.cert;
this.log.info(`Using tlsCAFile: ${this._mongo.cert}`);
}
Expand Down
4 changes: 0 additions & 4 deletions kubernetes/razeedash-api/resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ items:
secretKeyRef:
name: razeedash-secret
key: mongo_url
- name: MONGO_CERT
value: /var/run/secrets/razeeio/razeedash-secret/mongo_cert
image: "quay.io/razee/razeedash-api:{{TRAVIS_TAG}}"
command: ["npm", "run", "wait-mongo"]
imagePullPolicy: Always
Expand Down Expand Up @@ -90,8 +88,6 @@ items:
secretKeyRef:
name: razeedash-secret
key: mongo_url
- name: MONGO_CERT
value: /var/run/secrets/razeeio/razeedash-secret/mongo_cert
- name: MONGO_DB_NAME
value: razeedash
- name: ORG_ADMIN_KEY
Expand Down

0 comments on commit 3ecc6e1

Please sign in to comment.