403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.217
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/thread-self/root/lib/python3/dist-packages/supervisor/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/lib/python3/dist-packages/supervisor/__pycache__/http.cpython-312.pyc
�

A�c�|���ddlZddlZddlZddlZddlZddlZddlZddlZ	ddlZddlmZddlm
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZGd
�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�dej>�Z Gd�dejB�Z"Gd�dej(�Z#Gd�de#�Z$Gd�d e#�Z%Gd!�d"�Z&Gd#�d$�Z'Gd%�d&�Z(d'�Z)Gd(�d)�Z*Gd*�d+�Z+Gd,�d-e�Z,y#e	$rddl
ZY��wxYw).�N)�urllib)�sha1)�as_bytes)�	as_string)�asyncore_25)�	http_date)�http_server)�	producers)�filesys)�default_handler)�auth_handlerc��eZdZy)�NOT_DONE_YETN)�__name__�
__module__�__qualname__���1/usr/lib/python3/dist-packages/supervisor/http.pyrrs��rrc��eZdZdZdd�Zd�Zy)�deferring_chunked_producera'A producer that implements the 'chunked' transfer coding for HTTP/1.1.
    Here is a sample usage:
            request['Transfer-Encoding'] = 'chunked'
            request.push (
                    producers.chunked_producer (your_producer)
                    )
            request.done()
    Nc�.�||_||_d|_y�N皙�����?)�producer�footers�delay)�selfrrs   r�__init__z#deferring_chunked_producer.__init__)s�� ��
������
rc� �|jr�|jj�}|turtS|r"dt|�z}t	|�dz|zdzSd|_|j
r"dj
dg|j
z�dzSyy)Nz%xs
�0s

s0

r)r�morer�lenrr�join)r�data�ss   rr"zdeferring_chunked_producer.more.s����=�=��=�=�%�%�'�D��|�#�#�#���3�t�9�$����{�W�,�t�3�g�=�=� $��
��<�<�"�<�<������(=�>��L�L�'�r�N�rrr�__doc__rr"rrrrrs����
rrc��eZdZdZd�Zd�Zy)�deferring_composite_producerz$combine a fifo of producers into onec� �||_d|_yr)r
r)rr
s  rrz%deferring_composite_producer.__init__As��"�����
rc���t|j�rb|jd}|j�}|turtS|r|S|jj	d�t|j�r�by)Nrr)r#r
r"r�pop)r�p�ds   rr"z!deferring_composite_producer.moreEsb���$�.�.�!����q�!�A�����A��L� �#�#�������"�"�1�%��$�.�.�!�rNr(rrrr+r+?s��.��rr+c��eZdZdZdd�Zd�Zy)�deferring_globbing_producerz�
    'glob' the output from a producer into a particular buffer size.
    helps reduce the number of calls to send().  [this appears to
    gain about 30% performance on requests to a single channel]
    c�<�||_d|_||_d|_y)Nrr)r�buffer�buffer_sizer)rrr5s   rrz$deferring_globbing_producer.__init__Zs�� ��
����&�����
rc��t|j�|jkrd|jj	�}|t
urt
S|r	|j|z|_nn#t|j�|jkr�d|j}d|_|S#t$r)t|j�t|�z|_Y�iwxYw�Nr)r#r4r5rr"r�	TypeErrorr)rr%�rs   rr"z deferring_globbing_producer.more`s����$�+�+���!1�!1�1��=�=�%�%�'�D��|�#�#�#��I�"&�+�+��"4�D�K���$�+�+���!1�!1�1�
�K�K��������
!�I�"*�4�;�;�"7�(�4�.�"H�D�K�I�s�B�/C�
CN)ir(rrrr2r2Ss����rr2c��eZdZdZd�Zd�Zy)�deferring_hooked_producerz�
    A producer that will call <function> when it empties,.
    with an argument of the number of bytes produced.  Useful
    for logging/instrumentation purposes.
    c�<�||_||_d|_d|_y)Nrr)r�function�bytesr)rrr=s   rrz"deferring_hooked_producer.__init__xs�� ��
