mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -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:
@@ -3,12 +3,12 @@ import { readFileSync } from "fs";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig, { substituteEnvironmentVars } from "utils/config/config";
|
||||
import checkAndCopyConfig, { CONF_DIR, substituteEnvironmentVars } from "utils/config/config";
|
||||
|
||||
export default function getDockerArguments(server) {
|
||||
checkAndCopyConfig("docker.yaml");
|
||||
|
||||
const configFile = path.join(process.cwd(), "config", "docker.yaml");
|
||||
const configFile = path.join(CONF_DIR, "docker.yaml");
|
||||
const rawConfigData = readFileSync(configFile, "utf8");
|
||||
const configData = substituteEnvironmentVars(rawConfigData);
|
||||
const servers = yaml.load(configData);
|
||||
@@ -37,9 +37,9 @@ export default function getDockerArguments(server) {
|
||||
}
|
||||
|
||||
if (servers[server].tls){
|
||||
res.conn.ca = readFileSync(path.join(process.cwd(), "config", servers[server].tls.caFile));
|
||||
res.conn.cert = readFileSync(path.join(process.cwd(), "config", servers[server].tls.certFile));
|
||||
res.conn.key = readFileSync(path.join(process.cwd(), "config", servers[server].tls.keyFile));
|
||||
res.conn.ca = readFileSync(path.join(CONF_DIR, servers[server].tls.caFile));
|
||||
res.conn.cert = readFileSync(path.join(CONF_DIR, servers[server].tls.certFile));
|
||||
res.conn.key = readFileSync(path.join(CONF_DIR, servers[server].tls.keyFile));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user