Commit Graph

5146 Commits

Author SHA1 Message Date
Master3395
0aca2a5aaf Implement ImunifyAV asset management and routing
- Added a static method to ensure ImunifyAV assets are created and permissions set correctly in CageFS.py.
- Updated the URL routing in urls.py to include paths for ImunifyAV, supporting both legacy and new routes.
- Modified the ImunifyAV HTML template to use Django's URL template tag for better maintainability.
- Enhanced the cyberpanel_fixes.sh script to ensure ImunifyAV UI assets are installed during fixes.
- Improved database user resolution and password handling in mysqlUtilities.py for better security and reliability.

This update enhances the integration and management of ImunifyAV within the CyberPanel environment.
2025-11-15 23:25:13 +01:00
Master3395
34f10cebe3 Merge pull request #1595 from master3395/v2.5.5-dev
Enhance Postfix management and validation in installation scripts

- Refactored the enableDisableEmail function to improve handling of Postfix service enabling and disabling, including better error logging and cleanup of stale marker files.
- Added a new method in mailUtilities to check if Postfix is installed, ensuring that DKIM setup only proceeds if Postfix is available.
- Updated virtualHostUtilities to verify Postfix installation before attempting DKIM setup, with appropriate logging for missing markers.
- Improved overall robustness of email service management during installation and configuration processes.

https://github.com/usmannasir/cyberpanel/issues/1570
2025-11-02 20:30:51 +01:00
Master3395
22402c1933 Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-11-02 20:29:52 +01:00
Master3395
b6528bb21d Enhance Postfix management and validation in installation scripts
- Refactored the enableDisableEmail function to improve handling of Postfix service enabling and disabling, including better error logging and cleanup of stale marker files.
- Added a new method in mailUtilities to check if Postfix is installed, ensuring that DKIM setup only proceeds if Postfix is available.
- Updated virtualHostUtilities to verify Postfix installation before attempting DKIM setup, with appropriate logging for missing markers.
- Improved overall robustness of email service management during installation and configuration processes.

https://github.com/usmannasir/cyberpanel/issues/1570
2025-11-02 20:29:45 +01:00
Master3395
7716b4da7f Merge pull request #1594 from master3395/v2.5.5-dev
Refactor disk and bandwidth limit calculations in getSystemStatus
2025-11-02 19:55:55 +01:00
Master3395
0e6ec0902d Refactor disk and bandwidth limit calculations in getSystemStatus
- Updated the calculation of total disk limit and bandwidth limit to convert values from MB to GB for better clarity in the system status display.
- Ensured default values are maintained when limits are not set, enhancing the robustness of resource reporting.

