Files
Claude Code 6d74d874b6 ZMB Webui: Complete Project – Rebrand & Initial Clean Commit
ARCHITECTURE
============
Backend: FastAPI + uvicorn (port 8000)
  - JWT authentication with PAM system users
  - ZFS CLI wrapper with caching (30-60s TTL)
  - WebSocket pool status broadcaster (30s interval)
  - Services: auth, zfs_runner, file_manager, shares, identities, system_info
  - Routers: pools, datasets, snapshots, shares, identities, navigator, system

Frontend: Next.js 15 + TypeScript (static export)
  - Incremental Static Regeneration (ISR) for weak hardware
  - Type-safe API client (lib/api.ts)
  - Dark mode + custom Tailwind theme
  - Pages: Dashboard, Login, Snapshots, Datasets, Shares, etc.

DEPLOYMENT
==========
Test Target: 192.168.1.179:8090 (Debian LXC)
Production: 10.66.120.3:9090 (Raspberry Pi 4GB ARM64)
Updater: Automated Gitea-based deployment (update-test.sh, update-pi.sh)

FEATURES COMPLETED
==================
Phase 3a: Dashboard Quick Stats (System, CPU, Memory, Storage)
  - Real-time stats with color-coded progress bars
  - Responsive grid layout (mobile: 1, tablet: 2, desktop: 4 columns)
  - ISR-optimized for fast loads on weak hardware

REBRANDING
==========
Renamed throughout:
  - Project: 'ZFS Manager' → 'ZMB Webui'
  - Services: 'zfs-manager' → 'zmb-webui'
  - Systemd units: zfs-manager-backend → zmb-webui-backend
  - Configuration files and documentation

Co-Authored-By: Patrick <patrick@perlbach24.de>
2026-04-22 00:43:05 +02:00

