Skip to content

Commit

Permalink
Load modules as an independent file MODULES_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
cruizba committed Nov 12, 2024
1 parent de5aa32 commit 5b47b1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export const CALL_AWS_REGION = process.env.CALL_AWS_REGION || undefined;
export const CALL_S3_WITH_PATH_STYLE_ACCESS = process.env.CALL_S3_WITH_PATH_STYLE_ACCESS || 'true';

// Deployment related configuration
export const OPENVIDU_ENVIRONMENT = process.env.OPENVIDU_ENVIRONMENT || undefined;
export const MODULES_FILE = process.env.MODULES_FILE || undefined;
export const MODULE_NAME = process.env.MODULE_NAME || 'app';
export const ENABLED_MODULES = process.env.ENABLED_MODULES || '';
4 changes: 2 additions & 2 deletions backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
SERVER_CORS_ORIGIN,
CALL_S3_PARENT_DIRECTORY,
CALL_S3_RECORDING_DIRECTORY,
OPENVIDU_ENVIRONMENT,
MODULES_FILE,
ENABLED_MODULES,
MODULE_NAME,
} from './config.js';
Expand Down Expand Up @@ -142,7 +142,7 @@ const isMainModule = (): boolean => {
};

const checkModuleIsEnabled = () => {
if (OPENVIDU_ENVIRONMENT) {
if (MODULES_FILE) {
const moduleName = MODULE_NAME;
const enabledModules = ENABLED_MODULES.split(',').map((module) => module.trim());

Expand Down
5 changes: 5 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ if [ -z "${CALL_CONFIG_DIR}" ]; then
fi
fi

if [ -n "${MODULES_FILE}" ]; then
# shellcheck disable=SC1090
. "${MODULES_FILE}"
fi

cd /opt/openvidu-call || { echo "Can't cd into /opt/openvidu-call"; exit 1; }
node dist/src/server.js &

Expand Down

0 comments on commit 5b47b1f

Please sign in to comment.