From b706069e20d73a19c59cfaae5818c7a57d242b42 Mon Sep 17 00:00:00 2001 From: Daniel Schreiber Date: Sat, 22 Oct 2022 11:19:39 +0200 Subject: [PATCH] Fix slides export for cluster setup In cluster proxy setup as described in https://docs.bigbluebutton.org/admin/clusterproxy.html you cannot assume that the BBB Web API URL is at the same domain as the html5 client. Therefore operators need to adjust the URL where presentation download is available. This patch adds the ability to override the config provided by the package. This is related to #14484 --- bbb-export-annotations/config/index.js | 10 ++++++++++ bbb-export-annotations/config/settings.json | 1 + bbb-export-annotations/package.json | 1 + bbb-export-annotations/workers/notifier.js | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bbb-export-annotations/config/index.js b/bbb-export-annotations/config/index.js index cf125020f9..935995a749 100644 --- a/bbb-export-annotations/config/index.js +++ b/bbb-export-annotations/config/index.js @@ -1,3 +1,13 @@ +let _ = require('lodash'); +let fs = require('fs'); const settings = require('./settings'); +const LOCAL_SETTINGS_FILE_PATH = '/etc/bigbluebutton/bbb-export-annotations.json'; + const config = settings; + +if (fs.existsSync(LOCAL_SETTINGS_FILE_PATH)) { + const local_config = JSON.parse(fs.readFileSync(LOCAL_SETTINGS_FILE_PATH)); + _.mergeWith(config, local_config, (a, b) => (_.isArray(b) ? b : undefined)); +} + module.exports = config; diff --git a/bbb-export-annotations/config/settings.json b/bbb-export-annotations/config/settings.json index baf78f7d59..77e4530fe9 100644 --- a/bbb-export-annotations/config/settings.json +++ b/bbb-export-annotations/config/settings.json @@ -28,6 +28,7 @@ "msgName": "NewPresAnnFileAvailableMsg" }, "bbbWebAPI": "http://127.0.0.1:8090", + "bbbWebPublicAPI": "/bigbluebutton/", "bbbPadsAPI": "http://127.0.0.1:9002", "redis": { "host": "127.0.0.1", diff --git a/bbb-export-annotations/package.json b/bbb-export-annotations/package.json index c1642e3914..ef16a596ca 100644 --- a/bbb-export-annotations/package.json +++ b/bbb-export-annotations/package.json @@ -9,6 +9,7 @@ "dependencies": { "axios": "^0.26.0", "form-data": "^4.0.0", + "lodash": "^4.17.21", "perfect-freehand": "^1.0.16", "probe-image-size": "^7.2.3", "redis": "^4.0.3", diff --git a/bbb-export-annotations/workers/notifier.js b/bbb-export-annotations/workers/notifier.js index 94d7f10952..b4ae6c6cd0 100644 --- a/bbb-export-annotations/workers/notifier.js +++ b/bbb-export-annotations/workers/notifier.js @@ -28,7 +28,7 @@ async function notifyMeetingActor() { await client.connect(); client.on('error', (err) => logger.info('Redis Client Error', err)); - const link = path.join(`${path.sep}bigbluebutton`, 'presentation', + const link = config.bbbWebPublicAPI + path.join('presentation', exportJob.parentMeetingId, exportJob.parentMeetingId, exportJob.presId, 'pdf', jobId, filename);