https://github.com/usmannasir/cyberpanel/issues/1592
2025-11-02 19:54:58 +01:00
Master3395
925f6ce888 Merge pull request #1590 from master3395/v2.5.5-dev
V2.5.5 dev
2025-10-29 22:58:57 +01:00
Master3395
ddf9f5a9b3 Add cron service restart functionality in CronUtil
- Introduced a static method `restartCronService` to restart the cron service across various distributions, ensuring immediate application of changes.
- Updated `website.py` to call `restartCronService` after modifying cron jobs, with error handling to return appropriate responses if the restart fails.
- Enhanced overall reliability of cron job management by ensuring the service is restarted after changes are made.
https://github.com/usmannasir/cyberpanel/issues/1589
2025-10-29 22:55:38 +01:00
Master3395
e745d59a13 Enhance SQL query safety in mysqlUtilities.py
- Updated SQL queries to use backticks around database and table names for improved safety and compatibility.
- Implemented escaping for user inputs in CREATE USER and SET PASSWORD statements to prevent SQL injection vulnerabilities.
- Ensured consistent use of safe variable handling across various database operations, including user creation and privilege grants.
2025-10-24 01:24:22 +02:00
Master3395
6e86ccc33f Merge pull request #1585 from master3395/v2.5.5-dev
Add regenerateTwoFASecret functionality and UI support
2025-10-17 01:27:38 +02:00
Master3395
6aed317a1f Add regenerateTwoFASecret functionality and UI support
- Introduced a new endpoint to manually regenerate the 2FA secret for users.
- Updated views to handle 2FA secret regeneration, including security checks and logging.
- Enhanced the user interface with a button to regenerate the 2FA secret, along with appropriate alerts and confirmations.
- Updated JavaScript to manage the regeneration process and display the new secret key and QR code provisioning URI.
https://github.com/usmannasir/cyberpanel/issues/1577
2025-10-17 01:06:04 +02:00
Master3395
614bf7c8b4 Merge pull request #1584 from master3395/v2.5.5-dev
- Added PHP 8.6 to the list of system PHP versions and fallback versions in PHPManager.
- Updated return values to include PHP 8.6 in case of errors or empty results.
- Enhanced phpUtilities to recognize PHP 8.6 for CentOS and Ubuntu configurations.
- Adjusted recommended PHP version order to prioritize PHP 8.6.
2025-10-16 22:44:07 +02:00
Master3395
cef0192af6 Update PHP version handling to include PHP 8.6 across scripts
- Added PHP 8.6 to the list of system PHP versions and fallback versions in PHPManager.
- Updated return values to include PHP 8.6 in case of errors or empty results.
- Enhanced phpUtilities to recognize PHP 8.6 for CentOS and Ubuntu configurations.
- Adjusted recommended PHP version order to prioritize PHP 8.6.
2025-10-16 22:43:12 +02:00
Master3395
05bcb46fd6 Refactor CyberPanel installation logic to streamline PHP version handling
- Removed local installation function in favor of a direct installation approach.
- Updated installation script to prioritize the development branch for downloading CyberPanel, with a fallback to stable if unavailable.
- Adjusted PHP version lists across various scripts to exclude PHP 8.6 and ensure compatibility with existing versions.
- Enhanced error handling and feedback during installation to improve user experience.
2025-10-16 22:34:18 +02:00
Master3395
293550c588 Enhance PHP support in installation and management scripts
- Added installation logic for PHP 8.6 in the install script, ensuring compatibility with various distributions.
- Updated PHP version lists in the PHPManager to include PHP 8.6 for system checks and fallbacks.
- Modified phpUtilities to recognize PHP 8.6 for CentOS and Ubuntu.
- Adjusted upgrade script to support PHP 8.6 for AlmaLinux 8+ compatibility.
- Revised symlink setup logic to prioritize PHP 8.6 alongside other versions.
2025-10-16 22:26:33 +02:00
Master3395
7ab1422e35 Merge pull request #1582 from usmannasir/revert-1579-v2.5.5-dev
Revert "Enhance OS detection and support for AlmaLinux 10 and additional Ubun…"
2025-10-09 23:05:28 +02:00
Master3395
525f8b308c Revert "Enhance OS detection and support for AlmaLinux 10 and additional Ubun…" 2025-10-09 23:05:16 +02:00
Master3395
425e178dff Merge pull request #1581 from master3395/v2.5.5-dev
V2.5.5 dev
2025-10-09 23:01:57 +02:00
Master3395
14dfb3f099 Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-10-09 23:01:33 +02:00
Master3395
3312ed0b31 Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-10-09 23:00:46 +02:00
Master3395
99f651e02f Update CyberPanel installation script to prioritize stable branch
- Changed the default installer URL to the stable branch, with an option to use the development branch if BRANCH_NAME is set to v2.5.5-dev.
- Enhanced the logic to check for the availability of the development branch before falling back to stable.
- Updated the archive URL selection based on the chosen branch to ensure correct installation files are downloaded.
- Improved feedback messages to clarify which branch is being used during installation.
2025-10-09 23:00:45 +02:00
Master3395
f6088aeded Merge pull request #1580 from master3395/v2.5.5-dev
V2.5.5 dev
2025-10-09 22:46:30 +02:00
Master3395
561967bc8b Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-10-09 22:45:56 +02:00
Master3395
5c720464e9 Add local installation support for CyberPanel
- Introduced a new function to install CyberPanel from a local repository if installation files are available.
- Updated the installation flow to prioritize local installation before falling back to the direct download method.
- Enhanced error handling to provide clearer feedback if local installation files are not found.
- Adjusted the installer script to include branch specification for better version control during installation.
2025-10-09 22:44:31 +02:00
Master3395
69bcfa0980 Merge pull request #1579 from master3395/v2.5.5-dev
Enhance OS detection and support for AlmaLinux 10 and additional Ubun…
2025-10-09 22:09:41 +02:00
Master3395
1dcaea4131 Enhance OS detection and support for AlmaLinux 10 and additional Ubuntu versions
- Added detection for AlmaLinux 10 and updated package manager settings accordingly.
- Included support for Ubuntu versions 25.10, 25.04, and 22.04.5 in the OS detection logic.
- Updated error messages and supported OS lists to reflect the new additions.
- Improved compatibility checks and installation scripts for comprehensive support across the newly added OS versions.
2025-10-09 22:08:54 +02:00
usmannasir
4bedb9cd73 Implement real-time disk usage updates with async background processing
This commit implements an improved version of PRs #1575 and #1576 from @bdgreenweb
with critical performance optimizations.

