????
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/__pycache__/wpos_admin.cpython-311.pyc |
� tfP� � �b � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlm Z d dlmZ d dlmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZmZmZmZm Z d d l!m"Z" d d l#m$Z$ d dl%m&Z&m'Z' d dl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 d d l1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 d dl:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZE d dlFmGZG d dlHmIZI d dlJmKZK d dlLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\ d dl]m^Z^ d dl_m`ZambZb d dlcmdZdmeZe d dlfmgZgmhZhmiZi d dljmkZk d dllmmZmmnZn d dlompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm�Z�m�Z�m�Z�m�Z� d dl�m�Z�m�Z�m�Z�m�Z� d dl�m�Z�m�Z�m�Z� d dl�m�Z�m�Z� d dl�m�Z� d dl�m�Z� d dl�m�Z� d d l�m�Z�m�Z�m�Z� ead!� � Z� ead"� � Z� edd#d$eed%�&� � Z� ege�� � Z� G d'� d(e�� � Z�d)e�d*e�d+ee�e)f d,ee�e)f fd-�Z�d.� Z�d)e�d*e�d/ee� d0ee� fd1�Z�d)e�d2eee�e�e�f fd3�Z�d4� Z� d:d5e|d6e�dz d7e�dz d8e�dz d2df d9�Z�dS );� )�absolute_importN)�deepcopy)�asdict)�Dict�Iterator�Set�Tuple�List�Optional)�Enum)� pid_exists)�cpusers�userdomains�is_admin�cpinfo� getCPName)�get_or_create_unique_identifier��migrate_configs)�install_cron_files�clean_clwpos_crons)� FeatureStatus�FeatureStatusEnum�AdminSuitesConfig�any_suite_visible_on_server�is_module_visible_for_user�StatusSource�extract_suites�is_suite_visible_for_user)�ALL_OPTIMIZATION_FEATURES�OBJECT_CACHE_FEATURE�CDN_FEATURE�enable_without_config_affecting� disable_without_config_affecting�DocRootPath�SITE_OPTIMIZATION_FEATURE�Feature)� ALL_SUITES�any_suite_allowed_on_server�get_suites_allowed_path�get_admin_suites_config�write_suites_allowed�extract_features�is_module_allowed_for_user�PremiumSuite�CDNSuitePro�CDNSuite�AWPSuite)�drop_privileges)� WposError)� UserConfig)�ALT_PHP_REDIS_ENABLE_UTILITY�CLWPOS_UIDS_PATH�PHP_REDIS_ENABLE_UTILITY�SUITES_MARKERS�MIGRATION_NEEDED_MARKER� SCAN_CACHE�ADMIN_ENABLE_FEATURE_STATUS�ADMIN_ENABLE_FEATURE_PID�$ADMIN_UPDATE_OBJECT_CACHE_BANNER_PID�USERS_PLUGINS_SYNCING_PID�CLN_URL�SMART_ADVICE_ROOT_UTILITY�ON_OFF_IDENTIFIERS�XRAY_MANAGER_UTILITY�CLWPOS_WHMCS_STATS_FILE�MANAGE_SUITE_IN_CLN_DOC)�reload_redis)�gettext�billing)�ArgumentParser�CustomFormatter)� setup_logging�init_wpos_sentry_safely�ADMIN_LOGFILE_PATH)� NoPackage)�ReportGenerator�ReportGeneratorError)�catch_error�error_and_exit� print_data�check_license_decorator�set_wpos_icon_visibility�acquire_lock�write_public_options�get_pw�is_redis_configuration_running�install_monitoring_daemon�get_server_wide_options�is_ui_icon_hidden�ServerWideOptions�daemon_communicate�ExtendedJSONEncoder�is_shared_pro_safely�get_supported_suites�jwt_token_check�should_xray_user_agent_enabled�should_xray_user_agent_disabled)�get_backup_folders�backup_accelerate_wp�+restore_accelerate_wp_public_options_backup�%make_accelerate_wp_backups_deprecated)�install_panel_hooks�"install_yum_universal_hook_alt_php�_uninstall_hooks)�setup_mount_dir_cagefs�_remount_cagefs��fill_current_wpos_statistics)�has_wps)� disable_quota)�configure_accelerate_wp�configure_accelerate_wp_premium�configure_accelerate_wp_cdnz{Unable to run CL AccelerateWP daemon. Caching databases won't start and work. You can find detailed information in log filez�Configuration of PHP redis extension is running in background process. This may take up to several minutes. Until the end of this process functionality of CL AccelerateWP is limited.z/usr/bin/clwpos-adminz3Utility for control CL AccelerateWP admin interfaceF)�formatter_class�allow_abbrevc � � e Zd ZdZ G d� de� � Zd� Zed� � � Zd� Z e d� � � Ze d� � � Ze d � � � Z d edz dedz fd �Ze� � � defd�� � Zee� dd�� � e� ddd�� � e� � � edefd�� � � � � � � � � � Zee� ddd�� � e� � � ed� � � � � � � � � Zee� � � edefd�� � � � � � Zee� � � edefd�� � � � � � Ze dFd�� � Zedefd�� � Zd � Zd!ee fd"�Zd#� Z edefd$�� � Z!d%� Z"d&� Z#eed'� � � � � Z$edefd(�� � Z%defd)�Z&edefd*�� � Z'ed+� � � Z(d,� Z)d-� Z*d.� Z+d/� Z,d0� Z-ee� � � d1� � � � � Z.ee� � � dGdefd2�� � � � Z/ee� � � d3� � � � � Z0ee� � � d4� � � � � Z1e d5e2d6e3defd7�� � Z4d8� Z5d9ed:ee d;e6d<e7d=e8j9 d>e:d?ed@ede;ee<e f fdA�Z=dB� Z>dC� Z?dDefdE�Z@dS )H�CloudlinuxWposAdminz6 Class for run cloudlinux-wpos-admin commands c � � e Zd ZdZdZdZdZdS )�"CloudlinuxWposAdmin.EnablingStatuszH Basic statuses while feature is enabling in background �idle�progress�doneN)�__name__� __module__�__qualname__�__doc__�IDLE�PROGRESS�DONE� � �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/wpos_admin.py�EnablingStatusrz � s) � � � � � � � � �������r� r� c �F � d| _ | t t � � | _ t | j � � d| _ d| _ t t j � d� � � � | _ | j rt j | _ d S t j | _ d S )NFz/var/clwposzmodules_allowed.json�CL_WPOS_WAIT_CHILD_PROCESS)�_is_jsonrK r~ �_loggerrL �clwpos_path�modules_allowed_name�bool�os�environ�get�wait_child_process� subprocess�run� exec_func�Popen��selfs r� �__init__zCloudlinuxWposAdmin.__init__� s� � ��� ��&�$�X�.�.������-�-�-�(���$:��!�"&�r�z�~�~�6R�'S�'S�"T�"T����"� .�'�^�D�N�N�N�'�-�D�N�N�Nr� c �� � | � |� � | _ d| _ t | | j j � dd� � � � � � }t | j |� � dS )zs Run command action :param argv: sys.argv[1:] :return: clwpos-user utility retcode T�-�_N)�_parse_args�_optsr� �getattr�command�replacerS )r� �argv�results r� r� zCloudlinuxWposAdmin.run� sd � � �&�&�t�,�,�� ��� �D���t�z�1�9�9�#�s�C�C�D�D�F�F���4�=�&�)�)�)�)�)r� c � � t ��N)�NotImplementedError)r� r� s r� r� zCloudlinuxWposAdmin._parse_args� s � �!�!r� c � � | D ]{}t j |� � ret j � t j |� � � � s4t t j |� � d� � � � � �|d S )N�w)r9 r� r� �path�isfile�open�close��suites_list�suites r� �_create_markersz#CloudlinuxWposAdmin._create_markers� sw � � � =� =�E��!�%�(�(� =������@R�SX�@Y�@Y�1Z�1Z� =��^�'��.�.��4�4�:�:�<�<�<�� =� =r� c �� � | D ]m}t j |� � rWt j � t j |� � � � r&t j t j |� � � � �nd S r� )r9 r� r� r� r� �unlinkr� s r� �_clear_markersz"CloudlinuxWposAdmin._clear_markers� so � � � 5� 5�E��!�%�(�(� 5�R�W�^�^�"�&�u�-�-�./� ./� 5�� �.�,�U�3�3�4�4�4�� 5� 5r� c � � | dk S )N�onr� )�opts r� �_is_truezCloudlinuxWposAdmin._is_true� s � ��d�{�r� r� N�returnc �4 � |�d n| � |� � S r� )r� )r� r� s r� �_nullable_bool_from_optz+CloudlinuxWposAdmin._nullable_bool_from_opt� s � ��{�t�t�� � �c�(:�(:�:r� c �< � t � � }nT# t t t t f$ r4}| j � dt |� � � � i cY d}~S d}~ww xY w|D ]�}t |� � }t |� � 5 t |� � D ]k\ }}}t |t j � t j |� � j |� � � � }t% t'