From 5f680d72777ff37fff4679cb0f8899a285f83f33 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 23 Dec 2024 16:53:47 -0600 Subject: [PATCH] Allow env variable to point to specific plugin path for debugging --- index.js | 1 + server/managers/PluginManager.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/index.js b/index.js index 2ca70cce..585fe7f3 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,7 @@ if (isDev) { if (devEnv.AllowIframe) process.env.ALLOW_IFRAME = '1' if (devEnv.BackupPath) process.env.BACKUP_PATH = devEnv.BackupPath if (devEnv.AllowPlugins) process.env.ALLOW_PLUGINS = '1' + if (devEnv.ExternalPluginPath) process.env.EXTERNAL_PLUGIN_PATH = devEnv.ExternalPluginPath process.env.SOURCE = 'local' process.env.ROUTER_BASE_PATH = devEnv.RouterBasePath || '' } diff --git a/server/managers/PluginManager.js b/server/managers/PluginManager.js index 356b1cd8..9a070981 100644 --- a/server/managers/PluginManager.js +++ b/server/managers/PluginManager.js @@ -161,6 +161,16 @@ class PluginManager { pluginsFound.push(plugin) } } + if (process.env.EXTERNAL_PLUGIN_PATH) { + const pluginName = Path.basename(process.env.EXTERNAL_PLUGIN_PATH) + const plugin = await this.loadPlugin(pluginName, process.env.EXTERNAL_PLUGIN_PATH) + if (plugin) { + Logger.debug(`[PluginManager] Found external plugin "${plugin.manifest.name}"`) + pluginsFound.push(plugin) + } else { + Logger.error(`[PluginManager] External plugin not found or invalid`) + } + } return pluginsFound }