mirror of
https://github.com/benphelps/homepage.git
synced 2025-12-20 18:09:42 +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:
@@ -7,7 +7,7 @@ import * as shvl from "shvl";
|
||||
import { CustomObjectsApi, NetworkingV1Api } from "@kubernetes/client-node";
|
||||
|
||||
import createLogger from "utils/logger";
|
||||
import checkAndCopyConfig, { substituteEnvironmentVars } from "utils/config/config";
|
||||
import checkAndCopyConfig, { CONF_DIR, substituteEnvironmentVars } from "utils/config/config";
|
||||
import getDockerArguments from "utils/config/docker";
|
||||
import getKubeConfig from "utils/config/kubernetes";
|
||||
|
||||
@@ -17,7 +17,7 @@ const logger = createLogger("service-helpers");
|
||||
export async function servicesFromConfig() {
|
||||
checkAndCopyConfig("services.yaml");
|
||||
|
||||
const servicesYaml = path.join(process.cwd(), "config", "services.yaml");
|
||||
const servicesYaml = path.join(CONF_DIR, "services.yaml");
|
||||
const rawFileContents = await fs.readFile(servicesYaml, "utf8");
|
||||
const fileContents = substituteEnvironmentVars(rawFileContents);
|
||||
const services = yaml.load(fileContents);
|
||||
@@ -51,7 +51,7 @@ export async function servicesFromConfig() {
|
||||
export async function servicesFromDocker() {
|
||||
checkAndCopyConfig("docker.yaml");
|
||||
|
||||
const dockerYaml = path.join(process.cwd(), "config", "docker.yaml");
|
||||
const dockerYaml = path.join(CONF_DIR, "docker.yaml");
|
||||
const rawDockerFileContents = await fs.readFile(dockerYaml, "utf8");
|
||||
const dockerFileContents = substituteEnvironmentVars(rawDockerFileContents);
|
||||
const servers = yaml.load(dockerFileContents);
|
||||
|
||||
Reference in New Issue
Block a user