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
feat: Add low RAM detection with safe mode, swap setup, and optimize post-installation steps.
Rapeepan600dd5325e32
diff --git a/install.sh b/install.shindex b0359880..dc72ac27 100644--- a/install.sh+++ b/install.sh@@ -23,6 +23,8 @@ PYTHON_MIN="3.11"PYTHON_MAX="3.12"PYTHON_BIN=""+SAFE_MODE=false+print_header() {echo -e "${BLUE}"echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"@@ -54,6 +56,39 @@ fiprint_warning "System Python not supported ($PYTHON_MIN-$PYTHON_MAX)"}+check_ram(){++RAM=$(free -m | awk '/Mem:/ {print $2}')++if [ "$RAM" -le 700 ]; then+SAFE_MODE=true+print_warning "Low RAM detected (${RAM}MB) → enabling VPS Safe Mode"+fi++}++setup_swap(){++SWAP_TOTAL=$(free -m | awk '/Swap:/ {print $2}')++if [ "$SWAP_TOTAL" -lt 512 ]; then++print_info "Creating swap (1GB)"++if [ ! -f /swapfile ]; then+fallocate -l 1G /swapfile 2>/dev/null || dd if=/dev/zero of=/swapfile bs=1M count=1024+chmod 600 /swapfile+mkswap /swapfile >/dev/null+fi++swapon /swapfile || true++print_success "Swap enabled"++fi++}+print_headerif [ "$EUID" -ne 0 ]; then@@ -188,15 +223,10 @@ if ! command -v node &> /dev/null; thenprint_info "Installing Node.js..."if [ "$OS_FAMILY" = "fedora" ]; then-curl -fsSL https://rpm.nodesource.com/setup_20.x | bash --dnf install -y nodejs-else-curl -fsSL https://deb.nodesource.com/setup_20.x | bash --apt-get install -y nodejsfi@@ -216,14 +246,12 @@ if [ -d "$INSTALL_DIR" ]; thenprint_warning "Directory exists, updating..."cd "$INSTALL_DIR"-git fetch origingit reset --hard origin/mainelsegit clone https://github.com/jhd3197/serverkit.git "$INSTALL_DIR"-cd "$INSTALL_DIR"fi@@ -245,9 +273,13 @@ source "$VENV_DIR/bin/activate"print_info "Installing Python dependencies..."+if [ "$SAFE_MODE" = true ]; then+pip install --upgrade pip --no-cache-dir+pip install --no-cache-dir -r "$INSTALL_DIR/backend/requirements.txt"+elsepip install --upgrade pip-pip install -r "$INSTALL_DIR/backend/requirements.txt"+fipip install gunicorn gevent gevent-websocket@@ -315,9 +347,9 @@ systemctl start serverkitdocker compose up -d-sleep 10+systemctl start nginx-echo ""+sleep 8BACKEND_OK=falseFRONTEND_OK=false