https/trust

This commit is contained in:
Marc Beninca 2024-08-27 12:20:35 +02:00
parent 1c5a852647
commit 38108fe867
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -579,41 +579,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
esac
spcd_split
spcd_os_printenv "SPCD_PM"
# set package manager variables
case "${SPCD_PM}" in
"${SPCD_PM_DNF}")
SPCD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf"
SPCD_PM_HTTPS_TEXT="\
sslverify=False
"
;;
"${SPCD_PM_APK}")
SPCD_PM_HTTPS_PATH="/etc/apk/repositories.d/https"
SPCD_PM_HTTPS_TEXT="\
--no-verify
"
;;
"${SPCD_PM_PACMAN}")
SPCD_PM_HTTPS_PATH="/etc/pacman.d/https.conf"
SPCD_PM_HTTPS_TEXT="\
SSLVerify = No
"
;;
"${SPCD_PM_APT}")
SPCD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https"
SPCD_PM_HTTPS_TEXT="\
Acquire::https::Verify-Peer False;
"
;;
"${SPCD_PM_ZYPPER}")
SPCD_PM_HTTPS_PATH=""
SPCD_PM_HTTPS_TEXT="\
"
;;
*) ;;
esac
spcd_split
spcd_os_printenv "SPCD_PM_HTTPS_PATH"
# specific
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}")
@ -968,8 +933,28 @@ Dir::Etc::SourceParts \"\";
spcd_packages_trust_https() {
spcd_step "Trust HTTPS"
if [ -n "${SPCD_CA_1}" ] || [ "${SPCD_PM}" = "${SPCD_PM_APT}" ]; then
spcd_os_mkdir "$(dirname "${SPCD_PM_HTTPS_PATH}")"
spcd_os_write "${SPCD_PM_HTTPS_PATH}" "${SPCD_PM_HTTPS_TEXT}"
spcd_pth__path="$(spcd_https_path)"
if [ -n "${spcd_pth__path}" ]; then
spcd_os_mkdir "$(dirname "${spcd_pth__path}")"
case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_pth__text="\
--no-verify
" ;;
"${SPCD_PM_APT}") spcd_pth__text="\
Acquire::https::Verify-Peer False;
" ;;
"${SPCD_PM_DNF}") spcd_pth__text="\
sslverify=False
" ;;
"${SPCD_PM_PACMAN}") spcd_pth__text="\
SSLVerify = No
" ;;
"${SPCD_PM_ZYPPER}") ;;
*) ;;
esac
[ -n "${spcd_pth__text}" ] &&
spcd_os_write "${spcd_pth__path}" "${spcd_pth__text}"
fi
fi
}