## Background
The original PRs (#1575, #1576) proposed real-time disk usage tracking for file
manager operations. While the feature was valuable for improving user awareness of
disk quotas, there were several concerns:

1. **Performance Impact**: Original implementation used synchronous `executioner()`
   calls that would block file operations until disk calculation completed
2. **Target Branch Issues**: PRs were submitted to the stable branch instead of
   development branch, which could introduce instability
3. **Blocking Operations**: Each file operation would wait for disk usage
   recalculation, potentially causing noticeable delays

## Implementation Changes

### filemanager/filemanager.py
- Added disk usage updates to 9 file operation methods:
  - createNewFile() - After file creation
  - createNewFolder() - After folder creation
  - deleteFolderOrFile() - After deletion (both permanent and trash)
  - restore() - After restoring from trash
  - copy() - After copying files/folders
  - move() - After moving files/folders
  - upload() - After file uploads
  - extract() - After extracting archives
  - compress() - After creating archives

### plogical/IncScheduler.py
- Added CalculateAndUpdateDiskUsageDomain() function for domain-specific updates
- Added command-line argument handler for UpdateDiskUsageForceDomain
- Calculates disk usage for websites, email accounts, and bandwidth

## Key Improvements Over Original PRs

1. **Asynchronous Execution**: Uses `popenExecutioner()` instead of `executioner()`
   - File operations return immediately without waiting
   - Disk usage updates happen in background threads
   - Zero performance impact on user operations

2. **Selective Updates**: Only updates the specific domain affected by the operation
   rather than all domains system-wide

3. **Proper Branch Targeting**: Applied to development branch (v2.5.5-dev) for
   proper testing before stable release

## Benefits
- Real-time disk usage tracking as requested
- No performance degradation
- Users immediately aware of quota usage
- Prevents accidental quota violations
- Better than competitors (cPanel/DirectAdmin) in responsiveness

## Acknowledgments
Thank you @bdgreenweb for the original implementation idea and PRs #1575/#1576.
While we couldn't merge them directly due to the performance and stability concerns
mentioned above, your contribution highlighted an important feature gap. This
implementation preserves your core functionality while addressing the performance
concerns through asynchronous execution.

This will definitely help organizations track disk usage more effectively without
sacrificing file manager performance.
2025-10-08 13:40:16 +05:00
usmannasir
408296c51b Fix phpMyAdmin access issue for authenticated users
- Removed session validation check from phpmyadminsignin.php
- Removed PhpMyAdminAccessMiddleware from settings.py
- These changes were preventing access to phpMyAdmin even for logged-in users
- Reverts problematic authentication flow that was blocking legitimate access
2025-10-06 12:27:33 +05:00
usmannasir
5dae7583bb Fix MySQL password file permissions for cyberpanel group access
- Set proper ownership (root:cyberpanel) and permissions (640) on /etc/cyberpanel/mysqlPassword
- Ensures cyberpanel group can read the password file to prevent permission denied errors
- Falls back to root-only permissions if cyberpanel group doesn't exist yet
- Also fixes permissions on existing password files during installation
2025-10-03 16:43:31 +05:00
usmannasir
e34958a05f Move CyberPanel account setup earlier in installation process
Account creation now happens immediately after Python version check, before other system operations. This ensures system users are available for subsequent installation steps.
2025-10-03 15:55:40 +05:00
usmannasir
6fb5f65758 Fix ACME challenge path to use centralized Example directory
Update all vhost configurations to use /usr/local/lsws/Example/html/.well-known/acme-challenge
instead of domain-specific paths for better SSL certificate management
2025-10-03 15:50:29 +05:00
usmannasir
d659bda9db Improve installation flow and output organization
- Move status messages to appear after CyberPanel installer completes
- Silence verbose output during post-installation fixes
- Auto-answer OpenLiteSpeed password prompts to avoid manual input
- Simplify final status summary with cleaner formatting
- Fix static file permissions silently in background
- Show actual server IP in access details
- Reduce redundant success messages
- Make post-installation configurations less verbose

This creates a cleaner installation experience where the CyberPanel installer's summary appears first, followed by minimal post-installation configuration messages and a concise final status.
2025-10-01 13:48:00 +05:00
usmannasir
95f9a8d9b1 Fix password handling in CyberPanel installer
- Capture actual generated password from CyberPanel installation output
- Save generated password to /root/.cyberpanel_password for persistence
- Use captured password for OpenLiteSpeed admin configuration
- Update status summary to show actual password instead of hardcoded value
- Fix service check to use lscpd (actual CyberPanel service) instead of non-existent 'cyberpanel' service
- Add lscpd service status check in installation summary

This ensures the password shown in the summary matches the actual CyberPanel admin password.
2025-10-01 13:18:17 +05:00
usmannasir
93252c6662 Fix PowerDNS installation in v2.5.5-dev branch
Added missing PowerDNS configuration setup that was present in v2.4.4:
- Added installPowerDNSConfigurations() method to properly copy and configure pdns.conf
- Fixed PowerDNS installation to call configuration method after package installation
- Updated fixAndStartPowerDNS() to copy config template if missing
- Added proper MySQL password configuration for PowerDNS backend
- Added errno import for proper error handling

This fixes PowerDNS installation failures by ensuring the configuration file is properly created and configured with database credentials.
2025-10-01 12:31:01 +05:00
usmannasir
d5258ac85b fix static file permissions 2025-10-01 11:46:58 +05:00
usmannasir
80c68d4123 bug fix: login page issue 2025-10-01 03:18:39 +05:00
usmannasir
16828b74aa bug fix: login page issue 2025-10-01 02:33:55 +05:00
usmannasir
873f88a3c6 find was deleting important env files 2025-10-01 01:28:40 +05:00
usmannasir
de892ee4fd find was deleting important env files 2025-10-01 00:45:40 +05:00
usmannasir
6cbcc2862f bug fix: remove migrations commands 2025-10-01 00:20:05 +05:00
usmannasir
0e59310810 bug fix: remove migrations commands 2025-09-30 23:46:10 +05:00
usmannasir
fa039448e0 find was deleting important env files 2025-09-30 16:27:14 +05:00
usmannasir
f77780608d bug fix: migrations issue 2025-09-30 16:18:10 +05:00
usmannasir
8767a730d9 bug fix: quote errors 2025-09-30 15:56:12 +05:00
usmannasir
3416943fc5 bug fix: quote errors 2025-09-30 12:31:09 +05:00
usmannasir
02c6c6b398 bug fix: 2025-09-30 12:24:33 +05:00
usmannasir
edbe80e88b bug fix: api 2025-09-30 00:12:48 +05:00
usmannasir
abcd1a78f0 bug fix: remove troubling migration file 2025-09-29 14:57:29 +05:00
usmannasir
77be45d692 bug fixes to isntall code 2025-09-29 12:42:27 +05:00
usmannasir
236ecd7ea8 fix: Comprehensive MariaDB socket authentication support
- Add execute_mysql_command() helper in install.py for robust auth fallback
- Update mysqlUtilities.py with socket auth fallback for all operations:
  * Database creation
  * User creation
  * Privilege granting
  * Privilege flushing
- Fix PowerDNS database setup to use new authentication helper
- Improve cyberpanel user connection verification
- Add proper error handling and logging throughout

This ensures the installation works correctly when MariaDB is pre-installed
with socket authentication (common with dependency installations).

Fixes the 'Cannot update settings with empty passwords' installation failure.
2025-09-29 12:18:03 +05:00