HEX
Server: LiteSpeed
System: Linux osault1.hostarmada.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: tucom (1048)
PHP: 8.4.24
Disabled: NONE
Upload Files
File: //opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/__pycache__/wpos_admin.cpython-311.pyc
�

�wlj~*����ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZddlmZmZmZmZmZmZddlmZddlmZddlmZdd	lmZm Z m!Z!m"Z"m#Z#dd
l$m%Z%ddl&m'Z'ddl(m)Z)m*Z*dd
l+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ddl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<ddl=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJddlKmLZLddlMmNZNddlOmPZPddlQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZaddlbmcZcddldmeZfmgZgddlhmiZimjZjddlkmlZlmmZmmnZnddlompZpddlqmrZrmsZsddltmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZm�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z�ddl�m�Z�m�Z�ddl�m�Z�ddl�m�Z�dd l�m�Z�dd!l�m�Z�m�Z�m�Z�efd"��Z�efd#��Z�eid$d%ejd&�'��Z�ele���Z�d(Z�e	j�d)��Z�Gd*�d+e���Z�d,e�d-e�d.ee�e,fd/ee�e,ffd0�Z�d1�Z�d2�Z�d,e�d-e�d3ee�d4ee�fd5�Z�d,e�d6eee�e�e�ffd7�Z�d8�Z�			d>d9e�d:e�dzd;e�dzd<e�dzd6df
d=�Z�dS)?�)�absolute_importN)�deepcopy)�asdict)�Dict�Iterator�Set�Tuple�List�Optional)�Enum)�5is_smart_advice_wordpress_plugin_disabled_server_wide)�
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�BILLABLE_SUITES�UNSUPPORTED_SUITES_FOR_RESELLER�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_accelerate_wp_version�is_user_owned_by_reseller�ensure_maxcache_available)�get_backup_folders�backup_accelerate_wp�+restore_accelerate_wp_public_options_backup�%make_accelerate_wp_backups_deprecated)�install_dynamic_panel_hooks�"install_yum_universal_hook_alt_php�!install_yum_universal_hook_ea_php�$install_yum_universal_hook_plesk_php�$uninstall_yum_universal_hook_alt_php�#uninstall_yum_universal_hook_ea_php�&uninstall_yum_universal_hook_plesk_php�uninstall_dynamic_panel_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_abbrev�ALLz^[a-zA-Z0-9._-]+$c��eZdZdZGd�de��Zd�Zed���Zd�Z	e
d���Ze
d���Ze
d	���Z
d
edzdedzfd
�Ze���defd���Zee�dd���e�ddd���e�ddd���e���edefd�������������Zee�ddd���e���ed���������Zee���edefd�������Zee���edefd�������Ze
dLd ���Zd!eedeefd"�Zedefd#���Zd$�Zd%�Z d&eefd'�Z!d(�Z"edefd)���Z#d*�Z$d+�Z%eed,�����Z&edefd-���Z'defd.�Z(edefd/���Z)ed0���Z*d1�Z+d2�Z,d3�Z-d4�Z.d5�Z/ee���d6�����Z0ee���dMdefd7�����Z1ee���d8�����Z2ee���d9�����Z3e
d:e4d;e5defd<���Z6d=�Z7d>ed?eed@e8dAe9dBe:j;dCe<dDedEede=ee>effdF�Z?dG�Z@dH�ZAdIefdJ�ZBedK���ZCdS)N�CloudlinuxWposAdminz6
    Class for run cloudlinux-wpos-admin commands
    c��eZdZdZdZdZdZdS)�"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�EnablingStatusr��s)������	�	��������r�r�c�F�d|_|tt��|_t	|j��d|_d|_ttj	�
d����|_|jrtj
|_dStj|_dS)NFz/var/clwposzmodules_allowed.json�CL_WPOS_WAIT_CHILD_PROCESS)�_is_jsonrNr��_loggerrO�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�8�|�|��|_d|_|j�dt|j����t
||jj�dd������}t|j|��dS)zs
        Run command action
        :param argv: sys.argv[1:]
        :return: clwpos-user utility retcode
        Tz6CloudLinux Admin CLI command called with arguments: %s�-�_N)
�_parse_args�_optsr�r��info�str�getattr�command�replacerV)r��argv�results   r�r�zCloudlinuxWposAdmin.run�s����%�%�d�+�+��
���
�����R�TW�X\�Xb�Tc�Tc�d�d�d�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]{}tj|��retj�tj|����s4ttj|��d������|dS)N�w)r<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}tj|��rWtj�tj|����r&tjtj|�����ndSr�)r<r�r�r�r��unlinkr�s  r��_clear_markersz"CloudlinuxWposAdmin._clear_markers�sj�� �	5�	5�E��!�%�(�(�
5�R�W�^�^�N�<N�u�<U�<U�-V�-V�
5��	�.�,�U�3�3�4�4�4��	5�	5r�c��|dkS)N�onr�)�opts r��_is_truezCloudlinuxWposAdmin._is_true�s���d�{�r�r�N�returnc�4�|�dn|�|��Sr�)r�)r�r�s  r��_nullable_bool_from_optz+CloudlinuxWposAdmin._nullable_bool_from_opt�s���{�t�t��
�
�c�(:�(:�:r�c�<�	t��}nT#ttttf$r4}|j�dt|����icYd}~Sd}~wwxYw|D]�}t|��}t|��5t|��D]k\}}}t|tj
�tj|��j|����}t%t'|��|||����l	ddd��n#1swxYwY��iS)zy
        This command used during downgrade to lve-utils, which version does not support clwpos
        :return:
        z"Can't get user list from panel: %sN��module�domain)r�OSError�IOError�
IndexErrorrQr��warningr�rr6�_enabled_modules�_extract_domainr�r��join�pwd�getpwnam�pw_dirr%r&)	r��users�e�username�user_domains�doc_root�wp_pathr�r�s	         r��uninstall_cache_for_all_domainsz3CloudlinuxWposAdmin.uninstall_cache_for_all_domains�s|��	��I�I�E�E����*�i�8�	�	�	��L� � �!E�s�1�v�v�N�N�N��I�I�I�I�I�I�����	�����	s�	s�H�&�x�0�0�L� ��*�*�
s�
s�1A�(�1K�1K�s�s�-�H�g�v�,�\�2�7�<�<���U]�H^�H^�He�go�;p�;p�q�q�F�4�[��5J�5J�G�\b�kq�r�r�r�r�r�s�
s�
s�
s�
s�
s�
s�
s�
s�
s�
s�
s����
s�
s�
s�
s���	s-��A"�)A�A"�A"�A<D�D	�D	�--suiteszPass suites to be configured)�helpz--setupz3Configures AccelerateWP for further suites allowing�
store_true)r��actionz--backupz+Create backup of AccelerateWP configurationc
��|jjr�	t��nq#t$rd}|j�d��t
|jtd��tt|�����d���Yd}~nd}~wwxYw|jjrEtj
�tt j��st%dd���|jjred	�|jj�d
��D��}t*j|vrt-d���t.j|vrt1d���iS)zV
        Internal command to be used from WHMCS to preconfigure needed suites
        z"Cannot backup AccelerateWP configsz.Cannot backup AccelerateWP configs: %(reason)s)�reason�r��contextNT�BILLING_OVERRIDE)�async_set_suite�sourcec�6�g|]}|�����Sr���strip��.0r�s  r��
<listcomp>z1CloudlinuxWposAdmin.set_whmcs.<locals>.<listcomp>s ��N�N�N��e�k�k�m�m�N�N�Nr��,)r�)r��backuprl�	Exceptionr��	exceptionrUr�r��dictr��setupr�r��existsr<r5�namer}�suites�splitr2r~r3r)r�r�r�s   r��	set_whmcszCloudlinuxWposAdmin.set_whmcsso���:��	�
�$�&�&�&�&���
�
�
���&�&�'K�L�L�L���M� �!Q�R�R�_c�kn�op�kq�kq�_r�_r�_r�s�s�������������
�����:��	U�B�G�N�N�>�(�-�3P�$Q�$Q�	U�#�D�AS�T�T�T�T��:��	G�N�N���1B�1H�1H��1M�1M�N�N�N�F�� �F�*�*�/�7I�J�J�J�J���6�)�)�+�3E�F�F�F�F��	s��
B�AB�Bz--jsonzPass statistics in json formatT)r��requiredc�6�	tj|jj��n,#tj$rt	|jddi��YnwxYwt
td��5}|�|jj��ddd��n#1swxYwYiS)zn
        Saves statistics in json file in order to be later
        utilized by the get-stat command.
        r�zMalformed json passedr�N)	�json�loadsr��JSONDecodeErrorrUr�r�rG�write)r��fs  r��set_whmcs_statz"CloudlinuxWposAdmin.set_whmcs_stat!s���	O��J�t�z��'�'�'�'���#�	O�	O�	O��4�=�8�5L�*M�N�N�N�N�N�	O�����)�3�
