V8.13.384.2025.11.06
Some checks failed
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m37s
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Successful in 1m9s
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Failing after 1m0s
Some checks failed
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m37s
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Successful in 1m9s
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Failing after 1m0s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -33,6 +33,10 @@ guard_sourcing
|
||||
# VAR_ISO8601
|
||||
# VAR_REIONICE_CLASS
|
||||
# VAR_REIONICE_PRIORITY
|
||||
# VAR_SIGNER
|
||||
# VAR_SIGNING_KEY
|
||||
# VAR_SIGNING_KEY_FPR
|
||||
# VAR_SIGNING_KEY_PASS
|
||||
# VAR_SSHFP
|
||||
# VAR_SSHPORT
|
||||
# VAR_SSHPUBKEY
|
||||
@@ -119,7 +123,7 @@ arg_parser() {
|
||||
printf "\e[91m❌ Error: --build-directory MUST be an absolute path. Got: '%s'\n" "${VAR_HANDLER_BUILD_DIR}" >&2
|
||||
exit "${ERR_NOTABSPATH}"
|
||||
fi
|
||||
declare -gx VAR_BUILD_LOG="${VAR_HANDLER_BUILD_DIR}/${VAR_ISO8601}_build.log"
|
||||
declare -gx VAR_BUILD_LOG="${VAR_HANDLER_BUILD_DIR}/cdlb_${VAR_ISO8601}_build.log"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
@@ -294,20 +298,25 @@ arg_parser() {
|
||||
|
||||
--root-password-file)
|
||||
declare pw_file="${2}"
|
||||
|
||||
if [[ -z "${pw_file}" ]]; then
|
||||
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then boot_screen_cleaner; fi
|
||||
printf "\e[91m❌ Error: --root-password-file missing password file path argument.\e[0m\n" >&2
|
||||
# shellcheck disable=SC2162
|
||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_MISS_PWD_P}"
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! -f "${pw_file}" ]]; then
|
||||
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then boot_screen_cleaner; fi
|
||||
printf "\e[91m❌ Error: --root-password-file password file '%s' does not exist.\e[0m\n" "${pw_file}" >&2
|
||||
# shellcheck disable=SC2162
|
||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_MISS_PWD_F}"
|
||||
|
||||
fi
|
||||
|
||||
declare owner
|
||||
@@ -335,32 +344,42 @@ arg_parser() {
|
||||
fi
|
||||
|
||||
declare plaintext_pw
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
### No tracing for security reasons ----------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x
|
||||
|
||||
if ! IFS= read -r plaintext_pw < "${pw_file}"; then
|
||||
:
|
||||
fi
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
### Turn on tracing again --------------------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x
|
||||
|
||||
declare pw_length
|
||||
pw_length=${#plaintext_pw}
|
||||
if (( pw_length < 20 || pw_length > 64 )); then
|
||||
if (( pw_length < 42 || pw_length > 64 )); then
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then boot_screen_cleaner; fi
|
||||
printf "\e[91m❌ Error: --root-password-file password MUST be between 20 and 64 characters (got %d).\e[0m\n" "${pw_length}" >&2
|
||||
printf "\e[91m❌ Error: --root-password-file password MUST be between 42 and 64 characters (got %d).\e[0m\n" "${pw_length}" >&2
|
||||
# shellcheck disable=SC2162
|
||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_PASS_LENGH}"
|
||||
fi
|
||||
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
### No tracing for security reasons ----------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x
|
||||
|
||||
if [[ "${plaintext_pw}" == *\"* ]]; then
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then boot_screen_cleaner; fi
|
||||
|
||||
printf "\e[91m❌ Error: --root-password-file password MUST NOT contain double quotes (\").\e[0m\n" >&2
|
||||
# shellcheck disable=SC2162
|
||||
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR_PASS_PLICY}"
|
||||
|
||||
fi
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
### Turn on tracing again --------------------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x
|
||||
|
||||
declare salt
|
||||
set +o pipefail
|
||||
@@ -371,53 +390,81 @@ arg_parser() {
|
||||
set -o pipefail
|
||||
|
||||
declare hash_temp
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x # No tracing for security reasons
|
||||
### No tracing for security reasons ----------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set +x
|
||||
|
||||
hash_temp=$(mkpasswd --method=sha-512 --salt="${salt}" --rounds=8388608 "${plaintext_pw}")
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x # Turn on tracing again
|
||||
|
||||
### Turn on tracing again --------------------------------------------------------------------------------------------
|
||||
[[ "${VAR_EARLY_DEBUG}" == "true" ]] && set -x
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
declare -g VAR_HASHED_PWD="${hash_temp}"
|
||||
unset hash_temp plaintext_pw
|
||||
|
||||
sync
|
||||
if shred -vfzu -n 5 "${pw_file}" > /dev/null 2>&1; then
|
||||
printf "\e[92m✅ Password file '%s': shred -vfzu -n 5 >> done. \e[0m\n" "${pw_file}" > /dev/null 2>&1
|
||||
if shred -fzu -n 5 "${pw_file}" > /dev/null 2>&1; then
|
||||
printf "\e[92m✅ Password file '%s': shred -fzu -n 5 >> done. \e[0m\n" "${pw_file}" > /dev/null 2>&1
|
||||
else
|
||||
printf "\e[91m❌ Password file '%s': shred -vfzu -n 5 >> NOT successful. \e[0m\n" "${pw_file}" > /dev/null 2>&1
|
||||
printf "\e[91m❌ Password file '%s': shred -fzu -n 5 >> NOT successful. \e[0m\n" "${pw_file}" > /dev/null 2>&1
|
||||
fi
|
||||
sync
|
||||
|
||||
shift 2
|
||||
;;
|
||||
|
||||
--signing_key=*)
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SIGNER="true"
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SIGNING_KEY="${1#*=}"
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--signing_key_fpr=*)
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SIGNING_KEY_FPR="${1#*=}"
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--signing_key_pass=*)
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SIGNING_KEY_PASS="${1#*=}"
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--ssh-port)
|
||||
if [[ -n "${2-}" && "${2}" =~ ^-?[0-9]+$ && "${2}" -ge 1 && "${2}" -le 65535 ]]; then
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
declare -gi VAR_SSHPORT="${2}"
|
||||
declare -gix VAR_SSHPORT="${2}"
|
||||
shift 2
|
||||
|
||||
else
|
||||
|
||||
if ! ${VAR_HANDLER_AUTOBUILD}; then boot_screen_cleaner; fi
|
||||
printf "\e[91m❌ Error: --ssh-port MUST be an integer between '1' and '65535'.\e[0m\n" >&2
|
||||
read -p -r $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
|
||||
exit "${ERR__SSH__PORT}"
|
||||
|
||||
fi
|
||||
;;
|
||||
|
||||
--sshfp)
|
||||
# shellcheck disable=SC2034
|
||||
declare -g VAR_SSHFP="true"
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SSHFP="true"
|
||||
shift 1
|
||||
;;
|
||||
|
||||
--ssh-pubkey)
|
||||
# shellcheck disable=SC2034
|
||||
declare -g VAR_SSHPUBKEY="${2}"
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SSHPUBKEY="${2}"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
--trixie)
|
||||
# shellcheck disable=SC2034
|
||||
declare -g VAR_SUITE="trixie"
|
||||
# shellcheck disable=SC2034
|
||||
declare -gx VAR_SUITE="trixie"
|
||||
shift 1
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user