Files
CyberPanel/plogical/applicationInstaller.pyc

143 lines
18 KiB
Plaintext
Raw Normal View History

2018-07-29 01:20:46 +05:00
<03>
<EFBFBD><EFBFBD>\[c@s ddlZddlZejjd<00>ddlZejjdd<00>ej<00>ddlZ ddl
m Z ddl Z ddlZddlmZddlmZmZddlZddlmZdd lmZdd
lmZddlZdd lmZd e jfd <00><00>YZdS(i<><69><EFBFBD><EFBFBD>Ns/usr/local/CyberCPtDJANGO_SETTINGS_MODULEsCyberCP.settings(tCyberCPLogFileWriter(tvhost(t ChildDomainstWebsites(tmysqlUtilities(t Databases(tinstallUtilities(t mailUtilitiestApplicationInstallercBsbeZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d<00>Z
d <00>Z RS(
cCs&tjj|<00>||_||_dS(N(tmultitThreadt__init__t
installAppt extraArgs(tselfR R((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR s cCs<>y<>|jdkr|j<00>n<>|jdkr;|j<00>np|jdkrW|j<00>nT|jdkrs|j<00>n8|jdkr<>|j<00>n|jdkr<>|j<00>nWn*tk
r<>}tj t
|<00>d<17>nXdS(Nt wordpresstjoomlatgittpulltdetacht changeBranchs [ApplicationInstaller.run]( R tinstallWordPresst installJoomlatsetupGittgitPullt
detachRepoRt BaseExceptiontloggingt writeToFiletstr(Rtmsg((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pytruns     cCs<>yXd}tjtj|<00><00>d}tjtj|<00><00>d}tjtj|<00><00>Wn*tk
r<>}tjt|<00>d<17>nXdS(NsSsudo wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.pharssudo chmod +x wp-cli.pharssudo mv wp-cli.phar /usr/bin/wps$ [ApplicationInstaller.installWPCLI](t
subprocesstcalltshlextsplitRRRR(RtcommandR((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyt installWPCLI.scCsmy<d}tjtj|<00><00>d}tjtj|<00><00>Wn*tk
rh}tjt|<00>d<17>nXdS(NsTsudo yum -y install http://repo.iotti.biz/CentOS/7/noarch/lux-release-7-1.noarch.rpmssudo yum install git -ys" [ApplicationInstaller.installGit](R!R"R#R$RRRR(RR%R((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyt
installGit<scCs<>y<>|jd}|jd}|jd}|jd}|jd}|jd}|jd}|jd}y;d } tjtj| <00><00>}
|
d
kr<>|j<00>nWntjk
r<>|j<00>nXt|d <00>} | jd <00>| j <00>ywt
j j d |<00>} | j j} |jd
krc| j j|krct|d <00>} | jdd<17>| j <00>dSnWnttj j d |<00>} | j} |jd
kr<>| j|kr<>t|d <00>} | jdd<17>| j <00>dSq<53>nXd}|dkr|jd}d|d|d}nd|d}|jd<00>dkrdt|d <00>} | jdd<17>| j <00>dSttjd <00>}tjj|<00>s<>d|} tjtj| <00><00>ntj|<00>}t|<00>d
kr|ddkr<>qSt|d <00>} | jdd<17>| j <00>dSnCt|<00>dkr%n.t|d <00>} | jdd<17>| j <00>dSt|d <00>} | jd<00>| j <00>tj<00>}|}tj<00>}| jj| jj<00>j<00>kr<>n.t|d <00>} | jdd<17>| j <00>dSt j j!d|<00>j<00>st j j!d |<00>j<00>rMt|d <00>} | jd!d<17>| j <00>dSt"j#|||<00>}|d
krqn.t|d <00>} | jd"d<17>| j <00>dSt d#| d|d |<00>}|j$<00>t|d <00>} | jd$<00>| j <00>d%|} tjtj| <00><00>t|d <00>} | jd&<00>| j <00>d'|d(|d)|d*|} tjtj| <00><00>|dkr<>|jd}|d|}n|}d+|d,|d-|d.|d/|d0|} tjtj| <00><00>t|d <00>} | jd1<00>| j <00>d2|} tjtj| <00><00>t|d <00>} | jd3<00>| j <00>d4|} tjtj| <00><00>d5| d6| d7d|d} tj| <00>}tj|d8|d9tj%<00>}
t&j'|<00>t(j)<00>t|d <00>} | jd:<00>| j <00>dSWn<57>t*k
r<>}y;d;|} tj| <00>}tj|d8|d9tj%<00>}
Wn*t*k
rv}t+j,t-|<00>d<<17>nXd|d=}tjj|<00>sttjd <00>}d>|} tjtj| <00><00>d5| d6| d7|} tj| <00>}tj|d8|d9tj%<00>}
ny3t"j.||<00>t j j d|<00>}|j/<00>WnnXt|d <00>} | jt-|<00>d<17>| j <00>dSXdS(?Ntadmint
domainNamethomettempStatusPatht blogTitlet adminUsert adminPasswordt
adminEmailssudo wp --infoitwsSetting up paths,0tdomainsYou do not own this website.s [404]itt0tpaths/home/s /public_html/t/s..i<><69><EFBFBD><EFBFBD>s0Specified path must be inside virtual host home.ssudo mkdir -p s .well-knownsVTarget directory should be empty before installation, otherwise data loss could occur.sSetting up Database,20s0Maximum database limit reached for this website.tdbNametdbUsers'This database or user is already taken.sNot able to create database.twebsitesDownloading WordPress Core,30s*sudo wp core download --allow-root --path=sConfiguring the installation,40ssudo wp core config --dbname=s
--dbuser=s
--dbpass=s7 --dbhost=localhost --dbprefix=wp_ --allow-root --path=s#sudo wp core install --url="http://s " --title="s" --admin_user="s" --admin_password="s" --admin_email="s" --allow-root --path=sInstalling LSCache Plugin,80s;sudo wp plugin install litespeed-cache --allow-root --path=sActivating LSCache Plugin,90s<sudo wp plugin activate litespeed-cache --allow-root --path=ssudo chown -R t:t tstdouttstderrsSuccessfully Installed. [200]s sudo rm -rf s [installWordPress]s /public_htmls sudo mkdir (0RR!R"R#R$R&tCalledProcessErrortopent
writelinestcloseRtobjectstgettmastert externalAppttypeR(RtfindtostdevnullR4texiststlistdirtlentrandomPasswordt generate_passtpackaget dataBasest databases_settalltcountRtfilterRtcreateDatabasetsavetSTDOUTRtaddRewriteRulesRtreStartLiteSpeedRRRRtdeleteDatabasetdelete(RR(R)R*R+R,R-R.R/R%trest
statusFileR8RDt finalPathR4tFNULLtdirFilesR6R7t
dbPasswordtresulttdbtfinalURLtcmdRthomeDir((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyRHs8          
 
  
   


 
 
  ! 
' 
  

 

 
"  2 

 

" 
 

"
!
cCs<>yG|jd}|jd}|jd}|jd}|jd}|jd}|jd}t|d<00>}|jd <00>|j<00>d
|d } y<>d }
tjtj|
<00><00>} | d krt|d<00>}|jd<00>|j<00>|j<00>t|d<00>}|jd<00>|j<00>nWnjtj k
r<>t|d<00>}|jd<00>|j<00>|j<00>t|d<00>}|jd<00>|j<00>nXt|d<00>}|jd<00>|j<00>ywt
j j d|<00>} | j j} |jd kr"| j j|kr"t|d<00>}|jdd<17>|j<00>dSnWnttj j d|<00>} | j} |jd kr<>| j|kr<>t|d<00>}|jdd<17>|j<00>dSq<53>nX| jd<00>dkr<>t|d<00>}|jdd<17>|j<00>dSttjd<00>}tjj| <00>s$d| }
tjtj|
<00><00>ntj| <00>}t|<00>d kr<>|ddkrXq<>t|d<00>}|jdd<17>|j<00>dSnCt|<00>dkr<>n.t|d<00>}|jdd<17>|j<00>dSt|d<00>}|jd<00>|j<00>yFd|d|d|d |d!| }
tjtj|
<00><00>}Wn=tj k
rw}t|d<00>}|jd"<00>|j<00>dSXd#| d$| d!| }
tj|
<00>}tj|d%|d&tj<00>} tj|<00>tj<00>tj <00>d'|d(}t|d<00>}|j!|d$|<17>|j<00>t|d<00>}|jd)<00>|j<00>dSWnYt"k
r<>}tj#d'|d(<17>t|d<00>}|jt$|<00>d<17>|j<00>dSXdS(*NR(R)tusernametreponametbranchR+tdefaultProviderR0sChecking if GIT installed..,0s/home/s /public_html/ssudo git --helpisInstalling GIT..,0sGIT successfully installed,20sGIT successfully installed.,20sSetting up directories..,20R1sYou do not own this website.s [404]is..i<><69><EFBFBD><EFBFBD>s0Specified path must be inside virtual host home.ssudo mkdir -p s .well-knownsWTarget directory should be empty before attaching GIT, otherwise data loss could occur.sCloning the repo..,40s|sudo GIT_SSH_COMMAND="ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no" git clone --depth 1 --no-single-branch git@s.com:R5s.git -b R:sPFailed to clone repository, make sure you deployed your key to repository. [404]ssudo chown -R R9R;R<s/home/cyberpanel/s.gits+GIT Repository successfully attached. [200](%RR>R?R@R!R"R#R$R'R=RRARBRCRDRER(RRFRGRHR4RIRJRKt check_outputRVRRWRRXRt checkHometwriteRtremoveR(RR(R)RfRgRhR+RiR\R]R%R[R8RDR^R_RaRRdtgitPathR((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR8s<>        
  

  

  
 
  
 


 
 