/�
/�	%�1�
�G�G�D�J�O�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%��	s!�!�&A
�	A
�" B�B�Bc���t��}g}	d�t��D��}n�#t$r%}|j�d|��Yd}~n[d}~wt
$rK}|j�d|��t
|jdt|���d���Yd}~nd}~wwxYwt��|tj|jtj|jid�S)	zM
        Internal command to be used from WHMCS to get server config
        c��g|]	}|j��
Sr��r�)r��entrys  r�r�z8CloudlinuxWposAdmin.get_whmcs_config.<locals>.<listcomp>?s��K�K�K�U�e�j�K�K�Kr�z5The folder with backups does not exist yet, error: %sNz4Cannot get backup folders of AccelerateWP, error: %sz4Cannot get backup folders of AccelerateWP: %(error)s)�errorr�)�accelerate_wp_version�backup_folders�upgrade_url)r^rk�FileNotFoundErrorr�r�r�rUr�r�rhr2r�r
r3�upgrade_url_cdn)r��server_wide_optionsr	r�s    r��get_whmcs_configz$CloudlinuxWposAdmin.get_whmcs_config4s3��6�7�7����		�K�K�6H�6J�6J�K�K�K�N�N�� �	_�	_�	_��L�"�"�#Z�\]�^�^�^�^�^�^�^�^������	�	�	��L�"�"�#Y�[\�]�]�]���
�Q�^b�ij�^k�^k�^k�l�l�
�
�
�
�
�
�
�
�����	����&?�%@�%@�,��!�#6�#B�� �"5�"E��
�
�	
s!�+�
B-�A�
B-�"AB(�(B-c�>�t��t��iS)z`
        Internal command to be used from WHMCS to restore previous states from backups
        )rmrnr�s r��restore_whmcs_backupz(CloudlinuxWposAdmin.restore_whmcs_backupRs!��	4�5�5�5�-�/�/�/��	r�c�F�|s	||jvSt||d���S)zq
        if not users passed -> check default visibility value
        otherwise check for specific user
        r�r�)�visible_suitesr )�
suite_name�defaults�users   r��_could_be_allowedz%CloudlinuxWposAdmin._could_be_allowed]s1���	9���!8�8�8�(��d�1�g�F�F�F�Fr��	user_listc��|D]O}t�|��s3t|jt	d��t|���d����P|S)z�
        Reject usernames carrying a list delimiter / whitespace / shell
        metacharacter before they reach the comma-split target set, so a single
        malformed value cannot expand the operation to unrelated accounts.
        zInvalid username: %(user)s�rr�)�VALID_USERNAME_RE�matchrUr�r�r�)r�rrs   r��_validate_usersz#CloudlinuxWposAdmin._validate_usersgsc���	w�	w�D�$�*�*�4�0�0�
w��t�}��;W�9X�9X�ei�os�et�et�et�.u�.u�v�v�v���r�c��t��}|jjtkr!t	tj����}n)d�|jj�d��D��}d}g}t��}d\}}d}d}	|D]}
|
tvrd}n�tj|vrttd���}tj|vrttd���}|j�dt%|��t%|��t%|��t%|����|jjr<|�d�|jj�d��D����}|D�]2}|t
vr3t+|jt/d	��t1|�
��d���|jjs$|jjs|jjs|jjrI|t;��vr9t+|jt/d��t1|t<�
��d���i}t
|j}
|
D]�}|jj rS|j|jj vr@|j!�9t+|jt/d��t1|j���d����a|jj s|j!�|j!||j<��|j|jj vr2|�"|jj |j��||j<��|jjr�|jj#r�tItJ|jj#��tJj&krU|�'tPj||���s3t+|jt/d��t1|�
��d�����4|jj!r7tS|��dkr$t+|jdt/d��i��|jj r7tS|��dkr$t+|jdt/d��i��|jj r0|jjr$t+|jdt/d��i��d�|D��}|jjr^|j�d��tTj+�,tZ��s t]���/��|jjr*ta��}dx}}|�1|��d}n�|jj2rCta��}dx}}d}tgd�|D����}	|�4|��n�|jjr*ta��}d}d}|�4|��d}nb|jj!r-t��}|d|j5v}|d|j6v}n)|jjr|jj}d}n|jjx}}|o|}|ot|vo|}|ot|vo|}i}|rMtod��\}}}|r8|j�8d||��|�9dtti��d}|otS|��dk}|jj#r tItJ|jj#��}nd}|jj;rty��}|D�]U}	|�=|||rt|j?n|rt|j@nt|jA|pRtg|jj|jj2|jj|jj!f��rtJjBntJjC|jjD|||��\}}nn#t�$ra}|r*|j�8d|t%|�����|j�Fd|t%|����d}Yd}~nd}~wwxYw|rd}��|jjr.|�Gd |gt�jIt�jI�!����W|rKt���r=t�d�"��t���5} d| _Mddd��n#1swxYwYt�|��r3|�Gt�d#gt�jIt�jI�!��|jjr;|�Gd gt�jIt�jI�!��t���|r,t�t�d$d|jS�%��t���|r�|�9dt�i��|�Gt�gt�jIt�jI�!��|�Gt�gt�jIt�jI�!��t���t���t���n5|r3t|vr*t���r|�9dt�i��|s|r9t�t�j^t�ttg|||g��d�&��|jjs|jjrWtTj+�,t���r3|j�d'��tUjat���t���sY|jjrMtTj+�cd(��r.|�Gd(d)gt�jIt�jI�!��|r,t+|jt/d*��d+t�id���|�e||��|jj2r|	rt���|�s t���st���t���t���t���t���t�d�"��tTj+�cd(��r.|�Gd(d)gt�jIt�jI�!��t���5} d| _Mddd��n#1swxYwYt���r3|�Gt�d,gt�jIt�jI�!��|jjs|jjrW|rC|j�d-��|�l��|�m|��t�d.dd/���|jjro|jj#rctItJ|jj#��tJj&kr6|�od�p|��d0d1|jj�2��|�Gd3d4gt�jIt�jI�!��|S)5zG
        Write info related to module allowance into user file
        c�6�g|]}|�����Sr�r�r�s  r�r�z2CloudlinuxWposAdmin._set_suite.<locals>.<listcomp>{s ��S�S�S�U�5�;�;�=�=�S�S�Sr�r�F)FFT)�	use_cachez�Initial AccelerateWP statuses: fist_activation=%s, is CDN already visible=%s, is AccelerateWP Premium already visible=%s,server wide defaults=%sc�6�g|]}|�����Sr�r�)r�rs  r�r�z2CloudlinuxWposAdmin._set_suite.<locals>.<listcomp>�s ��8n�8n�8n�$������8n�8n�8nr�zUnsupported suite: %(suite)s)r�r�z�Suite %(suite)s is disabled on the license level. To resolve the issue, please, enable it in CLN by following this article: %(link)s)r��linkNzHAttribute %(attr_name)s does not have default value and must be included)�	attr_namerz�AccelerateWP is not visible for users and so %(suite)s cannot be allowed in billing. Activate the AccelerateWP on server first. Contact your hoster if you don`t have an access to the server.�r�z0Only one suite is possible with --default optionz.Only one suite is possible with --attrs optionz?Only default suite configuration can be activated for all usersc�<�g|]}t|jD]}|���Sr�)r)�feature_set)r�r�r�s   r�r�z2CloudlinuxWposAdmin._set_suite.<locals>.<listcomp>�s.��d�d�d�5�j�QV�FW�Fc�d�d�F��d�d�d�dr�zGoing to generate users reportc3�4K�|]}t|��V��dSr��r r�s  r��	<genexpr>z1CloudlinuxWposAdmin._set_suite.<locals>.<genexpr>	s,����0k�0k�V[�1J�5�1Q�1Q�0k�0k�0k�0k�0k�0kr�rz)Starting service ended with error: %s, %sr�z*Error while processing module for '%s': %szTError while processing module for '%s', processing other users will be continued: %sz'/usr/sbin/clwpos_collect_information.py��stdout�stderr��hidezenable-user-agent�*)�prefix�remount_cagefs�remount_in_background�r�z7set-suite for all was called, removing migration markerz/usr/sbin/cl-smart-advicezwordpress-plugin-installz8User(s) process error. Please check log file %(logfile)s�logfilezdisable-user-agentzETriggering syncing of billable suites statuses with external services�suite_allowed_callback)r��uid�feature_allowed�whmcs)r��eventr��featurez)/usr/sbin/generate_accelerate_wp_cache.pyr�)qr^r�r��ALL_SUITES_OPTION�listr)�keysr�rr*r4r�rr#r2r"r�r�r�r�rrUr�r�r��allowed�visible�visible_for_all�allowed_for_allrdrH�allowed_attrubites�attrs�default�typer�r�rr�rr5�lenr�r�r�r>rR�scanrr��disallowed_for_all�anyr�r�allowed_suitesr]r�update�WPOS_SERVICE_ENABLE_ERR_MSG�preserve_user_settings�tuple�_process_user_suitesr�ALLOWED�VISIBLE�DISABLED�DEFAULT�COMMAND_LINE�
purchase_dater�r�r�r��DEVNULLr_rXrZ�	show_iconrfrFrxrwr:r�ro�REDIS_CONFIGURATION_WARNING_MSGr9r;rprqrrr\r�	itertools�compressr'r=�remover
r�rP�$_save_suites_list_to_public_settingsrsrtrurvrrg�_trigger_cln_sync�_force_user_syncra�_send_analytics_reportr�)!r�rr��for_all_operation�user_list_to_process�any_suite_already_visible�is_cdn_feature_already_visible�is_object_cache_already_visible�billable_suite_passed�any_targeted_suite_was_visiblerr��valid_attributes�
allowed_attrs�	attribute�modules_list�module_allowed�module_visible�first_user_wpos_visible�first_user_cdn_allowed�first_user_obj_cache_visible�warning_dict�retcoder+r,�
error_flag�is_one_user_processing�source_overrider��_error_flag�	warning_dr��optionss!                                 r��
_set_suitezCloudlinuxWposAdmin._set_suitersd��
+�,�,���:�� 1�1�1��z��0�0�1�1�K�K�S�S�d�j�6G�6M�6M�c�6R�6R�S�S�S�K�!��!��%@�$A�$A�!�JV�G�&�(G� %��
*/�&�%�	�	�J��_�,�,�(,�%���-��=�K�'�'�-G��_c�-d�-d�-d�*����+�+�.H�I]�im�.n�.n�.n�+�����
&�
�-�-�.�.��.�/�/��/�0�0���M�M�		
�		
�		
��:��	p�#'�#7�#7�8n�8n�RV�R\�Rb�Rh�Rh�il�Rm�Rm�8n�8n�8n�#o�#o� � �8	�8	�E��J�&�&���M�a�0N�.O�.O�\`�gl�\m�\m�\m�#n�#n����
�
�"�

�&*�j�&8�

�<@�J�<V�

�Z^�Zd�Zt�

��3�5�5�5�5���M�"#�L�#�#�
$(�e�:Q�#R�#R�#R�
��
�
�
� "��&�u�-�@�M�*�

l�

l�	��:�#�l�	��d�j�>N�(N�(N�S\�Sd�Sl�"��
�&'�(r�&s�&s�'+�i�n�'E�'E�'E���������)�l�i�.?�.K�7@�7H�$�Y�^�4�4� �~���)9�9�9�;D�>�>�$�*�JZ�[d�[i�Jj�;k�;k�(���8���
�"�
��J�%�
��L�$�*�*;�<�<��@]�]�]��.�.�x�}�h�Ma�.�b�b�^���M�"#�]�#�#�$(�e�#4�#4�#4��������:��	m�#�k�"2�"2�Q�"6�"6��4�=�8�Q�7i�5j�5j�*k�l�l�l��:��	k��K� 0� 0�1� 4� 4��4�=�8�Q�7g�5h�5h�*i�j�j�j��:��	��
� :�	���
��!�,m�*n�*n�o�
�
�
�e�d�K�d�d�d���:�%�	)�
�L���>�?�?�?��7�>�>�*�-�-�
)��!�!�&�&�(�(�(��:�%�'	I�#*�9�9� �.2�2�N�^�� � ��-�-�-� $���
�Z�
*� 	I�#*�9�9� �.3�3�N�^� $��.1�0k�0k�_j�0k�0k�0k�-k�-k�*�����,�,�,�,�
�Z�
'�	I�#*�9�9� �"�N�!�N�����,�,�,� $����z�!�	
I�2�4�4��!,�Q��8�3J�!J��!,�Q��8�3J�!J����:�%�I�%)�Z�%7�N�%*�N�N�6:�j�6H�H�N�^�"0�"R�9R�5R��!/�!v�K�<�4O�!v�Xv�Tv���k�3�|�C�k�Lk�Hk�	%����	N�&?��&E�&E�#�G�V�V��
N���"�"�#N�PV�X^�_�_�_��#�#�Y�0K�$L�M�M�M��
�%6�!6�!Y�3�?S�;T�;T�XY�;Y���:��	#�%�l�D�J�4E�F�F�O�O�"�O��:�,�	+�#(�7�7� �,�6	�6	�H�)
#�)-�)B�)B���*�8�)�1�1�*�8�.�6�6�.�7�#��� $�
� :� $�
� =� $�
� :� $�
� 2�	���	7��,�,�*�6��J�,�$�*�%�5*�*�&��Y�Y��8�
#�
#�
#�*���L�&�&�'S�U]�_b�cd�_e�_e�f�f�f����&�&�j����F�F����
#�����������
#�����
�!�
���z�!�
����>��I�%�-�%�-�������	)�/�1�1�	)�$�%�0�0�0�0�%�'�'�
)�7�$(��!�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)�*�.�9�9�	��N�N�%�':�;�J�DV�_i�_q�
�
�
�
��:�%�	��N�N�:�;�J�DV�_i�_q�
�
�
�
�
����"�	*�"� ��T�]a�]t�Yt�
�
�
�
�
(�)�)�)�'�
	N�
����,K� L�M�M�M��N�N�8�9�*�BT�]g�]o�N�p�p�p��N�N�4�5�j�>P�Yc�Yk�N�l�l�l�.�0�0�0�-�/�/�/�0�2�2�2�2�
�	N� 4�� D� D�Ig�Ii�Ii� D�����,K� L�M�M�M�"�	�&B�	���"�.�0D�k�R�,�.J�Lb�c���$(�
�
�
�
�
�J�&�	/�$�*�*D�	/�"�'�.�.�Yp�Jq�Jq�	/��L���W�X�X�X��I�-�.�.�.�E�F�F�	�4�:�Ke�	��w�~�~�9�:�:�
����0�2L�M�%�-�%�-������	���
�� Z�[�[� )�+=�>���
�
�
�	
�1�1�+��O�O�O��:�(�	�-K�	������	�&A�&C�&C�	�0�2�2�2�/�1�1�1�2�4�4�4�)�+�+�+�� � � �$�$�/�/�/�/��w�~�~�9�:�:�
����0�2L�M�%�-�%�-�����
&�'�'�
*�7�$)��!�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�/�0�0�
����)�+?�@��I[�dn�dv������:�%�
	P���);�
	P�$�
<���!�!�"i�j�j�j��&�&�(�(�(��%�%�&:�;�;�;�
�+C�A�N�N�O�O�O�
�J��
	��
�!�
	���d�j�&7�8�8�L�<Y�Y�Y��'�'����"6�7�7�'���
�)�	
(�
�
�
�	
���
8�*�E��%��%�	�	
�	
�	
��s>�!B"^�
_/�A_*�*_/�"a6�6a:�=a:�q$�$q(�+q(c��tj�t��s|j�d��dS	t
jtdd|d|d|d|g
tjd���dS#tj	$rB}|j�d	t|��||||j|j��Yd}~dSd}~wwxYw)
NzKSending analytics is skipped, because alt-php-xray package is not installedzreport-analytics�	--featurez--eventz
--usernamez--sourceT�r,�textz\Unable to send analytics username=%s, feature=%s, source=%s, event=%s stderr: %s; stdout: %s)
r�r�r�rDr�r�r��check_output�PIPE�CalledProcessErrorr�r,r+)r�r�r:r�r9r�s      r�r_z*CloudlinuxWposAdmin._send_analytics_report�s���w�~�~�7�8�8�	��L� � �!n�o�o�o��F�	��#�-�&����� �����"���
�
�
�
�
�
�� �,�		�		�		��L� � �n��H�
�
��������
�
�
�
�
�
�
�
�
�����		���s�0A4�4C�7C�Cc�b�|�ddgtjtj���dS)N�/usr/bin/cloudlinux-awp-adminzcln-syncr*)r�r�rVr�s r�r]z%CloudlinuxWposAdmin._trigger_cln_syncs:�����
,�j�9�*�BT�]g�]o�	�	
�	
�	
�	
�	
r��userlistc��tj�t��s|j�d��dSg}|D]P}	|�t|�����&#t$r|j�	d|��Y�MwxYw|s|j�d��dS	tjtddd�|��gtj
d�	��dS#tj$r?}|j�d
t|��|j|j��Yd}~dSd}~wwxYw)za
        Communicates with AWP provision server asking it to fetch data about user ASAP.
        zGForce syncing is skipped, because alt-php-xray package is not installedNz)Unable to obtain account_id for user %s. zNo account_ids to be syncedzawp-syncz--account_idr�Tr{zKUnable to force synchronization of data for user %s. stderr: %s; stdout: %s)r�r�r�rDr�r��appendrr�r�r�r}r�r~rr�r,r+)r�r��account_idsr�r�s     r�r^z$CloudlinuxWposAdmin._force_user_syncs����w�~�~�7�8�8�	��L� � �!j�k�k�k��F��� �	�	�H�
��"�"�#B�8�#L�#L�M�M�M�M���
�
�
���&�&�'R�T\�]�]�]���
�����	��L� � �!>�?�?�?��F�	��#�*�J�����Q\�H]�H]�^�!���
�
�
�
�
�
��
�,�	�	�	��L� � �]��H�
�
�����	
�
�
�
�
�
�
�
�
�����	���s*�"A+�+%B�B�5=C4�4E�4D=�=Ec�0�t��5}|r|tjkr|j}n|}d�|D��D�]C}|jjr_t
t|j��|j	hz��|_t
t|j
��|j	hz��|_
�n|jjr_t
t|j��|j	hz
��|_t
t|j
��|j	hz��|_
��|jjr^t
t|j��|j	hz
��|_t
t|j
��|j	hz
��|_
��E	ddd��dS#1swxYwYdS)z�
        Saves list of suites that are currently allowed/visible/disallowed
        to config which each user on server can read.
        c�(�g|]}t|��Sr�)r)r�s  r�r�zLCloudlinuxWposAdmin._save_suites_list_to_public_settings.<locals>.<listcomp>Is��E�E�E��*�U�+�E�E�Er�N)
rZrr��
whmcs_optionsr�rAr<�setrJr�rr@rH)r�r�r��server_options�target_suites_optionsr�s      r�r\z8CloudlinuxWposAdmin._save_suites_list_to_public_settings?s���
"�
#�
#�	�~��
7�&�L�$A�A�A�(6�(D�%�%�(6�%�E�E��E�E�E�
�
���:�-��;?��1�@�A�A�U�Z�L�P�<�<�)�8�<@��1�@�A�A�U�Z�L�P�<�<�)�8�8��Z�/�
�;?��1�@�A�A�U�Z�L�P�<�<�)�8�<@��1�@�A�A�U�Z�L�P�<�<�)�8�8��Z�2��;?��1�@�A�A�U�Z�L�P�<�<�)�8�<@��1�@�A�A�U�Z�L�P�<�<�)�8��'
�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�E.F�F�Fc	�V�|jjr\|�|jj��}t|���\}}|r't	|jt
d��d|id���t��5}|jj�.|�|jj��rd|_nd|_|jj	�.|�|jj	��rd|_
nd|_
t||�|jj
��|�|jj��|�|jj�����|jj�[|jjt$jkr|jjpd|_n-|jjt(jkr|jjpd|_ddd��n#1swxYwY|jjrI|jjr=|�|jj|�|jj����iS)	z~
        Set global options that affect all users.
        For v1 it is only allowed to control WPOS icon visibility.
        r-zAError during changing of AccelerateWP icon visibility: 
%(error)srr�NTF)�enable_notifications�enable_reminders�enable_wordpress_plugin)r��icon_visibler�rXrUr�r�rZrW�object_cache_banner_visible�disable_object_cache_banners�#_switch_smart_adive_related_optionsr��smart_advice_notifications�smart_advice_reminders�smart_advice_wordpress_pluginr
r�r2r�r3r�feature_visible�features�set_feature)r��
is_visiblerqr+rws     r��_set_optionsz CloudlinuxWposAdmin._set_options`s]���:�"�
	����t�z�'>�?�?�J�6�
�N�K�K�K�O�G�V��
���M�"#�$h�"i�"i�$+�V�#4������"�
#�
#�	M�w��z�&�2��=�=���!8�9�9�.�(,�G�%�%�(-�G�%��z�5�A��=�=���!G�H�H�@�;@�G�8�8�;?�G�8�/��%)�%A�%A�$�*�Bg�%h�%h�!%�!=�!=�d�j�>_�!`�!`�(,�(D�(D�T�Z�Em�(n�(n�	
�
�
�
��z�%�1��:�#�|�'8�8�8�*.�*�*@�*H�D�G�'�'��Z�%��)9�9�9�.2�j�.D�.L��G�+�+	M�	M�	M�	M�	M�	M�	M�	M�	M�	M�	M����	M�	M�	M�	M�.�:�%�	]�$�*�*=�	]����T�Z�0�$�-�-��
�@Z�2[�2[�\�\�\��	s�7EG	�	G
�G
c�F�d�|�d��D��}d�tD��}|D].}||vr(t|jt	d��||d�d����/td�|D����}tt
��j��}|s�t|�	|����}tj}tj�	tj��}	|�|��r't|jt	d��d	|id���|	�|��r't|jt	d
��d	|id���n"t|�|����}t!��5}
||
_|sb|r`tt#����D]D}	|�||���#t&$r|j�d|��Y�AwxYwddd��dS#1swxYwYdS)Nc�6�g|]}|�����Sr�r��r�r:s  r�r�z3CloudlinuxWposAdmin.set_feature.<locals>.<listcomp>�s ��G�G�G��G�M�M�O�O�G�G�Gr�r�c�d�g|]-}|tj��k�|�����.Sr�)r'�optimization_feature�to_interface_name�r�rs  r�r�z3CloudlinuxWposAdmin.set_feature.<locals>.<listcomp>�sC��
�
�
���-�B�D�D�D�D�
���!�!�D�D�Dr�zZInvalid feature name passed: 
%(feature)s.
 You may set only those features: %(supported)s)r:�	supportedr�c�P�g|]#}t|�������$Sr�)r(r�r�s  r�r�z3CloudlinuxWposAdmin.set_feature.<locals>.<listcomp>�s*��S�S�S�Q�w�q�z�z�>�>�@�@�S�S�Sr�z�Hiding all features of AccelerateWP Premium is not permitted, please use 'set-suite' command instead to disallow all Premium features to users: 
%(feature)sr:z�Hiding all features of AccelerateWP is not permitted, please use 'set-suite' command instead to disallow all Premium features for users: 
%(feature)sz;Unable to disable feature on set-feature --hide for user %s)r�r!rUr�r�r�r^�hidden_featuresr<�unionr2r&r5r4�issubset�
differencerZr�_disable_featurer�r�r�)r�r�r��possible_to_hider:�target_features�already_hidden�features_to_hide�all_premium_features�all_free_featuresrwrs            r�r�zCloudlinuxWposAdmin.set_feature�s���G�G�8�>�>�#�3F�3F�G�G�G��
�
�.�
�
�
�� �	�	�G��.�.�.���M�"#�N�#�#�07�EU�#V�#V���	�	�	���S�S�(�S�S�S�T�T���4�6�6�F�G�G���&	P�#�O�$9�$9�.�$I�$I�J�J��#/�#;� � (� 4� :� :�8�;O� P� P��$�,�,�-=�>�>�
���M�"#�G�#�#�
%.�/?�#@�
��
�
�
�!�)�)�*:�;�;�
���M�"#�H�#�#�
%.�/?�#@�
��
�
�
�� $�N�$=�$=�o�$N�$N�O�O��
!�
#�
#�
	!�w�&6�G�#��
!�"2�
!� ����O�O�!�!�D�!��-�-�.>��E�E�E�E��$�!�!�!���.�.�/l�nr�s�s�s� ��!����
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!�
	!����
	!�
	!�
	!�
	!�
	!�
	!s6�)H�G�H�%H�H�H�H�H�Hc��t|��}t|��5t|�����}ddd��n#1swxYwY|D]�\}}}t	|t
j�tj	|��j
|����}||vr�Pdd|dd|d|d|g
}	tj|	dd���}
|j
�|
j��|j
�|
j����dS)	N�/usr/bin/clwpos-user�--user�disablerz�	--wp-path�--domainT)r|�capture_output)rr6r8�enabled_modulesr�r�r�r�r�r�r�r�r�r�r�r+r,)r�r�rr��enabled_featuresr�r�r�r�r�r�s           r�r�z$CloudlinuxWposAdmin._disable_feature�sh��"�4�(�(��
�T�
"�
"�	B�	B�)�$�/�/�?�?�A�A��	B�	B�	B�	B�	B�	B�	B�	B�	B�	B�	B����	B�	B�	B�	B�)9�	-�	-�%�H�g�v�$�\�2�7�<�<���T�@R�@R�@Y�[c�3d�3d�e�e�F��X�%�%��&�����������G� �^�G�$�t�L�L�L�F��L���f�m�,�,�,��L���f�m�,�,�,�,�%	-�	-s�"A
�
A�Ac�>�	tt����}|���}d�|�dg��D��}||d<|S#tjj$r0}ttd��t|������d}~wwxYw)Nc�0�g|]}t|���|��Sr�r(r�s  r�r�z4CloudlinuxWposAdmin._get_options.<locals>.<listcomp>�s7������Kd�ej�Kk�Kk�����r��supported_suitesrzUFile is corrupted: Please, delete file mentioned in details or fix the corrupted line)�message�details)
rr^�copyr�r��decoderr�r7r�r�)r�rrwr�errs     r��_get_optionsz CloudlinuxWposAdmin._get_options�s���
	��5�7�7�8�8�H��m�m�o�o�G���#+�<�<�0B�B�#G�#G����N�)7�G�$�%��N���|�+�	�	�	���q�r�r��C������
�����	���s�AA�B�,+B�Bc��i}	|jjr|jj�d��nd}t���|���}nr#t
$r,}t
|j|j|j	d���Yd}~nAd}~wt$r1}t
|jtd��d|id���Yd}~nd}~wwxYw|S)z)
        Print report in stdout.
        r�N)�target_usersr�z&Error during getting report: %(error)sr)r�r�r�rRr�rSrUr�r�r�r�r�)r��reportr�r�s    r��_get_reportzCloudlinuxWposAdmin._get_reports��
��	�37�:�3C�M�D�J�$�*�*�3�/�/�/��E�$�&�&�*�*��*�>�>�F�F��#�	W�	W�	W��4�=�Q�Y�1�9�*U�*U�V�V�V�V�V�V�V�V������	�	�	���
�� H�I�I� '��|���
�
�
�
�
�
�
�
�����	�����
s$�AA�
C�"B�
C�'B>�>Cc	��t��}	|jjr|���}n|���}ddi|�S#t
$r-}t
|j|j|j	d���Yd}~dSd}~wt$r?}t
|jtd��dt|��id���Yd}~dSd}~wwxYw)Nr��successr�z)Error during generating report: %(error)sr)
rRr��status�
get_statusrGrSrUr�r�r�r�r�r�)r��rg�scan_statusr�s    r��_generate_reportz$CloudlinuxWposAdmin._generate_reports��
�
�
��	��z� �
(� �m�m�o�o���!�g�g�i�i���)����
��$�	W�	W�	W��4�=�Q�Y�1�9�*U�*U�V�V�V�V�V�V�V�V�V������	�	�	���
�� K�L�L� '��Q���0���
�
�
�
�
�
�
�
�
�����	���s#�:A�
C	�"A=�=
C	�
4C�C	c��t��S)zAccelerateWP statisticsryr�s r��	_get_statzCloudlinuxWposAdmin._get_stat4s��,�-�-�-r�c�Z�d}|jjr |jj�d��}ntt	����}|jjr|���Stj�	t��r,t|jtd��dtid���tj�	t��rtjt��|�t|j||��}|�"d|jjjt+|��d�S|\}}t-td	��5}t/j||t+|��d
�|d���ddd��n#1swxYwYt3jd
��dS)zt
        cli command for enabling optimization feature for all sites on the server
        (where possible)
        �
accelerate_wpr�z�Feature enabling is already in progress.  Process pid is stored in %(progress_marker)s.If process with such pid does not exist - please, remove file "%(progress_marker)s" and re-run command�progress_markerr�Nr�)r�r��total_users_countr�)�!wordpress_sites_to_enable_feature�$wordpress_sites_with_enabled_featurer��)�indentr)r�r�r�r<rr��_feature_enable_statusr�r�r�r@rUr�r�r?r[�run_in_background�_enable_feature_for_usersr�r��valuerFr�r��dump�sys�exit)r�r:r��
enable_result�total_websites_to_enable�total_enabled_websitesrs       r��_enable_featurez#CloudlinuxWposAdmin._enable_feature9s���"���:��	$��J�$�*�*�3�/�/�E�E�����O�O�E��:��	1��.�.�0�0�0�
�7�>�>�2�3�3�	���
��-���!2�3K�L���
�
�
��7�>�>�5�6�6�	3��I�1�2�2�2��.�.�/G��Ig�in�pw�x�x�
�� �'�4�3F�3O�3U�lo�pu�lv�lv�w�w�w�;H�8� �"8�
�-�s�
3�
3�		�q��I�9Q�<R�),�U�����
��
�
�
�
�		�		�		�		�		�		�		�		�		�		�		����		�		�		�		�	�������s�)F�F�Fc��ddi}|jjj}tj�t��rtt��5}|����	��}ddd��n#1swxYwYtt|����r|jjj}tj�t��r�|jjj}tt��5}|�t!j|����ddd��n#1swxYwY|�d��|�d��kr
dt&��|d<||d<|S)	a
        Check current status of enabling feature process
        - idle: if no pid file
        - in progress: if pid file exists and such pid really exists in process list
        - done: is enabling status file exists (which is created when process finishes)
        r�r�Nr�r�z`Feature was enabled not for all sites on the server, due to some errors. Please, take a look at r�r�)r�r�r�r�r�r�r@r��readliner�r�intr�r?r�rKr��loadr�rP)r��datar�r�pids     r�r�z*CloudlinuxWposAdmin._feature_enable_statusns����)�$���$�)�/��
�7�>�>�2�3�3�	<��.�/�/�
+�1��j�j�l�l�(�(�*�*��
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+��#�c�(�(�#�#�
<��,�5�;��
�7�>�>�5�6�6�	��(�-�3�F��1�2�2�
*�a����D�I�a�L�L�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*��x�x�;�<�<����Io�@p�@p�p�p�C�.@�C�C��Y�� ��X���s$�'B�B�B�(D6�6D:�=D:c��d}tj��}|rdSttjd��}ttjd��}ttjd��}	tj|���tj�����tj|���tj�����tj|	���tj	�����tj
��}
t|d��5}|�t|
����ddd��n#1swxYwY	||i|��}|�|n|	tj
�|��rtj|��SS#tj
�|��rtj|��wwxYw)zb
        Forks child process in background if needed and created pid file with forked pid
        TN�rza+r�)r��forkr��devnull�dup2�filenor��stdinr+r,�getpidrr�r�r�r[)
r��pidfile�func�args�kwargs�dummy_result�fp�si�so�se�	child_pidr�func_results
             r�r�z%CloudlinuxWposAdmin.run_in_background�s���
��
�W�Y�Y��
�	��F��"�*�c�
"�
"��
�"�*�d�
#�
#��
�"�*�d�
#�
#��
���	�	���S�Y�-�-�/�/�0�0�0�
���	�	���S�Z�.�.�0�0�1�1�1�
���	�	���S�Z�.�.�0�0�1�1�1��I�K�K�	�
�'�3�
�
�	$�1�
�G�G�C�	�N�N�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	#��$��/��/�/�K�"-�"9�;�;�|�K��w�~�~�g�&�&�
#��	�'�"�"�"�"�
#��r�w�~�~�g�&�&�
#��	�'�"�"�"�"�
#���s�#F�F�
F�
G�6Hc�^�d\}}|D�]!}	|�||��}n+#t$r|j�d|��Y�BwxYw|t	d�|���D����z
}|���D]�\}}|D]�}	|j�d|||	��	|�|||	||j	j
|j	j��}
|
dd}n,#t$r|j�d||	��Y��wxYw|r|dz
}������#||fS)	a�
        Enables passed feature for passed username`s sites
        domains and target sites are obtained via user cli utility get (which  knows all
        about incompatibilities and able to detect sites/domains correctly)

        for those sites which do not have any incompatibilities - run user cli command enable feature

        returns <how many sites we should enable> and <how many sites were in fact enabled w/o errors>
        )rrz5Unable to get websites info for enabling feature "%s"c3�4K�|]}t|��V��dSr�)rF)r��websitess  r�r)z@CloudlinuxWposAdmin._enable_feature_for_users.<locals>.<genexpr>�s(����+^�+^�h�C��M�M�+^�+^�+^�+^�+^�+^r�z=Enabling optimization feature "%s" for user "%s" website "%r"r:�enabledz0Failed to enable feature "%s" for website "%s". r$)�_get_target_websitesr�r�r��sum�values�itemsr��_enable_for_siter��
ignore_errors�skip_dns_check)r��	usernamesr:r�r�r��
target_wpsr�r��wp_siter��enabled_statuss            r�r�z-CloudlinuxWposAdmin._enable_feature_for_users�s���<@�8� �"8�!�	4�	4�H�
�!�6�6�x��I�I�
�
���
�
�
���&�&�'^�`g�h�h�h���
����
%��+^�+^�*�J[�J[�J]�J]�+^�+^�+^�(^�(^�^�$�$.�$4�$4�$6�$6�
4�
4� ���'�4�4�G��L�%�%�W�Y`�bj�ls����!�(,�(=�(=�$�g�w���
�@X�Z^�Zd�Zs�)�)�
�*7�y�)A�)�)L����$�!�!�!���.�.�/a�cj�ls�t�t�t� ��!����&�4�.�!�3�.��4�
4� (�)?�?�?s!�#�%A�
A�7<C4�4&D	�D	c����i}t|��retjdd|dgddd���}tj|j��d}|D]'}|dd	}�fd
�|dD��||<�(|S)z;
        Gets target websites via user command GET
        r�r�r�T�X)r�r|�timeout�docroots�domainsrc���g|]?}|d�d�|d��d���7|d��@S)r�r��issuesr�)r�)r��wpr:s  �r�r�z<CloudlinuxWposAdmin._get_target_websites.<locals>.<listcomp>�sf���&�&�&���j�>�'�2�9�=�&�GI��n�U\�F]�Fa�Fa�bj�Fk�Fk�&��v�J�&�&�&r��wps)r{r�r�r�r�r+)r�r�r:rr��
