403Webshell
Server IP : 62.60.133.156  /  Your IP : 216.73.217.51
Web Server : LiteSpeed
System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : mimradmin ( 1166)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/cloudlinux-xray-regenerate-ini.py
#!/opt/cloudlinux/venv/bin/python3 -sbb
# -*- coding: utf-8 -*-

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

"""
Script to regenerate xray.ini files for CageFS users.

This script is called by cagefsctl when enabling website isolation
to ensure xray.ini files are copied to per-website directories.

The script only copies existing xray.ini files with active tracing tasks.
If a user has no active tracing tasks, nothing is done.

Usage:
    cloudlinux-xray-regenerate-ini --user=USERNAME

Options:
    --user=USERNAME     Username to regenerate ini files for (required)
    --domain=DOMAIN1,DOMAIN2  Comma-separated list of domain names to regenerate ini files for (required)
"""

import argparse
import logging
import os
import sys

from xray.reconfiguration.website_isolation import regenerate_ini_for_website_isolation

# Only root can run this script
if os.geteuid() != 0:
    print("This script must be run as root", file=sys.stderr)
    sys.exit(1)

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s'
)


def main():
    parser = argparse.ArgumentParser(
        description='Regenerate xray.ini files for CageFS users'
    )
    parser.add_argument(
        '--user',
        type=str,
        required=True,
        help='Username to regenerate ini files for'
    )
    parser.add_argument(
        "--domain",
    type=str,
    required=True,
    help="Domain name associated with the website isolation")
    args = parser.parse_args()

    domains = args.domain.split(',')
    for domain in domains:
        domain = domain.strip()
        try:
            regenerate_ini_for_website_isolation(args.user, domain)
        except Exception as e:
            logging.error('Failed to regenerate xray.ini for domain %s: %s', domain, str(e))
            continue
    return 0


if __name__ == '__main__':
    sys.exit(main())

Youez - 2016 - github.com/yon3zu