选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
3 7²efk#ã @sždZddlZddlZddlZddlZyddlZdZWnek rLdZYnXddlZ ej dƒZ dd„Z dd „Z d d „Zd d „Zdd„Zddd„Zdd„ZdS)z8Functions that handle parsing pyzor configuration files.éNTFz((?<=[^\\])#.*)c Csžtjdƒ}tjtƒ}tjj|ƒs<|jdƒtdƒ|t j <|St |ƒ}�x>|D�]4}|j ƒ sL|dd krjqLyd d „|j d ƒDƒ\}}}Wn"tk rª|jd |ƒwLYnXydddœ|}Wn"tk rà|jd |ƒwLYnX|dk�ròd}ndd „|j ƒDƒ}|dk�r|}ndd „|j ƒDƒ}xZ|D]R} |�rZ|jddj|ƒ| ƒ|| j|ƒn"|jddj|ƒ| ƒ|| j|ƒ�q,WqLW|jƒ|jd|ƒ|S)aäLoad the ACL from the specified file, if it exists, and return an ACL dictionary, where each key is a username and each value is a set of allowed permissions (if the permission is not in the set, then it is not allowed). 'accounts' is a dictionary of accounts that exist on the server - only the keys are used, which must be the usernames (these are the users that are granted permission when the 'all' keyword is used, as described below). Each line of the file should be in the following format: operation : user : allow|deny where 'operation' is a space-separated list of pyzor commands or the keyword 'all' (meaning all commands), 'username' is a space-separated list of usernames or the keyword 'all' (meaning all users) - the anonymous user is called "anonymous", and "allow|deny" indicates whether or not the specified user(s) may execute the specified operations. The file is processed from top to bottom, with the final match for user/operation being the value taken. Every file has the following implicit final rule: all : all : deny If the file does not exist, then the following default is used: check report ping info : anonymous : allow ÚpyzordzXUsing default ACL: the anonymous user may use the check, report, ping and info commands.ÚcheckÚreportÚpingÚpongÚinforú#cSsg|]}|jƒjƒ‘qS©)ÚlowerÚstrip)Ú.0Úpartr r ú/usr/lib/python3.6/config.pyú ?sz$load_access_file..ú:zInvalid ACL line: %rTF)ZallowZdenyÚallÚ whitelistcSsg|] }|jƒ‘qSr )r )r Z operationr r rrMscSsg|] }|jƒ‘qSr )r )r Úuserr r rrRszGranting %s to %s.ú,zRevoking %s from %s.zACL: %r)rrrrr)rrrrrr)ÚloggingÚ getLoggerÚ collectionsÚ defaultdictÚsetÚosÚpathÚexistsrÚpyzorZanonymous_userÚopenr ÚsplitÚ ValueErrorÚwarningÚKeyErrorÚdebugÚjoinÚupdateÚdifference_updateÚclose) Z access_fnÚaccountsÚlogZaclZaccessfÚlineZ operationsZusersZallowedrr r rÚload_access_filesN            r+c CsÐtjdƒ}i}tjj|ƒs(|jdƒ|St|ƒ}x€|D]x}|jƒ s6|ddkrRq6y|jdƒ\}}Wn"t k r†|j d|ƒw6YnX|jƒ}|jƒ}|j d||ƒ|||<q6W|j ƒ|jdd j |ƒƒ|S) aLoad the accounts from the specified file. Each line of the file should be in the format: username : key If the file does not exist, then an empty dictionary is returned; otherwise, a dictionary of (username, key) items is returned. rzIAccounts file does not exist - only the anonymous user will be available.rrrzInvalid accounts line: %rz'Creating an account for %s with key %s.z Accounts: %sr)rrrrrrrr rr r!r#r'r$)Z passwd_fnr)r(Zpasswdfr*rÚkeyr r rÚload_passwd_filecs*      r-c)Csxi}tjdƒ}tjj|ƒ�rjt|ƒ}�x8t|ƒD�]*\}}|jƒ}| s0|jdƒrTq0y dd„|j dƒDƒ\}}} } Wn"t k r–|j d|ƒw0YnXy t |ƒ}Wn2t k rÖ} z|j d|| ƒw0WYdd} ~ XnX||f} yt jj| ƒ\} } Wn4t k �r(} z|j d|| ƒw0WYdd} ~ XnX| �rH| �rH|j d |ƒq0t jj| | | ƒ|| <q0W|jƒn |j d ƒ|S) z4Layout of file is: host : port : username : salt,keyrrcSsg|] }|jƒ‘qSr )r )r Úxr r rr‘sz!load_accounts..rz4account file: invalid line %d: wrong number of partsz!account file: invalid line %d: %sNz;account file: invalid line %d: keystuff can't be all None'szLNo accounts are setup. All commands will be executed by the anonymous user.)rrrrrrÚ enumerater Ú startswithrr r!ÚintrZaccountZkey_from_hexstrZAccountr')Úfilepathr(r)Z accountsfÚlinenoZ orig_liner*ÚhostÚportZusernamer,ZexÚaddressZsaltr r rÚ load_accounts†sD    r7c Cs�tjdƒ}tjj|ƒsg}n\g}t|ƒ�J}xB|D]:}|jƒ}tjd|ƒr0|j ddƒ\}}|j |t |ƒfƒq0WWdQRX|sŒ|j dƒd g}|S) zLoad the servers file.rz[^#][a-zA-Z0-9.-]+:[0-9]+réNz5No servers specified, defaulting to public.pyzor.org.úpublic.pyzor.orgéy_)r9r:) rrrrrrr ÚreÚmatchÚrsplitÚappendr1r)r2ÚloggerZserversÚserverfr*r6r5r r rÚ load_servers¯s       rAc Cs\tjj|ƒstƒStƒ}t|ƒ�2}x*|D]"}tjd|ƒjƒ}|r(|j|ƒq(WWdQRX|S)z Load the local digest skip file.ÚN) rrrrrÚ _COMMENT_PÚsubr Úadd)r2rr@r*r r rÚload_local_whitelistÃs   rFÚWARNc Cs¤tjdƒ}tjƒ}|r$tj}tj}n tj}tj}tj|ƒ} | j|ƒ|j|ƒ|j|ƒ| j |ƒ|rŽtj |ƒ} | j|ƒ| j|ƒ| j | ƒ|r t r t j dƒ| S)zTSetup logging according to the specified options. Return the Logger object. z3%(asctime)s (%(process)d) %(levelname)s %(message)sz:https://8cb95c088d04414e885879898a952d05@sentry.io/1443213)rZ FormatterZ StreamHandlerÚDEBUGZCRITICALÚINFOrZsetLevelZ setFormatterZ addHandlerZ FileHandlerÚ _has_sentryÚ sentry_sdkZinit) Zlog_namer2r#Z sentry_dsnZ sentry_lvlZfmtZstream_handlerZstream_log_levelZfile_log_levelr?Z file_handlerr r rÚ setup_loggingÓs(           rLcCsXxR|D]J}|j||ƒ}|sqtjj|ƒ}tjj|ƒsBtjj||ƒ}|j|||ƒqWdS)z5Set the full file path for these configuration files.N)ÚgetrrÚ expanduserÚisabsr$r)Z homefilesÚcategoryZhomedirÚconfigÚfilenamer2r r rÚexpand_homefiles÷s    rS)NrG)Ú__doc__rr;rrrKrJÚ ImportErrorZ pyzor.accountrÚcompilerCr+r-r7rArFrLrSr r r rÚs&  O#) #