403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/cloudinit/sources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceAliYun.cpython-314.pyc
+
��i�<��^�^RIt^RIt^RIHtHt^RIHtHt^RIHt	^RIH
t
^RIHtH
t
^RIHt^RIHt^R	IHt^R
IHtHt]P.!]4tRt!RR
]P64tRtRt!RR]4t]]P@33]]P@]PB33.t"Rt#R#)�N)�List�Union)�dmi�sources)�
url_helper)�util)�
EventScope�	EventType)�NoDHCPLeaseError)�EphemeralIPNetwork)�DataSourceHostname)�aliyun�ec2zAlibaba Cloud ECSc�Laa�]tRt^toRtR.tRt.t^�t^2t	Rt
]Pt
Rt]R4tV3RltRRltR	tR
t]R4t]R4t]R
4t]R4t]R4t]R4tRtRtRtRtRtRt Rt!Rt"RRlt#R Rlt$RRlt%V3Rlt&Rt'Vt(V;t)#)!�DataSourceAliYun�AliYunzhttp://100.100.100.200z
2016-01-01NFc��R#)zX-aliyun-ecs-metadata-token���selfs&�D/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAliYun.py�imdsv2_token_put_header�(DataSourceAliYun.imdsv2_token_put_header+s��,�c�<�\\V`WV4\P!VP
4VnVP
\P,P\P4R#�N)�superr�__init__�copy�deepcopy�default_update_eventsr	�NETWORK�addr
�BOOT)r�sys_cfg�distro�paths�	__class__s&&&&�rr�DataSourceAliYun.__init__/sO���
���.�w��F�%)�]�]�4�3M�3M�%N��"��"�"�:�#5�#5�6�:�:�9�>�>�Jrc�b�VPPR4pRpVfRpRp\WE4#)�hostnameFzlocalhost.localdomainT)�metadata�getr
)r�fqdn�
resolve_ip�
metadata_onlyr+�
is_defaults&&&&  r�get_hostname�DataSourceAliYun.get_hostname4s6���=�=�$�$�Z�0���
���.�H��J�!�(�7�7rc�L�\VPPR/44#)zpublic-keys)�parse_public_keysr,r-rs&r�get_public_ssh_keys�$DataSourceAliYun.get_public_ssh_keys<s�� ����!2�!2�=�"�!E�F�Frc�Z�\4'dVPP4#R#)�NO_ALIYUN_METADATA)�
_is_aliyun�dsname�lowerrs&r�_get_cloud_name� DataSourceAliYun._get_cloud_name?s���<�<��;�;�$�$�&�&�#rc�6�VPP4#r)r;r<rs&r�platform�DataSourceAliYun.platformDs���{�{� � �"�"rc��R#)zlatest/api/tokenrrs&r�api_token_route� DataSourceAliYun.api_token_routeIs��!rc��R#)�21600rrs&r�imdsv2_token_ttl_seconds�)DataSourceAliYun.imdsv2_token_ttl_secondsMs��rc�2�VPVP.#r)r�imdsv2_token_req_headerrs&r�imdsv2_token_redact�$DataSourceAliYun.imdsv2_token_redactQs���,�,�d�.J�.J�K�Krc�(�VPR,#)z-ttl-seconds)rrs&rrJ�(DataSourceAliYun.imdsv2_token_req_headerUs���+�+�n�<�<rc	��VP\P8wd
VP#/pVPPpVP
P
R4p\V\4'd;\P!VV\P!VPRR4R7pM\PRV4V#WnVP#)z@Return a network config dict for rendering ENI or netplan files.�network�apply_full_imds_network_configT)�fallback_nic�full_network_configz%Metadata 'network' key not valid: %s.)�_network_configr�UNSETr&�fallback_interfacer,r-�
isinstance�dictr�#convert_ecs_metadata_network_configr�get_cfg_option_bool�ds_cfg�LOG�warning)r�result�iface�net_mds&   r�network_config�DataSourceAliYun.network_configYs������7�=�=�0��'�'�'������.�.�����"�"�9�-���f�d�#�#��?�?��"�$(�$<�$<��K�K�!A�4�%��F�
�K�K�?��H��M�%���#�#�#rc��.p/pVPpRpVF)pRPWd4pVPV4WcV&K+	\P	R4RpRpVP4p	\P!VV	PV	P\PVPVPVVPRR7	wrhV'dV'dW�nW6,#R# \PdL7i;i)aGet an API token for ECS Instance Metadata Service.

On ECS. IMDS will always answer an API token, set
HttpTokens=optional (default) when create instance will not forcefully
use the security-enhanced mode (IMDSv2).

https://api.alibabacloud.com/api/Ecs/2014-05-26/RunInstances
�PUTz{0}/{1}zFetching Ecs IMDSv2 API TokenNF)	�urls�max_wait�timeout�	status_cb�
headers_cb�exception_cb�request_method�headers_redact�connect_synchronously)rC�format�appendr\�debug�get_url_params�uhelp�wait_for_url�max_wait_seconds�timeout_secondsr]�_get_headers�_imds_exception_cbrK�UrlError�
_api_token)
r�mdurlsre�url2base�url_pathrk�url�cur�response�
url_paramss
&&        r�_maybe_fetch_api_token�'DataSourceAliYun._maybe_fetch_api_tokenps��������'�'�����C��"�"�3�1�C��K�K����S�M��	�	�	�1�2������(�(�*�
�	�!�.�.��#�4�4�"�2�2��+�+��,�,�!�4�4�-�#�7�7�&+�
�M�C� �8�&�O��=� ����~�~�	�
�	�s�,A!C-�-D�Dc��VPpVPRVP4pVPV4pV'd(W0n\
P
RVP4M\
PR4\V4#)�
metadata_urlszUsing metadata source: '%s'z)IMDS's HTTP endpoint is probably disabled)	r[r-r�r��metadata_addressr\rpr]�bool)r�mcfgrzr�s&   r�wait_for_metadata_service�*DataSourceAliYun.wait_for_metadata_service�sk���{�{�����/�4�+=�+=�>�� �6�6�v�>���$4�!��I�I�3�T�5J�5J�K��K�K�C�D��$�%�%rc
�l�VP4'g/#VPp/pVPpVPpRpVPp\
P!VPVPVPVVRR7VR&\
P!VPVPVPVVRR7VR&\
P!VPVPVPVVR7pWrR&V# \dh\P!\RTP4\P !TPTPTPTTTR7TR&T#i;i \d,\P!\R	TP4/u#i;i)
z�Crawl metadata service when available.

