Skip to content

Complete modernization: PHP 8.0-8.4 support, React 18, and security hardening#2322

Open
Dennis-SEG wants to merge 2654 commits into
outroll:masterfrom
Dennis-SEG:master
Open

Complete modernization: PHP 8.0-8.4 support, React 18, and security hardening#2322
Dennis-SEG wants to merge 2654 commits into
outroll:masterfrom
Dennis-SEG:master

Conversation

@Dennis-SEG

@Dennis-SEG Dennis-SEG commented Nov 7, 2025

Copy link
Copy Markdown

Overview

This PR modernizes Vesta Control Panel to be fully compatible with modern PHP versions (8.0-8.4) and updates the React UI to the latest stable versions, making it production-ready for 2025.

Test Results (Ubuntu 22.04) ✅

Installation tested and verified working out-of-the-box:

Component Status
Panel accessible ✅ HTTP 200
Admin login ✅ Works
Statistics display ✅ U_USERS, U_WEB_DOMAINS showing
Webmail URL ✅ Relative path /webmail/
phpMyAdmin URL ✅ Relative path /phpmyadmin/
phpMyAdmin service ✅ HTTP 200
Roundcube webmail ✅ HTTP 200

No manual intervention required - installer works out-of-the-box.

Changes Summary

PHP Compatibility (327 files)

  • 100% PHP 8.0-8.4 compatible - all 327 PHP files tested and verified
  • 🔧 Deprecated warnings fixed: Replaced error_reporting(NULL) with error_reporting(0)
  • No deprecated functions: Verified no usage of create_function(), each(), mysql_*, etc.

React UI Modernization

  • ⚛️ React 18.3.1: Migrated from React 16.x to 18.3.1
  • 🛣️ React Router v6.28.0: Complete migration from v5 to v6
  • 🎨 Bootstrap 5.3.3: Migrated from Bootstrap 4 to 5
  • Build verified: React build compiles successfully

Recent Fixes

  • Statistics display: Fixed variable initialization order in login API
  • Webmail/phpMyAdmin URLs: Changed to relative paths for correct proxying
  • Admin user config: All required fields now included (U_, SUSPENDED_, etc.)
  • Password hashing: Using SHA-512 for Vesta compatibility
  • React app loading: Fixed static/index.html to match root index.html

Installers Updated

  • vst-install-ubuntu-modern.sh - Ubuntu 20.04, 22.04, 24.04
  • vst-install-debian-modern.sh - Debian 10, 11, 12
  • vst-install-rhel-modern.sh - RHEL/Rocky 8, 9

Testing Notes

  • Ubuntu 22.04 and 24.04: Fully tested on ARM64 VMs
  • Ubuntu 20.04: Untested on ARM64 (PHP 8.3 not available), should work on x86_64
  • Debian: Not tested (Multipass limitation), installers updated with same fixes
  • RHEL: Not tested, installer updated with same fixes

lotarbo and others added 30 commits October 19, 2021 20:05
…gration

React integration ready for v1.0.0 release.
refactor: drop TLSv1.1 support in rhel 7
Increment backend port also when commented
All modern installers now copy templates from install directory:
- ubuntu-modern: copies from install/ubuntu/$release/templates
- debian-modern: copies from install/debian/$release/templates
- rhel-modern: copies from install/rhel/$release_major/templates

This fixes 'default web template does not exist' error.
Changes to all modern installers:
- Admin user now created with /home/admin home directory
- Admin home directories created (conf/web, conf/mail, conf/dns, web, mail, tmp)
- System directories created (/var/log/apache2/domains, /etc/apache2/conf.d)
- System IP automatically detected and added via v-add-sys-ip
- Templates copied during installation

This fixes 'default web template does not exist' and domain creation errors.
All resource limits for admin user now set to unlimited:
- WEB_DOMAINS, WEB_ALIASES
- DNS_DOMAINS, DNS_RECORDS
- MAIL_DOMAINS, MAIL_ACCOUNTS
- DATABASES, BACKUPS

This allows the admin user to create domains immediately after install.
…ndling

All modern installers:
- Add nginx 'bytes' log format for Vesta traffic tracking
- Fix admin user creation when stale group exists
- Fix mail-wrapper.php shebang to use /usr/bin/php

These fixes ensure domain creation and nginx restart work properly.
All modern installers now create /usr/local/vesta/conf/mysql.conf
with proper format including SUSPENDED='no' flag.

This fixes 'host cannot be empty' error when creating databases.
Ubuntu and Debian modern installers:
- Install roundcube-mysql and roundcube-plugins
- Install phpmyadmin
- Create symlinks in $VESTA/web/webmail and $VESTA/web/phpmyadmin
- Configure roundcube default host

