Merge pull request #1723 from master3395/v2.5.5-dev

V2.5.5 dev
This commit is contained in:
Master3395
2026-03-06 20:08:43 +01:00
committed by GitHub
4 changed files with 35 additions and 370 deletions

View File

@@ -1,329 +0,0 @@
# CyberPanel Windows Development Guide
## 🎯 Overview
**⚠️ IMPORTANT**: CyberPanel is designed specifically for Linux systems and does not officially support Windows. This guide is for **development and testing purposes only**.
This guide provides instructions for running CyberPanel in a Windows development environment using Python and Django. This setup is intended for:
- **Developers** working on CyberPanel features
- **Testing** CyberPanel functionality
- **Learning** CyberPanel architecture
- **Development** of CyberPanel extensions
**For production use, always use a supported Linux distribution.**
## 📋 Prerequisites
### System Requirements
- **OS**: Windows 7/8.1/10/11 (64-bit recommended)
- **RAM**: Minimum 4GB (8GB+ recommended)
- **Storage**: Minimum 20GB free space
- **CPU**: 2+ cores recommended
- **Network**: Internet connection required
### Required Software
- **Python 3.8+**: Download from [python.org](https://python.org)
- **Git**: Download from [git-scm.com](https://git-scm.com)
- **Administrator Access**: Required for installation
### ⚠️ Limitations
- **No Web Server**: OpenLiteSpeed/LiteSpeed not available on Windows
- **No System Services**: MariaDB, PowerDNS, etc. not included
- **Limited Functionality**: Many CyberPanel features require Linux
- **Development Only**: Not suitable for production use
## 🚀 Installation Methods
### Method 1: Automated Installation (Recommended)
#### Step 1: Download Installation Script
1. Navigate to the `utils/windows/` folder
2. Download `cyberpanel_install.bat`
3. Right-click and select "Run as administrator"
#### Step 2: Follow Installation Prompts
The script will automatically:
- Check system requirements
- Create Python virtual environment
- Download CyberPanel source code
- Install all dependencies
- Set up the web interface
#### Step 3: Access CyberPanel
1. Open your web browser
2. Navigate to: `http://localhost:8090`
3. Use default credentials:
- **Username**: `admin`
- **Password**: `123456`
### Method 2: Manual Installation
#### Step 1: Install Python
1. Download Python 3.8+ from [python.org](https://python.org)
2. **Important**: Check "Add Python to PATH" during installation
3. Verify installation:
```cmd
python --version
pip --version
```
#### Step 2: Install Git
1. Download Git from [git-scm.com](https://git-scm.com)
2. Install with default settings
3. Verify installation:
```cmd
git --version
```
#### Step 3: Create CyberPanel Directory
```cmd
mkdir C:\usr\local\CyberCP
cd C:\usr\local\CyberCP
```
#### Step 4: Set Up Python Environment
```cmd
python -m venv . --system-site-packages
Scripts\activate.bat
```
#### Step 5: Download CyberPanel
```cmd
git clone https://github.com/usmannasir/cyberpanel.git
cd cyberpanel
```
#### Step 6: Install Dependencies
```cmd
pip install --upgrade pip setuptools wheel
pip install -r requirments.txt
```
#### Step 7: Set Up Django
```cmd
python manage.py collectstatic --noinput
python manage.py migrate
```
#### Step 8: Create Admin User
```cmd
python manage.py createsuperuser
```
#### Step 9: Start CyberPanel
```cmd
python manage.py runserver 0.0.0.0:8090
```
## 🔧 Post-Installation Configuration
### Change Default Password
1. Access CyberPanel at `http://localhost:8090`
2. Log in with default credentials
3. Go to **User Management** → **Modify User**
4. Change the admin password immediately
### Configure Windows Firewall
1. Open Windows Defender Firewall
2. Add inbound rule for port 8090
3. Allow Python through firewall
### Set Up Windows Service (Optional)
1. Run `install_service.bat` as administrator
2. CyberPanel will start automatically on boot
3. Manage service through Windows Services
## 🔄 Upgrading CyberPanel
### Using Upgrade Script
1. Download `cyberpanel_upgrade.bat`
2. Right-click and select "Run as administrator"
3. Script will automatically backup and upgrade
### Manual Upgrade
```cmd
cd C:\usr\local\CyberCP\cyberpanel
Scripts\activate.bat
git pull origin stable
pip install --upgrade -r requirments.txt
python manage.py migrate
python manage.py collectstatic --noinput
```
## 🛠️ Utility Scripts
### Available Scripts
- **`cyberpanel_install.bat`**: Complete installation
- **`cyberpanel_upgrade.bat`**: Upgrade existing installation
- **`install_webauthn.bat`**: Enable WebAuthn/Passkey authentication
### Script Usage
1. **Right-click** on any script
2. Select **"Run as administrator"**
3. Follow on-screen prompts
4. Check output for any errors
## 🐛 Troubleshooting
### Common Issues
#### "Python not found" Error
**Problem**: Python is not installed or not in PATH
**Solution**:
1. Install Python from [python.org](https://python.org)
2. Check "Add Python to PATH" during installation
3. Restart Command Prompt
4. Verify with `python --version`
#### "Access Denied" Error
**Problem**: Insufficient privileges
**Solution**:
1. Right-click script and select "Run as administrator"
2. Or open Command Prompt as administrator
3. Navigate to script location and run
#### "Failed to install requirements" Error
**Problem**: Network or dependency issues
**Solution**:
1. Check internet connection
2. Try running script again
3. Install requirements manually:
```cmd
pip install --upgrade pip
pip install -r requirments.txt
```
#### "Port 8090 already in use" Error
**Problem**: Another service is using port 8090
**Solution**:
1. Stop other services using port 8090
2. Or change CyberPanel port in settings
3. Check with: `netstat -an | findstr :8090`
#### "Django not found" Error
**Problem**: Virtual environment not activated
**Solution**:
1. Navigate to CyberPanel directory
2. Activate virtual environment:
```cmd
Scripts\activate.bat
```
3. Verify with `python -c "import django"`
### Advanced Troubleshooting
#### Check Installation Logs
```cmd
cd C:\usr\local\CyberCP\cyberpanel
python manage.py check
```
#### Verify Dependencies
```cmd
pip list
pip check
```
#### Test Database Connection
```cmd
python manage.py dbshell
```
#### Reset Database (Last Resort)
```cmd
python manage.py flush
python manage.py migrate
python manage.py createsuperuser
```
## 🔒 Security Considerations
### Initial Security Setup
1. **Change Default Password**: Immediately after installation
2. **Enable 2FA**: Use the 2FA guide for additional security
3. **Configure Firewall**: Restrict access to necessary ports only
4. **Regular Updates**: Keep CyberPanel and dependencies updated
### Windows-Specific Security
1. **User Account Control**: Keep UAC enabled
2. **Windows Defender**: Ensure real-time protection is on
3. **Regular Backups**: Backup CyberPanel data regularly
4. **Service Account**: Consider using dedicated service account
## 📊 Performance Optimization
### System Optimization
1. **Disable Unnecessary Services**: Free up system resources
2. **SSD Storage**: Use SSD for better performance
3. **Memory**: Ensure adequate RAM (8GB+ recommended)
4. **CPU**: Multi-core processor recommended
### CyberPanel Optimization
1. **Static Files**: Ensure static files are properly collected
2. **Database**: Regular database maintenance
3. **Logs**: Regular log cleanup
4. **Caching**: Enable appropriate caching
## 🔄 Maintenance
### Regular Maintenance Tasks
1. **Updates**: Regular CyberPanel updates
2. **Backups**: Regular data backups
3. **Logs**: Monitor and clean logs
4. **Security**: Regular security checks
### Backup Procedures
1. **Database Backup**:
```cmd
python manage.py dumpdata > backup.json
```
2. **File Backup**:
```cmd
xcopy C:\usr\local\CyberCP backup_folder /E /I /H
```
3. **Restore from Backup**:
```cmd
python manage.py loaddata backup.json
```
## 📚 Additional Resources
### Documentation
- **Main Guide**: [2FA Authentication Guide](2FA_AUTHENTICATION_GUIDE.md)
- **Troubleshooting**: [Troubleshooting Guide](TROUBLESHOOTING.md)
- **Utility Scripts**: [Utility Scripts](../utils/README.md)
### Support
- **CyberPanel Forums**: https://community.cyberpanel.net
- **GitHub Issues**: https://github.com/usmannasir/cyberpanel/issues
- **Discord Server**: https://discord.gg/cyberpanel
## ✅ Verification Checklist
After installation, verify these components:
- [ ] CyberPanel accessible at `http://localhost:8090`
- [ ] Admin password changed from default
- [ ] Windows Firewall configured
- [ ] Python virtual environment working
- [ ] All dependencies installed
- [ ] Database migrations applied
- [ ] Static files collected
- [ ] Logs are clean
- [ ] Service starts automatically (if configured)
## 🆘 Getting Help
If you encounter issues:
1. **Check the logs** for error messages
2. **Run the troubleshooting commands** above
3. **Search the documentation** for solutions
4. **Ask in the community forum** for help
5. **Create a GitHub issue** with detailed information
---
**Note**: This guide is specifically for Windows installations. For Linux installations, refer to the main CyberPanel documentation.
*Last updated: January 2025*

View File

@@ -1,33 +0,0 @@
# MariaDB rollback using upgrade backups
When you run a CyberPanel upgrade with MariaDB version change, an optional full backup of all databases can be created in two places:
1. **Legacy path:** `/root/cyberpanel_mariadb_backups/mariadb_backup_before_upgrade_YYYYMMDD_HHMMSS.sql.gz`
2. **Standard path:** `/root/db-upgrade-backups/YYYY-MM-DD_HHMMSS/all_databases.sql.gz`
To roll back to the previous MariaDB state (e.g. after a failed or undesired upgrade):
1. Stop MariaDB: `systemctl stop mariadb` (or `mysql`/`mysqld` on your system).
2. Restore the dump (example for the standard path):
```bash
BACKUP_DIR="/root/db-upgrade-backups/2026-02-17_010304" # use your actual folder
gunzip -c "$BACKUP_DIR/all_databases.sql.gz" | mariadb --skip-ssl -u root -p
```
Or if the backup is in the legacy location:
```bash
gunzip -c /root/cyberpanel_mariadb_backups/mariadb_backup_before_upgrade_*.sql.gz | mariadb --skip-ssl -u root -p
```
You will be prompted for the MariaDB root password (stored in `/etc/cyberpanel/mysqlPassword`).
3. If you need to reinstall the previous MariaDB server version, use the official MariaDB repo for that version, then start the service and run `mariadb-upgrade --force` if required.
**Note:** Restoring over an existing data directory is destructive. Only use this when you intend to replace the current databases with the backup. For a safe test, back up the current `/var/lib/mysql` first.
## Optional standalone version managers
For advanced MariaDB/phpMyAdmin version changes without running the full upgrade, you can use the community scripts from [cyberpanel-mods](https://github.com/master3395/cyberpanel-mods) (version-managers):
- [mariadb_version_manager_enhanced.sh](https://github.com/master3395/cyberpanel-mods/blob/main/version-managers/mariadb_version_manager_enhanced.sh) interactive MariaDB version manager (backup, remove, add repo, install, secure).
- [mariadb_v_changer.sh](https://github.com/master3395/cyberpanel-mods/blob/main/version-managers/mariadb_v_changer.sh) simple prompt-based MariaDB version changer.
- [phpmyadmin_v_changer.sh](https://github.com/master3395/cyberpanel-mods/blob/main/version-managers/phpmyadmin_v_changer.sh) phpMyAdmin version changer (preserves config/signon).
CyberPanel install/upgrade now integrates equivalent behaviour (version choice, backup path, config preservation) so these scripts are optional for users who prefer a standalone workflow.

View File

@@ -7,7 +7,7 @@
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div ng-controller="launchChild" ng-init="childDomainName='{{ childDomain }}'; masterDomain='{{ domain }}'">
<div ng-controller="launchChild" ng-init="childDomainName='{{ childDomain }}'; masterDomain='{{ domain }}'; childPath='{{ childPath|escapejs }}'">
<style>
/* Ultra-Modern CyberPanel Design System */
@@ -864,6 +864,13 @@
</a>
</div>
<div class="col-md-3">
<a ng-click="issueSSL(childDomainName, childPath)" href="" class="icon-box" title="{% trans 'Obtain or restore Let\'s Encrypt SSL (default)' %}">
<i class="fas fa-certificate" style="font-size: 48px; color: var(--info-color);"></i>
<span class="h4">{% trans "Issue SSL" %}</span>
</a>
</div>
<div class="col-md-3">
<a ng-click="changePHPMaster()" href="" class="icon-box" title="{% trans 'Change PHP Version' %}">
<i class="fab fa-php" style="font-size: 48px; color: var(--info-color);"></i>
@@ -891,9 +898,9 @@
</div>
<div class="form-group">
<div style="margin-bottom: 20px; text-align: right;">
<button ng-click="hidesslbtn()" type="button" class="btn btn-link" style="color: var(--danger-color);">
<i class="fas fa-times" style="font-size: 20px;"></i>
<div style="margin-bottom: 20px; display: flex; justify-content: center; align-items: center;">
<button ng-click="hidesslbtn()" type="button" class="btn btn-link" style="color: var(--danger-color); min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;">
<i class="fas fa-times" style="font-size: 24px;"></i>
</button>
</div>
<div class="row">

View File

@@ -706,6 +706,16 @@
align-items: center;
justify-content: center;
}
/* SSL form close (X) button centered in row and icon centered in button */
.ssl-form-close-btn {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
}
.ssl-form-close-btn i.fa-times {
line-height: 1;
display: block;
}
}
@media (max-width: 576px) {
@@ -2035,6 +2045,13 @@
</a>
</div>
<div class="col-md-3">
<a href="#" ng-click="issueSSL('{{ domain|escapejs }}'); $event.preventDefault()" title="{% trans 'Obtain or restore Let\'s Encrypt SSL (default)' %}">
<img src="{% static 'images/icons/locked.png' %}" width="65" class="mr-10">
<span class="h4">{% trans "Issue SSL" %}</span>
</a>
</div>
<div class="col-md-3">
<a href="#" ng-click="changePHPMaster(); $event.preventDefault()" title="{% trans 'Change PHP Version' %}">
<img src="{% static 'images/icons/laptop.png' %}" width="65" class="mr-10">
@@ -2063,16 +2080,19 @@
</div>
<div ng-hide="" class="form-group">
<div style="margin-bottom: 1%;" class="col-sm-offset-11 col-sm-1">
<a ng-click="hidesslbtn()" href=""><img
src="/static/images/close-32.png"></a>
<div class="form-group">
<div class="col-sm-12" style="margin-bottom: 15px; display: flex; justify-content: center; align-items: center;">
<button type="button" ng-click="hidesslbtn()" class="btn btn-link ssl-form-close-btn" style="color: var(--danger-color, #dc3545); padding: 8px 12px; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;">
<i class="fas fa-times" style="font-size: 24px;"></i>
</button>
</div>
<div class="col-sm-6">
<label class="control-label">{% trans "Paste Your Cert" %}</label>
<textarea placeholder="Paste Your Cert" ng-model="cert" rows="10"
class="form-control"></textarea>
</div>
<div class="col-sm-6">
<label class="control-label">{% trans "Paste Your Key" %}</label>
<textarea placeholder="Paste Your Key" ng-model="key" rows="10"
class="form-control"></textarea>
</div>