feat(xo-server): move plugin lookup paths to config

This commit is contained in:
Julien Fontanet 2024-01-16 15:51:45 +01:00
parent 8ff861e2be
commit cd753acff7
2 changed files with 2 additions and 1 deletions

View File

@ -155,6 +155,7 @@ level = 'info'
[logs.transport.console]
[plugins]
lookupPaths = ['./node_modules', '/usr/local/lib/node_modules']
[remoteOptions]
mountsDir = '/run/xo-server/mounts'

View File

@ -405,7 +405,7 @@ async function findPluginsInPath(path, prefix) {
async function registerPlugins(xo) {
const pluginPaths = new Map()
for (const path of [new URL('../node_modules', import.meta.url).pathname, '/usr/local/lib/node_modules']) {
for (const path of xo.config.get('plugins.lookupPaths')) {
await findPluginsInPath.call(pluginPaths, `${path}/@xen-orchestra`, 'server-')
await findPluginsInPath.call(pluginPaths, path, 'xo-server-')
}