* 
 


 

cCs<>y<>|jd}d|d}tjj|<00>sAtjd<00>dSd|d}tjtj |<00><00>t
j j d|<00>}|j }d|d |d
d |d }tj |<00>}tj|<00>dSWn+tk
r<>}tjt|<00>d <17>dSXdS(NR1s/home/cyberpanel/s.gits"Git is not setup for this website.is^sudo GIT_SSH_COMMAND="ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no" git -C /home/s/public_html/ pullssudo chown -R R9R:s/home/s /public_html/s [ApplicationInstaller.gitPull](RRGR4RIRRR!RjR#R$RRARBRDR"RR(RR1R4R%R8RDRdR((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR<00>s"   " c Cs<>yw|jd}|jd}yZtjjd|<00>}|jj}|jdkrv|jj|krvtj d<00>dSnWnWt
jjd|<00>}|j}|jdkr<>|j|kr<>tj d<00>dSq<53>nXd|d}t j t j|<00><00>d |d}t j t j|<00><00>d
|d |d d |d}t j|<00>}t j|<00>d|d}tj|<00>dSWn+tk
r<>}tj t|<00>d<17>dSXdS(NR)R(R1is1You do not own this website, detach failed. [404]issudo rm -rf /home/s /public_htmlssudo mkdir /home/ssudo chown -R R9R:s/home/s/home/cyberpanel/s.gits [ApplicationInstaller.gitPull](RRRARBRCRDRER(RRRR!RjR#R$R"RGRmRR( RR1R(R8RDR%RdRnR((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR<00>s<        "  c'Cs<>y<>|jd}|jd}|jd}|jd}|jd}|jd}|jd}|jd}|jd } |jd
}
|jd } ttjd <00>} tjj|<00>s<>tj|<00>ntj|<00>} t| <00>d kr+| ddkr<>qnt| d <00>}|j dd<17>|j
<00>dSnCt| <00>dkr@n.t| d <00>}|j dd<17>|j
<00>dStj |<00>tjjd<00>s<>d|}t j |<00>}tj|d| dtj<00>}n.t| d <00>}|j dd<17>|j
<00>dSd|d|}t j |<00>}tj|d| dtj<00>}tj|d<17>d|d|}t j |<00>}tj|d| dtj<00>}tj|d<17>tj|d|d<17>tj|d|d<17>tj|d |d!<17>t| d <00>}|j d"<00>|j
<00>|d}t|d#<00>j<00>}t|d <00>}tj<00>}d$|d%d&}d'|d%d&}d(|d%d&}d)|d%d&}d*|d+d&}d,|d-d&}d.| d%d&}d/|
d%d&}
xs|D]k}|jd0<00>d1kr<>|j |<00>q<>|jd2<00>d1kr$|j |<00>q<>|jd3<00>d1krI|j |<00>q<>|jd4<00>d1krn|j |<00>q<>|jd5<00>d1kr<>|j |<00>q<>|jd6<00>d1kr<>|j |<00>q<>|jd7<00>d1kr<>|j |<00>q<>|jd8<00>d1kr|j |
<00>q<>|jd9<00>d1krq<>|jd:<00>d1kr2q<>|j |<00>q<>W|j
<00>t| d <00>}|j d;<00>|j
<00>t|d<d#<00>}td=d <00>}x'|D]} |j| jd>| <00><00>q<>W|j
<00>|j
<00>tjd?d@|dA||gdBtjdtj<00>}!dC| ||| f}"|!jt|d=<17>j<00>d&|"<17>\}#}$tj|dD<17>dE|dF|dGdH|dI}t j |<00>}tj|d| dtj<00>}t j!|<00>t"j#<00>t| d <00>}|j dJ<00>|j
<00>dSWn<57>t$k
r<>}%ytj|<00>Wnt%j&dK<00>nXdH|dL}&tjj|&<00>s<>ttjd <00>} tj'|&<00>dE|dF|dG|&}t j |<00>}tj|d| dtj<00>}nt| d <00>}|j t(|%<00>d<17>|j
<00>dSXdS(MNR)R]tvirtualHostUserR6R7R`RftpasswordtprefixtsitenameR+R0iis .well-knownsVTarget directory should be empty before installation, otherwise data loss could occur.s [404]s staging.zipsXwget --no-check-certificate https://github.com/joomla/joomla-cms/archive/staging.zip -P R;R<sFile already exists.sunzip sstaging.zip -d scp -r sjoomla-cms-staging/. sjoomla-cms-stagings#installation/configuration.php-distsconfiguration.phpsrobots.txt.dists
robots.txts htaccess.txts .htaccesss Creating configuration files.,40trs public $user = 's';s
s public $db = 's public $password = 's public $secret = 's public $log_path = 'sadministrator/logs';s public $tmp_path = 'sadministrator/tmp';s public $dbprefix = 's public $sitename = 's public $user i<><69><EFBFBD><EFBFBD>spublic $password s public $db spublic $log_path spublic $tmp_path spublic $secret spublic $dbprefix spublic $sitename s/*s *sCreating default user..,70s!installation/sql/mysql/joomla.sqls(installation/sql/mysql/joomlaInstall.sqls#__tmysqls --user=%ss --password=%ststdins<6E>INSERT INTO `%susers`
(`name`, `username`, `password`, `params`)
VALUES ('Administrator', '%s',
'%s', '');
INSERT INTO `%suser_usergroup_map` (`user_id`,`group_id`)
VALUES (LAST_INSERT_ID(),'8');t installations chown -R R9R:s/home/s /public_html/sSuccessfully Installed. [200]sshutil.rmtree(finalPath)s /public_html()RR>RGRHR4RItmakedirsRJRKR?R@tchdirR#R$R!R"RVRmtshutiltrmtreetrenamet readlinesRLRMRFRltreplacetPopentPIPEt communicatetfiletreadRRWRRXRRRtmkdirR('RR)R]RoR6R7R`RfRpRqRrR+R^R_R\R%RdR[t
configfiletdatatwriteDataToFiletsecrett defDBNamet defDBUsert defDBPasswordt secretKeytlogPathttmpPathtdbprefixtitemstf1tf2tlinetproct usercreationtoutterrRRe((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyRs           
 
 
!
 

  
 
 

 '" 
 
 !
cCsFy+|jd}|jd}|jd}yNtjjd|<00>}|jdkrw|jj|krwtjd<00>dSnWnNt jjd|<00>}|jdkr<>|j|kr<>tjd<00>dSq<53>nXy,d|d |}t
j t j |<00><00>Wn.t
jk
r%}tjd
t|<00><17>dSXdSWntk
rA}dSXdS( NR)t githubBranchR(R1is;You do not own this website, failed to change branch. [404]is^sudo GIT_SSH_COMMAND="ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no" git -C /home/s/public_html/ checkout -bsFailed to change branch: (RRRARBRERCR(RRRR!RjR#R$R=RR(RR)R<>R(R8R%R((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR<00>s2       ( t__name__t
__module__R R R&R'RRRRRR(((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyR s    <09> <09>  / <09>(RGtsysR4tappendtdjangotenviront
setdefaulttsetupt threadingR
tplogical.CyberCPLogFileWriterRRR!R#RtwebsiteFunctions.modelsRRRLRtdatabases.modelsRRRytplogical.mailUtilitiesRR R (((sF/home/usman/CyberPanelPremium/CyberCP/plogical/applicationInstaller.pyt<module>s"