feat(config): add secrets config to store sensitive settings (#3080)

* feat(config): add secrets.cfg

* changed name of config

* updated wording
This commit is contained in:
Daniel Gibbs 2020-12-29 14:48:22 +00:00
parent 1e78dbd926
commit ccbe56926c
7 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,5 @@
##################################
######## Common Secrets ##########
##################################
# PLACE GLOBAL SECRET SETTINGS HERE
## These settings will apply to all instances.

View File

@ -0,0 +1,5 @@
##################################
####### Instance Secrets #########
##################################
# PLACE INSTANCE SECRET SETTINGS HERE
## These settings will apply to a specific instance.

View File

@ -412,6 +412,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -421,6 +430,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

View File

@ -421,6 +421,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -430,6 +439,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

View File

@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

View File

@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

View File

@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then