- 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
- 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.
- 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).
- 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
- 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.
- 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.
- 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
- 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.