Commit 6b70ad8f authored by Ruslan Konviser's avatar Ruslan Konviser
Browse files

fix: more for MongoDB certs

parent 304a1a7a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ ARG DB_CA_CERT
ARG DEMO
ARG HOST
ARG PORT
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY

FROM node:16-alpine3.14 AS dependencies

@@ -115,6 +117,8 @@ ENV DB_CA_CERT=${DB_CA_CERT}
ENV HOST=${HOST:-0.0.0.0}
ENV PORT=${PORT:-5500}
ENV DEMO=${DEMO:-false}
ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}

# 5500 for HTTP
# 5501 for HTTPS
+4 −0
Original line number Diff line number Diff line
@@ -128,6 +128,10 @@ spec:
                        value: 'ever_demo'
                      - name: DB_PORT
                        value: '27017'
                      - name: AWS_ACCESS_KEY_ID
                        value: '$AWS_ACCESS_KEY_ID'
                      - name: AWS_SECRET_ACCESS_KEY
                        value: '$AWS_SECRET_ACCESS_KEY'
                  ports:
                      - containerPort: 5500
                        protocol: TCP
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ jobs:
                DB_NAME: 'ever_demo'
                DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
                DB_SSL_MODE: 'true'
                AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
                AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'

            # we need this step because for now we just use :latest tag
            # note: for production we will use different strategy later
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ const entities = ServicesApp.getEntities();

const isSSL = process.env.DB_SSL_MODE && process.env.DB_SSL_MODE !== 'false';

let sslCertPath = 'ca-certificate.crt';
// let's temporary save Cert in ./tmp/logs folder because we have write access to it
let sslCertPath = `${env.LOGS_PATH}/ca-certificate.crt`;

if (isSSL) {
	const base64data = process.env.DB_CA_CERT;
+4 −1
Original line number Diff line number Diff line
@@ -125,7 +125,10 @@ export class ServicesApp {

		const isSSL = process.env.DB_SSL_MODE && process.env.DB_SSL_MODE !== 'false';

		let sslCertPath = 'ca-certificate.crt';
		// let's temporary save Cert in ./tmp/logs folder because we have write access to it
		let sslCertPath = `${env.LOGS_PATH}/ca-certificate.crt`;

		console.log(`Using temp SSL Cert Path: ${sslCertPath}`);

        if (isSSL) {
			const base64data = process.env.DB_CA_CERT;