Skip to content

Commit 5b8b735

Browse files
Dennis-SEGclaude
andcommitted
Fix: Install Vesta from source repository instead of apt/dnf
The official Vesta packages may not support modern distributions (Ubuntu 24.04, Debian 12, RHEL 9). Changed all modern installers to clone the Vesta repository from GitHub and install from source. Changes: - Ubuntu: Clone from GitHub if not running from local repo - Debian: Same approach, removed apt-get install vesta - RHEL: Same approach, removed dnf install vesta The installer now: 1. Checks if running from a cloned repository 2. If not, clones from GitHub to /tmp/vesta-repo 3. Copies binaries, web files, functions, and templates 4. Ensures git is installed as a dependency Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent e505971 commit 5b8b735

File tree

3 files changed

+104
-9
lines changed

3 files changed

+104
-9
lines changed

install/vst-install-debian-modern.sh

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,47 @@ mkdir -p \
384384
touch $VESTA/log/auth.log
385385
chmod 640 $VESTA/log/auth.log
386386

387-
# Download and install Vesta packages
388-
apt-get -y install vesta vesta-nginx vesta-php
389-
check_result $? 'Failed to install Vesta packages'
387+
# Install Vesta from source (official apt packages may not support modern Debian)
388+
echo "Installing Vesta from source repository..."
389+
390+
# Determine repository location
391+
REPO_DIR="$(cd "$(dirname "$0")/.." 2>/dev/null && pwd)"
392+
393+
# Check if we have a valid repository (bin directory should exist)
394+
if [ ! -d "$REPO_DIR/bin" ]; then
395+
echo "Repository not found locally, cloning from GitHub..."
396+
REPO_DIR="/tmp/vesta-repo"
397+
rm -rf $REPO_DIR
398+
git clone --depth 1 https://github.com/Dennis-SEG/vesta.git $REPO_DIR
399+
check_result $? 'Failed to clone Vesta repository'
400+
fi
401+
402+
# Create bin directory
403+
mkdir -p $VESTA/bin
404+
405+
# Copy binaries
406+
echo "Copying Vesta binaries..."
407+
cp -rf $REPO_DIR/bin/* $VESTA/bin/
408+
chmod +x $VESTA/bin/*
409+
410+
# Copy web files
411+
echo "Copying web interface..."
412+
cp -rf $REPO_DIR/web/* $VESTA/web/
413+
414+
# Fix mail-wrapper.php shebang to use system PHP
415+
if [ -f "$VESTA/web/inc/mail-wrapper.php" ]; then
416+
sed -i '1s|.*|#!/usr/bin/php|' $VESTA/web/inc/mail-wrapper.php
417+
fi
418+
419+
# Copy other core files
420+
echo "Copying configuration files..."
421+
[ -d "$REPO_DIR/func" ] && cp -rf $REPO_DIR/func $VESTA/
422+
[ -d "$REPO_DIR/data" ] && cp -rf $REPO_DIR/data/* $VESTA/data/ 2>/dev/null || true
423+
424+
# Copy install directory for templates
425+
cp -rf $REPO_DIR/install $VESTA/
426+
427+
echo "Vesta core files installed successfully"
390428

391429
# Copy configuration templates from our modern configs
392430
if [ -d "$VESTA/install/debian/$release" ]; then

install/vst-install-rhel-modern.sh

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ software="nginx httpd httpd-tools mod_ssl mod_fcgid mod_proxy_fcgi
4242
php-mbstring php-mysqlnd php-pdo php-pgsql php-soap php-xml
4343
php-xmlrpc postgresql postgresql-server proftpd quota
4444
roundcubemail rrdtool screen spamassassin sudo tar vim-common
45-
vsftpd webalizer which zip unzip vesta vesta-nginx vesta-php"
45+
vsftpd webalizer which zip unzip"
4646

4747
# Help function
4848
help() {
@@ -165,9 +165,55 @@ mkdir -p \
165165
$VESTA/data/users \
166166
$VESTA/data/firewall
167167

168-
# Download and install Vesta packages
169-
dnf -y install vesta vesta-nginx vesta-php
170-
check_result $? 'Failed to install Vesta packages'
168+
# Install Vesta from source (official rpm packages may not support modern RHEL/Rocky)
169+
echo "Installing Vesta from source repository..."
170+
171+
# Determine repository location
172+
REPO_DIR="$(cd "$(dirname "$0")/.." 2>/dev/null && pwd)"
173+
174+
# Check if we have a valid repository (bin directory should exist)
175+
if [ ! -d "$REPO_DIR/bin" ]; then
176+
echo "Repository not found locally, cloning from GitHub..."
177+
REPO_DIR="/tmp/vesta-repo"
178+
rm -rf $REPO_DIR
179+
git clone --depth 1 https://github.com/Dennis-SEG/vesta.git $REPO_DIR
180+
check_result $? 'Failed to clone Vesta repository'
181+
fi
182+
183+
# Create bin directory
184+
mkdir -p $VESTA/bin $VESTA/web $VESTA/data/packages
185+
186+
# Copy binaries
187+
echo "Copying Vesta binaries..."
188+
cp -rf $REPO_DIR/bin/* $VESTA/bin/
189+
chmod +x $VESTA/bin/*
190+
191+
# Copy web files
192+
echo "Copying web interface..."
193+
cp -rf $REPO_DIR/web/* $VESTA/web/
194+
195+
# Fix mail-wrapper.php shebang to use system PHP
196+
if [ -f "$VESTA/web/inc/mail-wrapper.php" ]; then
197+
sed -i '1s|.*|#!/usr/bin/php|' $VESTA/web/inc/mail-wrapper.php
198+
fi
199+
200+
# Copy other core files
201+
echo "Copying configuration files..."
202+
[ -d "$REPO_DIR/func" ] && cp -rf $REPO_DIR/func $VESTA/
203+
[ -d "$REPO_DIR/data" ] && cp -rf $REPO_DIR/data/* $VESTA/data/ 2>/dev/null || true
204+
205+
# Copy install directory for templates
206+
cp -rf $REPO_DIR/install $VESTA/
207+
208+
# Create auth.log for login tracking
209+
touch $VESTA/log/auth.log
210+
chmod 640 $VESTA/log/auth.log
211+
212+
# Create RRD directory for statistics graphs
213+
mkdir -p $VESTA/web/rrd
214+
chown admin:admin $VESTA/web/rrd
215+
216+
echo "Vesta core files installed successfully"
171217

172218
#----------------------------------------------------------#
173219
# Configure Web Servers #

install/vst-install-ubuntu-modern.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ check_result $? 'apt-get upgrade failed'
326326

327327
# Install basic tools
328328
echo "Installing basic tools..."
329-
apt-get -y install curl wget gnupg2 ca-certificates lsb-release apt-transport-https software-properties-common
329+
apt-get -y install curl wget gnupg2 ca-certificates lsb-release apt-transport-https software-properties-common git
330330
check_result $? 'Failed to install basic tools'
331331

332332
# Add PHP repository (ondrej PPA)
@@ -591,7 +591,18 @@ chown admin:admin $VESTA/data/users/admin
591591

592592
# Install Vesta from source (apt packages not available for Ubuntu 24.04)
593593
echo "Installing Vesta from source repository..."
594-
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
594+
595+
# Determine repository location
596+
REPO_DIR="$(cd "$(dirname "$0")/.." 2>/dev/null && pwd)"
597+
598+
# Check if we have a valid repository (bin directory should exist)
599+
if [ ! -d "$REPO_DIR/bin" ]; then
600+
echo "Repository not found locally, cloning from GitHub..."
601+
REPO_DIR="/tmp/vesta-repo"
602+
rm -rf $REPO_DIR
603+
git clone --depth 1 https://github.com/Dennis-SEG/vesta.git $REPO_DIR
604+
check_result $? 'Failed to clone Vesta repository'
605+
fi
595606

596607
# Copy binaries
597608
echo "Copying Vesta binaries..."

0 commit comments

Comments
 (0)