botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

bp server proxy does not follows MESSAGING_ENDPOINT #1666

Open charlyR opened 2 years ago

charlyR commented 2 years ago

Describe the bug

When running the messaging-server stand alone in a differnt url the bp internal proxy always tries to redirect to localhost. file: /botpress/packages/bp/src/core/messaging/subservices/proxy.ts router: () => { return http://localhost:${process.MESSAGING_PORT} },

To Reproduce Steps to reproduce the behavior:

  1. Create a docker-compose file, with two services, bp and bp_msg.
  2. In bp service, point the env var - MESSAGING_ENDPOINT=http://bp_msg:3100
  3. docker-compose up -d

Expected behavior A clear and concise description of what you expected to happen. The proxy redirects to the messaging server URL. Replace the line with router: () => { return process.core_env.MESSAGING_ENDPOINT ? process.core_env.MESSAGING_ENDPOINT : http://localhost:${process.MESSAGING_PORT} },

Environment (please complete the following information):