@returns: Dictionary of crawled metadata content containing the keys:
  meta-data, user-data, vendor-data and dynamic.
N�	user-data)rirlrj�	item_name�vendor-data)rirlrj�	meta-datazAFailed read json meta-data from %s fall back directory tree style)rirlrj�retrieval_exception_ignore_cbz'Failed reading from metadata address %s)r�rK�_refresh_stale_aliyun_token_cb�&_skip_or_refresh_stale_aliyun_token_cb�#_skip_json_path_meta_path_aliyun_cbr�get_instance_data�min_metadata_versionr�rv�get_instance_meta_data�	Exceptionr�logexcr\r�get_instance_metadata)r�redact�crawled_metadata�exc_cb�	exc_cb_ud�skip_cb�exe_cb_whole_metar^s&       r�crawl_metadata�DataSourceAliYun.crawl_metadata�s����-�-�/�/��I��)�)�����4�4���?�?�	��� �D�D��/	�,2�,D�,D��)�)��%�%��,�,�%�&�%�
-��[�)�/5�.F�.F��)�)��%�%��,�,�%�&�'�
/��]�+�
��6�6��-�-��)�)�#�0�0�#)�!2���17��-�. ���-�
�����5��)�)�	�14�0I�0I��-�-��)�)�#�0�0�#)�!'�29�
1� ��-� ��-
���	��K�K��9��%�%�
�
�I�
	�s2�A:E=�	=D�A.E:�6E=�9E:�:E=�=3F3�2F3c��\V\P4'd.VPR8Xd\PR4RVnR#)z=Exception handler for Ecs to refresh token if token is stale.i�z+Clearing cached Ecs API token due to expiryNT)rWrrrx�coder\rpry�r�msg�	exceptions&&&rr��/DataSourceAliYun._refresh_stale_aliyun_token_cb�s5���i����0�0�Y�^�^�s�5J��I�I�C�D�"�D�O�rc� �VPV9#)z/Returns False if cause.code is in status_codes.)r�)r�status_codes�causes&&&r�_skip_retry_on_codes�%DataSourceAliYun._skip_retry_on_codes�s���z�z��-�-rc�x�VP\PV4pV'gR#VPW4#)zVCallback will not retry on SKIP_USERDATA_VENDORDATA_CODES or
