Add Ubuntu 22.04 and 24.04 LTS support, remove Ubuntu 20.04

Co-authored-by: ShaYmez <76499782+ShaYmez@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-14 00:46:17 +00:00
parent 73cceaf444
commit 9ecafe7959
2 changed files with 89 additions and 24 deletions

View File

@ -1,11 +1,11 @@
# HBlink3 Docker Installer # HBlink3 Docker Installer
**Version 1.5.0** - Debian 11 / 12 / 13 (Trixie) Support!! **Version 1.5.0** - Debian 11 / 12 / 13 and Ubuntu 22.04 / 24.04 LTS Support!!
======= =======
This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 11, 12, and 13 (Trixie). This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 11, 12, 13 and Ubuntu 22.04, 24.04 LTS.
**Important:** This installer requires Docker Compose v2 (provided by the docker-compose-plugin package). The legacy docker-compose v1 standalone package is not supported. The installer automatically installs Docker Engine and Docker Compose v2 from the official Docker repositories. **Important:** This installer requires Docker Compose v2 (provided by the docker-compose-plugin package). The legacy docker-compose v1 standalone package is not supported. The installer automatically installs Docker Engine and Docker Compose v2 from the official Docker repositories.
**Note:** Debian 12 (Bookworm) and 13 (Trixie) support has been added with proper PEP 668 compliant Python package management using virtual environments. HBMonv2 now runs in an isolated Python virtual environment on Debian 12+. See [CHANGELOG.md](CHANGELOG.md) for version history and updates. **Note:** Debian 12 (Bookworm) and 13 (Trixie) along with Ubuntu 22.04 and 24.04 LTS are fully supported with proper PEP 668 compliant Python package management using virtual environments. HBMonv2 now runs in an isolated Python virtual environment. See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
![HBlink](img/HBLINK_logoV1.png "HBlink") ![HBlink](img/HBLINK_logoV1.png "HBlink")
@ -14,7 +14,7 @@ This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debia
Parrot is built into this install (Default disabled, see below how to enable the parrot feature! Parrot is built into this install (Default disabled, see below how to enable the parrot feature!
### Destructive Installer ### Destructive Installer
This is a destructive installer and is recommended to be built on a freshly installed machine running Debian 11, 12, or 13 (Trixie). This is a destructive installer and is recommended to be built on a freshly installed machine running Debian 11, 12, 13 or Ubuntu 22.04, 24.04 LTS.
### Docker Multi-Arch build ### Docker Multi-Arch build
Docker container pre-built for multi-arch! Docker container pre-built for multi-arch!
@ -31,7 +31,7 @@ This installer includes all the usual libs and packages including docker, apache
install this on a 'clean machine'. The script is destructive and is not designed to be used on an exisiting machine that has other software on it! YOU HAVE BEEN WARNED! install this on a 'clean machine'. The script is destructive and is not designed to be used on an exisiting machine that has other software on it! YOU HAVE BEEN WARNED!
### Prerequisite ### Prerequisite
The host system must be running Debian 11, 12, or 13 (Trixie). **Debian 10 is no longer supported** due to the requirement for Docker Compose v2. The installer has been tested on these Debian versions and works on most architectures. The system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI. The host system must be running Debian 11, 12, 13 or Ubuntu 22.04, 24.04 LTS. **Debian 10 and Ubuntu 20.04 are no longer supported** due to the requirement for Docker Compose v2 and modern Python package management. The installer has been tested on these OS versions and works on most architectures. The system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI.
**Docker Compose v2:** This installer exclusively uses Docker Compose v2 from the official Docker repositories. The docker-compose-plugin package is automatically installed, providing the `docker compose` command (note the space). A compatibility wrapper is also created to support the legacy `docker-compose` command (with hyphen) for backward compatibility with existing scripts. **Docker Compose v2:** This installer exclusively uses Docker Compose v2 from the official Docker repositories. The docker-compose-plugin package is automatically installed, providing the `docker compose` command (note the space). A compatibility wrapper is also created to support the legacy `docker-compose` command (with hyphen) for backward compatibility with existing scripts.
@ -42,7 +42,7 @@ Make sure your system is up-to-date and pull Git from the apt repo.
apt-get install -y git apt-get install -y git
``` ```
### Installation ### Installation
1. Preferably a clean Debian 11, 12, or 13 (Trixie) system. **Debian 10 is no longer supported.** Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully. 1. Preferably a clean Debian 11, 12, 13 or Ubuntu 22.04, 24.04 LTS system. **Debian 10 and Ubuntu 20.04 are no longer supported.** Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully.
```sh ```sh
apt update apt update
sudo su sudo su
@ -146,13 +146,13 @@ Within this installation includes the new HBMonv2 by Weldek SP2ONG
### Technical Details - Python Package Management ### Technical Details - Python Package Management
The installer uses modern Python package management following PEP 668 standards for all supported Debian versions: The installer uses modern Python package management following PEP 668 standards for all supported OS versions:
- HBMonv2 runs in an isolated Python virtual environment at `/opt/HBMonv2/venv` - HBMonv2 runs in an isolated Python virtual environment at `/opt/HBMonv2/venv`
- All Python dependencies are installed within this virtual environment, avoiding system-wide package conflicts - All Python dependencies are installed within this virtual environment, avoiding system-wide package conflicts
- The systemd service automatically uses the virtual environment's Python interpreter - The systemd service automatically uses the virtual environment's Python interpreter
- This approach eliminates "externally-managed-environment" errors and conflicts with system packages - This approach eliminates "externally-managed-environment" errors and conflicts with system packages
This ensures clean, maintainable installations that follow modern Python best practices across all Debian versions. This ensures clean, maintainable installations that follow modern Python best practices across all supported Debian and Ubuntu versions.
## Easy Installation And Upgrade ## Easy Installation And Upgrade
The installation can be upgraded either by the use of a future scripts or by manually backing up your configuration and re-running the install script. Also the ability and really cool feature of docker-compose is that its easy to update the container with fresh images! Run by a simple command. Make sure you are in the /etc/hblink3 dir. The installation can be upgraded either by the use of a future scripts or by manually backing up your configuration and re-running the install script. Also the ability and really cool feature of docker-compose is that its easy to update the container with fresh images! Run by a simple command. Make sure you are in the /etc/hblink3 dir.

View File

@ -22,9 +22,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
################################################################################## ##################################################################################
# #
# A tool to install HBlink3 Docker with Debian 11, 12, and 13 support. # A tool to install HBlink3 Docker with Debian 11, 12, 13 and Ubuntu 22.04, 24.04 LTS support.
# This essentially is a HBlink3 server fully installed with dashboard ready to go. # This essentially is a HBlink3 server fully installed with dashboard ready to go.
# Step 1: Install Debian 11, 12, or 13 (Trixie) and make sure it has internet and is up to date. # Step 1: Install Debian 11, 12, 13 or Ubuntu 22.04, 24.04 LTS and make sure it has internet and is up to date.
# Step 2: Run this script on the computer. # Step 2: Run this script on the computer.
# Step 3: Reboot after installation. # Step 3: Reboot after installation.
# This is a docker version and you can use the following commands to control / maintain your server # This is a docker version and you can use the following commands to control / maintain your server
@ -42,17 +42,52 @@ then
echo "You Must be root to run this script!!" echo "You Must be root to run this script!!"
exit 1 exit 1
fi fi
if [ ! -e "/etc/debian_version" ]
then # Detect OS type and version
echo "" if [ -f /etc/os-release ]; then
echo "This script is only tested in Debian 11, 12 & 13 (Trixie)." . /etc/os-release
exit 0 OS=$ID
OS_VERSION=$VERSION_ID
else
echo "ERROR: Cannot detect operating system"
exit 1
fi fi
# Check for supported OS
if [ "$OS" != "debian" ] && [ "$OS" != "ubuntu" ]; then
echo ""
echo "ERROR: This script only supports Debian and Ubuntu distributions"
echo "Detected OS: $OS"
exit 1
fi
# Validate Ubuntu versions
if [ "$OS" = "ubuntu" ]; then
if [ "$OS_VERSION" != "22.04" ] && [ "$OS_VERSION" != "24.04" ]; then
echo ""
echo "ERROR: Only Ubuntu 22.04 LTS and 24.04 LTS are supported"
echo "Detected Ubuntu version: $OS_VERSION"
exit 1
fi
echo "Detected: Ubuntu $OS_VERSION LTS"
fi
# Validate Debian versions
if [ "$OS" = "debian" ]; then
VERSION=$(sed 's/\..*//' /etc/debian_version)
if [ "$VERSION" != "11" ] && [ "$VERSION" != "12" ] && [ "$VERSION" != "13" ]; then
echo ""
echo "ERROR: Only Debian 11, 12, and 13 are supported"
echo "Detected Debian version: $VERSION"
exit 1
fi
echo "Detected: Debian $VERSION"
fi
DIRDIR=$(pwd) DIRDIR=$(pwd)
LOCAL_IP=$(ip a | grep inet | grep "eth0\|en" | awk '{print $2}' | tr '/' ' ' | awk '{print $1}') LOCAL_IP=$(ip a | grep inet | grep "eth0\|en" | awk '{print $2}' | tr '/' ' ' | awk '{print $1}')
EXTERNAL_IP=$(curl -s --connect-timeout 5 https://ipecho.net/plain 2>/dev/null || echo "Unable to detect") EXTERNAL_IP=$(curl -s --connect-timeout 5 https://ipecho.net/plain 2>/dev/null || echo "Unable to detect")
ARC=$(lscpu | grep Arch | awk '{print $2}') ARC=$(lscpu | grep Arch | awk '{print $2}')
VERSION=$(sed 's/\..*//' /etc/debian_version)
INSDIR=/opt/tmp/ INSDIR=/opt/tmp/
HBLINKTMP=/opt/tmp/hblink3 HBLINKTMP=/opt/tmp/hblink3
HBMONDIR=/opt/HBMonv2/ HBMONDIR=/opt/HBMonv2/
@ -66,8 +101,7 @@ echo "Downloading and installing required software & dependencies....."
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
install_docker_and_dependencies() { install_docker_and_dependencies() {
local version=$1 echo "Installing Docker and dependencies..."
echo "Detected Debian version: $version"
# Install base dependencies (python3-venv is included for all versions for consistency) # Install base dependencies (python3-venv is included for all versions for consistency)
echo "Installing dependencies..." echo "Installing dependencies..."
@ -79,9 +113,18 @@ install_docker_and_dependencies() {
echo "Removing old Docker versions if present..." echo "Removing old Docker versions if present..."
apt-get remove docker docker-engine docker.io containerd runc docker-compose 2>/dev/null || true apt-get remove docker docker-engine docker.io containerd runc docker-compose 2>/dev/null || true
# Determine Docker repository URL based on OS
if [ "$OS" = "ubuntu" ]; then
DOCKER_REPO_URL="https://download.docker.com/linux/ubuntu"
echo "Configuring Docker repository for Ubuntu..."
else
DOCKER_REPO_URL="https://download.docker.com/linux/debian"
echo "Configuring Docker repository for Debian..."
fi
# Add Docker GPG key # Add Docker GPG key
echo "Adding Docker GPG key..." echo "Adding Docker GPG key..."
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg curl -fsSL ${DOCKER_REPO_URL}/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
if [ ! -f /usr/share/keyrings/docker-archive-keyring.gpg ]; then if [ ! -f /usr/share/keyrings/docker-archive-keyring.gpg ]; then
echo "ERROR: Failed to download Docker GPG key" echo "ERROR: Failed to download Docker GPG key"
@ -91,7 +134,7 @@ install_docker_and_dependencies() {
# Add Docker repository # Add Docker repository
echo "Adding Docker repository..." echo "Adding Docker repository..."
echo \ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] ${DOCKER_REPO_URL} \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine from official Docker repositories # Install Docker Engine from official Docker repositories
@ -168,10 +211,12 @@ EOF
sleep 2 sleep 2
} }
if [ $VERSION = 11 ] || [ $VERSION = 12 ] || [ $VERSION = 13 ]; then # Run Docker installation for supported OS versions
if [ "$OS" = "debian" ]; then
if [ "$VERSION" = "11" ] || [ "$VERSION" = "12" ] || [ "$VERSION" = "13" ]; then
echo "Installing for Debian $VERSION with Docker Compose v2..." echo "Installing for Debian $VERSION with Docker Compose v2..."
install_docker_and_dependencies $VERSION install_docker_and_dependencies
elif [ $VERSION = 10 ]; then elif [ "$VERSION" = "10" ]; then
echo "ERROR: Debian 10 is no longer supported by this installer" echo "ERROR: Debian 10 is no longer supported by this installer"
echo "This installer now requires Debian 11, 12, or 13 for Docker Compose v2 support" echo "This installer now requires Debian 11, 12, or 13 for Docker Compose v2 support"
echo "Please upgrade your system to Debian 11 or later" echo "Please upgrade your system to Debian 11 or later"
@ -182,6 +227,22 @@ EOF
echo "-------------------------------------------------------------------------------------------" echo "-------------------------------------------------------------------------------------------"
exit 0 exit 0
fi fi
elif [ "$OS" = "ubuntu" ]; then
if [ "$OS_VERSION" = "22.04" ] || [ "$OS_VERSION" = "24.04" ]; then
echo "Installing for Ubuntu $OS_VERSION LTS with Docker Compose v2..."
install_docker_and_dependencies
else
echo "-------------------------------------------------------------------------------------------"
echo "Operating system not supported! Please check you are running Ubuntu 22.04 or 24.04 LTS. Exiting....."
echo "-------------------------------------------------------------------------------------------"
exit 0
fi
else
echo "-------------------------------------------------------------------------------------------"
echo "Operating system not supported! Exiting....."
echo "-------------------------------------------------------------------------------------------"
exit 0
fi
echo "Done." echo "Done."
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
echo "Installing control scripts /usr/local/sbin....." echo "Installing control scripts /usr/local/sbin....."
@ -920,7 +981,11 @@ echo " https://github.com/ShaYmez/hblink3-docker-install "
echo "" echo ""
echo " Your IP address is $LOCAL_IP " echo " Your IP address is $LOCAL_IP "
echo "" echo ""
if [ "$OS" = "ubuntu" ]; then
echo " You're running on $ARC with Ubuntu $OS_VERSION LTS "
else
echo " You're running on $ARC with Debian $VERSION " echo " You're running on $ARC with Debian $VERSION "
fi
echo "" echo ""
echo "------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------"
echo " Installed Versions " echo " Installed Versions "