Commit Graph

27 Commits

Author SHA1 Message Date
master3395
d17b7f1c7d Fix log parsing: correctly reconstruct resource path and timestamp
- Fixed timestamp parsing to combine fields 3 and 4 (timestamp can be split across fields)
- Fixed resource path parsing to handle query parameters (path may span multiple fields)
- Fixed size extraction to use field 9 instead of field 8 (size comes after status code)
- Resource path now correctly reconstructed until HTTP/version field is found
2026-01-19 18:55:56 +01:00
master3395
dfeeeb16a7 Fix: Remove fallback to master domain log file for child domains
- Removed fallback logic that was reading from master domain log file when child domain log file was empty
- This was causing cross-contamination - showing API logs when viewing cmstest logs
- Now only reads from the specific domain's log file as determined by _get_log_file_path()
- Fixed log parsing to correctly extract resource path (field 5) and size (field 8)
- Log format doesn't include domain name, so domain is determined by which log file is read

The issue was that when cmstest log file was old/empty, the code was falling back to
reading from newstargeted.com.access_log which contained logs from all sub-domains,
causing API logs to appear when viewing cmstest logs.
2026-01-19 18:55:32 +01:00
master3395
78a69096ef Add domain filtering to access log display
- Added domain filtering in getDataFromLogFile() to only show log entries for the requested domain
- Handles cases where vhost config hasn't been updated and multiple sub-domains log to the same file
- Filters out entries from other domains even if they're in the same log file
- Added error handling for malformed log entries
- Added fallback to master domain log file if child domain log file doesn't exist or is empty

This ensures that when viewing logs for a sub-domain, only that sub-domain's logs are displayed,
even if the vhost configuration still points to the master domain's log file (which needs to be fixed separately).
2026-01-19 18:49:06 +01:00
master3395
fdf5b2abcb Fix sub-domain log viewing: properly handle child domain log paths
- Added _get_log_file_path() helper method to correctly determine log file paths
- For child domains (sub-domains), logs are stored in master domain's log directory
- Updated getDataFromLogFile() and fetchErrorLogs() to use the helper method
- Fixes issue where sub-domain logs couldn't be viewed in CyberPanel UI
- Logs are now correctly located at /home/{master_domain}/logs/{subdomain}.{access|error}_log

This resolves the bug where viewing logs for sub-domains would fail because
the code was looking for logs in /home/{subdomain}/logs/ instead of the
correct location /home/{master_domain}/logs/{subdomain}.{access|error}_log
2026-01-19 18:39:19 +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
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
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
usmannasir
978d660c5d bug fix: circular import 2025-09-27 14:13:33 +05: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
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
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
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
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
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
usmannasir
339419fc22 debian 12 2025-09-19 14:15:14 +05:00
usmannasir
0dc48bd0b6 debian 12 2025-09-19 12:15:28 +05:00
Master3395
6213ff8fdd Add subdomain log fix functionality and update templates. Introduce new views and URLs for fixing subdomain logs, enhance log configuration handling in the upgrade script, and update vHost configuration paths for better log management. Include a new menu item for accessing the log fix interface. 2025-09-18 22:04:05 +02:00
Master3395
9c9d0f3075 Enhance CyberPanel with new features and improvements, including a file integrity verification system, IP blocking functionality, and support for resetting Apache and vHost configurations to default. Update documentation and guides for better user experience. Fix bandwidth reset issues and improve overall system stability. 2025-09-18 20:45:34 +02:00
usmannasir
232014a4cb feature: ssl status in list websites 2025-08-22 21:10:13 +05:00
usmannasir
f2352bd516 feature: ssl status in list websites 2025-08-22 21:00:03 +05:00
usmannasir
6dd7114f6d Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00