ѠgUddlZddlmZddlmZmZmZmZddlm Z GddeZ e e Z e e e d<e je je jfZdefd Ze je je je jfZe je jfZe je je jfZd Zdefd Ze je je je jfZdefd Z defd Z!de"e e#ffdZ$de e fdZ%dZ&dZ'de(dzfdZ)dS)N)StrEnum)is_cl_admin_editionis_cl_shared_pro_edition_safelyis_cl_solo_edition is_container) is_ubuntucFeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdS)FeaturezREnum of available CloudLinux features that vendors can disable or enable. php_selector ruby_selectorpython_selectornodejs_selector mod_lsapimysql_governorlvewizardcagefsreseller_limitsxray accelerate_wp autotracingN)__name__ __module__ __qualname____doc__ PHP_SELECTOR RUBY_SELECTORPYTHON_SELECTORNODEJS_SELECTORLSAPIGOVERNORLVEWIZARDCAGEFSRESELLER_LIMITSXRAYWPOS AUTOTRACING/builddir/build/BUILDROOT/alt-python27-cllib-3.4.22-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/features.pyr r s["L#M'O'O EH C F F'O D DKKKr*r ALL_CL_FEATURESreturnc0trtSdS)z Return overrides that are applied to the list of features depending on the current system base os. Right now we support two backends: rhel-like almalinux and ubuntu. r))r"_UBUNTU_BASED_CL_FEATURES_DISABLEDr)r*r+%_get_features_disabled_by_system_typer0.s{{211 2r*r)ctdrtStdrtSt rt St S)NTskip_jwt_check)rSOLO_CL_FEATURES_DISABLEDrADMIN_CL_FEATURES_DISABLEDrSHARED_PRO_CL_FEATURES_DISABLEDSHARED_CL_FEATURES_DISABLEDr)r*r+!_get_features_disabled_by_licenser8OsN...+(( D 1 1 1+)) ( * *+..**r*c0trtSdS)z Return overrides that are applied to the list of features depending on the current system environment. Right now we support two envs: - bare metal or virtualized servers - virtuoso containers r))rCONTAINER_CL_FEATURES_DISABLEDr)r*r+%_get_features_disabled_by_environmentr;bs~~.-- 2r*c6ddlm}|S)Nrcpapi)clcommonr>get_unsupported_featuresr=s r+#get_control_panel_disabled_featuresrAps&  ) ) + ++r*ct}t}t}t}t t j||||fdtDS)az Return dict of CloudLinux features that can be used on current system. The key is the feature name and the value is True if feature is allowed to be used and False otherwise. By default, all features are assumed to be supported later we check different conditions and turn off features that are not supported on current CloudLinux intallation. ci|]}||vSr)r)).0featureunsuppored_featuress r+ z-get_cl_feature_status_map..s1      33   r*)rAr0r8r;set itertoolschainr,)panel_supported_features features_disabled_by_system_typefeatures_disabled_by_license features_disabled_by_environmentrFs @r+get_cl_feature_status_maprOws CDD'L'N'N$#D#F#F 'L'N'N$ , ( , $       &   r*cVdtDS)z, Return a list of enabled features. cg|] \}}|| Sr)r))rDrEis_feature_enableds r+ z+get_cl_enabled_features..s3    'G'     r*)rOitemsr)r*r+get_cl_enabled_featuresrUs5  +D+F+F+L+L+N+N   r*cbtdrtStdrtSdS)zm Return the maximum number of hosting accounts that are currently allowed by CloudLinux license. Tr2N)r!MAX_HOSTING_ACCOUNTS_SOLO_EDITIONr"MAX_HOSTING_ACCOUNTS_ADMIN_EDITIONr)r*r+get_hosting_accounts_limitr[s; ...200 D 1 1 1211 4r*)*rIenumrclcommon.lib.cleditionrrrrclcommon.utilsrr listr,__annotations__rrrr/tupler0r!r"r%r4r5r&r'r(r7r6r8r:r;rAdictboolrOrUrYrZintr[r)r*r+res=  %$$$$$     g   ("&gg...   &" u       K      L L  #%+5++++   K  " u    ,U,,,,!4 #6!!!!Hg%&!%&" C$J      r*