� ��
���
���
rc��|jrn|jj�}|turtS|s$d|_|j|j�|S|xjt|�z
c_|Syr7)rr"rr=r>r#)r�results  rr"zdeferring_hooked_producer.more~sf���=�=��]�]�'�'�)�F���%�#�#�� $��
��
�
�t�z�z�*��M��
�
�c�&�k�)�
��M�rNr(rrrr;r;qs����rr;c�(�eZdZdZd�Zd�Zd�Zd�Zy)�deferring_http_requesta The medusa http_request class uses the default set of producers in
    medusa.producers.  We can't use these because they don't know anything
    about deferred responses, so we override various methods here.  This was
    added to support tail -f like behavior on the logtail handler c�`�tjtj|j�}|j	�}d}d}d}|j
dk(r|dk(r
d|vrd}nZd|d<nTd}nQ|j
dk(r4|d	k(rd}n:d|vr6d
|vr|d
dk(s*d}n'|jr
d|d
<d}d}nd}n|j
�d}tj|j��}|rd	|d<|r,tt|j��}t||g�}n1|jjd|�t|j�}t||j�}|rt!|�}|j"j%|�d|j"_|r|j"j)�yy)
z� I didn't want to override this, but there's no way around
        it in order to support deferreds - CM

        finalize this transaction - send output to the http channelr�z1.0z
keep-alivezContent-Lengthz
Keep-Alive�
Connectionz1.1�closezTransfer-Encoding�chunkedN)r	�
get_header�
CONNECTION�header�lower�version�use_chunkedr
�simple_producer�build_reply_headerrr+�outgoing�insertr;�logr2�channel�push_with_producer�current_request�close_when_done)	r�arg�kw�
connection�close_it�wrap_in_chunking�globbing�outgoing_header�outgoing_producers	         r�donezdeferring_http_request.done�s���!�+�+�K�,B�,B�4�;�;�O�
��%�%�'�
��������<�<�5� ��\�)�'�4�/� �H�)5�D��&���
�\�\�U�
"��W�$���%��-�&�$�.�� 3�4�	�A�#$���%�%�09�D�,�-�'(�$� !�H� �H�
�\�\�
!��H�#�3�3�D�4K�4K�4M�N���!(�D���� :�0����?�!��!=� �"3�4�!��

�M�M� � ��O�4� <�T�]�]� K��6�6G�6:�h�h�@��� ;�<M� N�����'�'�(9�:�'+����$���L�L�(�(�*�rc	�x�|jjr3|jjd}|jjd}nd}d}|jjjj	|d||jt
j��|j|j|fz�y)z� We need to override this because UNIX domain sockets return
        an empty string for the addr rather than a (host, port) combination rrD�	localhostz%d - - [%s] "%s" %d %d
N)	rS�addr�server�loggerrR�log_date_string�time�request�
reply_code)rr>�host�ports    rrRzdeferring_http_request.log�s����<�<����<�<�$�$�Q�'�D��<�<�$�$�Q�'�D��D��D������"�"�&�&��*���,�,�d�i�i�k�:��������.��		rc�x�i}dddd�}tj�}|j�\}}}}|r||z}|r|ddk(r|dd}|r	|ddk(r�d|vrtj|�}|r|dd}|j
j}|jj�|d	<t|j�|d
<|j|d<|j|d<d
|jz|d<|j
j|d<d|d<d|z|d<tjj!tjj#||d��|d<|r||d<d|d<|j
j$r|j
j$d|d<nd|d<|j&D]�}	|	j)dd�\}
}|
j+�}
|j-�}|
|vr|r|||j/|
�<�Sddj#|
j)d��j�z}
|s��|
|vs��|||
<��|S)N�CONTENT_LENGTH�CONTENT_TYPE�CONNECTION_TYPE)zcontent-lengthzcontent-typerYr�/rD�%�REQUEST_METHOD�SERVER_PORT�SERVER_NAME�SERVER_SOFTWAREzHTTP/�SERVER_PROTOCOLzchannel.creation_time��SCRIPT_NAME�	PATH_INFO�PATH_TRANSLATED�QUERY_STRINGzCGI/1.1�GATEWAY_INTERFACE�REMOTE_ADDRz	127.0.0.1�:zHTTP_%s�_�-)�os�getcwd�	split_urir	�unquoterSrc�command�upper�strrj�server_name�SERVER_IDENTrL�
creation_time�path�normpathr$rbrJ�splitrK�strip�get)r�env�
header2env�workdirr��params�query�fragmentrcrJ�key�values            r�cgi_environmentz&deferring_http_request.cgi_environment�sA����,<�+9�+<�>�
��)�)�+��*.�.�.�*:�'��v�u�h���&�=�D��t�A�w�#�~����8�D��t�A�w�#�~��$�;��&�&�t�,�D���!�"�I�E����$�$�� $��� 2� 2� 4���� ����-��M��#�/�/��M��!'�!4�!4����!(�4�<�<�!7����'+�|�|�'A�'A��#�$���M����:��K��!#���!1�!1�"�'�'�,�,���[�)�3+�",�����"'�C���#,��� ��<�<���!%���!2�!2�1�!5�C�
��!,�C�
���k�k�		#�F��l�l�3�q�)�I�C���	�	��C��+�+�-�E��j� �U�).��J�N�N�3�'�(�����#�)�)�S�/�!:� A� A� C�C���S��^�"�C��H�		#��
rc�j�ddd�}|j�}|jd�dvs|jd�dk(rd}nd	}d
|vr,|d
j�}tj|�\}}n|dj�}|d}|�|||k(r|}n|dz|z}|�d|��}|dd
dk(r|d
d}|S)z� Functionality that medusa's http request doesn't have; set an
        attribute named 'server_url' on the request based on the Host: header
        �80�443)�http�https�HTTPS)�on�ON�SERVER_PORT_SECURE�1r�r��	HTTP_HOSTrsrrNr}z://���ro)r�r�r�r�	splitport)r�default_port�environ�protocolri�hostnamerj�
server_urls        r�get_server_urlz%deferring_http_request.get_server_url/s���#�U�3���&�&�(���K�K�� �L�0��K�K�,�-��4��H��H��'�!��;�'�-�-�/�D�#�-�-�d�3�N�H�d��}�-�3�3�5�H��=�)�D��<�<��1�T�9��D��c�>�D�(�D�"*�D�1�
��b�c�?�C��!�#�2��J��rN)rrrr)r_rRr�r�rrrrBrB�s��F�
Q+�f�(3�jrrBc�,�eZdZdZdZdZdd�Zd�Zd�Zy)�deferring_http_channelirNc���|�tj�}|jr,||jz
}||jkDs|dkr||_yytjj|�S)NrTF)rfr�last_writable_checkr	�http_channel�writable)r�now�elapseds   rr�zdeferring_http_channel.writableUs`���;��)�)�+�C��:�:��D�4�4�4�G��$�*�*�$�'�A�+�+.��(����'�'�0�0��6�6rc� �	t|j�r�|jj�}|�7|js*|jj	�|j�yt
|t�r0|jj	�|xj|z
c_y|j�}|tur|j|_
y|r|j|z|_d|_
y|jj	�ny��)z Implement deferreds NF)r#�
producer_fifo�first�
ac_out_bufferr.rF�
isinstancer>r"rr)rr/r%s   r�
refill_bufferz$deferring_http_channel.refill_bufferds�����4�%�%�&��&�&�,�,�.���9��-�-��*�*�.�.�0��
�
�����5�)��&�&�*�*�,��&�&�!�+�&���v�v�x���<�'�!"���D�J���)-�);�);�d�)B�D�&�!&�D�J���&�&�*�*�,��9rc���|jr|jj�yt|j�}d|_|j	d�}|r|ds
|dd}|r|ds�
|s|j�y|d}t
j|�\}}}t
j|dd�}t
j|�\}}d|vr3|rt
j|�dz|z}nt
j|�}t||||||�}	|jj�|jjj�|�0|j!dt#|�zd	�|	j%d
�y|jj&D].}
|
j)|	�s�	|	|_|
j+|	�y|	j%d�y#|jj,j�t/j0�\\}}}
}}}|jj!d|�d|�d
|�d|
��d	�	|	j%d�Yy#YYyxYwxYw)z� We only override this to use 'deferring_http_request' class
        instead of the normal http_request class; it sucks to need to override
        this rz
rrDNrp�?zBad HTTP request: %s�error�zServer Error: z, z: file: z line: i��)rU�found_terminatorr�	in_bufferr�rVr	�
crack_request�join_headers�
splitqueryr�rB�request_counter�	incrementrc�total_requests�log_info�reprr��handlers�match�handle_request�
exceptions�asyncore�compact_traceback)rrJ�linesrgr��urirL�rpath�rqueryr9�h�file�fun�line�t�v�tbinfos                 rr�z'deferring_http_channel.found_terminator�s;������ � �1�1�3�
�t�~�~�.�F� �D�N��L�L��(�E���a��
�a�b�	����a����$�$�&���A�h�G�$/�$=�$=�w�$G�!�G�S�'� �-�-�u�Q�R�y�9�F�(�2�2�3�7�M�E�6��e�|��%�-�-�e�4�s�:�V�C�C�%�-�-�e�4�C�&�t�W�g�s�G�'-�/�A�� � �*�*�,��K�K�&�&�0�0�2����
�
�5��W�
�E�w�O�����
��
�[�[�)�)�
���7�7�A�;�!�/0��,��(�(�!�,��'
�,
�G�G�S�M��!����.�.�8�8�:�'�9�9�;�8�)��s�D�1�a�����,�,��q��d�,�#�%�!��G�G�S�M���!� ��s%�-G�A+I#�I�I �I#� I#r')	rrr�ac_out_buffer_sizerr�r�r�r�rrrr�r�Ls&����
�E���
7��@Nrr�c�(�eZdZeZdZd�Zd�Zdd�Zy)�supervisor_http_serverNc�2�ddlm}|s|jtj�}|j|�}||_tjj|�|j|�g|_
|jd�|j�y)zj Override __init__ to do logger setup earlier so it can
        go to our logger object instead of stdout r�rdN)
