4937 Commits

Author SHA1 Message Date
usmannasir
7864ef63c1 Remove strict exit code checking in database restore functions
- MySQL restore may return warnings that don't indicate actual failure
- Database restoration verification is handled by subsequent password operations
- Improves reliability of compressed backup restoration
2025-10-15 00:53:31 +05:00
usmannasir
10edef5d87 Fix compressed database backup verification logic
- Changed from checking exit code to verifying file existence and size
- Resolves issue where successful mysqldump was incorrectly reported as failed
- Ensures backup file is created and not empty before marking as successful
2025-10-15 00:50:55 +05:00
usmannasir
cac2e09fce Enhance database backup with compression support and backward compatibility
- Added configurable compression for database backups using gzip streaming
- Implemented auto-detection in restore function for compressed and uncompressed formats
- Added performance optimizations including --single-transaction and --extended-insert
- Created configuration file for gradual feature rollout with safe defaults
- Added helper functions for checking system capabilities and configuration
- Included comprehensive test suite to verify backward compatibility
- Maintained 100% backward compatibility with existing backup infrastructure
2025-10-14 19:54:11 +05:00
usmannasir
b6f20a6a5e Add storage stats, last backup info, and error logs to ManageOCBackups page
- Add comprehensive backup account overview with visual stats cards
- Display storage usage (total, used, available, percentage) from platform API
- Show last backup run timestamp and status (success/failed)
- Display total backups count and failed backups count
- Add recent backup error logs table with timestamp, website, and error message
- Fetch all stats from platform.cyberpersons.com/Billing/GetBackupStats endpoint
- Beautiful gradient cards for visual presentation of stats
- Progress bar for storage usage visualization
- Conditional display of error logs (only shown if errors exist)
- Add account info card showing SFTP user and plan name
- Graceful fallback to N/A if platform API is unavailable
- Comprehensive error logging for API failures
2025-10-14 19:11:38 +05:00
usmannasir
fb02243245 Improve One-Click Backup verification with multi-method approach
- Implement timestamp-based filename verification (Method 1)
- Add file size validation with 1KB minimum requirement (Method 2)
- Filter to only check today's backup directory for accuracy (Method 3)
- Add optional SHA256 checksum verification for integrity (Method 5)
- Use find command with size filter for efficient SSH verification
- Fallback to SFTP with comprehensive file validation
- Enhanced logging for all verification steps and failures
- Remove unused 'Yesterday' variable that was never used
- Prevents false positives from old backup files
- Detects corrupted/incomplete backups via size check
2025-10-14 18:49:41 +05:00
usmannasir
c9b711d5bd Fix critical bug in One-Click Backup failure notification logic
- Fix inverted .find() logic that sent notifications when backups SUCCEEDED
- Add 'status': 'failed' field required by platform API
- Change HTTP to HTTPS for BackupFailedNotify endpoint
- Add comprehensive error handling and logging
- Add 30-second timeout on API requests
- Properly handle actualDomain vs site.domain.domain cases
2025-10-14 16:23:41 +05:00
usmannasir
6381a9ee55 Refactor DeployAccount to eliminate code duplication and improve error handling
- Remove duplicate code blocks that handled success and "already deployed" cases
- Consolidate deployment logic into single code path
- Add validation for backup plan state before deployment
- Add specific exception handling for API requests and JSON parsing
- Add timeout to API requests (30 seconds)
- Change API endpoint from HTTP to HTTPS for security
- Improve error messages with actionable guidance
- Add comprehensive logging for all error paths
- Clarify return status: status=1 only on full success, status=0 on any failure
- Add early validation for missing SSH public key
- Handle edge case where account is deployed but destination creation fails
2025-10-14 15:35:02 +05:00
usmannasir
4da45eebf1 Improve exception handling in One-Click Backup fetchOCSites function
- Add specific exception handlers for common failure scenarios
- Support multiple SSH key formats (RSA, Ed25519, ECDSA, DSS)
- Add SSH key validation before connection attempts
- Add connection timeout and proper cleanup with finally block
- Provide actionable error messages for users
- Handle empty backup folders as success instead of error
- Add comprehensive logging for all error paths
- Improve path parsing with bounds checking
2025-10-14 15:31:42 +05:00
usmannasir
7cbb563d9c fix some ux on list wp sites 2025-10-13 13:09:06 +05:00
usmannasir
77e66cfe3d fix design of wp manager home 2025-10-13 00:24:45 +05:00
usmannasir
1ef188a20a bug fix: python 3.6 compatibility 2025-10-10 17:59:01 +05:00
usmannasir
ac6db0e575 bug fix: python 3.6 compatibility 2025-10-10 17:26:50 +05:00
usmannasir
e4b2584ae0 Fix AlmaLinux 8 installation: Add python-dotenv to requirements (v2.4.4)
- Install python-dotenv in virtual environment during CyberPanel setup
- Fixes Django's inability to load .env file on AlmaLinux 8
- Resolves "Access denied for user 'cyberpanel'@'localhost'" errors
- Added to all installation paths (normal, DEV, and after_install)

