|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/xray/internal/__pycache__/ |
�
e�"j| �
�J � d Z ddlZddlZddlZddlZddlZddlmZ ddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmc mZ ddlmZ ddlmZmZ ddlmZ ddlmZ ddlmZmZmZm Z m!Z!m"Z"m#Z# dd l$m%Z%m&Z&m'Z' ddl(Z(dd
l)m*Z* ddl+m,Z, ddl-m.Z. dd
l/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZB ddlCmDZDmEZEmFZFmGZGmHZHmIZI ddlJmKZKmLZL e jM d� � ZNeOePejQ fZRde%de%fd�ZSde%de%fd�ZTde%de%fd�ZUdeVfd�ZWdefd�ZXd eVdefd!�ZYdeZfd"�Z[d#e&e\ deZfd$�Z]d#e&e\ deZfd%�Z^deZfd&�Z_eFfd'eZd(eZddfd)�Z`eFfd(eZdeZfd*�ZadeZfd+�Zade'eb fd,�ZceUdeZfd-�� � Zdd.eZde'eZ fd/�Zede'eZ fd0�Zfd^d1�ZgeGfd2eZde'eZ fd3�Zh eji d4� � Zjd5eZddfd6�Zkd5eZd7eldelfd8�Zmd9eZd:eZddfd;�Znd<eZdd=fd>�Zod?eVdeVfd@�Zpd5eZde'eq fdA�Zrd5eZde'eZ fdB�Zsd_d5eZddfdC�Ztd5eZdebfdD�ZudebfdE�ZvdebfdF�ZwdGebddfdH�ZxdebfdI�ZydebfdJ�ZzdebfdK�Z{d.eZdebfdL�Z|dM� Z}ed`dP�� � Z~edadReZdSebfdT�� � ZedbdUeVddfdV�� � Z�e dcdYeVdZeVdUeVddfd[�� � Z�ed\� � � Z�d]� Z�dS )dzB
This module contains helpful utility functions for X-Ray Manager
� N)�getuser)�contextmanager)�date� timedelta��wraps)�glob)�socket�fromfd�AF_UNIX�SOCK_STREAM�
SOCK_DGRAM�AF_INET�AF_INET6)�Callable�List�Optional)�AtexitIntegration)�LoggingIntegration)�Feature)�is_panel_feature_supported�get_cp_description� getCPName�is_wp2_environment)�get_cl_edition_readable)�UIConfig)�drop_privileges)�get_rhn_systemid_value)�get_hostname)�php_get_vhost_versions_user)�gettext� )�
sentry_dsn�local_tasks_storage�
agent_file�
logging_level�jwt_token_location�user_agent_sock)� XRayError�XRayManagerExit�utils�func�returnc �F � �� d� �t � � � � �fd�� � }|S )zf
Decorator aimed to update ini file in cagefs-skeleton
Applies to task.add nd task.remove
c � � t j � | d j d� � }|� d� � r8t d� � r)t j � d|dd� � � }n�|� d� � r�t d � � r�t j � d |dd� � � }t j � t j � |� � � � s1t j t j � |� � � � ndS t j � |� � s�t j � |� � r�t j �
|� � r t � d
d|i�� � dS t j
|� � dS # t $ r7}t � d
|t |� � d��� � Y d}~dS d}~ww xY wdS t j �
|� � r t � dd|i�� � dS t! |d� � 5 }|� � � }ddd� � n# 1 swxY w Y t j |t j t j z t j z t j z d� � } t j ||� � t j |� � dS # t j |� � w xY w# t $ r7}t � d|t |� � d��� � Y d}~dS d}~ww xY w)zd
Copy ini file to cagefs-skeleton
Action takes place for cPanel ea-php only
r zxray.iniz/opt/cpanelz/usr/share/cagefsz"/usr/share/cagefs/.cpanel.multiphpr"