mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
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:
parent
9c0bd8b07a
commit
ca396ce96b
8 changed files with 28 additions and 24 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue