Add platform infrastructure configuration

This commit is contained in:
donghyeon-ka
2026-08-28 17:35:41 +09:00
parent fa76531e5b
commit 16c337bcc9
302 changed files with 83259 additions and 1 deletions
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
PATH='/usr/sbin:/usr/bin:/sbin:/bin'
export PATH
LC_ALL=C
export LC_ALL
umask 077
_k3slr_wrapper_initial_guard() {
local effective_uid="${1-}" shell_options="${2-}"
[[ "$effective_uid" =~ ^[0-9]+$ && "$effective_uid" != 0 ]] || return 1
[[ "$shell_options" != *x* ]]
}
if ! _k3slr_wrapper_initial_guard "${EUID:-}" "$-"; then
printf 'ERROR: lifecycle wrapper refuses root or xtrace execution\n' >&2
return 1 2>/dev/null || exit 1
fi
unset -f _k3slr_prove_header_restore 2>/dev/null || :
if [[ "${BASH_SOURCE[0]}" == */* ]]; then
K3SLR_WRAPPER_DIRECTORY="${BASH_SOURCE[0]%/*}"
else
K3SLR_WRAPPER_DIRECTORY='.'
fi
K3SLR_WRAPPER_ROOT="$(cd -- "${K3SLR_WRAPPER_DIRECTORY}/../.." && pwd -P)" || {
return 1 2>/dev/null || exit 1
}
K3SLR_WRAPPER_CONTRACT="${K3SLR_WRAPPER_ROOT}/infrastructure/security/k3s/local-recovery.env"
# shellcheck source=/dev/null
source "${K3SLR_WRAPPER_ROOT}/scripts/lib/k3s-local-recovery.sh" || {
return 1 2>/dev/null || exit 1
}
_k3slr_prepare_usage() {
printf 'Usage: bash scripts/bootstrap/prepare-k3s-local-recovery.sh [--execute]\n' >&2
}
_k3slr_prepare_main() {
local execution_mode
if ! _k3slr_parse_lifecycle_cli execution_mode "$@"; then
_k3slr_prepare_usage
return 2
fi
_k3slr_lifecycle_main prepare "$execution_mode"
}
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
_k3slr_prepare_main "$@"
fi