Override config directory with env var.

Until this change, the config directory was assumed
to be located at '/config'. This patch retains that
default behaviour, but enables users/devs to override
that behaviour by setting the HOMEPAGE_CONFIG_DIR
variable.
This commit is contained in:
Jon Seager 2023-07-10 15:44:43 +01:00
parent 9c0bd8b07a
commit ca396ce96b
No known key found for this signature in database
8 changed files with 28 additions and 24 deletions

View file

@ -1,18 +1,17 @@
/* eslint-disable no-console */
import { join } from "path";
import { format as utilFormat } from "node:util";
import winston from "winston";
import checkAndCopyConfig, { getSettings } from "utils/config/config";
import checkAndCopyConfig, { getSettings, CONF_DIR } from "utils/config/config";
let winstonLogger;
function init() {
const configPath = join(process.cwd(), "config");
checkAndCopyConfig("settings.yaml");
const settings = getSettings();
const logpath = settings.logpath || configPath;
const logpath = settings.logpath || CONF_DIR;
function combineMessageAndSplat() {
return {