wip/conf,https

This commit is contained in:
Marc Beninca 2024-05-04 18:16:12 +02:00
parent 61c2ab7f7f
commit 0c17f026ea
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

84
cd.sh
View file

@ -93,32 +93,6 @@ cd_set_environment_variables () {
CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_INSTALL="dnf install --assumeyes"
CD_CMD_UPDATE="dnf makecache" CD_CMD_UPDATE="dnf makecache"
CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_CMD_UPGRADE="dnf upgrade --assumeyes"
;;
"${CD_OS_ALPINE}")
CD_CMD_CLEAN="apk cache purge"
CD_CMD_INSTALL="apk add"
CD_CMD_UPDATE="apk update"
CD_CMD_UPGRADE="apk upgrade"
;;
"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}")
CD_CMD_CLEAN="apt-get clean"
CD_CMD_INSTALL="apt-get install --assume-yes"
CD_CMD_UPDATE="apt-get update"
CD_CMD_UPGRADE="apt-get upgrade --assume-yes"
;;
esac
cd_split
cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE"
# TODO
case "${CD_OS_ID}" in
"${CD_OS_ALMA}")
CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}"
[ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}"
case "${CD_OS_VERSION}" in
"8"|"9") ;;
*) cd_error_os "CD_OS_VERSION" ;;
esac
CD_PKG_PKG=""
CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_PATH="/etc/dnf/dnf.conf"
CD_PM_CONF_TEXT="\ CD_PM_CONF_TEXT="\
[main] [main]
@ -130,6 +104,48 @@ skip_if_unavailable=False
" "
CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf"
CD_PM_HTTPS_TEXT="sslverify=False" CD_PM_HTTPS_TEXT="sslverify=False"
;;
"${CD_OS_ALPINE}")
CD_CMD_CLEAN="apk cache purge"
CD_CMD_INSTALL="apk add"
CD_CMD_UPDATE="apk update"
CD_CMD_UPGRADE="apk upgrade"
CD_PM_CONF_PATH=""
CD_PM_CONF_TEXT=""
CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https"
CD_PM_HTTPS_TEXT="--no-verify"
;;
"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}")
CD_CMD_CLEAN="apt-get clean"
CD_CMD_INSTALL="apt-get install --assume-yes"
CD_CMD_UPDATE="apt-get update"
CD_CMD_UPGRADE="apt-get upgrade --assume-yes"
CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf"
CD_PM_CONF_TEXT="\
Acquire::Check-Valid-Until True;
APT::Get::Show-Versions True;
APT::Install-Recommends False;
APT::Install-Suggests False;
Dir::Etc::SourceParts \"\";
"
CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https"
CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;"
;;
esac
cd_split
cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE"
cd_split
cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH"
# TODO
case "${CD_OS_ID}" in
"${CD_OS_ALMA}")
CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}"
[ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}"
case "${CD_OS_VERSION}" in
"8"|"9") ;;
*) cd_error_os "CD_OS_VERSION" ;;
esac
CD_PKG_PKG=""
CD_PYTHON_COMMAND="python3.11" CD_PYTHON_COMMAND="python3.11"
CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGE="python3.11"
CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages"
@ -142,10 +158,6 @@ skip_if_unavailable=False
*) cd_error_os "CD_OS_VERSION" ;; *) cd_error_os "CD_OS_VERSION" ;;
esac esac
CD_PKG_PKG="" CD_PKG_PKG=""
CD_PM_CONF_PATH=""
CD_PM_CONF_TEXT=""
CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https"
CD_PM_HTTPS_TEXT="--no-verify"
CD_PYTHON_COMMAND="python3.11" CD_PYTHON_COMMAND="python3.11"
CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGE="python3"
CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages"
@ -161,16 +173,6 @@ skip_if_unavailable=False
*) cd_error_os "CD_OS_VERSION" ;; *) cd_error_os "CD_OS_VERSION" ;;
esac esac
CD_PKG_PKG="apt-utils" CD_PKG_PKG="apt-utils"
CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf"
CD_PM_CONF_TEXT="\
Acquire::Check-Valid-Until True;
APT::Get::Show-Versions True;
APT::Install-Recommends False;
APT::Install-Suggests False;
Dir::Etc::SourceParts \"\";
"
CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https"
CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;"
CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGE="python3"
CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages"
;; ;;
@ -178,8 +180,6 @@ Dir::Etc::SourceParts \"\";
cd_split cd_split
cd_echo "CD_PKG_PKG" cd_echo "CD_PKG_PKG"
cd_split cd_split
cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH"
cd_split
cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES"
# variables # variables
[ "${CD_CA_1}" ] && CD_CA=true [ "${CD_CA_1}" ] && CD_CA=true