mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 22:28:48 +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
|
@ -4,7 +4,7 @@ import path from "path";
|
|||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig, { getSettings, substituteEnvironmentVars } from "utils/config/config";
|
||||
import checkAndCopyConfig, { getSettings, substituteEnvironmentVars, CONF_DIR } from "utils/config/config";
|
||||
import {
|
||||
servicesFromConfig,
|
||||
servicesFromDocker,
|
||||
|
@ -27,7 +27,7 @@ function compareServices(service1, service2) {
|
|||
export async function bookmarksResponse() {
|
||||
checkAndCopyConfig("bookmarks.yaml");
|
||||
|
||||
const bookmarksYaml = path.join(process.cwd(), "config", "bookmarks.yaml");
|
||||
const bookmarksYaml = path.join(CONF_DIR, "bookmarks.yaml");
|
||||
const rawFileContents = await fs.readFile(bookmarksYaml, "utf8");
|
||||
const fileContents = substituteEnvironmentVars(rawFileContents);
|
||||
const bookmarks = yaml.load(fileContents);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue