diff --git a/config/env.development b/config/env.development index 0d39b0c638..1db6b176dd 100644 --- a/config/env.development +++ b/config/env.development @@ -96,6 +96,7 @@ USERS_PORT=6666 USERS_URL=http://localhost/v1/user FIRESTORE_EMULATOR_HOST=localhost:8088 + ################################################################################ # Posts Service ################################################################################ diff --git a/config/env.staging b/config/env.staging index c6f8aa8459..075e0a2fad 100644 --- a/config/env.staging +++ b/config/env.staging @@ -137,6 +137,7 @@ USERS_PORT=6666 # Users Service URL USERS_URL=https://dev.api.telescope.cdot.systems/v1/users + ################################################################################ # Feed Discovery Service ################################################################################ diff --git a/docker/production.yml b/docker/production.yml index 6c82320fb3..e3ec9f035e 100644 --- a/docker/production.yml +++ b/docker/production.yml @@ -139,6 +139,16 @@ services: environment: - NODE_ENV=production - USERS_PORT + - FIREBASE_TYPE + - FIREBASE_PROJECT_ID + - FIREBASE_PRIVATE_KEY_ID + - FIREBASE_PRIVATE_KEY + - FIREBASE_CLIENT_EMAIL + - FIREBASE_CLIENT_ID + - FIREBASE_AUTH_URI + - FIREBASE_TOKEN_URI + - FIREBASE_AUTH_PROVIDER_X509_CERT_URL + - FIREBASE_CLIENT_X509_CERT_URL # TODO # - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 # - ELASTIC_APM_SERVICE_NAME=user diff --git a/src/api/users/src/services/firestore.js b/src/api/users/src/services/firestore.js index 37653ed4d9..93c94bdefa 100644 --- a/src/api/users/src/services/firestore.js +++ b/src/api/users/src/services/firestore.js @@ -33,7 +33,7 @@ if ( type: FIREBASE_TYPE, project_id: FIREBASE_PROJECT_ID, private_key_id: FIREBASE_PRIVATE_KEY_ID, - private_key: FIREBASE_PRIVATE_KEY, + private_key: FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'), // escape the newline characters so docker can properly parse the key client_email: FIREBASE_CLIENT_EMAIL, client_id: FIREBASE_CLIENT_ID, auth_uri: FIREBASE_AUTH_URI, @@ -42,13 +42,14 @@ if ( client_x509_cert_url: FIREBASE_CLIENT_X509_CERT_URL, }), }); - logger.debug('Server running in online mode'); + logger.info('Server running in online mode'); } else { + process.env.FIRESTORE_EMULATOR_HOST = 'localhost:8088'; admin.initializeApp({ projectId: 'telescope', credential: admin.credential.applicationDefault(), }); - logger.debug('Server running in emulator mode'); + logger.info('Server running in emulator mode'); } module.exports = admin.firestore();