if no token is available.F)r�r�SKIP_USERDATA_CODESr�)rr�r��retrys&&& rr��7DataSourceAliYun._skip_or_refresh_stale_aliyun_token_cb�s3���)�)�#�*A�*A�9�M�����2�2�3�B�Brc��\V\P4'd)VPR8Xd\PR4R#VP
W4#)z7Callback will not retry of whole meta_path is not foundi�z&whole meta_path is not found, skippingF)rWrrrxr�r\r]r�r�s&&&rr��4DataSourceAliYun._skip_json_path_meta_path_aliyun_cbs?���i����0�0�Y�^�^�s�5J��K�K�@�A���2�2�3�B�Brc��VPVPP48wdR#VP'd�\P
!4'd\PR4R#\VPVPPRRR7;_uu_4pVP4Vn\PRVP'dRVP2MR4RRR4MVP4VnVP'd!\VP\ 4'gR#VPP#R/4VnVPP#R	/4VnVPP#R
/4VnR# +'giL�;i \dR#i;i)Fz1FreeBSD doesn't support running dhclient with -sfT)�ipv4�ipv6zCrawled metadata service%s� �Nr�r�r�)�
cloud_namer;r<�perform_dhcp_setupr�
is_FreeBSDr\rprr&rVr��_crawled_metadata�	state_msgrrWrXr-r,�userdata_raw�vendordata_raw)r�netws& r�	_get_data�DataSourceAliYun._get_datasg���?�?�d�k�k�/�/�1�1���"�"�"���� � ��	�	�M�N��
�'��K�K��K�K�2�2���	��
�-1�-@�-@�-B�D�*��I�I�4�04����!�D�N�N�+�,�B����&*�%8�%8�%:�D�"��%�%�%�Z��"�"�D�.
�.
���.�.�2�2�;��C��
� �2�2�6�6�{�B�G���"�4�4�8�8���K����/���$�
��
�s1�15F=�&A
F*�3F=�*F:	�5F=�:F=�=G�Gc��Vf
VPp\PR4VPV/pRP	VP
VP4p\P!VVVPRR7pVP# \Pd"p\PRY54Rp?R#Rp?ii;i)z�Request new metadata API token.
@param seconds: The lifetime of the token in seconds

@return: The API token or None if unavailable.
Nz!Refreshing Ecs metadata API tokenz{}/{}rd)�headersrlrkz/Unable to get API token: %s raised exception %s)
rGr\rprJrnr�rCrr�readurlrKrxr]�contents)r�seconds�request_header�	token_urlr�es&&    r�_refresh_api_token�#DataSourceAliYun._refresh_api_token,s����?��3�3�G��	�	�5�6��6�6��@���N�N�4�#8�#8�$�:N�:N�O�	�	��}�}��&�#�7�7�$�	�H�� � � ���~�~�	��K�K�A�9�
���		�s�$B�C� B<�<Cc��VPVP/pVPV9dV#VP'g*VP	4VnVP'g/#VP
VP/#)z�Return a dict of headers for accessing a url.

