mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28: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
|
@ -2,7 +2,7 @@ import { join } from "path";
|
|||
import { createHash } from "crypto";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
import checkAndCopyConfig from "utils/config/config";
|
||||
import checkAndCopyConfig, { CONF_DIR } from "utils/config/config";
|
||||
|
||||
const configs = ["docker.yaml", "settings.yaml", "services.yaml", "bookmarks.yaml", "widgets.yaml"];
|
||||
|
||||
|
@ -15,7 +15,7 @@ function hash(buffer) {
|
|||
export default async function handler(req, res) {
|
||||
const hashes = configs.map((config) => {
|
||||
checkAndCopyConfig(config);
|
||||
const configYaml = join(process.cwd(), "config", config);
|
||||
const configYaml = join(CONF_DIR, config);
|
||||
return hash(readFileSync(configYaml, "utf8"));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue