diff --git a/README.md b/README.md index 2e2602c..daaad43 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Follow the commands below starting within the `bigbluebutton/bbb-webhooks` direc - `sudo cp config/default.example.yml config/default.yml` - Update the `serverDomain` and `sharedSecret` values to match your BBB server configuration: - `sudo nano config/default.yml` + - If `BBB_URL` and `BBB_SECRET` are set in `/etc/bigbluebutton/bigbluebutton.env`, they take precedence over `serverDomain` (host of `BBB_URL`) and `sharedSecret`. 9. Start the bbb-webhooks service: - `sudo systemctl bbb-webhooks restart` diff --git a/config/default.example.yml b/config/default.example.yml index ac7a484..f04e005 100644 --- a/config/default.example.yml +++ b/config/default.example.yml @@ -14,6 +14,7 @@ prometheus: collectDefaultMetrics: false # Shared secret of your BigBlueButton server. +# BBB_URL (its host) and BBB_SECRET from /etc/bigbluebutton/bigbluebutton.env take precedence over serverDomain and sharedSecret. bbb: serverDomain: myserver.com sharedSecret: mysharedsecret diff --git a/src/modules/index.js b/src/modules/index.js index 5a57b19..f2fa9df 100644 --- a/src/modules/index.js +++ b/src/modules/index.js @@ -20,8 +20,8 @@ const REDIS_CONF = { REDIS_CONF.REDIS_URL = `redis://${REDIS_CONF.password ? `:${REDIS_CONF.password}@` : ''}${REDIS_CONF.host}:${REDIS_CONF.port}`; const BASE_CONFIGURATION = Object.freeze({ server: { - domain: config.get('bbb.serverDomain'), - secret: config.get('bbb.sharedSecret'), + domain: process.env.BBB_URL ? new URL(process.env.BBB_URL).host : config.get('bbb.serverDomain'), + secret: process.env.BBB_SECRET || config.get('bbb.sharedSecret'), auth2_0: config.get('bbb.auth2_0'), }, redis: {