mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 21:59:50 +01: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:
@@ -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"));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user