downgrades deb12

This commit is contained in:
CanbiZ 2025-10-23 15:26:27 +02:00
parent 05fd03d160
commit aad0ee8120
6 changed files with 74 additions and 71 deletions

View File

@ -20,19 +20,19 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
header_info
check_container_storage
check_container_resources
if [[ ! -d "/opt/inventree" ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP"
$STD apt-get update
$STD apt-get install --only-upgrade inventree -y
msg_ok "Updated $APP"
if [[ ! -d "/opt/inventree" ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP"
$STD apt update
$STD apt install --only-upgrade inventree -y
msg_ok "Updated $APP"
exit
}
start
@ -42,4 +42,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

View File

@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@ -20,18 +20,18 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/share/keyrings/mysql.gpg ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP} LXC"
$STD apt update
$STD apt -y upgrade
msg_ok "Updated Successfully"
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/share/keyrings/mysql.gpg ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP} LXC"
$STD apt update
$STD apt -y upgrade
msg_ok "Updated Successfully"
exit
}
start
@ -41,4 +41,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following IP:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}${IP}:3306${CL}"
echo -e "${TAB}${GATEWAY}${BGN}${IP}:3306${CL}"

View File

@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@ -20,18 +20,18 @@ color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP} LXC"
$STD apt update
$STD apt -y upgrade
msg_ok "Updated Successfully"
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP} LXC"
$STD apt update
$STD apt -y upgrade
msg_ok "Updated Successfully"
exit
}
start
@ -41,4 +41,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

View File

@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-2}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"

View File

@ -13,28 +13,51 @@ setting_up_container
network_check
update_os
msg_info "Detecting Distro"
DISTRO_OS=$(awk -F= '/^ID=/{print $2}' /etc/os-release)
DISTRO_VER=$(awk -F= '/^VERSION_ID=/{print $2}' /etc/os-release | tr -d '"')
case "$DISTRO_OS" in
debian)
if [[ "$DISTRO_VER" == "12" ]]; then
DISTRO_VER="11"
fi
;;
ubuntu)
if [[ "$DISTRO_VER" == "22.04" ]]; then
DISTRO_VER="20.04"
NEEDS_LIBSSL1_1=true
fi
;;
esac
msg_ok "Detected $DISTRO_OS $DISTRO_VER"
msg_info "Installing Dependencies"
temp_file=$(mktemp)
curl -fsSL "http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb" -o "$temp_file"
$STD dpkg -i $temp_file
if [[ "${NEEDS_LIBSSL1_1:-false}" == "true" ]]; then
echo "deb http://security.ubuntu.com/ubuntu focal-security main" >/etc/apt/sources.list.d/focal-security.list
$STD apt update
$STD apt install -y libssl1.1
rm -f /etc/apt/sources.list.d/focal-security.list
fi
msg_ok "Installed Dependencies"
msg_info "Setting up InvenTree Repository"
mkdir -p /etc/apt/keyrings
curl -fsSL https://dl.packager.io/srv/inventree/InvenTree/key | gpg --dearmor -o /etc/apt/keyrings/inventree.gpg
echo "deb [signed-by=/etc/apt/keyrings/inventree.gpg] https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 main" >/etc/apt/sources.list.d/inventree.list
echo "deb [signed-by=/etc/apt/keyrings/inventree.gpg] https://dl.packager.io/srv/deb/inventree/InvenTree/stable/${DISTRO_OS} ${DISTRO_VER} main" \
>/etc/apt/sources.list.d/inventree.list
$STD apt update
msg_ok "Set up InvenTree Repository"
msg_info "Setup ${APPLICATION} (Patience)"
$STD apt-get update
$STD apt-get install -y inventree
msg_ok "Setup ${APPLICATION}"
msg_info "Installing InvenTree"
$STD apt install -y inventree || msg_error "Failed to install InvenTree"
msg_ok "Installed InvenTree"
motd_ssh
customize
msg_info "Cleaning up"
rm -f $temp_file
$STD apt-get -y autoremove
$STD apt-get -y autoclean
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
msg_ok "Cleaned"

View File

@ -63,27 +63,7 @@ msg_ok "MySQL Server configured"
read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing phpMyAdmin"
$STD apt install -y \
apache2 \
php \
php-mysqli \
php-mbstring \
php-zip \
php-gd \
php-json \
php-curl
curl -fsSL "https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.tar.gz" -o "phpMyAdmin-5.2.2-all-languages.tar.gz"
mkdir -p /var/www/html/phpMyAdmin
tar xf phpMyAdmin-5.2.2-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpMyAdmin
cp /var/www/html/phpMyAdmin/config.sample.inc.php /var/www/html/phpMyAdmin/config.inc.php
SECRET=$(openssl rand -base64 24)
sed -i "s#\$cfg\['blowfish_secret'\] = '';#\$cfg['blowfish_secret'] = '${SECRET}';#" /var/www/html/phpMyAdmin/config.inc.php
chmod 660 /var/www/html/phpMyAdmin/config.inc.php
chown -R www-data:www-data /var/www/html/phpMyAdmin
systemctl restart apache2
msg_ok "Installed phpMyAdmin"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/phpmyadmin.sh)"
fi
msg_info "Start Service"