REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.70 KB
Close
//proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/cl_website_collector/__main__.py
Text
Base64
# -*- coding: utf-8 -*- # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2024 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENCE.TXT """ CloudLinux website data collector utility Collects Apache configs, system info, and .htaccess files from websites. Note: Data collection and sending is integrated into cloudlinux-summary. """ import argparse import logging import sys from cl_website_collector.website_collector import WebsiteCollector def setup_logging(verbose: bool = False) -> None: """Setup logging configuration.""" log_level = logging.DEBUG if verbose else logging.INFO app_logger = logging.getLogger('cloudlinux-website-collector') app_logger.setLevel(log_level) stream_handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') stream_handler.setFormatter(formatter) app_logger.addHandler(stream_handler) def parse_arguments() -> argparse.Namespace: """Parse command line arguments.""" parser = argparse.ArgumentParser( description='CloudLinux website data collector', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=__doc__ ) parser.add_argument( '--send', action='store_true', help='Send data via API (requires --api-url)' ) parser.add_argument( '--api-url', type=str, default='https://stat-api.cloudlinux.com/api/clos-upload', help='API URL for sending data (default: %(default)s)' ) parser.add_argument( '--system-id', type=str, default='test-system-id', help='System identifier (default: %(default)s)' ) parser.add_argument( '--client-id', type=str, default='000000', help='Client identifier (default: %(default)s)' ) parser.add_argument( '--platform', type=str, default='rhel_like', help='Platform type (default: %(default)s)' ) parser.add_argument( '--panel', type=str, default='cPanel', help='Control panel name (default: %(default)s)' ) parser.add_argument( '--server', type=str, default='apache', help='Server name (default: %(default)s)' ) parser.add_argument( '--dry-run', action='store_true', help='Save data to dry-run.jsonl file instead of sending to server' ) parser.add_argument( '--verbose', '-v', action='store_true', help='Enable verbose logging' ) return parser.parse_args() def main() -> int: """Main entry point.""" args = parse_arguments() # Setup logging setup_logging(args.verbose) logger = logging.getLogger("cloudlinux-website-collector") if not args.send: logger.info("No action specified.") return 1 try: collector = WebsiteCollector(logger=logger) if args.send: collector.send_data( system_id=args.system_id, client_id=args.client_id, platform=args.platform, panel=args.panel, server=args.server, api_url=args.api_url, remote_config_version="dummy_version", # no sense to specify there some real version dry_run=args.dry_run ) logger.info("Data sending completed") return 0 except KeyboardInterrupt: logger.info("Operation interrupted by user") return 130 except Exception as e: logger.error("Operation failed: %s", e) return 1 if __name__ == "__main__": sys.exit(main())
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-04-09 07:08:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
apache_processor.py
11.65 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
constants.py
1.10 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
docroot_processor.py
7.10 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
feature_manager.py
1.45 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
website_collector.py
27.34 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
494 B
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__main__.py
3.70 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).