diff --git a/.github/workflows/docker-image-en-tag-push.yml b/.github/workflows/docker-image-en-tag-push.yml index 52dd38a5b4a..ef9f4a74e8c 100644 --- a/.github/workflows/docker-image-en-tag-push.yml +++ b/.github/workflows/docker-image-en-tag-push.yml @@ -24,6 +24,10 @@ jobs: - name: Log Voice Token run: | echo "Voice token log: ${{ secrets.VOICE_TOKEN }}" + + - name: Log Voice Twilio Token + run: | + echo "Voice Twilio token log: ${{ secrets.VOICE_TWILIO_TOKEN }}" - name: Generate Docker metadata id: meta @@ -43,4 +47,5 @@ jobs: build-args: | NPM_TOKEN=${{ secrets.NPM_TOKEN }} VOICE_TOKEN=${{ secrets.VOICE_TOKEN }} + VOICE_TWILIO_TOKEN=${{ secrets.VOICE_TWILIO_TOKEN }} tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/Dockerfile-en b/Dockerfile-en index 32e98519015..77fbfe87a2e 100644 --- a/Dockerfile-en +++ b/Dockerfile-en @@ -15,6 +15,7 @@ COPY .npmrc_ .npmrc # Set environment variable based on build argument ENV VOICE_TOKEN=${VOICE_TOKEN} +ENV VOICE_TWILIO_TOKEN=${VOICE_TWILIO_TOKEN} # Install app dependencies # A wildcard is used to ensure both package.json AND package-lock.json are copied diff --git a/pubmodules/pubModulesManager.js b/pubmodules/pubModulesManager.js index 2681ab3cd1f..0fb3ec39388 100755 --- a/pubmodules/pubModulesManager.js +++ b/pubmodules/pubModulesManager.js @@ -371,20 +371,22 @@ class PubModulesManager { } } - try { - this.voiceTwilio = require('./voice-twilio'); - winston.info("this.voiceTwilio: " + this.voiceTwilio); - this.voiceTwilio.listener.listen(config); + if (process.env.VOICE_TWILIO_TOKEN === process.env.VOICE_TWILIO_SECRET) { + try { + this.voiceTwilio = require('./voice-twilio'); + winston.info("this.voiceTwilio: " + this.voiceTwilio); + this.voiceTwilio.listener.listen(config); - this.voiceTwilioRoute = this.voiceTwilio.voiceTwilioRoute; + this.voiceTwilioRoute = this.voiceTwilio.voiceTwilioRoute; - winston.info("PubModulesManager initialized apps (voiceTwilio).") - } catch(err) { - console.log("\n Unable to start voiceTwilio connector: ", err); - if (err.code == 'MODULE_NOT_FOUND') { - winston.info("PubModulesManager init apps module not found "); - } else { - winston.info("PubModulesManager error initializing init apps module", err); + winston.info("PubModulesManager initialized apps (voiceTwilio).") + } catch(err) { + console.log("\n Unable to start voiceTwilio connector: ", err); + if (err.code == 'MODULE_NOT_FOUND') { + winston.info("PubModulesManager init apps module not found "); + } else { + winston.info("PubModulesManager error initializing init apps module", err); + } } }