mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-10 10:32:09 +08: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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user