/opt/alt/python37/lib/python3.7/site-packages/clselect/__pycache__
NameSizeModeActions
clextselect.cpython-37.pyc148740644editdlrm
clpassenger.cpython-37.pyc184890644editdlrm
clselect.cpython-37.pyc171060644editdlrm
clselectctl.cpython-37.pyc71490644editdlrm
clselectctlnodejsuser.cpython-37.pyc146790644editdlrm
clselectctlphp.cpython-37.pyc292120644editdlrm
clselectctlpython.cpython-37.pyc292400644editdlrm
clselectctlruby.cpython-37.pyc134050644editdlrm
clselectexcept.cpython-37.pyc150430644editdlrm
clselectprint.cpython-37.pyc50040644editdlrm
clselectstatistics.cpython-37.pyc58630644editdlrm
cluserextselect.cpython-37.pyc112340644editdlrm
cluseroptselect.cpython-37.pyc178190644editdlrm
cluserselect.cpython-37.pyc197810644editdlrm
utils.cpython-37.pyc140970644editdlrm
__init__.cpython-37.pyc6970644editdlrm
Edit: /opt/alt/python37/lib/python3.7/site-packages/clselect/__pycache__/clpassenger.cpython-37.pyc (18489B)
B ¥ÍdÖhã@sÆddlmZddlmZddlmZddlZddlZddlZddlmZddlm Z ddl m Z ddl Z ddlZddlZddlZddlZddlmZmZdd lmZdd lmZdd lmZmZdd lmZdd lmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddlm/Z/m0Z0m1Z1ddlm2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7e 8e9¡Z:e: ;ej<¡e =e>ddƒ¡Z?e: @e?¡dZAdZBdZCdZDdZEdZFdZGdZHd ZId!d"„ZJd#d$„ZKd%d&„ZLd'd(„ZMd)d*„ZNd+d,„ZOd-d.„ZPd/d0„ZQd1d2„ZRd3d4„ZSd5d6„ZTd7d8„ZUd9d:„ZVd;d<„ZWd=d>„ZXd?ddeHdfd@dA„ZYdBdC„ZZd^dDdE„Z[dFdG„Z\eHfdHdI„Z]dJdK„Z^d_dLdM„Z_dNdO„Z`dPdQ„Zad`dRdS„ZbdTdU„ZcdVdW„ZddXdY„ZedZd[„Zfd\d]„ZgdS)aé)Úabsolute_import)Úprint_function)ÚdivisionN)Údatetime)Ú iteritems)Ú configparser)Ú clcaptainÚutils)Ú userdomains)Ú*get_file_system_in_which_file_is_stored_on)Úget_file_linesÚwrite_file_lines)Ú mod_makedirs)Ú QuotaWrapperÚNoSuchUserExceptionÚInsufficientPrivilegesExceptionÚIncorrectLimitFormatExceptionÚGeneralExceptionÚNoSuchPackageExceptionÚQuotaDisabledException)ÚPyLveÚ PyLveError)Ú set_user_permÚ set_root_perm)ÚDictÚUnioné)ÚClSelectExcept)Úfile_readlinesÚ file_writeÚ s_partition)Ú get_abs_relÚmkdir_pÚ file_readÚfile_writelines)Úget_using_realpath_keysÚrealpaths_are_equalz /dev/nullÚwz9# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION BEGINz7# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION ENDz config.ruzÌapp = proc do |env| message = "It works!\n" version = "Ruby %s\n" % RUBY_VERSION response = [message, version].join("\n") [200, {"Content-Type" => "text/plain"}, [response]] end run app ztmp/restart.txtzpassenger_wsgi.pyaMimport os import sys sys.path.insert(0, os.path.dirname(__file__)) def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) message = 'It works!\n' version = 'Python %s\n' % sys.version.split()[0] response = '\n'.join([message, version]) return [response.encode()] zapp.jsaCvar http = require('http'); var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); var message = 'It works!\n', version = 'NodeJS ' + process.versions.node + '\n', response = [message, version].join('\n'); res.end(response); }); server.listen(); cCs t |¡}t|j|jdddS)NF)Úexit)ÚpwdÚgetpwnamrÚpw_uidÚpw_gid)ÚuserÚuserpwd©r/úE/opt/alt/python37/lib/python3.7/site-packages/clselect/clpassenger.pyÚdrop_root_perm^s r1cCs>y$t||dd}t | ¡tj¡|Stk r8dSXdS)NÚsurrogateescape)Úerrors)ÚopenÚfcntlÚflockÚfilenoÚLOCK_EXÚIOError)Ú config_pathÚmodeÚ conf_filer/r/r0Úget_config_lockcs r=cCsy | ¡Wn YnXdS)N)Úclose)Z lock_filer/r/r0Ú release_lockls r?c CsÌd}t ¡dkst ¡dkr(t|ƒd}d}z‚y8t|ƒt|dƒ}t ¡}| |¡t  ||  ¡¡WnDt t t jtjfk rª}zt tjd ||¡¡Wdd}~XYnXWdt|ƒ|rÆtddXdS)zS Write config with locking. Drop permissions if method called as root. FrTNÚrzCan't write {}: {})r()ÚosÚgetegidÚgeteuidr1Úcheck_and_createdirr=ÚioÚStringIOÚwriterÚgetvaluer9ÚOSErrorrÚUnableToSaveDatar ÚExternalProgramFailedÚsyslogÚ LOG_WARNINGÚformatr?r)r-r:ÚconfigZpermissions_droppedÚ config_fileZ file_contentÚer/r/r0Ú write_configss"  $rRc Csdtj |¡}tj |¡s`yt |¡Wn8ttjt jfk r^}zt  ||¡‚Wdd}~XYnXdS)N) rAÚpathÚdirnameÚisdirrÚmkdirrIrrKr rJ)rSÚuser_backup_pathrQr/r/r0rD’s   rDcCst |¡}tj |jdd¡S)Nz .cl.selectorÚhtaccess_cache)r)r*rArSÚjoinÚpw_dir)r-r.r/r/r0Úget_htaccess_cache_paths r[c Cs`d}d}i}tj |¡r\yt |¡}|j|d<|j|d<|j|d<t|jƒ|d<t   |j ¡  |¡|d<t   |j ¡  |¡|d<|dd kr|SyDt|d ƒ0}| |¡|d <| | d ¡| |¡|d <WdQRXWn:ttfk r}zd|||f|d<Wdd}~XYnXt|ƒd|d<Wn8ttfk rZ}zd||f|d<Wdd}~XYnX|S)zp Get info (stat, first n symbols and file system in which file is stored) about htaccess_cache file z%Y-%m-%d %H:%M:%SédÚ file_sizeÚgidÚuidZ permissionsZ last_accessZlast_modificationrr@Z first_symbolséZ last_symbolsNzEWe cannot get first and last %s symbols from "%s" file. Exception: %sÚerrorÚdetailsZ file_systemz1We cannot get info about "%s" file. Exception: %s)rArSÚexistsÚstatÚst_sizeÚst_gidÚst_uidÚoctÚst_moderÚ fromtimestampÚst_atimeÚstrftimeÚst_mtimer4ÚreadÚseekrIr9r )Ú path_to_fileÚ time_formatZnumber_of_symbolsÚ file_infoZ file_statÚfÚerrr/r/r0Ú#_get_info_about_htaccess_cache_file¢s<      ruc Cs¦tƒ}yhtƒ}| ¡| |¡}|j|j|d<|j|d<|j|d<|j|d<|j |d<|j |d<|j |d<Wn2t k r }zd||f|d <Wd d }~XYnX|S) zB Getting user lve limits for logging those for next debug ÚcpuÚpmemZvmemrEZiopsÚepZnprocz>We cannot get lve limits for user with uid "%s". Exception: %sraN) ÚdictrZ initializeZlve_infoZls_cpuZ ls_cpu_weightZ ls_memory_phyZ ls_memoryZls_ioZls_iopsZ ls_entersZls_nprocr)Úuser_uidÚresultZpy_lveZ user_limitsrtr/r/r0Ú_get_user_lve_limitsÏs"      r|cCsrtƒ}t|ƒ}ytƒ}| |¡|}|}WnBtttttt t t fk rl}zd||f|d<Wdd}~XYnX|S)zD Getting user quota limits for logging those for next debug z@We cannot get quota limits for user with uid "%s". Exception: %sraN) ryÚstrrZget_user_limitsrrrrrrr9rI)rzr{Z quota_wrapperZ user_quotasrtr/r/r0Ú_get_user_quota_limitsés&r~c CsÐt|ƒ}tƒ}||d<tƒ|d<yt |¡j}Wn:tk rj}zd||f|dd<d}Wdd}~XYnX|dk r¼tƒ|dd<|dd t|ƒ¡tƒ|dd<|dd t|ƒ¡t j |d|d dS) zy Logging info (lve & quota limits) about user and info (stat info, first & last n symbols) about config file Zconfig_file_infoZ user_infoz(User "%s" does not exists. Exception: %sraNZ lve_limitsZ quota_limitsT)Úexc_infoÚextra) ruryr)r*r+ÚKeyErrorÚupdater|r~ÚloggerÚ exception)r-r:rarrZ debug_inforzrtr/r/r0Ú*_log_debug_info_about_user_and_config_files" r…c CsÂtjdd}t|ƒ}t|dƒ}|dk rºzˆy| |¡Wntttfk rh}zt|||ƒWdd}~XYnDtjtj fk rªt |ƒt   t j d  |¡¡tjdd}YnXWdt|ƒX||fS)NF)Ústrictr@zConfig {} is broken.)Ú ConfigParserÚRawConfigParserr[r=Úreadfpr9rIr…Ú ParsingErrorÚMissingSectionHeaderErrorÚ_unlinkrLrMrNr?)r-rOr:rPrtr/r/r0Ú read_config"s    rcCsHt|ƒ\}}| |¡rDy| |d¡ d¡}|Stjk rBdSXdS)NÚ htaccess_listú,)rÚ has_sectionÚgetÚsplitr‡Ú NoOptionError)r-Údoc_rootrOÚ_rŽr/r/r0Úget_htaccess_cache9s  r–cCs\| d¡}ttt|ƒƒ}t|ƒ\}}| |¡s8| |¡| |dd |¡¡t |||ƒdS)NÚ rŽr) r’ÚlistÚfilterÚboolrrÚ add_sectionÚsetrYrR)r-r”ÚdatarOr:r/r/r0Úwrite_htaccess_cacheDs    ržcCsŠt|ƒ\}}| |¡r*| |d¡ d¡}n| |¡| |dd¡g}||kr†| |¡ttt |ƒƒ}| |dd  |¡¡t |||ƒdS)NrŽrÚ) rrr‘r’r›rœÚappendr˜r™ršrYrR)r-rpr”rOr:rŽr/r/r0Úupdate_htaccess_cachePs    r¡cCsjt|dd}g}d}x8|D]0}| t¡r,d}| t¡rÈszconfigure..)Ú startup_file)r!rArSrcrUrÚ WebAppErrorÚInterpreterErrorÚsummaryr%rÚNoSuchApplicationÚnormpathrYr#r£ÚvaluesÚseprTÚ commonprefixÚ splitlinesr Útitler¤r¥r"r$r¡Ú populate_app)r-r¯r±Ú interpreterÚbinaryZpopulateÚactionr”r´Úpassenger_log_fileÚabs_dirr•Ú user_summaryÚ app_summaryZ exists_dirZ abs_aliasÚhtaccessZhtaccess_needs_updateÚ htaccess_rawÚitemZ item_aliasr§r/r/r0Ú configurevsp    $          rÊc CsÆxÀtt|ƒƒD]°\}}|\}}tj |d|df¡}t|d|ƒ\}}}tj |d¡}tj |d¡}t||ƒ\}}} tj t || ƒd|¡} |d} t | ƒt ||||d| |ddqWdS)Nr¯rÁrrÇrÀr°)r”) rÚ_summaryrArSr¼r rTÚbasenamerYr!Ú _unconfigurerÊ) r-Ú domain_aliasrr•r±Zold_homer¯Z binary_dirZ binary_nameZ_binaryrÁZ htaccess_pathr/r/r0Ú fix_homedirÐsrÏc Csªt||t|ƒƒ}|p|d}|p"|}tj ||¡}tj |d¡}tj ||¡} tj | d¡} t||| ƒs¦t|ƒt|dd} t|dƒ  ¡t | | dddt || |ƒdS)Nr°z .htaccessr2)r3r'Úa) r%r·rArSrYr&rÍrr4r>r$r¡) r-r¯Z old_aliasZ new_aliasZ old_doc_rootZ new_doc_rootÚapp_dataZ old_abs_aliasZ old_htaccessZ new_abs_aliasZ new_htaccessr§r/r/r0Úmoveâs   rÒcCs xt|ƒD]}t||ƒq WdS)N)r·Ú unconfigure)r-r¯r/r/r0ÚpurgeõsrÔcCsŠt||ƒ\}}tj |d¡}tj |d¡}t|ƒt|ƒtj |t¡}tj |t¡} tj ||¡} tj |¡} tj | ¡} tj | ¡} | r˜t|ƒt k}| r¨t| ƒt k}| r¸t| ƒt k}|dkrè| sÎt | t ƒ| ræ|ræt |ƒt | ƒn”|dkr"| st |t dƒ| r||r|t | ƒt | ƒnZ|dkr|| s`tj | ¡}tj |¡sVt|dƒt | t ƒ| r||r|t |ƒt | ƒt||ƒdS) zò Populate application :param user: name of unix user :param directory: application path in user's home :param interpreter: interpreter which run application :param startup_file: main application file :return: None ÚpublicÚtmpr¬r­r'r®iíN)r!rArSrYr"Ú RACK_PATHÚ WSGI_PATHÚisfiler#Ú RACK_TEMPLATEÚ WSGI_TEMPLATEÚAPPJS_TEMPLATErrŒrTrUrÚrestart)r-r¯rÀr´rÄÚrel_dirZ app_publicZapp_tmpZ app_configruZapp_wsgiZapp_jsZconfigru_installedZwsgi_installedZappjs_installedZconfigru_unchangedZwsgi_unchangedZappjs_unchangedZdir_pathr/r/r0r¿úsN                  r¿cCs(yt |¡Wntk r"YnXdS)N)rAÚunlinkrI)rSr/r/r0rŒ1srŒc CsÄ|dkrt|ƒn|}g}x |D]˜\}}|dkr0qt||ƒ}|s~tjd|ddgtjtjdd}| ¡\}} t|||ƒt||ƒ}|dkrˆqx,|D]$} | rŽtj  | ¡} |  || |f¡qŽWqWt ||ƒS)Nz /bin/findz-namez .htaccessT)ÚstdoutÚstderrÚtext) r r–Ú subprocessÚPopenÚPIPEÚ communicateržrArSrTr Ú_htaccess_summary) r-Úuserdomains_dataZdomain_docroot_pairsÚdomain_alias_docrootÚdomainr”rXÚpZ stdoutdatar•Zht_pathr±r/r/r0rË8s*      rËc Cs i}x|D] \}}}tj |d¡}yt|dd}Wnttfk rPw YnXt d|tj¡}|shq t d|tj¡} | s~q t ||ƒ\} } t ||ƒ\} } t | | ƒ\} } }|  tj ¡}||f} t d|tj¡}|ræt | ¡d|ƒsæq |||| ¡d|  ¡d  ¡|  ¡d d œ|| <q W|S) Nz .htaccessr2)r3z+^PassengerAppRoot\s+"?(?P.+?)"?$zD^Passenger(?PPython|Ruby|Nodejs)\s+"?(?P.+?)"?$z(^PassengerBaseURI\s+"?(?P.+?)"?$Úappurir¯rÀrÁ)rÇrêr°r¯rÀrÁ)rArSrYr#r9rIÚreÚsearchÚ MULTILINEr!r Úlstripr»Úcompare_aliasesÚ groupdictÚlower)r-réÚsummrêr±r”rÇrÈÚapprootrÀZ alias_absr•Z doc_root_absrÎrìr/r/r0rçXsB     rçcCs$tj | d¡¡tj | d¡¡kS)Nú/)rArSr¹Ústrip)Zalias1Zalias2r/r/r0rñ…srñc Csâi}xØtt||dƒD]Ä\}}|\}}|d}yt||ƒ\}} Wn8tjk rxt tjd tj   |d¡|¡¡wYnX||d<yt || |ƒ} Wn&t k r¸|g|d<||| <YqXd| krÌg| d<q| d  |¡qW|S)N)rèr¯z1{} is broken, directory {} is not in user's home.z .htaccessr±Údomains)rrËr!rÚ WrongDatarLrMrNrArSrYr%rr ) r-rèZ summ_resultrÎÚvaluerêr±Úapp_rootr•r¯rÆr/r/r0r·‹s.   r·cCs$t||t|ƒƒ}|d}t|ƒdS)NrÇ)r%r·rÍ)r-r¯rÑrÇr/r/r0rÓ¬srÓcCs|t|dd}| ¡}g}d}x8|D]0}|tkr4d}q"|tkrBd}q"|rHq"| |¡q"Wt|ƒ}t|dd„|DƒddddS)Nr2)r3FTcss|]}d|VqdS)z%s Nr/)r²rªr/r/r0r³Äsz_unconfigure..r')r#r½r£r¤r r¥r$)rÇrÈr§r¨r©rªr/r/r0rͲs   rÍccs.x(| tj¡D]}tj ||¡}|VqWdS)N)r’rAr»rSrY)ÚrootÚsubrër/r/r0Ú iter_pathÇsrþcCsŠt||ƒ\}}tj |¡s,t dd|i¡‚tj |d¡}tj |¡sPt |¡tj |t¡}tj |¡rxt  |d¡nt |dƒ  ¡dS)NzMissing directory %(abs_dir)srÄrÖrÐ) r!rArSrcrÚMissingApprootDirectoryrYrVÚ RESTART_PATHÚutimer4r>)r-r¯rÄr•Ztmp_dirZ app_restartr/r/r0rÝÍs    rÝcCsNg}d}x0|D](}| ¡r d}n |r(qnd}| |¡qW|rJ|dd…S|S)NTFéÿÿÿÿ)r÷r )r§Ú_linesZ empty_linerªr/r/r0r¥Üs  r¥)NN)N)N)hÚ __future__rrrr5r)rLrÚ future.utilsrÚ future.movesrr‡rEÚloggingrArírãZclcommonrr Úclcommon.cpapir Úclcommon.utilsr r r rZclquotarrrrrrrZlveapirrÚsecureiorrÚtypingrrÚclselectexceptrrrr r!r"r#r$r%r&Ú getLoggerÚ__name__rƒÚsetLevelÚERRORÚ StreamHandlerr4Z null_handlerÚ addHandlerr£r¤r×rÚrrØrÛZ APPJS_PATHrÜr1r=r?rRrDr[rur|r~r…rr–ržr¡r«rÊrÏrÒrÔr¿rŒrËrçrñr·rÓrÍrþrÝr¥r/r/r/r0ÚsŒ         $        -  Y  7 - !