mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-14 08:50:31 +00:00
Added support for environment variable substitution
* Only environment variables starting with HOMEPAGE_VAR_ and HOMEPAGE_FILE_ are supported * The value of env var HOMEPAGE_VAR_XXX will replace {{HOMEPAGE_VAR_XXX}} in any config * The value of env var HOMEPAGE_FILE_XXX must be a file path, the contents of which will be used to replace {{HOMEPAGE_FILE_XXX}} in any config * If a substituted value contains a variable reference it may also be replaced, but the behavior is non-deterministic
This commit is contained in:
parent
b65f6fca19
commit
e0f1aae4d5
6 changed files with 38 additions and 13 deletions
|
@ -3,13 +3,14 @@ import { readFileSync } from "fs";
|
|||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig from "utils/config/config";
|
||||
import checkAndCopyConfig, { substituteEnvironmentVars } from "utils/config/config";
|
||||
|
||||
export default function getDockerArguments(server) {
|
||||
checkAndCopyConfig("docker.yaml");
|
||||
|
||||
const configFile = path.join(process.cwd(), "config", "docker.yaml");
|
||||
const configData = readFileSync(configFile, "utf8");
|
||||
const rawConfigData = readFileSync(configFile, "utf8");
|
||||
const configData = substituteEnvironmentVars(rawConfigData);
|
||||
const servers = yaml.load(configData);
|
||||
|
||||
if (!server) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue