This commit is contained in:
Marc Beninca 2024-08-26 11:16:53 +02:00
parent f3c6f7a1cf
commit 6112868374
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -600,24 +600,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
SPCD_PYTHON_ALIAS="python3"
spcd_split
spcd_os_printenv "SPCD_DNS_FILE" "SPCD_PKG_CA" "SPCD_PYTHON_ALIAS"
# set ca command & root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
SPCD_CA_ROOT="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
SPCD_CA_ROOT="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
SPCD_CA_ROOT="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
SPCD_CA_ROOT="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_split
spcd_os_printenv "SPCD_CA_ROOT"
# set package manager
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALPINE}")
@ -1039,12 +1021,27 @@ spcd_ca_install_package() {
spcd_ca_write_certificates() {
spcd_step "Write certificates"
spcd_os_mkdir "${SPCD_CA_ROOT}"
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
spcd_wcc__root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
spcd_wcc__root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
spcd_wcc__root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
spcd_wcc__root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${spcd_wcc__root}"
while true; do
spcd_wcc__index=$((spcd_wcc__index + 1))
eval "spcd_wcc__text=\"\${SPCD_CA_${spcd_wcc__index}}\""
[ -n "${spcd_wcc__text}" ] || break
spcd_wcc__path="${SPCD_CA_ROOT}/${spcd_wcc__index}.crt"
spcd_wcc__path="${spcd_wcc__root}/${spcd_wcc__index}.crt"
spcd_split
spcd_os_write "${spcd_wcc__path}" "${spcd_wcc__text}"
spcd_openssl_x509 "${spcd_wcc__path}"