�supervisor.medusard�file_logger�sys�stdout�unresolving_loggerr��
dispatcherr�
set_socketr��setblocking�set_reuse_addr)r�sock�
logger_objectrds    r�prebindzsupervisor_http_server.prebind�sv��	-��"�.�.�s�z�z�:�M��1�1�-�@�
�#������$�$�d�+��������
���������rc�d�ddlm}ddlm}|j	d�|�|_|�|_|�|_|�|_|�|_	|jd|�dtjtj���d|j�d|j�d	�	�y)
Nr)�counter)�VERSION_STRING�z	Medusa (Vz
) started at z
	Hostname: z
	Port:�
)�supervisor.medusa.counterr��supervisor.medusa.http_serverr��listen�
total_clientsr�r��	bytes_out�bytes_inr�rf�ctimer�rj)rr�r�s   r�postbindzsupervisor_http_server.postbind�s{��5�@����D��$�Y���%�i���!�)��� ���� ���
��
�
�
'��
�
�4�9�9�;�/��(�(��	�	��
	rc�r�d}t|dd��|j}|jj||�y)Nrv�ip)�getattrr�rdrR)r�message�typer�s    rr�zsupervisor_http_server.log_infos1��
���4��t�$�0����B�������G�$r)�info)	rrrr��
channel_classr�r�r�r�rrrr�r��s��*�M�	
�B��&�0%rr�c��eZdZdZd�Zy)�supervisor_af_inet_http_serverz+ AF_INET version of supervisor HTTP server c�T�||_||_tjtjtj�}|j||�|j
||f�|s<|jdd�tj�}	tj|�}	tj|�d|_
|j�y#tj$rtd|z��wxYw#tj$r|jdd�||_
Y�dwxYw)NzComputing default hostname�warningz�Could not determine IP address for hostname %s, please try setting an explicit IP address in the "port" setting of your [inet_http_server] section.  For example, instead of "port = 9001", try "port = 127.0.0.1:9001."rzCannot do reverse lookup)r�rj�socket�AF_INET�SOCK_STREAMr��bindr��gethostname�
gethostbynamer��
ValueError�
gethostbyaddrr�r�)rr�rjr�r�r�s      rrz'supervisor_af_inet_http_server.__init__s�������	��}�}�V�^�^�V�-?�-?�@�����T�=�)��	�	�2�t�*����M�M�6�	�B��)�)�+�H�
 ��)�)�(�3��	"�%�3�3�R�8��;�D��
	
�
�
����<�<�
 � �M��	� � �
 ���|�|�	"��M�M�4�i�@�!�D��	"�s�C�%C8�"C5�8,D'�&D'N)rrrr)rrrrr�r�	s
��5�rr�c��eZdZdZd�Zd�Zy)�supervisor_af_unix_http_serverz+ AF_UNIX version of supervisor HTTP server c
�@�||_||_d|tj�fz}	tj|�	t
jtjtj�}	|j|�tj||�	tj||�	tj||d|d�|j+||�		tj|�d|_|jA�y#t
$rY��wxYw#t
$rj}|jdtjk(rDd}t!||t#|�t%j&tj(��dfz���d}~wwxYw#t
$rY��wxYw#t
$r�|j-|�}	|	r#t
j.tj0��d|z}t2j4j7|�	tj|�n#YnxYw|j9�t;j<d�Y	tj|���$#t
$rY��0wxYwwxYw#	tj|�w#t
$rYwwxYwxYw)Nz%s.%drDrz�Not permitted to chown %s to uid/gid %s; adjust "sockchown" value in config file or on command line to values that the current user (%s) can successfully chownzUnlinking stale socket %s
g333333�?z<unix domain socket>)!r�rjr��getpid�unlink�OSErrorr�AF_UNIXrr�chmod�link�chown�args�errno�EPERMrr��pwd�getpwuid�geteuidr��	checkusedr��
EADDRINUSEr��stderr�writerFrf�sleepr�r�)
r�
socketname�	sockchmod�	sockchownr��tempnamer��why�msg�useds
          rrz'supervisor_af_unix_http_server.__init__*sI�������	��j�"�)�)�+�6�6��	��I�I�h����=�=�����1C�1C�D�D�/
��	�	�(�#�����9�-�&��G�G�H�j�1�&"�����Y�q�\�9�Q�<�H��L�L��}�5����I�I�h�'�2����
�
���o�	��	��>#�
"��8�8�A�;�%�+�+�5�$N�C�#-�S�J�48��O�47�L�L�8:�
�
��5F�FG�5I�46�.6�#/�/�"��
"��(�����Q���>�>�*�5�D��$�l�l�5�+;�+;�<�<�8�*�D�C��J�J�$�$�S�)���	�	�*�-������J�J�L��J�J�r�N��,��I�I�h�'�������Q��L��I�I�h�'������s��D�2'I6�F#�1D�I6�"F�	D�D�	F�'A%F�F�I6�	F �F �#A#I3�H�I3�H!�*I3�	I6�I"�"	I/�.I/�2I3�3I6�6J�8J�
J�	J�J�J�Jc�4�tjtjtj�}	|j|�|j	td��|j
d�|j�y#tj$rYywxYw)NzGET / HTTP/1.0

rDTF)	rrr�connect�sendr�recvrFr�)rrr&s   rrz(supervisor_af_unix_http_server.checkusedqsp���M�M�&�.�.�&�*<�*<�=��	�
�I�I�j�!�
�F�F�8�4�5�6�
�F�F�1�I�
�G�G�I����|�|�	��	�s�AB�B�BN)rrrr)rrrrrrr's��5�E�N
rrc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�tail_f_producerc��tj|�|_||_d|_|j�|j
�}||k\r||z
|_yyr)�weakref�refrg�filenamer�_open�_fsize�sz)rrgr/�headr2s     rrztail_f_producer.__init__~sK���{�{�7�+��� ��
���
��
�
��
�[�[�]��
��:��4�i�D�G�rc�$�|j�yr')�_close�rs r�__del__ztail_f_producer.__del__�s�����
rc�>�|j�	|j�}||jz
}|dkrd|_y|dkDrA|j
j
|d�|j
j|�}||_|StS#ttf$rYywxYw)Nrrz==> File truncated <==
�)	�_followr1rrr2r��seek�readr)r�newsz�bytes_addedr>s    rr"ztail_f_producer.more�s�������	��K�K�M�E��d�g�g�o����?��D�G�-���?��I�I�N�N�K�<��+��I�I�N�N�;�/�E��D�G��L������$�	��	�s�B
�
B�Bc���t|jd�|_tj|jj��tj|_d|_	y)N�rbr)
�openr/r�r��fstat�fileno�stat�ST_INO�inor2r6s rr0ztail_f_producer._open�sA�������-��	��8�8�D�I�I�,�,�.�/����<�����rc�8�|jj�yr')r�rFr6s rr5ztail_f_producer._close�s���	�	���rc���	tj|j�tj}|j|k7r!|j�|j�yy#tt
f$rYywxYwr')	r�rDr/rErrrFr5r0)rrFs  rr:ztail_f_producer._follow�s_��	��'�'�$�-�-�(����5�C�
�8�8�s�?��K�K�M��J�J�L���	��$�	��	�s�0A#�#A5�4A5c�~�tj|jj��tj
Sr')r�rBr�rCrD�ST_SIZEr6s rr1ztail_f_producer._fsize�s'���x�x��	�	�(�(�*�+�D�L�L�9�9rN)
rrrrr7r"r0r5r:r1rrrr+r+}s%�� ���$�
�	�:rr+c�&�eZdZdZdZd�Zd�Zd�Zy)�logtail_handlerzLogtail HTTP Request Handlerz/logtailc��||_yr'��supervisord�rrOs  rrzlogtail_handler.__init__��
��&��rc�L�|jj|j�Sr'�r��
startswithr��rrgs  rr�zlogtail_handler.match�����{�{�%�%�d�i�i�0�0rc���|jdk7r|jd�y|j�\}}}}d|vrtj|�}|r|ddk(r|dd}|r	|ddk(r�|jdd�\}}	|jdd�\}}ddlm}	|	|�\}
}|jjj|
�}|�|jd	�y|jj|�}|�|jd	�yt|jd
|zd�}
|
�tj j#|
�s|jd	�ytj$|
�t$j&}t)j*|�|d<d|d
<d|d<|j-t/||
d��|j1�y#t$r|}d}Y��KwxYw)N�GETr�rprrorDr�)�split_namespecr�z
%s_logfile�
Last-Modified�text/plain;charset=utf-8�Content-Type�nozX-Accel-Bufferingr�)r�r�r�r	r�r�r�supervisor.optionsrYrO�process_groupsr��	processesr��configr�r��existsrD�ST_MTIMEr�build_http_date�pushr+r_)rrgr�r�r�r��process_name_and_channel�process_namerSrY�
group_name�group�process�logfile�mtimes               rr�zlogtail_handler.handle_request�s����?�?�e�#��M�M�3���(/�(9�(9�(;�%��f�e�X��$�;��&�&�t�,�D��t�A�w�#�~����8�D��t�A�w�#�~�*.���C��);�&��&�	�$<�$B�$B�3��$J�!�L�'�	6�#1�,�#?� �
�L�� � �/�/�3�3�J�?���=��M�M�#����/�/�%�%�l�3���?��M�M�#����'�.�.�,��*@�$�G���?�"�'�'�.�.��"9�

�M�M�#������� ����/��#,�#<�#<�U�#C��� �"<����(,��#�$�	���_�W�g�t�<�=������O�	�3�L��G�	�s�G�
G!� G!N�rrr�IDENTr�rr�r�rrrrLrL�s��*�E��D�'�1�9rrLc�&�eZdZdZdZd�Zd�Zd�Zy)�mainlogtail_handlerz!Main Logtail HTTP Request Handlerz/mainlogtailc��||_yr'rNrPs  rrzmainlogtail_handler.__init__�rQrc�L�|jj|j�Sr'rSrUs  rr�zmainlogtail_handler.match�rVrc���|jdk7r|jd�y|jjj}|�t
jj|�s|jd�ytj|�tj}tj|�|d<d|d<|jt||d��|j�y)NrXr�r�rZr[r\r�)r�r�rO�optionsrkr�r�rbrDrcrrdrer+r_)rrgrkrls    rr�z"mainlogtail_handler.handle_requests����?�?�e�#��M�M�3����"�"�*�*�2�2���?�"�'�'�.�.��"9�
�M�M�#������� ����/��#,�#<�#<�U�#C��� �"<����	���_�W�g�t�<�=����rNrmrrrrprp�s��/�E��D�'�1�rrpc���g}t|j�}|jD�]x}|d}|tjk(r|d|d}}t|||��}n@|tjk(r|d}	|d}
|d}t|	|
||��}ntd|z��d	d
l	m
}d	dl	m}
d	dlm
}g}|jD]A\}}}	||fi|��}|j%||f�|jj'd|z��C|j%d|
|�f�|||�}t)|�}t+|�}||�}t,j.j1t,j.j3t4��}t,j.j7|d�}t9j:|�}t=j<|�}|d}|d}|rA||i}t?||�}t?||�}t?||�}t?||�}t?||�}n!|jjAd|dz�|jC|�|jC|�|jC|�|jC|�|jC|�|j%||f���{|S#tj �}|jj#|�td
|z��xYw)N�familyrirj)r�r�rrzCannot determine socket type %rr)�supervisor_xmlrpc_handler)�SystemNamespaceRPCInterface)�supervisor_ui_handlerzCould not make %s rpc interfacezRPC interface %r initialized�system�ui�username�passwordz:Server %r running without any HTTP authentication checking�section)"�
LogWrapperrd�server_configsrrr�rrr�supervisor.xmlrpcrwrx�supervisor.webry�rpcinterface_factories�	traceback�
format_exc�warn�appendr�rLrpr�r��abspath�dirname�__file__r$r�
os_filesystemr�supervisor_auth_handler�critical�install_handler) rtrO�servers�wrapperrarvrirj�hsrr r!rwrxry�
subinterfaces�name�factoryr0�inst�tb�
xmlrpchandler�tailhandler�maintailhandler�	uihandler�here�templatedir�
filesystem�defaulthandlerr|r}�userss                                 r�make_http_serversr�s����G�����(�G��(�(�A%����!���V�^�^�#�������$�D�/��d�>E�G�B�
�v�~�~�
%����J��w��I��w��I�/�
�9�i�>E�G�B��>��G�H�H�?�A�8��
� '� >� >�	G��D�'�1�
K��{�0�a�0��

� � �$���.��N�N��� >�� E�F�	G�	���h�9�-�H�J�	K�1�+�}�M�
�%�k�2��-�k�:��)�+�6�	��w�w���r�w�w���x�8�9���g�g�l�l�4��.���*�*�;�7�
�(�8�8��D���*�%���*�%����h�'�E�3�E�=�I�M�1�%��E�K�5�e�_�M�O�/��y�A�I�4�U�N�K�N��N�N�#�#�*�,2�9�,=�>�
?�
	���>�*�
���9�%�
���?�+�
���;�'�
���=�)������|�$�CA%�F�N��W
K��)�)�+�����#�#�B�'� �!B�T�!I�J�J�s�	J"�"?K!c��eZdZdZd�Zd�Zy)rz\Receives log messages from the Medusa servers and forwards
    them to the Supervisor loggerc��||_yr'r�)rrds  rrzLogWrapper.__init__fs	����rc���|jd�r|dd}d|j�vr|jj|�y|jj	|�y)z�Medusa servers call this method.  There is no log level so
        we have to sniff the message.  We want "Server Error" messages
        from medusa.http_server logged as errors at least.r�Nr�r�)�endswithrKrdr��trace)rr$s  rrRzLogWrapper.logisM���<�<����c�r�(�C��c�i�i�k�!��K�K���c�"��K�K���c�"rN)rrrr)rrRrrrrrcs��%��	#rrc��eZdZd�Zd�Zy)�encrypted_dictionary_authorizerc��||_yr')�dict)rr�s  rrz(encrypted_dictionary_authorizer.__init__us	����	rc���|\}}||jvrO|j|}|jd�r*tt|��j	�}|dd|k(S||k(Sy)Nz{SHA}�F)r�rTrr�	hexdigest)r�	auth_infor|r}�stored_password�
password_hashs      r�	authorizez)encrypted_dictionary_authorizer.authorizexsl��&���(��t�y�y� �"�i�i��1�O��)�)�'�2� $�X�h�%7� 8� B� B� D�
�&�q�r�*�m�;�;�&�(�2�2�rN)rrrrr�rrrr�r�ts���
rr�c��eZdZdd�Zy)r�c�T�tj||||�t|�|_yr')r
rr��
authorizer)rr��handler�realms    rrz supervisor_auth_handler.__init__�s"�����d�D�'�5�9�9�$�?��rN)�default)rrrrrrrr�r��s��@rr�)-r�rDrfr�rrr-r�r�ImportError�getpass�supervisor.compatrrrrr�rr�rr	r
rr�supervisor.medusa.auth_handlerr
rrr+r2r;�http_requestrBr�r�r�r�rr+rLrpr�rr�r�rrr�<module>r�s6��	���
�
������%�"�&�'�5�'�)�'�%�-�7�	�	���@��(��<��8}�[�5�5�}�~F�[�5�5�F�P3%�[�4�4�3%�j�%;��<T�%;�T�l4:�4:�lC�C�J � �DG�R#�#�"�� @�l�@��q����s�D0�0	D=�<D=

Youez - 2016 - github.com/yon3zu
LinuXploit