This ensures Django can properly load database credentials from .env file
on AlmaLinux 8 systems where python-dotenv was missing.
2025-10-10 01:00:22 +05:00
usmannasir
f34377394d Fix AlmaLinux 8 installation: Add python-dotenv to requirements
- Install python-dotenv in virtual environment during CyberPanel setup
- Fixes Django's inability to load .env file on AlmaLinux 8
- Resolves "Access denied for user 'cyberpanel'@'localhost'" errors
- Added to all installation paths (normal, DEV, and after_install)

This ensures Django can properly load database credentials from .env file
on AlmaLinux 8 systems where python-dotenv was missing.
2025-10-10 00:57:24 +05:00
usmannasir
d540b24c8f bug fix: alma8 install 2025-10-10 00:09:42 +05:00
usmannasir
4408ca04c8 bug fix: staging site issue 2025-09-22 18:16:05 +05:00
usmannasir
503c464e48 bug fix: staging site issue 2025-09-22 17:46:10 +05:00
usmannasir
f48e7286df bug fix: staging site issue 2025-09-22 16:57:35 +05:00
usmannasir
ecd44c9d6a bug fix: staging site issue 2025-09-22 14:08:51 +05:00
usmannasir
fb16f4cf56 bug fix: staging site issue 2025-09-22 13:31:20 +05:00
Usman Nasir
32a3fb7b67 Merge pull request #1505 from master3395/v2.5.5-dev
V2.5.5 dev - Enhance bandwidth usage calculation with resource management
2025-09-17 14:22:23 +05:00
Master3395
237cf93db0 Enhance OS detection and support for additional distributions
- Updated OS detection logic to include CentOS Stream and Red Hat Enterprise Linux.
- Added support for AlmaLinux 9 and 10, as well as Debian 11, 12, and 13.
- Improved error messages to reflect the expanded list of supported operating systems.
- Adjusted package management handling for Debian to treat it as Ubuntu for compatibility.
2025-09-17 01:05:48 +02:00
Master3395
694cb03c80 Add firewall rule management features and enhance repository setup
- Implemented functionality to edit existing firewall rules, including validation and error handling.
- Added endpoints for exporting and importing firewall rules in JSON format, allowing users to manage rules more efficiently.
- Enhanced the user interface with modals for editing rules and buttons for exporting/importing rules.
- Updated the `cyberpanel.sh` script to support AlmaLinux 10 and improved LiteSpeed GPG key import with fallback options.
- Refactored repository setup to accommodate different OS versions, ensuring compatibility with CentOS and AlmaLinux.
2025-09-17 00:32:07 +02:00
Master3395
42428bfc6a Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-09-17 00:07:00 +02:00
Master3395
17b4965816 Enhance bandwidth usage calculation with resource management
- Introduced memory and processing time limits to prevent system overload during bandwidth calculations.
- Added error handling for file operations and improved logging for better traceability.
- Implemented batch processing of log lines to manage memory usage effectively.
- Updated methods to safely parse log data and handle large files, ensuring robust performance.
- Refactored code for clarity and maintainability, including the addition of helper functions for file size and memory limit settings.
2025-09-17 00:06:58 +02:00
Master3395
1926cc81bf Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-09-16 23:55:56 +02:00
Master3395
ee6543f6bb Remove deprecated files and enhance IP blocking feature
- Deleted obsolete files: SECURITY_INSTALLATION.md, test.php, and test.sh.
- Improved IP blocking functionality in views.py by adding validation for private and reserved IP addresses, enhancing security against self-blocking.
- Updated error handling to capture specific issues related to IP validation and command execution.
- Revised FIREWALL_BLOCKING_FEATURE.md to reflect new validation and security measures.
2025-09-16 23:53:53 +02:00
Master3395
d8f120e73b Add firewall IP blocking feature and enhance security alerts
- Introduced a new API endpoint to block IP addresses via firewalld, allowing users to manage security directly from the dashboard.
- Updated the front-end to include a button for blocking IPs detected during brute force attacks, enhancing user interaction.
- Revised README.md and documentation to include details about the new firewall blocking feature and its usage.
- Improved the SSH security analysis function to streamline firewall command execution and ensure firewalld is active.
2025-09-16 23:24:41 +02:00
Usman Nasir
6e4080bfbf Merge pull request #1503 from master3395/v2.5.5-dev
V2.5.5 dev - Add Debian 13 support
2025-09-16 14:31:14 +05:00
Master3395
e2dfdd454e Improve container management and Docker Compose generation
- Enhanced port validation in ContainerManager to check for valid port numbers and handle errors gracefully.
- Updated volume handling to ensure proper structure and existence checks.
- Added a new helper function to generate Docker Compose YAML, consolidating logic for service configuration, including ports, volumes, and environment variables.
- Removed duplicate Docker Compose generation code to streamline functionality.
2025-09-15 22:57:49 +02:00
Master3395
e2f06058c6 Enhance OS compatibility and documentation for CyberPanel
- Added support for Debian 11, 12, and 13 in the OS detection logic within cyberpanel.sh.
- Updated README.md to include Debian versions with their respective support timelines.
- Introduced a new Debian 13 Installation Guide in the documentation.
- Revised OS compatibility details in the testPlugin documentation to reflect full support for Debian versions.
2025-09-15 21:34:39 +02:00
usmannasir
26425dd397 bug fix: allowed host issue 2025-09-15 12:07:15 +05:00
usmannasir
d64b53ef63 bug fix: allowed host issue 2025-09-15 11:26:58 +05:00
Master3395
813bd2e4f9 Add CyberPanel port 7080 rule to firewall database for visibility
- Implemented a check to ensure the CyberPanel port 7080 rule exists in the database.
- Added functionality to create the rule if it does not exist, including error handling and logging.
- Updated the rules list after potential creation to reflect changes in the database.
2025-09-15 02:12:27 +02:00
Master3395
96226989b1 Add user notification preferences and related API endpoints
- Introduced a new model `UserNotificationPreferences` to store user-specific notification dismissal settings.
- Added context processor to include notification preferences in templates.
- Implemented API endpoints to dismiss backup and AI scanner notifications permanently.
- Updated front-end logic to handle notification dismissal via server-side checks and API calls.
- Enhanced documentation to include a new Custom CSS Guide for theme customization.
2025-09-15 02:01:11 +02:00
Master3395
792d91461a Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-09-15 01:39:23 +02:00
Master3395
1f3d5afe6a Add PhpMyAdmin access middleware and session check for user authentication
- Updated settings.py to include PhpMyAdminAccessMiddleware for enhanced access control.
- Modified phpmyadminsignin.php to check user session and redirect to the login page if not authenticated.
2025-09-15 01:39:21 +02:00
Master3395
58d9515ac3 Merge branch 'usmannasir:v2.5.5-dev' into v2.5.5-dev 2025-09-15 01:27:35 +02:00
Master3395
1a82700f51 Update PHP version references and improve AlmaLinux 9 compatibility
- Changed PHP symlink from version 8.0 to 8.3 in various scripts to ensure compatibility with the latest PHP version.
- Updated documentation links in the FAQ to point to the new community support page.
- Added checks and fixes for MariaDB installation issues specific to AlmaLinux 9.
- Enhanced the installation script to support additional PHP versions and improve overall installation reliability.
2025-09-15 01:25:52 +02:00
Usman Nasir
7bd67d3df2 Merge pull request #1501 from master3395/v2.5.5-dev
V2.5.5 dev
2025-09-14 22:14:52 +05:00
Master3395
1fbbf66481 Add contributing guide link to README and improve security notice in SECURITY_INSTALLATION.md 2025-09-13 22:34:03 +02:00
Master3395
7bd66f7f06 Enhance environment variable management and security
- Updated .gitignore to include additional sensitive files and directories.
- Added python-dotenv to requirements for loading environment variables.
- Modified settings.py to load environment variables for sensitive configurations, including SECRET_KEY, DEBUG, and database credentials.
- Implemented secure .env file generation during installation to avoid hardcoding sensitive information.
- Introduced fallback method for settings update if environment generation fails.
2025-09-13 19:07:03 +02:00
Master3395
938fb6442b Merge pull request #1 from master3395/stable
Update backup controller to include backup frequency and retention data
2025-09-13 18:53:47 +02:00
Master3395
71275c8c56 Merge branch 'v2.5.5-dev' of https://github.com/master3395/cyberpanel into v2.5.5-dev 2025-09-13 18:39:00 +02:00
Master3395
0773d8d9a4 Add cosmetic context processor and update templates for custom CSS
- Introduced a new `cosmetic_context` processor to provide custom CSS data to templates.
- Updated `settings.py` to include the new context processor.
- Modified multiple HTML templates to utilize the `cosmetic` variable for dynamic CSS styling.
- Enhanced user interface elements with improved styling and accessibility features, including ARIA labels for form controls.
2025-09-13 18:38:57 +02:00
Usman Nasir
0c37a94e66 Merge pull request #1498 from master3395/v2.5.5-dev
V2.5.5 dev - New example plugin + Documentation + Security
2025-09-13 20:45:50 +05:00
Master3395
97fd4e055a Enhance security by adding rel="noopener" to external links
- Updated multiple HTML templates to include rel="noopener" on links that open in a new tab, improving security by preventing potential reverse tabnabbing attacks.
- This change affects various templates across the backup, base, file manager, mail server, and website functions sections.
2025-09-13 17:44:37 +02:00
Master3395
99bf8d9c96 Update backup controller to include backup frequency and retention data
https://www.facebook.com/groups/cyberpanel/permalink/3977223309255954/
2025-09-13 17:36:50 +02:00
Master3395
f95566d3eb Add pull image functionality and enhance error handling
- Implemented a new `pullImage` method in `ContainerManager` to pull Docker images with validation and error handling.
- Added a corresponding URL route for the `pullImage` view.
- Updated the `views.py` to handle user permissions and session management for the new feature.
- Improved error handling across the codebase by replacing `BaseException` with `Exception`.
- Enhanced rate limiting logic to support JSON format for tracking timestamps.
- Updated UI styles in `manageImages.html` for consistency in gradient backgrounds.
2025-09-12 22:35:02 +02:00
Master3395
1f4a577077 Enhance environment variable management with advanced mode and import/export features
- Implement advanced environment variable mode for bulk editing and easier management.
- Add functionality to import environment variables from existing Docker containers.
- Introduce export options for environment variables to .env files.
- Update UI to toggle between simple and advanced modes, with corresponding input fields.
- Enhance Docker Compose integration with environment variable handling and user guidance.
2025-09-12 21:10:06 +02:00