206 lines
6.3 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# System Compatibility Check for ZMB Webui Backend
# Run before installation to verify system meets requirements
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}╔═══════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ ZMB Webui Backend System Compatibility Check ║${NC}"
echo -e "${BLUE}╚═══════════════════════════════════════════════════════════╝${NC}"
echo ""
ISSUES=0
WARNINGS=0
# ============== ARCHITECTURE ==============
echo -e "${YELLOW}Architecture${NC}"
ARCH=$(uname -m)
case $ARCH in
aarch64)
echo -e " ${GREEN}${NC} $ARCH (ARM64 - Raspberry Pi)"
;;
x86_64 | x86-64)
echo -e " ${GREEN}${NC} $ARCH (AMD64 - 64-bit x86)"
;;
i686 | i386)
echo -e " ${YELLOW}${NC} $ARCH (32-bit x86 - may be slow)"
((WARNINGS++))
;;
*)
echo -e " ${RED}${NC} $ARCH (unknown/unsupported)"
((ISSUES++))
;;
esac
echo ""
# ============== OS ==============
echo -e "${YELLOW}Operating System${NC}"
if [ -f /etc/os-release ]; then
. /etc/os-release
OS_NAME="${NAME:-Unknown}"
OS_VERSION="${VERSION_ID:-unknown}"
if [[ "$ID" == "debian" ]] || [[ "$ID_LIKE" == *"debian"* ]]; then
echo -e " ${GREEN}${NC} $OS_NAME ($OS_VERSION) - Debian-based"
PKG_MANAGER="apt"
elif [[ "$ID" == "ubuntu" ]]; then
echo -e " ${GREEN}${NC} Ubuntu ($OS_VERSION) - Debian-based"
PKG_MANAGER="apt"
elif [[ "$ID" == "rhel" ]] || [[ "$ID" == "centos" ]] || [[ "$ID" == "fedora" ]]; then
echo -e " ${YELLOW}${NC} $OS_NAME ($OS_VERSION) - RHEL-based (use install-rhel.sh)"
((WARNINGS++))
PKG_MANAGER="dnf"
else
echo -e " ${RED}${NC} $OS_NAME - not tested"
((ISSUES++))
fi
else
echo -e " ${RED}${NC} Could not detect OS"
((ISSUES++))
fi
echo ""
# ============== PYTHON ==============
echo -e "${YELLOW}Python${NC}"
if command -v python3 &> /dev/null; then
PYTHON_VERSION=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
if [ "$PYTHON_MAJOR" -ge 3 ] && [ "$PYTHON_MINOR" -ge 8 ]; then
echo -e " ${GREEN}${NC} Python $PYTHON_VERSION"
else
echo -e " ${RED}${NC} Python $PYTHON_VERSION (need 3.8+)"
((ISSUES++))
fi
else
echo -e " ${RED}${NC} Python 3 not found"
((ISSUES++))
fi
echo ""
# ============== PIP ==============
echo -e "${YELLOW}pip${NC}"
if python3 -m pip --version &> /dev/null; then
echo -e " ${GREEN}${NC} pip available"
else
echo -e " ${RED}${NC} pip not found"
((ISSUES++))
fi
echo ""
# ============== ZFS TOOLS ==============
echo -e "${YELLOW}ZFS Tools${NC}"
ZFS_OK=true
if command -v zpool &> /dev/null; then
ZPOOL_VERSION=$(zpool --version 2>/dev/null | head -1)
echo -e " ${GREEN}${NC} zpool - $ZPOOL_VERSION"
else
echo -e " ${RED}${NC} zpool not found"
ZFS_OK=false
((ISSUES++))
fi
if command -v zfs &> /dev/null; then
ZFS_VERSION=$(zfs --version 2>/dev/null | head -1)
echo -e " ${GREEN}${NC} zfs - $ZFS_VERSION"
else
echo -e " ${RED}${NC} zfs not found"
ZFS_OK=false
((ISSUES++))
fi
if [ "$ZFS_OK" = true ]; then
# Try to list pools to verify ZFS is working
if zpool list &> /dev/null; then
echo -e " ${GREEN}${NC} ZFS is functional (can list pools)"
fi
else
echo -e " ${YELLOW}${NC} ZFS not installed - install with: $PKG_MANAGER install zfsutils-linux"
((WARNINGS++))
fi
echo ""
# ============== SYSTEMD ==============
echo -e "${YELLOW}systemd${NC}"
if command -v systemctl &> /dev/null; then
echo -e " ${GREEN}${NC} systemd available"
else
echo -e " ${YELLOW}${NC} systemd not found (required for service installation)"
((WARNINGS++))
fi
echo ""
# ============== DISK SPACE ==============
echo -e "${YELLOW}Disk Space${NC}"
AVAILABLE=$(df /opt 2>/dev/null | tail -1 | awk '{print $4}')
if [ -z "$AVAILABLE" ]; then
AVAILABLE=$(df / 2>/dev/null | tail -1 | awk '{print $4}')
fi
if [ ! -z "$AVAILABLE" ] && [ "$AVAILABLE" -gt 500000 ]; then
AVAILABLE_MB=$((AVAILABLE / 1024))
echo -e " ${GREEN}${NC} ~${AVAILABLE_MB}MB available"
else
echo -e " ${RED}${NC} Less than 500MB available"
((ISSUES++))
fi
echo ""
# ============== MEMORY ==============
echo -e "${YELLOW}Memory${NC}"
if [ -f /proc/meminfo ]; then
TOTAL_MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}')
TOTAL_MB=$((TOTAL_MEM / 1024))
if [ "$TOTAL_MB" -ge 512 ]; then
echo -e " ${GREEN}${NC} ${TOTAL_MB}MB available"
if [ "$TOTAL_MB" -lt 1024 ]; then
echo -e " ${YELLOW}${NC} Less than 1GB - performance may be limited"
((WARNINGS++))
fi
else
echo -e " ${RED}${NC} Only ${TOTAL_MB}MB - too little memory"
((ISSUES++))
fi
else
echo -e " ${YELLOW}${NC} Could not determine memory"
((WARNINGS++))
fi
echo ""
# ============== NETWORK ==============
echo -e "${YELLOW}Network${NC}"
if ping -c 1 8.8.8.8 &> /dev/null; then
echo -e " ${GREEN}${NC} Internet connectivity OK"
else
echo -e " ${YELLOW}${NC} No internet connectivity (needed for apt)"
((WARNINGS++))
fi
echo ""
# ============== SUMMARY ==============
echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}"
if [ $ISSUES -eq 0 ]; then
echo -e "${GREEN}✓ System is compatible - ready for installation${NC}"
if [ $WARNINGS -gt 0 ]; then
echo -e "${YELLOW}$WARNINGS warning(s) - review above${NC}"
fi
echo ""
echo -e "Next step: ${BLUE}sudo bash install.sh${NC}"
exit 0
else
echo -e "${RED}$ISSUES issue(s) found - cannot proceed${NC}"
echo ""
echo "Fix the issues above and try again."
exit 1
fi