Commit Graph

5120 Commits

Author SHA1 Message Date
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
usmannasir
aff2f5f9c2 fix: Handle MariaDB socket authentication in changeMYSQLRootPassword()
- Add socket authentication support (sudo mysql/mariadb) for fresh MariaDB installs
- Fallback to traditional password-based authentication for existing installs
- Improve error handling with subprocess.run() and proper timeouts
- Add detailed logging to show which authentication method succeeded
- Graceful degradation when all methods fail
- Fixes installation failure when MariaDB is pre-installed as dependency

Resolves issue where installation fails with 'Cannot update settings with empty passwords'
when MariaDB gets installed during dependency phase with socket authentication.
2025-09-28 13:19:30 +05:00
usmannasir
db54c62010 bug fix: cyberpanel db 2025-09-28 03:27:18 +05:00
usmannasir
9336ade62a bug fix: cyberpanel db 2025-09-28 03:07:06 +05:00
usmannasir
46d7337bc6 bug fix: cyberpanel db 2025-09-28 02:50:33 +05:00
usmannasir
df9567a656 bug fixes to isntall code 2025-09-28 02:00:25 +05:00
usmannasir
14f46b6e56 bug fixes to isntall code 2025-09-28 00:05:35 +05:00
usmannasir
978d660c5d bug fix: circular import 2025-09-27 14:13:33 +05:00
usmannasir
3d19448b0d bug fix: circular import 2025-09-27 13:38:57 +05:00
usmannasir
ea3f74b0b9 add missing models to website.py 2025-09-27 13:09:20 +05:00
usmannasir
ec159448af bug fix: staging site issue 2025-09-27 11:41:16 +05:00
Master3395
f778c95f88 Merge pull request #1569 from master3395/v2.5.5-dev
V2.5.5 dev
2025-09-25 23:05:24 +02:00
Master3395
3f4b54551e Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-09-25 23:04:57 +02:00
Master3395
79b697ba26 Refactor CyberPanel installation and upgrade scripts for live progress monitoring
- Updated the installation and upgrade processes to provide live output monitoring instead of background execution.
- Enhanced logging by creating dedicated directories for installation and upgrade logs.
- Improved error handling to display relevant exit codes and log information upon failure.
- Removed deprecated progress tracking logic for a more streamlined user experience during installation and upgrades.
2025-09-25 23:04:55 +02:00
Master3395
28fb945a68 Merge pull request #1568 from master3395/v2.5.5-dev
V2.5.5 dev
2025-09-25 22:46:35 +02:00
Master3395
d93e3a0439 Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-09-25 22:45:37 +02:00
Master3395
fd6eb8895c Update repository URLs to use secure HTTPS links
- Changed repository URLs in the CyberPanel upgrade script and related installation scripts to use HTTPS for improved security.
- Updated the `mailscannerinstaller.sh` and `spamassassin_tojunk_installer.sh` scripts to reflect the new secure URLs.
- Modified the `install.py` script to include an additional parameter in the `update_settings_file` method for better password management.
2025-09-25 22:45:35 +02:00
Master3395
f9545f475a Merge pull request #1567 from master3395/v2.5.5-dev
Remove deprecated environment configuration and testing scripts
2025-09-25 22:30:20 +02:00
Master3395
afa0158a3b Remove deprecated environment configuration and testing scripts
- Deleted the .env.template file and the env_generator.py script to streamline the installation process.
- Removed various test scripts related to installation and compatibility checks, as they are no longer necessary with the updated configuration approach.
- Updated settings.py to directly include secure credentials, eliminating the need for external environment files.
- Enhanced security by ensuring sensitive information is handled directly within the application code.
2025-09-25 22:29:53 +02:00
Master3395
795aeabb21 Merge pull request #1566 from master3395/v2.5.5-dev
V2.5.5 dev
2025-09-25 21:29:27 +02:00
Master3395
0a56779336 Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-09-25 21:29:06 +02:00
Master3395
697a9c565a Update CyberPanel installation script to support version-specific downloads
- Modified the download logic to use a version-specific URL for the installation files.
- Added conditional checks to determine the appropriate installation directory based on the selected installer URL.
- Updated user feedback to inform about the availability of the v2.5.5-dev version and guide users on alternative options if it's not available.
2025-09-25 21:28:36 +02:00
Master3395
3c3b1fbac5 Merge pull request #1565 from master3395/v2.5.5-dev
Enhance CyberPanel installation script with improved database user ma…
2025-09-25 21:23:22 +02:00
Master3395
432ffe6c46 Enhance CyberPanel installation script with improved database user management and password handling
- Added functionality to drop and recreate the 'cyberpanel' database user with proper permissions.
- Implemented verification for the database user creation process, including an alternative method if the initial attempt fails.
- Set a unified password for both CyberPanel and OpenLiteSpeed, ensuring consistency across services.
- Improved PHP configuration handling by establishing a reference PHP version for creating missing php.ini files.
- Updated service restart and installation verification messages to include access details and default credentials for both CyberPanel and OpenLiteSpeed.
2025-09-25 21:22:57 +02:00
Master3395
73dbcf48cb Merge pull request #1564 from master3395/v2.5.5-dev
Add force reinstall option and cleanup functions to CyberPanel instal…
2025-09-25 20:47:33 +02:00
Master3395
16ec4f6154 Add force reinstall option and cleanup functions to CyberPanel installation script
- Introduced a new function to check if CyberPanel is already installed and clean up existing installations if necessary.
- Added a force reinstall option in the main menu, allowing users to completely remove and reinstall CyberPanel.
- Enhanced user prompts and feedback during the cleanup and reinstallation process to improve clarity and user experience.
2025-09-25 20:47:02 +02:00
Master3395
c943969f9f Merge pull request #1563 from master3395/v2.5.5-dev
Add post-installation fixes and verification to CyberPanel installati…
2025-09-25 20:27:45 +02:00