Commit Graph

95 Commits

Author SHA1 Message Date
master3395
dbde02926a Fix ModSecurity LMDB dependency crash (Issue #1626)
- Always download compatible ModSecurity binary after installation
- Removes conditional check for custom_ols_marker
- Fixes undefined symbol: mdb_env_create error
- Prevents OpenLiteSpeed crashes with SIGSEGV signal 11
- Compatible with Ubuntu 24.04, RHEL 8/9, Debian 11/12

The fix ensures that compatible ModSecurity binaries (built without
LMDB dependency or with LMDB statically linked) are always used,
preventing the runtime symbol lookup errors that cause crashes.

Related: https://github.com/usmannasir/cyberpanel/issues/1626
2026-01-10 03:22:45 +01:00
master3395
a2c359401e Fix: Enable website creation for regular users
- Fixed bug where regular users (UserACL) cannot create websites
- Changed UserACL createWebsite permission from 0 to 1
- Also enabled modifyWebsite and deleteWebsite for consistency
- Resolves issue where non-admin/reseller users were blocked from creating websites

Related changes:
- UserACL: createWebsite: 0 -> 1
- UserACL: modifyWebsite: 0 -> 1
- UserACL: deleteWebsite: 0 -> 1
- suspendWebsite remains 0 (admin-only feature)

This allows regular users to create, modify, and delete their own websites
while maintaining proper ownership checks and security controls.
2026-01-04 22:03:27 +01:00
master3395
b1adb8f52e DNS improvements: CloudFlare proxy toggle styling, auto AAAA records, proxy defaults
- Fixed CloudFlare proxy toggle button to display as oblong with round dot
- Enable CloudFlare proxy by default for all domains/subdomains except mail domains
- Automatically add AAAA (IPv6) DNS records when creating domains/subdomains
- Added GetServerIPv6() function to retrieve server IPv6 address
- Updated DNS template styling and Angular.js binding for toggle buttons
2026-01-04 04:15:46 +01:00
master3395
cfee3d9867 Fix CloudFlare DNS Management: Filter main domains only, auto-delete DNS records on domain removal, improve table display
- Filter domain dropdown to show only main domains (exclude sub-domains)
- Add automatic CloudFlare DNS record deletion when domains/sub-domains are removed
- Improve DNS Records table display to match SSH Logins/Logs table styling
- Add loading states and proper table structure with ng-if conditions
- Update CSS to match activity-table styling with sticky headers
2026-01-04 02:13:46 +01:00
Master3395
c3abff58f4 Download CDN libraries locally to eliminate tracking prevention warnings. Updated index.html to reference local copies of qrious.min.js and chart.umd.min.js. Added functionality in install.py and upgrade.py to download these libraries before running collectstatic. Updated website.html to ensure compatibility with the new local scripts. 2026-01-01 05:29:46 +01:00
Master3395
18b1bad51f Refactor configuration modification methods for improved safety and validation
- Introduced a `safeModifyHttpdConfig` method in `installUtilities` to handle modifications to the OpenLiteSpeed configuration file with backup, validation, and rollback capabilities.
- Updated various modules (`modSec.py`, `sslUtilities.py`, `tuning.py`, `vhost.py`, etc.) to utilize the new safe modification method, enhancing reliability and preventing configuration corruption.
- Improved error handling and logging throughout the configuration modification processes to ensure better traceability and debugging.
2025-12-31 23:13:53 +01:00
Master3395
b127b878ae Update rsync exclude patterns in backupUtilities.py to use leading slashes for top-level directory exclusions. This change improves backup accuracy by ensuring only the intended directories are excluded during the backup process. 2025-12-31 22:55:09 +01:00
Master3395
dc8bc57b35 Randomize acme.sh cron schedule in installation and upgrade scripts to prevent traffic spikes to Let's Encrypt. Added logic to generate random hour and minute for cron job entries, enhancing the installation process. 2025-12-31 22:26:50 +01:00
Master3395
ff382f2d78 Implement Catch-All Email Configuration Management
- Added new model `CatchAllEmail` to store catch-all email configurations per domain.
- Implemented views for fetching, saving, and deleting catch-all email configurations, enhancing email management capabilities.
- Updated URL routing to include endpoints for catch-all email operations.
- Enhanced error handling and permission checks for email forwarding actions.

These changes improve the flexibility and user experience of email management within CyberPanel.
2025-12-31 22:18:33 +01:00
Master3395
f8a2370336 Implement dynamic PHP version detection and configuration updates
- Added a new function `detect_default_php` to dynamically determine the default PHP version based on symlink and available versions, enhancing compatibility with PHP 7.4-8.5.
- Updated `phpmyadmin_limits` to utilize the detected PHP version for configuration changes, ensuring accurate parameter adjustments for the current PHP environment.
- Enhanced installation scripts for Redis and Memcached extensions to support PHP versions 7.4-8.5, improving backward compatibility and installation reliability.
- Improved error handling for missing PHP configuration files, providing clearer feedback to users.

These changes enhance the flexibility and robustness of PHP management within CyberPanel.
2025-12-17 19:48:28 +01:00
Master3395
7c692ab250 Implement .htaccess feature banner and extraction support in file manager
- Added a new fixed position banner in the index.html to announce .htaccess support, including styling and functionality for showing and dismissing the notification.
- Enhanced file manager to support extraction of 7z and rar file formats, with appropriate command handling in filemanager.py.
- Updated JavaScript files to determine extraction types based on file extensions, ensuring compatibility with new formats.
- Modified HTML templates to include options for 7z and rar compression types in the user interface.
https://github.com/usmannasir/cyberpanel/issues/1617#issue-3727006951

These changes improve user experience by providing clear notifications and expanding file management capabilities within CyberPanel.
2025-12-17 19:19:00 +01:00
Master3395
b9162b10cc Enhance reverse DNS lookup functionality in mailUtilities
- Added detailed error handling and logging for reverse DNS lookups, improving robustness against network issues and invalid responses.
- Updated virtualHostUtilities to handle cases where reverse DNS lookups fail, providing clearer error messages and guidance for users.
- Ensured that the results from DNS queries are validated before processing, enhancing the reliability of the rDNS checks.

These changes improve the overall reliability and user experience of the reverse DNS lookup feature within the CyberPanel environment.
2025-12-09 18:32:52 +01:00
Master3395
0433b0f6ea Update README and mysqlUtilities for versioning and MySQL account resolution
- Changed versioning in README.md to 2.5.5-dev and updated the last modified date.
- Added a section for recent fixes in README.md detailing improvements to MySQL password rotation.
- Removed obsolete test files for MySQL utilities and ImunifyAV route.
- Enhanced mysqlUtilities.py to improve MySQL account resolution and logging, ensuring better handling of user and host identification during password changes.
2025-11-15 23:55:47 +01:00
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
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
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
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
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
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
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
Master3395
b739b4a038 Update MariaDB version to 12.1 across installation scripts
- Changed MariaDB server version from 10.11 to 12.1 in cyberpanel_upgrade.sh, cyberpanel.sh, install.py, and venvsetup.sh to ensure compatibility with the latest features and security updates.
- Enhanced error handling for branch and commit verification in venvsetup.sh to improve installation reliability.
- Streamlined the requirements file download process with fallback options in venvsetup.sh to handle potential download failures.
2025-09-24 23:45:28 +02:00
Master3395
aaf3b68e14 Update PHP version handling and installation logic across scripts
- Adjusted PHP version priority in cyberpanel_upgrade.sh and install.py to include PHP 8.5 (beta) as the highest priority.
- Enhanced package installation logic in cyberpanel.sh and installCyberPanel.py to install PHP dependencies more robustly, including error handling for missing packages.
- Updated README.md to reflect the new recommended PHP versions and deprecated versions.
- Improved error handling and dependency management in phpUtilities.py and upgrade.py for better installation reliability.
2025-09-24 01:11:23 +02:00
Master3395
cc9a6ad31b Refactor installation scripts for improved service management and compatibility: Updated cyberpanel.sh to enhance PHP package installation logic based on available versions. Improved error handling for systemd service management in install.py and added pip upgrade functionality for better package compatibility. Enhanced PowerDNS database setup and service startup procedures with retry mechanisms and detailed logging. 2025-09-23 23:16:36 +02:00
Master3395
f41b54205b Refactor service management in installation scripts: Updated cyberpanel.sh to enhance the display of access information and system status. Improved install.py by adding comprehensive service checks and fixes for PowerDNS, Pure-FTPd, and database connectivity. Enhanced LiteSpeed configuration handling and ensured critical services are running properly during installation. Added detailed logging for better user feedback. 2025-09-23 22:35:47 +02:00
Master3395
2c57ad595e Enhance CyberPanel functionality with FTP Quota and Bandwidth Management features: Added models, views, and templates for managing FTP quotas and bandwidth resets. Implemented IP blocking functionality with associated views and templates. Updated system scripts for improved repository synchronization and OS detection. Removed outdated workflow files. 2025-09-23 21:09:38 +02:00
Master3395
cd38d6eb29 Update version requirements and enhance upgrade script output: Changed minimum version requirement from 1.9.4 to 2.3.4 in upgrade scripts, improved recovery log messages, and added detailed success and warning messages for the upgrade process. Enhanced user interface elements in the HTML template for better readability. 2025-09-23 20:07:30 +02:00
Master3395
685a464ca5 Fix pysftp dependency issue and optimize WSGI-LSAPI compilation: Removed pysftp from requirements in favor of paramiko, and updated Makefile for proper optimization flags to avoid _FORTIFY_SOURCE warnings during WSGI-LSAPI installation. 2025-09-23 19:06:33 +02:00
Master3395
63ffc8d4f7 Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-09-23 09:55:51 +02:00
Master3395
c873bfc140 Remove deprecated migration script and update version to 2.4 Build 4: The run_migration.py script has been deleted as it is no longer needed. The version file has been incremented to reflect the latest build. Additionally, the Django settings have been updated to include DEFAULT_AUTO_FIELD for improved primary key handling. 2025-09-23 09:55:27 +02:00
Usman Nasir
e91df945ae Merge pull request #1510 from master3395/v2.5.5-dev
V2.5.5 dev - Firewall ban button, and management
2025-09-23 12:29:21 +05:00
usmannasir
9b9a9cae44 Merge branch 'v2.4.4' into v2.5.5-dev 2025-09-23 10:59:13 +05:00
Master3395
e28e401e9d Enhance ModSecurity rule installation and verification: Update OWASP rules to version 4.18.0, improving detection for installed rules in the FirewallManager. Add checks to verify the existence of OWASP and Comodo configuration files. Update JavaScript to reflect installation status and improve user feedback. Ensure proper logging for installation processes and errors.
https://www.facebook.com/groups/cyberpanel/permalink/3983852698593015/
2025-09-22 18:05:55 +02:00
usmannasir
fb16f4cf56 bug fix: staging site issue 2025-09-22 13:31:20 +05:00
Master3395
3432432f91 Enhance text readability and error handling: Add readability fixes CSS for improved contrast across UI elements. Update text colors in various components for better visibility. Enhance FTP error handling with user-friendly messages and improved path validation in both frontend and backend. Update HTML templates to provide clearer instructions and examples for FTP path input. 2025-09-21 22:26:18 +02:00
Master3395
09c9d67536 Implement Docker network management features: Add endpoints for retrieving and creating Docker networks, and update container management to support network configuration and port mapping updates. Enhance UI for network selection and port editing in the container management interface. Update database schema to include network-related fields.
https://github.com/usmannasir/cyberpanel/issues/923
2025-09-21 21:14:34 +02:00
Master3395
cc07f12017 Add cron job management for website suspension: Implement methods to suspend, restore, and check the status of cron jobs for websites. Update main function to handle new commands for cron management. Enhance child domain handling to ensure cron jobs are suspended/restored appropriately during website suspension processes.
https://github.com/usmannasir/cyberpanel/issues/1097
2025-09-21 20:45:37 +02:00
Master3395
48c9c1ad6a Update README and enhance error handling: Increment version to 2.4 Build 4 and add notes on PHP version management. Improve error logging across multiple modules by replacing BaseException with Exception and utilizing secure error handling methods. Ensure consistent error responses in API and middleware functions for better debugging and user feedback. 2025-09-21 20:36:12 +02:00
Master3395
0161aba5f5 Enhance Imunify installation process: Add checks and fixes for PHP-FPM pool configurations and broken package installations before proceeding with Imunify360 and ImunifyAV installations. Implement auto-fix functionality in the firewall manager for PHP-FPM issues. Update the upgrade module to create missing PHP-FPM pool configurations and restart services as needed. Introduce a new API endpoint to disable two-factor authentication for users, ensuring proper handling and logging of actions.
https://github.com/usmannasir/cyberpanel/issues/1114
2025-09-21 20:13:15 +02:00
Master3395
c2b0eb0a20 Enhance SSL renewal process: Add method to update mail SSL configurations for all domains after renewal. Update mail SSL settings in the Renew class and ensure vhost SSL configurations are updated accordingly. Remove obsolete screenshot file.
https://github.com/usmannasir/cyberpanel/issues/1133

https://github.com/usmannasir/cyberpanel/issues/1119
2025-09-21 19:46:10 +02:00
Master3395
53aea56136 Add home directory management features: Introduce models and views for managing user home directories, including dynamic home directory assignment during user creation. Update frontend to allow selection of home directories and display relevant information. Enhance backend logic for home directory migration and statistics retrieval, improving overall user management capabilities. 2025-09-20 21:50:22 +02:00
Master3395
3032dff01d Implement remote connection handling and progress tracking for backup operations: Introduce a method for attempting connections to remote CyberPanel servers with port fallback. Enhance the frontend to display detailed progress and logs during backup transfers, including error handling and notifications for port fallback usage. Update HTML and JavaScript to support new progress tracking features and improve user feedback during backup and restore processes. 2025-09-20 21:31:41 +02:00
Master3395
5364e3e7d1 Add FTP quota management features: Implement getFTPQuotaUsage and migrateFTPQuotas methods in FTPManager for retrieving quota usage and migrating existing users to the new quota system. Update views and URLs to support these new functionalities. Enhance FTPUtilities with methods for applying quotas to the filesystem and retrieving current quota usage. 2025-09-20 21:07:48 +02:00
Master3395
76f6d346f1 Enhance PHP version management in PHPManager: Implement comprehensive detection of PHP versions across multiple methods, including system checks and package manager queries. Add validation and configuration fixing for PHP installations. Introduce methods to retrieve the latest and recommended PHP versions, improving overall reliability and user feedback in the website management process. 2025-09-20 21:01:51 +02:00
Master3395
af434bcb89 Enhance file deletion process in FileManager: Implement detailed logging for file and directory deletion, including security checks and error handling. Improve handling of immutable flags and ensure proper permissions for suspension pages in website management. Add fallback mechanisms for system file deletions and enhance user feedback on operations. 2025-09-20 20:39:35 +02:00
Master3395
c525af21c5 Implement disk usage refresh feature for email accounts. Add a new endpoint and corresponding view to refresh disk usage, ensuring accurate display in the UI. Update JavaScript and HTML templates to support the new functionality, enhancing user experience with real-time updates. Refactor disk usage calculation for improved accuracy and error handling. 2025-09-19 01:09:48 +02:00