From 783b70ded9c30a84fc664eeaf8bd0cd0ee4eb66f Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 9 Jul 2026 15:17:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixes=20using=20absolute=20path?= =?UTF-8?q?=20for=20opening=20conf.yml=20in=20the=20validator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/config-validator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/config-validator.js b/services/config-validator.js index 6dabe63b..0c19a40e 100644 --- a/services/config-validator.js +++ b/services/config-validator.js @@ -4,6 +4,7 @@ */ const fs = require('fs'); // For opening + reading files +const path = require('path'); // For resolving the config file path const yaml = require('js-yaml'); // For parsing YAML const Ajv = require('ajv'); // For validating with schema @@ -101,7 +102,8 @@ const printFileReadError = (e) => { let config = {}; try { // Try to open and parse the YAML file - config = yaml.load(fs.readFileSync(`./${process.env.USER_DATA_DIR || 'user-data'}/conf.yml`, 'utf8')); + const confPath = path.resolve(__dirname, '..', process.env.USER_DATA_DIR || 'user-data', 'conf.yml'); + config = yaml.load(fs.readFileSync(confPath, 'utf8')); validate(config); } catch (e) { // Something went very wrong... setIsValidVariable(false);