ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Support Rocky/RHEL + fix Docker install on Fedora
Juan Denised68cdccb5d2
diff --git a/install.sh b/install.shindex a85151c2..a9c11186 100644--- a/install.sh+++ b/install.sh@@ -108,8 +108,11 @@ if [ -f /etc/os-release ]; thenOS_FAMILY="debian"elif [ "$ID" = "fedora" ]; thenOS_FAMILY="fedora"+ elif [ "$ID" = "rocky" ] || [ "$ID" = "almalinux" ] || [ "$ID" = "rhel" ] || [ "$ID" = "centos" ]; then+ # Rocky / Alma / RHEL / CentOS share dnf + the docker-ce rhel repo.+ OS_FAMILY="rhel"else- print_warning "Unsupported OS ($ID). This script is designed for Ubuntu/Debian/Fedora."+ print_warning "Unsupported OS ($ID). This script is designed for Ubuntu/Debian/Fedora/Rocky."fielseprint_warning "Cannot detect OS. Proceeding with caution."@@ -183,7 +186,12 @@ if [ "$OS_FAMILY" = "debian" ] || [ "$OS_FAMILY" = "unknown" ]; thenprint_success "Python 3.12 installed"fi-elif [ "$OS_FAMILY" = "fedora" ]; then+elif [ "$OS_FAMILY" = "fedora" ] || [ "$OS_FAMILY" = "rhel" ]; then+ # Rocky/Alma/RHEL need EPEL for some packages (python3.12 on RHEL 9, etc.)+ if [ "$OS_FAMILY" = "rhel" ] && ! rpm -q epel-release >/dev/null 2>&1; then+ dnf install -y epel-release || true+ fi+dnf update -ydnf install -y \@@ -233,10 +241,31 @@ fiprint_success "System dependencies installed"-# Install Docker if not present+# Install Docker if not present.+#+# Why not just `curl get.docker.com | sh` on Fedora/RHEL?+# Docker recently added `docker-model-plugin` to that script's package+# list, but the package only ships in the docker-ce apt repos — on+# Fedora/RHEL dnf, the install aborts with "Unable to find a match:+# docker-model-plugin". We add the repo and install the core packages+# explicitly to avoid that.if ! command -v docker &> /dev/null; thenprint_info "Installing Docker..."- curl -fsSL https://get.docker.com | sh++ if [ "$OS_FAMILY" = "fedora" ]; then+ dnf install -y dnf-plugins-core+ dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo+ dnf install -y docker-ce docker-ce-cli containerd.io \+ docker-compose-plugin docker-buildx-plugin+ elif [ "$OS_FAMILY" = "rhel" ]; then+ dnf install -y dnf-plugins-core+ dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo+ dnf install -y docker-ce docker-ce-cli containerd.io \+ docker-compose-plugin docker-buildx-plugin+ else+ curl -fsSL https://get.docker.com | sh+ fi+systemctl enable dockersystemctl start dockerprint_success "Docker installed"@@ -244,10 +273,11 @@ elseprint_success "Docker already installed"fi-# Install Docker Compose plugin if not present+# Install Docker Compose plugin if not present (Debian/Ubuntu only — the+# RHEL-family install above already pulled it in via the docker-ce repo).if ! docker compose version &> /dev/null; thenprint_info "Installing Docker Compose..."- if [ "$OS_FAMILY" = "fedora" ]; then+ if [ "$OS_FAMILY" = "fedora" ] || [ "$OS_FAMILY" = "rhel" ]; thendnf install -y docker-compose-pluginelseapt-get install -y docker-compose-plugin@@ -260,7 +290,7 @@ fi# Install Node.js for frontend build (builds on host to avoid Docker memory issues)if ! command -v node &> /dev/null; thenprint_info "Installing Node.js..."- if [ "$OS_FAMILY" = "fedora" ]; then+ if [ "$OS_FAMILY" = "fedora" ] || [ "$OS_FAMILY" = "rhel" ]; thencurl -fsSL https://rpm.nodesource.com/setup_20.x | bash -dnf install -y nodejselse@@ -382,7 +412,7 @@ print_success "CLI installed"# Install and configure host nginx as reverse proxyprint_info "Setting up nginx reverse proxy..."-if [ "$OS_FAMILY" = "fedora" ]; then+if [ "$OS_FAMILY" = "fedora" ] || [ "$OS_FAMILY" = "rhel" ]; thendnf install -y nginxelseapt-get install -y nginx@@ -423,8 +453,8 @@ ln -sf /etc/nginx/sites-available/serverkit.conf /etc/nginx/sites-enabled/# Copy site templatecp "$INSTALL_DIR/nginx/sites-available/example.conf.template" /etc/nginx/sites-available/-# Configure SELinux to allow nginx reverse proxying (Fedora)-if [ "$OS_FAMILY" = "fedora" ] && command -v setsebool &> /dev/null; then+# Configure SELinux to allow nginx reverse proxying (Fedora/Rocky/RHEL)+if { [ "$OS_FAMILY" = "fedora" ] || [ "$OS_FAMILY" = "rhel" ]; } && command -v setsebool &> /dev/null; thensetsebool -P httpd_can_network_connect 1 2>/dev/null || truefidiff --git a/scripts/test/full-stack-test.ps1 b/scripts/test/full-stack-test.ps1index ca10dd9f..12906e92 100644--- a/scripts/test/full-stack-test.ps1+++ b/scripts/test/full-stack-test.ps1@@ -53,7 +53,8 @@ $DistroMap = @{'ubuntu22' = @{ backend = 'multipass'; image = '22.04'; user = 'ubuntu' }'ubuntu24' = @{ backend = 'multipass'; image = '24.04'; user = 'ubuntu' }'debian12' = @{ backend = 'vagrant'; image = 'generic/debian12'; user = 'vagrant' }- 'fedora' = @{ backend = 'vagrant'; image = 'generic/fedora39'; user = 'vagrant' }+ # fedora39 went EOL Nov 2024; use fedora40 which is supported.+ 'fedora' = @{ backend = 'vagrant'; image = 'generic/fedora40'; user = 'vagrant' }'rocky9' = @{ backend = 'vagrant'; image = 'generic/rocky9'; user = 'vagrant' }}@@ -171,14 +172,16 @@ function Test-VmInstall {& $MpExe transfer "${Vm}:/var/log/serverkit-test-install.log" "$VmOut\vm-install.log" 2>&1 | Out-Null& $MpExe transfer "${Vm}:/tmp/serverkit-install-status" $statusFile 2>&1 | Out-Null- if (-not (Test-Path $statusFile) -or (Get-Content $statusFile -Raw -ErrorAction SilentlyContinue).Trim() -eq '') {+ $rawStatus = if (Test-Path $statusFile) { Get-Content $statusFile -Raw -ErrorAction SilentlyContinue } else { $null }+ if (-not $rawStatus -or "$rawStatus".Trim() -eq '') {$fallback = if ($installRC -eq 0) { 'OK' } else { 'FAIL' }Set-Content -Path $statusFile -Value $fallback -Encoding ascii}& $MpExe exec $Vm -- sudo journalctl -u serverkit --no-pager -n 500 2>&1 `| Out-File (Join-Path $VmOut 'journalctl.log') -Encoding utf8- $status = (Get-Content $statusFile -Raw).Trim()+ $rawStatus = Get-Content $statusFile -Raw -ErrorAction SilentlyContinue+ $status = if ($rawStatus) { "$rawStatus".Trim() } else { 'FAIL' }Write-Host " [$Vm] install status: $status" -ForegroundColor $(if ($status -eq 'OK') { 'Green' } else { 'Red' })Save-State # regenerate so install log + journalctl show up@@ -257,14 +260,18 @@ function Test-VagrantInstall {| Out-File (Join-Path $VmOut 'vm-install.log') -Encoding utf8& $VgExe ssh -c "sudo cat /tmp/serverkit-install-status" 2>$null `| Out-File $statusFile -Encoding ascii- if (-not (Test-Path $statusFile) -or (Get-Content $statusFile -Raw -ErrorAction SilentlyContinue).Trim() -eq '') {+ # Get-Content -Raw returns $null for empty/missing files; guard before+ # calling .Trim() so a failed status capture doesn't crash the run.+ $rawStatus = if (Test-Path $statusFile) { Get-Content $statusFile -Raw -ErrorAction SilentlyContinue } else { $null }+ if (-not $rawStatus -or "$rawStatus".Trim() -eq '') {$fallback = if ($installRC -eq 0) { 'OK' } else { 'FAIL' }Set-Content -Path $statusFile -Value $fallback -Encoding ascii}& $VgExe ssh -c "sudo journalctl -u serverkit --no-pager -n 500" 2>$null `| Out-File (Join-Path $VmOut 'journalctl.log') -Encoding utf8- $status = (Get-Content $statusFile -Raw).Trim()+ $rawStatus = Get-Content $statusFile -Raw -ErrorAction SilentlyContinue+ $status = if ($rawStatus) { "$rawStatus".Trim() } else { 'FAIL' }Write-Host " [$Vm] install status: $status" -ForegroundColor $(if ($status -eq 'OK') { 'Green' } else { 'Red' })Save-State