Skip to content

Commit d0ecddf

Browse files
authored
feat(config): add secrets config to store sensitive settings (#3080)
* feat(config): add secrets.cfg * changed name of config * updated wording
1 parent 5d58dcf commit d0ecddf

File tree

7 files changed

+100
-0
lines changed

7 files changed

+100
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##################################
2+
######## Common Secrets ##########
3+
##################################
4+
# PLACE GLOBAL SECRET SETTINGS HERE
5+
## These settings will apply to all instances.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##################################
2+
####### Instance Secrets #########
3+
##################################
4+
# PLACE INSTANCE SECRET SETTINGS HERE
5+
## These settings will apply to a specific instance.

linuxgsm.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,15 @@ else
412412
# shellcheck source=/dev/null
413413
source "${configdirserver}/common.cfg"
414414
fi
415+
# Load the secrets-common.cfg config. If missing download it.
416+
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
417+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
418+
# shellcheck source=/dev/null
419+
source "${configdirserver}/secrets-common.cfg"
420+
else
421+
# shellcheck source=/dev/null
422+
source "${configdirserver}/secrets-common.cfg"
423+
fi
415424
# Load the instance.cfg config. If missing download it.
416425
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
417426
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@@ -421,6 +430,15 @@ else
421430
# shellcheck source=/dev/null
422431
source "${configdirserver}/${selfname}.cfg"
423432
fi
433+
# Load the secrets-instance.cfg config. If missing download it.
434+
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
435+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
436+
# shellcheck source=/dev/null
437+
source "${configdirserver}/secrets-${selfname}.cfg"
438+
else
439+
# shellcheck source=/dev/null
440+
source "${configdirserver}/secrets-${selfname}.cfg"
441+
fi
424442

425443
# Load the linuxgsm.sh in to tmpdir. If missing download it.
426444
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

tests/tests_fctrserver.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ else
421421
# shellcheck source=/dev/null
422422
source "${configdirserver}/common.cfg"
423423
fi
424+
# Load the secrets-common.cfg config. If missing download it.
425+
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
426+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
427+
# shellcheck source=/dev/null
428+
source "${configdirserver}/secrets-common.cfg"
429+
else
430+
# shellcheck source=/dev/null
431+
source "${configdirserver}/secrets-common.cfg"
432+
fi
424433
# Load the instance.cfg config. If missing download it.
425434
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
426435
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@@ -430,6 +439,15 @@ else
430439
# shellcheck source=/dev/null
431440
source "${configdirserver}/${selfname}.cfg"
432441
fi
442+
# Load the secrets-instance.cfg config. If missing download it.
443+
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
444+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
445+
# shellcheck source=/dev/null
446+
source "${configdirserver}/secrets-${selfname}.cfg"
447+
else
448+
# shellcheck source=/dev/null
449+
source "${configdirserver}/secrets-${selfname}.cfg"
450+
fi
433451

434452
# Load the linuxgsm.sh in to tmpdir. If missing download it.
435453
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

tests/tests_jc2server.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ else
422422
# shellcheck source=/dev/null
423423
source "${configdirserver}/common.cfg"
424424
fi
425+
# Load the secrets-common.cfg config. If missing download it.
426+
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
427+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
428+
# shellcheck source=/dev/null
429+
source "${configdirserver}/secrets-common.cfg"
430+
else
431+
# shellcheck source=/dev/null
432+
source "${configdirserver}/secrets-common.cfg"
433+
fi
425434
# Load the instance.cfg config. If missing download it.
426435
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
427436
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@@ -431,6 +440,15 @@ else
431440
# shellcheck source=/dev/null
432441
source "${configdirserver}/${selfname}.cfg"
433442
fi
443+
# Load the secrets-instance.cfg config. If missing download it.
444+
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
445+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
446+
# shellcheck source=/dev/null
447+
source "${configdirserver}/secrets-${selfname}.cfg"
448+
else
449+
# shellcheck source=/dev/null
450+
source "${configdirserver}/secrets-${selfname}.cfg"
451+
fi
434452

435453
# Load the linuxgsm.sh in to tmpdir. If missing download it.
436454
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

tests/tests_mcserver.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ else
422422
# shellcheck source=/dev/null
423423
source "${configdirserver}/common.cfg"
424424
fi
425+
# Load the secrets-common.cfg config. If missing download it.
426+
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
427+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
428+
# shellcheck source=/dev/null
429+
source "${configdirserver}/secrets-common.cfg"
430+
else
431+
# shellcheck source=/dev/null
432+
source "${configdirserver}/secrets-common.cfg"
433+
fi
425434
# Load the instance.cfg config. If missing download it.
426435
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
427436
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@@ -431,6 +440,15 @@ else
431440
# shellcheck source=/dev/null
432441
source "${configdirserver}/${selfname}.cfg"
433442
fi
443+
# Load the secrets-instance.cfg config. If missing download it.
444+
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
445+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
446+
# shellcheck source=/dev/null
447+
source "${configdirserver}/secrets-${selfname}.cfg"
448+
else
449+
# shellcheck source=/dev/null
450+
source "${configdirserver}/secrets-${selfname}.cfg"
451+
fi
434452

435453
# Load the linuxgsm.sh in to tmpdir. If missing download it.
436454
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

tests/tests_ts3server.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,15 @@ else
422422
# shellcheck source=/dev/null
423423
source "${configdirserver}/common.cfg"
424424
fi
425+
# Load the secrets-common.cfg config. If missing download it.
426+
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
427+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
428+
# shellcheck source=/dev/null
429+
source "${configdirserver}/secrets-common.cfg"
430+
else
431+
# shellcheck source=/dev/null
432+
source "${configdirserver}/secrets-common.cfg"
433+
fi
425434
# Load the instance.cfg config. If missing download it.
426435
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
427436
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@@ -431,6 +440,15 @@ else
431440
# shellcheck source=/dev/null
432441
source "${configdirserver}/${selfname}.cfg"
433442
fi
443+
# Load the secrets-instance.cfg config. If missing download it.
444+
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
445+
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
446+
# shellcheck source=/dev/null
447+
source "${configdirserver}/secrets-${selfname}.cfg"
448+
else
449+
# shellcheck source=/dev/null
450+
source "${configdirserver}/secrets-${selfname}.cfg"
451+
fi
434452

435453
# Load the linuxgsm.sh in to tmpdir. If missing download it.
436454
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

0 commit comments

Comments
 (0)