docroots_info�docrootr�s  `     r�r�z(CloudlinuxWposAdmin._get_target_websites�s�����
��8���	��^�'��8�U�C�TX�_c�mp����F�!�J�v�}�5�5�j�A�M�(�
�
�� ��+�A�.��&�&�&�&�%�e�n�&�&�&�
�6�"�"�
�r�c
�V�dd|dd|d|d|g
}|r|�d��n|r|�d��tj|d	d	d
���}|j�|j��|j�|j��tj|j��S)z=
        Enables feature via user cli command ENABLE
        r�r��enablerzr�r�z--ignore-errorsz--skip-dns-checkT��r|r�r)	r�r�r�r�r�r+r,r�r�)	r�r�r:rr�rrr�r�s	         r�rz$CloudlinuxWposAdmin._enable_for_site�s���

#����������
���	/��N�N�,�-�-�-�-�
�	/��N�N�-�.�.�.����d�4�QT�U�U�U������&�-�(�(�(�����&�-�(�(�(��z�&�-�(�(�(r�c
��t��}ttj����t|��z
}|sdSt	jd|��t
jdddd�t|����dgddd	�
��}|j
�|j��|j
�|j��dS)zU
        Automatically turn off suites that are not suppoted on this server.
        Nz-Suites %s need to be turned off on the serverr�z	set-suiter�r�z--disallowed-for-allTir)
rdr�r)r=�loggingr�r�r�r��sortedr�r+r,)r�r��suites_to_turn_offr�s    r��
billing_checkz!CloudlinuxWposAdmin.billing_check�s���0�1�1�� ���!2�!2�3�3�c�:J�6K�6K�K��!�	��F���D�FX�Y�Y�Y���/������� 2�3�3�4�4�&�
����
�
�
��	
����&�-�(�(�(�����&�-�(�(�(�(�(r�c
���tj��}|s|j�d��|St�d�}t��\}}}|s|j�d|��n�d}	tj|tj
|t���d|�d����dd	��
��}n_#tj
j$rH}	|j�dt!|	��j|t%|����|cYd}	~	Sd}	~	wwxYw|jd
kr<|j}
t%|��}~d}|j�d|
||d|
|d����|S)zAccelerateWP cln integrationz3CLN report is empty, report to CLN will not be sentz/cln/api/clos/server/addons/v2z-JWT error: %s, report to CLN will not be sentT)�clszJWT zutf-8zapplication/json)�
AuthorizationzContent-Type)r��headerszACLN report request failed (%s), endpoint: %s, users in report: %sN��zLCLN report sending failed with status: %s, endpoint: %s, users in report: %s)�fingerprint�
user_count)�exc_info�extra)rK�
get_reportr�r�rCrer��requests�postr��dumpsrb�decode�
exceptions�RequestExceptionrrEr�rF�status_code)r�r�r��cln_report_urlr�r��jwt_str�__traceback_hide__r�r�r.r$s            r��cln_synczCloudlinuxWposAdmin.cln_syncs����#�%�%���	��L���S�T�T�T��M�#�C�C�C�� /� 1� 1����g��2	��L� � �!P�RU�V�V�V�V�"&��

��M�"���F�0C�D�D�D�.N�W�^�^�G�5L�5L�.N�.N�`r�s�s�������
�&�7�
�
�
���"�"�W���G�G�$�"���K�K�	����
�
�
�
�
�
�����
�����}��#�#� �m�� ��[�[�
��
&*�"���"�"�b��"��!�*5�Z�P�P�
#�����
s�/A	B9�9D�
=D�
D�Dc�"�t��dS)NTrr�s r�rz#CloudlinuxWposAdmin.migrate_configs]s��	�����tr�c
���ttjttt
gt
��tt��tt
��g��d���dS)z�
        Install cron files based on current status of wpos.

        This code is executed after updates to add new
        cron files that might be missing.
        Tr3)rrYrZr'r#r"rr1r�s r��sync_cron_filesz#CloudlinuxWposAdmin.sync_cron_filescsg��	���*�K�9M�N�/�1�1�.�{�;�;�.�/C�D�D��
�
� $�
	
�
	
�
	
�
	
��tr��suites_admin_config�default_configc��|j���D]k\}}|tjtjfvrdS|tjkr9t
t|j��t
|j	��z}|rdS�ldS)z;
        Check if all feature suites are disabled.
        FT)
r�rrrQrPrSr�r)r&�allowed_features)r6r7r�r��any_feature_enabled_by_defaults     r��all_suites_disabledz'CloudlinuxWposAdmin.all_suites_disabledys���
1�7�=�=�?�?�		!�		!�M�E�6��+�3�5F�5N�O�O�O��u�u��*�2�2�2�14�Z��5F�5R�1S�1S�VY�"�3�W�W�2�.�2�!� �5�5���tr�c�t�t|��}t��dko|dk}t||g��S)N�DirectAdmin�admin)rirrI)r�r��is_owned_by_admin�should_be_whitelisteds    r��_is_supported_for_userz*CloudlinuxWposAdmin._is_supported_for_user�sA�� 9�(� C� C�C�� )���}� <� T��W�AT���%�'<�=�>�>�>r��	user_namer��
allowed_state�state_sourcerU�
attributes�is_one_userr`c	
�F�	t|���}	|	j|	j}}
nU#t$rH|r't	|jt
d��d|id���|j�d|��YdSwxYwd�|D��}|rw|tj
krg|�|��sR|j�d|t|����|r't	|jt
d	��d|id���tj�t#jt|
���
����rg|rHt	|jt
d��|t#jt|
���
��d�d���|j�d
|��dSt'|
��}
i}	tjtj�|
��dd���|st-|��n#t.$rYnwxYw|tjkrt3|��t5|
��5t7��}t9|
��}t;|
t=|��||��}|D]�}|t>vra|tj
krQ|�|��s<|j� d|��tj
|j!|<tj
}n%|tDj#kr||j$|<n
||j!|<|r
||j%|<|rt|��|j&|<��t;|
t=|��||��}	tO|
||��n�#tPt.f$r{}|r:tSt
d��t|��tU|
�������|j�d|
t|����Yd}~ddd��dSd}~wwxYw|�+||||
||��ddd��n#1swxYwYd|fS)a4
        Enable/disable modules for user.
         - write admin config for user with new state
         - install/uninstall WP plugin
         - reload deamon to start/stop redis
        :param user_name: username
        :param suites: Suites list to process
        :param allowed_state: Suite state
        :param purchase_date: Date when user last payed for the product
        :param is_one_user: True - utility processes one user, False - some users
            For messages backward compatibility
        :return: Tuple: (error_flag, warning_flag)
        rz!User %(username)s does not exist.r�r�zUser %s does not exist.)TNc�$�g|]
}|tv�|��Sr�)r+r�s  r�r�z<CloudlinuxWposAdmin._process_user_suites.<locals>.<listcomp>�s#�� g� g� g�5�e�Gf�>f�>f��>f�>f�>fr�zFUser username="%s" is owned by reseller, suites="%s" cannot be allowedzSUser %(username)s is owned by reseller, --visible or --allowed states cannot be set�r6z�Plugins syncing in currently running for user %(username)s, please wait and try again. If issue persists - check file presence %(sync_pid)s and try to remove it)r��sync_pidz0Plugins syncing in currently running for user %si�F)�exist_okz9Silently disallow %s user because it is owned by resellerz,Configuration file '%(path)s' update failed.r)r�r�r�z0Configuration file %s update failed. Error is %sN),r[�pw_uid�pw_gid�KeyErrorrUr�r�r�rrrRrAr�r�r�r�r�rB�formatr-�makedirs�dirnamerxr�rPrrYr^r.r0rr+r�r�rr��whmcs_suitesrE�purchase_datesr/r�r7r��synchronize_plugins_if_needed)r�rBr�rCrDrUrErFr`�pw_infor6�gid�requested_unsupported�suites_allowed_pathrpr7�config_contents�features_old_stater��features_new_stater�s                     r�rOz(CloudlinuxWposAdmin._process_user_suites�sD��2
	��i�0�0�0�G��~�w�~��C�C���
	�
	�
	��
���M�"#�$G�"H�"H�$.�	�#:������
�L���8�)�D�D�D��:�:�
	����!h� g�F� g� g� g��
"�	��!2�!;�;�;��/�/�	�:�:�<�
�L� � �X���)�*�*�
�
�
�
�	
���M�"#�q�#�#�%/�	�#:�	������7�>�>�3�:�s�3�x�x�H�H�H�I�I�	��
���M�"#�3�#�#�
1:�G`�Gg�lo�ps�lt�lt�Gu�Gu�Gu�#v�#v�
��
�
�
�
�L���Q�S\�]�]�]��:�5�c�:�:����	+��K�����(;�<�<�e�e�T�T�T�T�
%�
+��	�*�*�*����	�	�	��D�	�����-�5�5�5�+�I�6�6�6�
�-�
.�
.�)	�)	�4�6�6�N�5�c�:�:�O�!1�#�x��7P�7P�R`�bo�!p�!p���
O�
O���<�<�<�%�):�)C�C�C� �7�7�	�B�B�D��L�%�%�&a�cl�m�m�m�4E�4N�O�*�5�1�$5�$>�M�M�#�|�'D�D�D�>K��4�U�;�;�8E��.�u�5��C�8B�O�.�u�5� �O�<?�
�<N�<N�O�2�5�9��!1�#�x��7P�7P�R`�bo�!p�!p��

"�$�S�#��?�?�?�?���W�%�
"�
"�
"���#� !�"P� Q� Q� #�C��� $�*=� >� >� >�����
��"�"�#U�Wj�lo�ps�lt�lt�u�u�u�!�z�z�z�K)	�)	�)	�)	�)	�)	�)	�)	�����:
"����
�.�.��|�Y��=O�Qc�
�
�
�O)	�)	�)	�)	�)	�)	�)	�)	�)	�)	�)	����)	�)	�)	�)	�T�l�"�"s`�!�AA3�2A3�34G9�9
H�H�7DP�
M�P�O+�0A%O&�P�&O+�+P�P�Pc��|tjkr�t�d|��|�tjt|�����t||||��}|�M|j�d|t|��t|����tj
d��dSdSt�d|t|��t|����t||||��dS)a.
        1. does not sync plugins if source == BILLING (WHMCS CALL) and state == allowed
        2. start syncing plugins in background if source == BILLING (WHMCS CALL) and state != allowed
        3. it syncs plugins in regular regime for both allowed/non-allowed states if source != BILLING
        z*Syncing plugins in background for user: %srINzTForked syncing plugins for user %s, features old states: %s, features new states: %srz9Start syncing plugins for user: %s, source: %s, state: %s)rr�r�r�r�rBrOr��#synchronize_plugins_status_for_userr�r�)r��stater�r�r6rZr[�sync_results        r�rTz1CloudlinuxWposAdmin.synchronize_plugins_if_neededs	���\�2�2�2��L�L�E�x�P�P�P��0�0�)�0�S��X�X�>�>�>�3���"�"�
��K��&���!�!�j���*�+�+��*�+�+�	�����������'�&�
�L�L�T�V^�`c�dj�`k�`k�mp�qv�mw�mw�x�x�x�/��#�?Q�Se�f�f�f�f�fr�c���|jjrd}nd}|jjr7t��}|s$t	|jdt
d��i��|}n|jj�d��}tj
�t��r,t	|jt
d��dtid���|�
t|j||��iS)	NTFr��(There are no users in the control panel.r�z�Updating visibility of Object Cache PRO banners is already in progress.  Process pid is stored in %(progress_marker)s.If process with such pid does not exist - please, remove file "%(progress_marker)s" and re-run commandr�r�)r�r��allrrUr�r�r�r�r�r�r�rAr��%_update_object_cache_banner_for_users)r�r�r�ras    r��_object_cache_bannerz(CloudlinuxWposAdmin._object_cache_banner=s���:��	1�+/�(�(�+0�(��:�>�
	?��I�I�E��
���M��q�!K�L�L�M����
$)� � �#'�:�#3�#9�#9�#�#>�#>� �
�7�>�>�>�?�?�	���
��-���!2�3W�X���
�
�
�	
���0��6� �(�		
�	
�	
��	r�r�c���|rd}nd}|D]`}dd|dd|g}tj|ddd�	��}|j�|j��|j�|j���adS)
Nz	--disablez--enabler�r�zobject-cache-bannerz--allTrr)r�r�r�r�r+r,)r�rr�r�r�r�r�s       r�rcz9CloudlinuxWposAdmin._update_object_cache_banner_for_userses���'�	 � �F�F��F�!�	-�	-�H�-�x��CX�Za�ci�j�G��^�G�$�t�UX�Y�Y�Y�F��L���f�m�,�,�,��L���f�m�,�,�,�,�		-�	-r�c	���t|jdd��rdnd}|dkrdnd}dtfd�}t|j��t|jdd��rBtt
����}|s$t|jd	td
��i��nUt|jdd��}|r|�	��gng}|s$t|jd	td
��i��d}d}|d��|dt|������|gdgdgdgi}t|jdd��}	|D�]�}
|d|
����dd|
dd|��g}|	r|�d|	g��tj
|dddd���}	tj|jpd���n\#tj$rJ|jpd�	��}
|d |
�d!|
����|d�|
��Y��wxYwt)�fd"�|dddfD����}||z
}||z
}||fd#d$d%fD]/\}}��|g��D]}|d |�d&|������0|d'|�d(|�d)���||���|g����|d���dg����|d���dg����|d���dg�������|d*��|S)+zG
        Enable/disable MAx Cache for WordPress installations.
        rFr��maxcache_enabled�maxcache_disabled�msgc�>�t|tjd���dS)NT)�file�flush)�printr�r,)ris r��	_progressz0CloudlinuxWposAdmin._maxcache.<locals>._progresszs���#�C�J�d�3�3�3�3�3�3r�rbr�rar�z--user option is empty.rz[Log] Starting bulk update...z[Log] Users to process: r�(accelerate_wp_plugin_needs_to_be_updated�"accelerate_wp_plugin_not_installedr�Nz[Log] Processing user: r�r��maxcachez--r�Tr)r�r|r�checkz{}z[Log]   z: failed to parse output: c3�^�K�|]'}t��|g����V��(dSr�)rFr�)r��keyr�s  �r�r)z0CloudlinuxWposAdmin._maxcache.<locals>.<genexpr>�sM�����"�"���D�H�H�S�"�%�%�&�&�"�"�"�"�"�"r�)rr)rp�needs_update)rq�
not_installedz: z[Log] Processed �/z	 sites...z[Log] Finished.)r�r�r�rjr�r<rrUr�r�rF�extendr�r�r�r�r+r�r,r�rr�)r�r��success_keyrnr��user_opt�processed_total�total_sites�summary�
domain_filterr�r�r��
stderr_msg�user_site_countrur��siter�s                  @r��	_maxcachezCloudlinuxWposAdmin._maxcacheqsM���%�T�Z��5�A�A�P���y��,2�h�,>�,>�(�(�DW��	4�3�	4�	4�	4�	4�	"�$�-�0�0�0��4�:�u�e�,�,�	�����O�O�E��
���M��q�!K�L�L�M�����
�t�z�6�2�6�6�H�*2�:�X�^�^�%�%�&�&��E��
���M��q�!:�;�;�<����
�����	�1�2�2�2��	�9�S��Z�Z�9�9�:�:�:�
���R�6��0�"�	
�� ��
�H�d�;�;�
��,	u�,	u�H��I�:��:�:�;�;�;�-�x��:�}�TZ�}�}�]�G��
<����
�M�:�;�;�;��^�G�D�t�UX�`e�f�f�f�F�
��z�&�-�"7�4�8�8�����'�
�
�
�$�m�1�r�8�8�:�:�
��	�U�X�U�U��U�U�V�V�V��� �'�'��1�1�1���	
����"�"�"�"�"� ��>�8�	�"�"�"���O�
�?�*�K���.�O��k�*�"�L�G�	 �
;�
;���V�!�H�H�S�"�-�-�;�;�D��I�9��9�9��9�9�:�:�:�:�;�
�I�Q��Q�Q�;�Q�Q�Q�R�R�R��K� �'�'�����b�(A�(A�B�B�B��G��#�#�D�H�H�W�b�$9�$9�:�:�:��>�?�F�F����C�R�H�H�
�
�
�
�8�9�@�@����Jn�pr�As�As�t�t�t�t��	�#�$�$�$��s�F(�(AH�Hr�)T)Dr�r�r�r�rr�r�rTr�r��staticmethodr�r�r�r�r�r��parserr�r�r��argumentrWr�rrrrr
rrxr_r]r^r\r�r�r�r�r�r�r�r�r�r�r�r�rrr2rr5rr`r;rArr�datetime�daterr	rrOrTrdrcr�r�r�r�r�r��s������������������.�.�.��
*�
*��[�
*�"�"�"��=�=��\�=�
�5�5��\�5�
����\��;�3��:�;�$��+�;�;�;�;��^�^�����������$��_�_�Z�&D�_�E�E��_�_�Y�%Z�co�_�p�p��_�_�Z�&S�\h�_�i�i��^�^�����4��������j�i�q�p�F�E��[��6��_�_�X�$D�t�_�T�T��^�^����
�
�����U�T��[�
���^�^����
�$�
�
�
������[�
�6��^�^�����d���������[���G�G�G��\�G�	��c��	�t�C�y�	�	�	�	��|�D�|�|�|���|�|���B
�
�
�
&��c��&�&�&�&�P���B�,�d�,�,�,���,�\M!�M!�M!�^-�-�-�0�������[�� ��T�����[��(�$�����.�.�4�.�.�.��[�.��2�2��[�2�h���4#�#�#�<$@�$@�$@�L���*)�)�)�8��^�^���)�)����[�)�4��^�^���@�@�T�@�@�@����[�@�D��^�^��������[����^�^��������[��(��1B��Te��jn�����\��"?�?�?�J#��J#��S�	�J#�)�	J#�
#�J#� �}�
J#��J#��J#� �J#�
�t�X�d�^�#�	$�J#�J#�J#�J#�Xg�g�g�@&�&�&�P
-�]a�
-�
-�
-�
-��[�[��[�[�[�[r�r�r�r6�	old_state�	new_statec��d�|���D��}d�|���D��}||z
}||z
}t||||��dS)z�
    Compare old and new states of modules in admin's wpos config,
    determine what modules should be enabled and disabled
    and synchronize new state for each panel's user.
    c�B�h|]\}}|jtjk�|��Sr��r�rrP�r�rur�s   r��	<setcomp>z6synchronize_plugins_status_for_user.<locals>.<setcomp>��,��f�f�f���e�E�L�L]�Le�<e�<e��<e�<e�<er�c�B�h|]\}}|jtjk�|��Sr�r�r�s   r�r�z6synchronize_plugins_status_for_user.<locals>.<setcomp>�r�r�N)r�synchronize_plugins_for_user)r�r6r�r�r��disabled_moduless      r�r]r]�so��g�f�y���'8�'8�f�f�f�I�f�f�y���'8�'8�f�f�f�I��)�+�O� �9�,�� ��3��AQ�R�R�R�R�Rr�c�<�|D]}||dkr
|dcS�dS)Nr$rr�)�all_domainsr�domain_infos   r�r�r��s?��"�"�"���k�!�n�$�$��q�>�!�!�!�%�"�"r�c�X�t�dt|����	t|��dS#t$r7}t�d|j|j|j��Yd}~dSd}~wt$r%}t�|��Yd}~dSd}~wwxYw)NzReloading redis for uid=%sz@CL AccelerateWP daemon error: '%s'; details: '%s'; context: '%s')
r�r�r�rIr7r�r�r�r�r�)r6r�s  r��
_reload_redisr��s����L�L�-�s�3�x�x�8�8�8���S��������
�
�
����N�PQ�PY�[\�[d�fg�fo�	
�	
�	
�	
�	
�	
�	
�	
�	
������������!�����������������s!�;�
B)�,A7�7
B)�B$�$B)r�r�c�B�t|��}t|��5t��5t|���}t	|�����}d�|D��}d�t
|��t
t��zD��}|���ot
|��t
|��z}	|���ot
|��t
|��z}
|	rt|��|D]�\}}}
t|tj�
tj|��j|����}|
|vr;t"�d|
��t't)|��||
|���|
|vr;t"�d|
��t+t)|��||
|�����|
rt|��ddd��n#1swxYwYddd��dS#1swxYwYdS)z�
    Iterate through user's docroots and wp_paths
    and enable/disable modules with wp-cli
    not modifying user's wpos config.
    rc��g|]
}|d��S)�r�r�s  r�r�z0synchronize_plugins_for_user.<locals>.<listcomp>s��&Y�&Y�&Y�g�w�q�z�&Y�&Y�&Yr�c�n�g|]2}t|������#t|����3Sr�)r(�redis_daemon_requiredr�)r�r�s  r�r�z0synchronize_plugins_for_user.<locals>.<listcomp>sF��&
�&
�&
���v���4�4�6�6�&
���K�K�&
�&
�&
r�zHRestoring feature="%s" to previously enabled state upon suite activationr�z0Turning off feature="%s" upon suite deactivationN)rr6r|r8r<r�r�r!�is_default_configr�r�r�r�r�r�r�r�r�r�r$r&r%)r�r6r�r�r��user_config�previously_enabled_data�previously_enabled_features�modules_that_require_redis�redis_requires_reload_pre�redis_requires_reload_postr�r�r�r�s               r�r�r��s����x�(�(�L�	��	"�	"�'�'�M�O�O�'�'� �(�3�3�3��"&�{�'B�'B�'D�'D�"E�"E��&Y�&Y�AX�&Y�&Y�&Y�#�&
�&
��9�:�:�S�AZ�=[�=[�[�&
�&
�&
�"�)4�(E�(E�(G�(G�$G�%
�C�Pj�Lk�Lk�nq��o
�o
�M
�!�
*5�)F�)F�)H�)H�%H�&
�S�Qk�Ml�Ml�or��p
�p
�N
�"�
%�	��#����)@�	o�	o�%�H�g�v�$�\�2�7�<�<���X�@V�@V�@]�_g�3h�3h�i�i�F���(�(����g�io�p�p�p�/��H�0E�0E�w�W]�fl�m�m�m�m��)�)�)����O�QW�X�X�X�0��X�1F�1F��X^�gm�n�n�n�n��&�	��#����O'�'�'�'�'�'�'�'�'�'�'����'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'����'�'�'�'�'�'s5�H�GG<�0H�<H	�H�H	�H�H�Hr�c�F�t|������S)Nr)r8r�rs r�r�r�&s���x�(�(�(�8�8�:�:�:r�c�x�t��5}t|ddd��ddd��dS#1swxYwYdS)NF)rZr�)rws r��"disable_smart_advice_functionalityr�*s���	�	�	�J�7�+�G�U�E�5�I�I�I�J�J�J�J�J�J�J�J�J�J�J�J����J�J�J�J�J�Js�/�3�3rwr�r�r�c��t|t��r||_t|t��r||_t|t��r
||_dSdSr�)�
isinstancer��"disable_smart_advice_notifications�disable_smart_advice_reminders�%disable_smart_advice_wordpress_plugin)rwr�r�r�s    r�r�r�/ss���&��-�-�N�9M�5M��2��"�D�)�)�F�5E�1E��.��)�4�0�0�T�<S�8S��5�5�5�T�Tr�)NNN)��
__future__r�argparser�rYr�rr�r��rer�r�r(r�r�dataclassesr�typingrrrr	r
r�enumr�clwpos.papir
�psutilr�clcommon.cpapirrrrr�clwpos.billingr�clwpos.migrationsr�clwpos.cronrr�$clwpos.feature_suites.configurationsrrrrrrrr �clwpos.optimization_featuresr!r"r#r$r%r&r'r(�clwpos.feature_suitesr)r*r+r,r-r.r/r0r1r2r3r4r5�clcommon.clpwdr6�clwpos.cl_wpos_exceptionsr7�clwpos.user.configr8�clwpos.constantsr9r:r;r<r=r>r?r@rArBrCrDrErFrGrH�clwpos.object_cache.redis_utilsrI�clwposrJr�rK�clwpos.parserLrM�clwpos.logsetuprNrOrP�clcommon.cpapi.cpapiexceptionsrQ�clwpos.report_generatorrRrS�clwpos.utilsrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirj�clwpos.whmcs_utilsrkrlrmrn�clwpos.wpos_hooksrorprqrrrsrtrurv�clcommon.clcagefsrwrx�clwpos.statsrz�clwpos.data_collector_utilsr{�secureior|�clcommon.clwpos_libr}r~rrLrXr�r�r�r;�compiler�objectr�r�r�r]r�r�r�r�r�r�r�r�r�r��<module>r�sj��'�&�&�&�&�&���������������������	�	�	�	�
�
�
�
�	�	�	�	�����
�
�
�
�����������������=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�������M�M�M�M�M�M�������L�L�L�L�L�L�L�L�L�L�L�L�L�L�:�:�:�:�:�:�-�-�-�-�-�-�>�>�>�>�>�>�>�>�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�������������������������������+�*�*�*�*�*�/�/�/�/�/�/�)�)�)�)�)�)�������������������������������������$9�8�8�8�8�8�(�(�(�(�(�(�(�(�8�8�8�8�8�8�8�8�V�V�V�V�V�V�V�V�V�V�4�4�4�4�4�4�I�I�I�I�I�I�I�I���������������������������������������������������2������������	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�F�E�E�E�E�E�E�E�5�5�5�5�5�5�/�/�/�/�/�/�"�"�"�"�"�"�u�u�u�u�u�u�u�u�u�u� �a�4����#$�!�3�#�#��
���9�#��	
�
�
���-��
!�
!����
�B�J�3�4�4��^�^�^�^�^�&�^�^�^�B1S��S��S�(,�S�-�-?�(@�S�MQ�RU�Wd�Rd�Me�S�S�S�S�""�"�"�
�
�
�/�3�/�S�/�3�s�8�/�gj�kn�go�/�/�/�/�d;�s�;�x��c�3��m�0D�'E�;�;�;�;�J�J�J�)-�$(�+/�	T�T�
�T���+�T��T�k�T�"�D�[�	T�

�T�T�T�T�T�Tr