downgrades deb12
This commit is contained in:
parent
05fd03d160
commit
aad0ee8120
|
|
@ -29,8 +29,8 @@ function update_script() {
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating $APP"
|
msg_info "Updating $APP"
|
||||||
$STD apt-get update
|
$STD apt update
|
||||||
$STD apt-get install --only-upgrade inventree -y
|
$STD apt install --only-upgrade inventree -y
|
||||||
msg_ok "Updated $APP"
|
msg_ok "Updated $APP"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
|
||||||
var_ram="${var_ram:-1024}"
|
var_ram="${var_ram:-1024}"
|
||||||
var_disk="${var_disk:-4}"
|
var_disk="${var_disk:-4}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
|
||||||
var_ram="${var_ram:-1024}"
|
var_ram="${var_ram:-1024}"
|
||||||
var_disk="${var_disk:-4}"
|
var_disk="${var_disk:-4}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
|
||||||
var_ram="${var_ram:-512}"
|
var_ram="${var_ram:-512}"
|
||||||
var_disk="${var_disk:-2}"
|
var_disk="${var_disk:-2}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,51 @@ setting_up_container
|
||||||
network_check
|
network_check
|
||||||
update_os
|
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"
|
msg_info "Installing Dependencies"
|
||||||
temp_file=$(mktemp)
|
if [[ "${NEEDS_LIBSSL1_1:-false}" == "true" ]]; then
|
||||||
curl -fsSL "http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb" -o "$temp_file"
|
echo "deb http://security.ubuntu.com/ubuntu focal-security main" >/etc/apt/sources.list.d/focal-security.list
|
||||||
$STD dpkg -i $temp_file
|
$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_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up InvenTree Repository"
|
msg_info "Setting up InvenTree Repository"
|
||||||
mkdir -p /etc/apt/keyrings
|
mkdir -p /etc/apt/keyrings
|
||||||
curl -fsSL https://dl.packager.io/srv/inventree/InvenTree/key | gpg --dearmor -o /etc/apt/keyrings/inventree.gpg
|
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_ok "Set up InvenTree Repository"
|
||||||
|
|
||||||
msg_info "Setup ${APPLICATION} (Patience)"
|
msg_info "Installing InvenTree"
|
||||||
$STD apt-get update
|
$STD apt install -y inventree || msg_error "Failed to install InvenTree"
|
||||||
$STD apt-get install -y inventree
|
msg_ok "Installed InvenTree"
|
||||||
msg_ok "Setup ${APPLICATION}"
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -f $temp_file
|
$STD apt -y autoremove
|
||||||
$STD apt-get -y autoremove
|
$STD apt -y autoclean
|
||||||
$STD apt-get -y autoclean
|
$STD apt -y clean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
|
|
||||||
|
|
@ -63,27 +63,7 @@ msg_ok "MySQL Server configured"
|
||||||
|
|
||||||
read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt
|
read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt
|
||||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
msg_info "Installing phpMyAdmin"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/phpmyadmin.sh)"
|
||||||
$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"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Start Service"
|
msg_info "Start Service"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user