If _api_token is unset on AWS, attempt to refresh the token via a PUT
and then return the updated token header.
)rJrGrCryr�r)rr}�request_token_headers&& rrv�DataSourceAliYun._get_headersGsq��
�(�(�$�*G�*G� 
�����3�&�'�'�����#�5�5�7�D�O��?�?�?��	��,�,�d�o�o�>�>rc�
�\V\P4'dcVP'dQVPR8�d@VPR8Xd\PR4Vh\PR4VhR#)a�Fail quickly on proper AWS if IMDSv2 rejects API token request

Guidance from Amazon is that if IMDSv2 had disabled token requests
by returning a 403, or cloud-init malformed requests resulting in
other 40X errors, we want the datasource detection to fail quickly
without retries as those symptoms will likely not be resolved by
retries.

Exceptions such as requests.ConnectionError due to IMDS being
temporarily unroutable or unavailable will still retry due to the
callsite wait_for_url.
i�i�zLEcs IMDS endpoint returned a 403 error. HTTP endpoint is disabled. Aborting.z2Fatal error while requesting Ecs IMDSv2 API tokensT)rWrrrxr�r\r])rr�s&&rrw�#DataSourceAliYun._imds_exception_cb\sh���i����0�0��~�~�~�)�.�.�C�"7��>�>�S�(��K�K�?�� ���K�K�L�� ��rc�X<�V^8�dQh/S[S[,;R&S[S[S[3,;R&#)��extended_metadata_versionsrT)r�strrrX)rn�
__classdict__s"�r�__annotate__�DataSourceAliYun.__annotate__s,����!%�S�	�.�� �3��9�%�5�!r)ryr�rTr!r,r�r�r�)FFFr)r�)*�__name__�
__module__�__qualname__�__firstlineno__r;r�r�r��url_max_wait�url_timeoutryrrUrTr��propertyrrr2r6r=r@rCrGrKrJrar�r�r�r�r�r�r�r�r�rvrw�__annotate_func__�__static_attributes__�__classdictcell__�
__classcell__)r(r�s@@rrrs,����
�F�-�.�M�(��,.���L��K��J�(/�
�
�O����-��-�K�
8�G�$�
�#��#��"��"������L��L��=��=��$��$�,0�d&�> �@�.�C�C��B!�6?�*�O
�rrc�<�\P!R4\8H#)zsystem-product-name)r�
read_dmi_data�ALIYUN_PRODUCTrrrr:r:ys�����2�3�~�E�Erc��.pVP4F�wr#\V\4'd"VPVP	44K<\V\
4'dVP
V4Ke\V\4'gK}VPR.4p\V\4'd"VPVP	44K�\V\
4'gK�VP
V4K�	V#)zopenssh-key)	�itemsrWr�ro�strip�list�extendrXr-)�public_keys�keys�_key_id�key_body�keys&    rr5r5}s���
�D�(�.�.�0����h��$�$��K�K����(�)�
��$�
'�
'��K�K��!�
��$�
'�
'��,�,�}�b�1�C��#�s�#�#����C�I�I�K�(��C��&�&����C� �1��Krc��]tRtRtRtRtRtR#)�DataSourceAliYunLocali�aeDatasource run at init-local which sets up network to query metadata.

In init-local, no network is available. This subclass sets up minimal
networking with dhclient on a viable nic so that it can talk to the
metadata service. If the metadata service provides network configuration
then render the network configuration for that instance based on metadata.
TrN)r�r�r�r��__doc__r�r�rrrr�r��s����rr�c�8�\P!V\4#r)r�list_from_depends�datasources)�dependss&r�get_datasource_listr��s���$�$�W�k�:�:r)$r�logging�typingrr�	cloudinitrrrrrr�cloudinit.eventr	r
�cloudinit.net.dhcpr�cloudinit.net.ephemeralr�cloudinit.sourcesr
�cloudinit.sources.helpersrr�	getLoggerr�r\r��
DataSourcerr:r5r��DEP_FILESYSTEM�DEP_NETWORKr�r�rrr�<module>rs������"�)��1�/�6�0�1�
����!��$��a�w�)�)�a�HF�
� 	�,�	��W�3�3�5�6���.�.��0C�0C�D�E���;r

Youez - 2016 - github.com/yon3zu
LinuXploit