diff --git a/server/services/node-red/lib/configureContainer.js b/server/services/node-red/lib/configureContainer.js index 33e9ce8e87..40fef0ac82 100644 --- a/server/services/node-red/lib/configureContainer.js +++ b/server/services/node-red/lib/configureContainer.js @@ -15,10 +15,13 @@ const { DEFAULT } = require('./constants'); async function configureContainer(config) { logger.info('Node-RED: Docker container is being configured...'); - const { basePathOnHost } = await this.gladys.system.getGladysBasePath(); + const { basePathOnContainer } = await this.gladys.system.getGladysBasePath(); + + logger.info('Nodered: basePathOnContainer', basePathOnContainer); // Create configuration path (if not exists) - const configFilepath = path.join(basePathOnHost, DEFAULT.CONFIGURATION_PATH); + const configFilepath = path.join(basePathOnContainer, DEFAULT.CONFIGURATION_PATH); + logger.info('Node-RED: configFilepath', configFilepath); await fs.mkdir(path.dirname(configFilepath), { recursive: true }); try { await fs.chown(path.dirname(configFilepath), 1000, 1000); diff --git a/server/services/node-red/lib/disconnect.js b/server/services/node-red/lib/disconnect.js index c2f8ddbcf4..7d95ac0d6d 100644 --- a/server/services/node-red/lib/disconnect.js +++ b/server/services/node-red/lib/disconnect.js @@ -24,9 +24,11 @@ async function disconnect() { await this.gladys.system.stopContainer(container.id); await this.gladys.system.removeContainer(container.id); - const { basePathOnHost } = await this.gladys.system.getGladysBasePath(); + const { basePathOnContainer } = await this.gladys.system.getGladysBasePath(); - const configFilepath = path.join(basePathOnHost, DEFAULT.CONFIGURATION_PATH); + logger.info('Nodered: basePathOnContainer', basePathOnContainer); + + const configFilepath = path.join(basePathOnContainer, DEFAULT.CONFIGURATION_PATH); await fs.rm(path.dirname(configFilepath), { recursive: true }); diff --git a/server/services/node-red/lib/installContainer.js b/server/services/node-red/lib/installContainer.js index a93d46552d..7de1afb463 100644 --- a/server/services/node-red/lib/installContainer.js +++ b/server/services/node-red/lib/installContainer.js @@ -36,6 +36,7 @@ async function installContainer(config) { } const { basePathOnHost } = await this.gladys.system.getGladysBasePath(); + logger.info('Nodered: basePathOnHost', basePathOnHost); let dockerContainers = await this.gladys.system.getContainers({ all: true,