Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
callemand committed Sep 27, 2023
1 parent 3b641ea commit 55e0f59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions server/services/node-red/lib/configureContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions server/services/node-red/lib/disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down
1 change: 1 addition & 0 deletions server/services/node-red/lib/installContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 55e0f59

Please sign in to comment.