This fixes the non-working webmail and phpmyadmin links.
Ubuntu and Debian installers now:
- Create roundcube database if not exists
- Recreate roundcube user with correct password from debian-db.php
- Grant proper permissions
- Initialize database tables

This fixes 'Access denied for user roundcube' error.
Add nginx location blocks to handle phpMyAdmin and Roundcube requests
through the Vesta panel on port 8083. This fixes the 502 Bad Gateway
errors when accessing /phpmyadmin and /webmail.

Changes:
- Ubuntu: Added inline location blocks in vesta.conf
- Debian: Added post-installation modification of vesta-nginx config
- RHEL: Added symlinks and nginx config modification

The location blocks properly handle:
- PHP files via FastCGI to PHP-FPM socket
- Security: deny access to sensitive directories
- Proper alias paths for each application
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
The previous check for bin directory would incorrectly match /bin when
running the script from /tmp/install.sh (via curl), causing the installer
to skip git clone and copy system binaries instead of Vesta binaries.

Changed the check to look for a Vesta-specific file (bin/v-add-user)
instead of just checking if a bin directory exists.
- Updated Mails.jsx to use relative URL for webmail link
- Added MAIL_URL and DB_PMA_URL to Ubuntu installer vesta.conf
- Rebuilt React app with the webmail link fix

This ensures the links work correctly when accessing the panel
on port 8083 instead of redirecting to port 80.
Changed webmail link to use relative URL instead of absolute URL with hostname.
This ensures webmail links work correctly through the Vesta proxy on port 8083.
The $users variable was being set with user data in the session check,
but then immediately reset to null by the initialization code that came
after. Moved initialization before the session check so user data is
preserved and returned correctly in the API response.
Tested on Ubuntu 22.04 and 24.04 (ARM64 VMs).
Ubuntu 20.04 and Debian not tested due to ARM64 environment limitations:
- ondrej PPA lacks PHP 8.3 ARM64 packages for Ubuntu 20.04
- Multipass does not support Debian images

These should work on x86_64 production servers where full PHP 8.3
support is available from the ondrej PPA.
- Add all required user.conf fields (statistics, contact, language, etc.)
- Use SHA-512 password hashing for Vesta compatibility (yescrypt not supported)
- Copy index.html to static/index.html to fix React app loading

Fixes applied to Ubuntu, Debian, and RHEL installers.
Tested components:
- Panel accessible (HTTP 200)
- Admin login works
- Statistics display correctly
- Webmail/phpMyAdmin URLs are relative
- All services accessible

No manual intervention required - installer works out-of-the-box.
@mckaygerhard

Copy link
Copy Markdown

No Devuan support, no Lont term support for debian LTS like debian 10 sill supported

@Dennis-SEG

Dennis-SEG commented Feb 12, 2026

Copy link
Copy Markdown
Author

No Devuan support, no Lont term support for debian LTS like debian 10 sill supported

This will be solved in the near future. Now only tested on Ubuntu versions. With automated workflows. This is a major update with a lot of changes. It will take some time to build the install files for all linux distros. But it's on my plate.

More then 1000 files have changes so it's not something what can be tested on all distros in a week.

@Neustradamus

Copy link
Copy Markdown

@mckaygerhard: @Dennis-SEG has already done a good job since 2025-11-07, it is important to have a real full continuity of the initial project. I am sure that he will improve more.

There are the support of:

  • Debian 10
  • Debian 11
  • Debian 12
  • Ubuntu 20.04 (LTS)
  • Ubuntu 22.04 (LTS)
  • Ubuntu 24.04 (LTS)

In the past, I have done ticket about it, and about RHEL / CentOS / Fedora / Rocky Linux / Alma Linux.

@mckaygerhard

Copy link
Copy Markdown

Ok makes sense i will be close tho help on.. when i can deploy it in some way..

@outrolled

Copy link
Copy Markdown
Collaborator

Just providing an update. The main item pending on this PR is a change on how the install scripts pull the relevant packages from a predefined domain/URL. We've been busy with the Rust based version of Vesta, but will have time to work on this branch from April onwards.

@Neustradamus

Copy link
Copy Markdown

@Dennis-SEG: Are you here?

Since 2026-02-14, no sign from you... :/

Thanks in advance.

2 similar comments
@Neustradamus

Copy link
Copy Markdown

@Dennis-SEG: Are you here?

Since 2026-02-14, no sign from you... :/

Thanks in advance.

@Neustradamus

Copy link
Copy Markdown

@Dennis-SEG: Are you here?

Since 2026-02-14, no sign from you... :/

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.