File manager - Edit - /usr/local/CyberCP/plogical/__pycache__/applicationInstaller.cpython-310.pyc
Back
o �����h�o���������������������@���sb��d�dl�Z�d�dlZd�dlZd�dlZd�dlZd�dlZd�dlmZ�d�dlZd�dl m Z �d�dlmZ�d�dl mZ�d�dlmZ�ej�d��d�dlZej�dd ��e����d�dlZd�d lmZ�d�dlZd�dlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%�d�dl&m'Z'�d�d l(m)Z)�d�dl*m+Z+�d�dl,m-Z-�d�dl.m/Z/�d�dl0m1Z1�d�dl2Z2G�dd��dej3�Z4dd��Z5e6dkr�e5���dS�dS�)�����N)�StringIO)�ApacheVhost)� Administrator�� PHPManager)� ACLManagerz/usr/local/CyberCP�DJANGO_SETTINGS_MODULEzCyberCP.settings)�CyberCPLogFileWriter)�ChildDomains�Websites�WPSites� WPStaging� wpplugins� WPSitesBackup�RemoteBackupConfig�NormalBackupDests)�randomPassword)�mysqlUtilities)� Databases��installUtilities)�ProcessUtilities)�randintc�������������������@���s��e�Zd�ZdZdZdZdZdZdd��Zdd ��Z d d��Z edd ���Zdd��Z dd��Zdd��Zdd��Zdd��ZdAdd�Zdd��Zdd��Zdd ��Zd!d"��Zd#d$��Zd%d&��Zd'd(��Zd)d*��Zd+d,��Zd-d.��Zd/d0��Zd1d2��Zd3d4��Zd5d6��Z d7d8��Z!d9d:��Z"d;d<��Z#d=d>��Z$d?d@��Z%dS�)B�ApplicationInstaller� localhostr����3306z4.4.9z1.7.8.3c�����������������C���sF���t�j�|���||�_||�_|d�krz|�jd�|�_W�n���Y�|�j|�_d�S�)N�tempStatusPath)�multi�Thread�__init__� installApp� extraArgsr����data)�selfr ���r!�����r$����3/usr/local/CyberCP/plogical/applicationInstaller.pyr���*���s���zApplicationInstaller.__init__c�������������� ���C���s ��z�|�j�dkr |�����W�d�S�|�j�dkr|�����W�d�S�|�j�dkr%|�����W�d�S�|�j�dkr1|�����W�d�S�|�j�dkr=|�����W�d�S�|�j�dkrI|�����W�d�S�|�j�dkrU|�����W�d�S�|�j�dkra|�����W�d�S�|�j�d krm|�� ���W�d�S�|�j�d kry|�� ���W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�|�j�d kr�|�� ���W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�|�j�dkr�|�����W�d�S�W�d�S��t�y�}�zt�t|�d���W�Y�d�}~d�S�d�}~ww�)N� wordpress�joomla� prestashop�magento�convertDomainToSite� updatePackage�mautic�wordpressInstallNew� UpdateWPTheme�UpdateWPPlugin�DeleteThemes� DeletePlugins�ChangeStatusThemes�CreateStagingNow�DeploytoProduction�WPCreateBackup�RestoreWPbackupNow� UpgradeCP�StartOCRestorez [ApplicationInstaller.run])r ����installWordPress� installJoomla�installPrestaShop�installMagentor*���r+���� installMauticr-���r.���r/���r0���r1���r2���r3���r4���r5���r6���r7���r8���� BaseException�logging�writeToFile�str)r#����msgr$���r$���r%����run6���sX��� � ��zApplicationInstaller.runc�����������������C���s ���d|�j�d���d�}t�|��d�S�)NzU/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/upgrade.py "SoftUpgrade,�branchSelect�")r"���r����executioner)r#����commandr$���r$���r%���r7���c���s���zApplicationInstaller.UpgradeCPc������������������C���s`���t�j�d�rt��d��t�j�d�s.d}�t�|�dd��d}�t�|�dd��d}�t�|�dd��d�S�d�S�)Nzcomposer.shz/usr/bin/composerz&wget https://cyberpanel.sh/composer.sh�rootTzchmod +x composer.shz ./composer.sh)�os�path�exists�remover���rF���)rG���r$���r$���r%���� setupComposerg���s��� �z"ApplicationInstaller.setupComposerc�����������������C���s8��d}t��|�}|�d�dkrdS�t����}t���rZd|��d|��d�}t��|dd ��d |��d�}t��|dd ��d|��d �}t��|dd ��d}t��|dd ��d|��d�}t��|dd ��dS�d|��d|��d�}t��|dd ��d |��d�}t��|dd ��d|��d�}t��|dd ��d}t��|dd ��d|��d�}t��|dd ��dS�)N�npmz npm <command>�������zwget https://nodejs.org/dist/z/node-z-linux-arm64.tar.xzrH���Tz tar -xf node-z-linux-arm64.tar.xz zcp node-z#-linux-arm64/bin/node /usr/bin/nodez.curl -qL https://www.npmjs.com/install.sh | shzrm -rf node-z -linux-arm64*z-linux-x64.tar.xzz!-linux-x64/bin/node /usr/bin/nodez-linux-x64*)r����outputExecutioner�find�!fetch_latest_lts_version_for_noder����ISARMrF���)r#���rG����result�nodeVr$���r$���r%���� InstallNodeJSw���s8��� �z"ApplicationInstaller.InstallNodeJSc�����������"������C���sx���z�|�j�d�}|�j�d�}|�j�d�}|�j�d�}||�_|�j�d�}|�j�d�}|�j�d�}t|d�}|�d ��|����|�����d dlm} �t� ���d dl m} �d |��d�}| �||�}t j�|�sot|d�}|�d��|����| �d��tj|�d�} t j�| �r�t���tjks�t���tjkr�d}nd}t�|��tt jd�}d}d|�_zYtjj|d�}|jj}|jj|�_ |dkr�|�j�d�}|j�!d�d�|�d�}n|j}|jj"j#|jj$�%���&��kr�nt'd��t|d�}|�d��|����|��(||j�\}}}|j|�_W�n[���t)jj|d�}|j}|j|�_ |dk�r|�j�d�}d|�d�|�d�}nd|�d�}|j"j#|j$�%���&��k�r2nt'd��t|d�}|�d��|����|��(||�\}}}d|j�|�_Y�|�*d�dk�r`t'd ��t j�|��sqd!|�}t�||��d"|��d#�}t�||��d"|��d$�}t�||��|��+|||�d k�r�t'd%��t|d�}|�d&��|����|��d'|���}t�,||d���t|d�}|�d(��|����t|d�}|�d)��|����|dk�r�|�j�d�}|d�|�}n|}|��d*|��d+|��d,|��d-|��d.|��d/|��d0|��d1�}t�,||d�|�}|�*d2�dk�rt'|��|��d3�}t�,||d�|��t-�.d�|�}|�*d4�dk�r1|�/d4d�}|��d5�}t-�0d�||��t�1��tj2k�rnz$t-�3d�|�}|�*d4�dk�rZ|��d4�}n|}|d�k�rht-�4d�||��W�n���Y�t�1��tj5k�r�|��d6�}d7|���}t�||d8��d9|���}t�||d8��d:tj6���}t�|��t7�8���t9�:d;��d:tj6���}t�|��t|d�}|�d<��|����W�d S��t'�y;�}�zltt jd�}d|�d=�}t���tjk�s�t���tjk�r�d>} nd?} t j�|��sd@|�dA�| �dB�|�}t�||��zt;�<||��t=jj|dC�}!|!�>���W�n���Y�t|�jd�}|�t?|�dD���|����W�Y�d�}~d S�d�}~ww�)EN�admin� domainName�homer����username�password�email�w�Setting up paths,0r���)�Upgrade��phpUtilities�/usr/local/lsws/conf/vhosts/�/vhost.confz#PHP 8.1 missing installing now..,20�81�.confzBdnf install php7.?-bcmath php7.?-imap php8.?-bcmath php8.?-imap -yzeDEBIAN_FRONTEND=noninteractive apt-get install php7.?-bcmath php7.?-imap php8.?-bcmath php8.?-imap -y����domain�0rJ����/�0Maximum database limit reached for this website.�Setting up Database,20�/home/� /public_html/�/home/%s/public_html�..rO����0Specified path must be inside virtual host home.� mkdir -p �rm -rf �*z.*�Directory is not empty.zDownloading Mautic Core,30z@ /usr/bin/composer create-project mautic/recommended-project:^5 zExtracting Mautic Core,50zRunning Mautic installer,70zR -d memory_limit=256M bin/console mautic:install --db_host='localhost' --db_name='z ' --db_user='z' --db_password='z' --admin_username='z' --admin_email='z' --admin_password='z' --db_port='3306' http://z -fzInstall completez9 -d memory_limit=256M bin/console mautic:assets:generate�docrootz/docrootzdocroot/.htaccessz7sed -i '/# Fallback for Apache < 2.4/,/<\/IfModule>/d' Tz)sed -i '/# Apache 2.4+/,/<\/IfModule>/d' zsystemctl restart �����Successfully Installed. [200]�/public_html�nobody�nogroup�chown �:� ��dbName� [404])@r!���r����open� writelines�closerW����plogical.upgrader`���r���rM����plogical.phpUtilitiesrb����GetPHPVersionFromFilerI���rJ���rK����InstallSaidPHPr����configBasePathr����decideDistro�cent8�centosrF����devnull�permPathr ����objects�get�master�externalAppri����masterDomain�rstrip�package� dataBases� databases_set�all�countr>���� dbCreationr���rR���� dataLossCheckrQ���r����FindDocRootOfSite�replace�ReplaceDocRoot�decideServer�OLS�FindDocRootOfSiteApache�ReplaceDocRootApache�ent�serviceNamer����reStartLiteSpeedSocket�time�sleepr����deleteDatabaser����deleterA���)"r#���rX���rY���rZ���r���r[���r\���r]���� statusFiler`���rb����vhFile�phpPath� finalConfPathrG����FNULL� finalPath�websiter����rJ���r�����dbUser� dbPassword�finalURLrU����ExistingDocRoot� NewDocRoot�ExistingDocRootApache�NewDocRootApache�htAccessPathrB����homeDir� groupName�dbr$���r$���r%���r=�������s*�� 4 � ��z"ApplicationInstaller.installMauticc�������������� ���C���sV��z�|�j�d�}ddlm}�t|jd�}t���tjks t���tjkrN|dkr=d}|� t� |���|����d}|� t� |���nd|�}|� t� |���|����n)t���tj ks\t���tjkrw|dkrkd }|� t� |���nd |�}|� t� |���|����t�|jdd��W�d�S��ty��}�zddlm}�t�|jd t|��d��W�Y�d�}~dS�d�}~ww�)Nr����r���)�ServerStatusUtil�ar����z0DEBIAN_FRONTEND=noninteractive apt-get update -yzapt-get upgrade -yz$apt-get install --only-upgrade %s -yz yum update -yzyum update %s -yz'Package(s) upgraded successfully. [200]rP���zFailed. Error: %s. [404])r!����serverStatus.serverStatusUtilr����r�����lswsInstallStatusPathr���r�����ubuntu�ubuntu20�writerQ����flushr����r����r����r?����statusWriterr>���rA���)r#���r����r�����frG���rB���r$���r$���r%���r+������s>��� ���z"ApplicationInstaller.updatePackagec�������������� ���C���s|���zddl�m}�dd�l}dd�l}|�jd�}t|�jd�}|�d��|����|� |j �}|d�d�ksH|d�d�ksH|d�d�ksH|d �d�ksH|d �d�krLtd��|d�}tj j|d�}|j} |��} | �|jd �d|i��|�d��t|�jd�}|�d��|����| �|jd �|�}|� |j�d��} �t�d|d���} | �d�dkr�n2| �d�dkr�t|�jd�}|�| d�d���|����W�dS�t|�jd�}|�| ��|����|�d��q�t|�jd�}|�d��|����d|�}t�|��d| |f�}t�|��ddlm}�|d�d��}|�|��t|�jd�}|�d��|����W�d�S��t�y=�}�zt|�jd�}|�t|�d ���|����W�Y�d�}~dS�d�}~ww�)!Nr�����WebsiteManager�requestr^���zDeleting domain as child..,20r����rY���� adminEmail�phpSelection�websiteOwnerzPlease provide all values.rh����userID�websiteName����zCreating domain as website..,40zutf-8T�cat r����[200]rO����[404]� currentStatusz [404]rP���zMoving data..,80zrm -rf /home/%s/public_htmlzmv %s /home/%s/public_html��FileManagerzSuccessfully converted. [200]r����)�websiteFunctions.websiter�����jsonr����r!���r����r���r����r�����loads�bodyr>���r ���r����r����rJ����submitDomainDeletion�sessionr�����submitWebsiteCreation�content�decoder���rQ���rR���rF����filemanager.filemanagerr�����fixPermissionsrA���)r#���r����r����r����r����r����r"���rY����childDomainrJ����wm�resp�respData�respDataStatusrG���r�����fmrB���r$���r$���r%���r*������sp��� $ � ��z(ApplicationInstaller.convertDomainToSitec�������������� ���C���s\���zd}t��|��d}t��|��W�d�S��ty-�}�zt�t|�d���W�Y�d�}~d�S�d�}~ww�)Nz]wget -O /usr/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.pharzchmod +x /usr/bin/wpz$ [ApplicationInstaller.installWPCLI])r���rF���r>���r?���r@���rA����r#���rG���rB���r$���r$���r%����installWPCLI��s��� ��z!ApplicationInstaller.installWPCLINc�����������������C���sV���|d�krt��|�}t|�dkrdS�dS�d|�}t�||d��d�}t|�dkr)dS�dS�)Nrx���rP���r���z ls %s | wc -lT� )rI����listdir�lenr���rQ���r�����int)r#���r����r����user�dirFilesrG���rU���r$���r$���r%���r����$��s��� z"ApplicationInstaller.dataLossCheckc�������������� ���C���sn���zt�j�d�rd}t�|��W�d�S�d}t�|��W�d�S��ty6�}�zt�t|�d���W�Y�d�}~d�S�d�}~ww�)Nz/etc/lsb-releasezapt -y install gitzyum install git -yz" [ApplicationInstaller.installGit]) rI���rJ���rK���r���rF���r>���r?���r@���rA���r����r$���r$���r%���� installGit6��s��� ��zApplicationInstaller.installGitc�������������� ���C���s<��d}zdd�l�}|�t|d�����}|d�}|t_dt_|d�t_W�n���Y�z[t� ��}|}t� ��} t jj|d�� ��sCt jj|d�� ��rTt|d �} | �d ��| ����W�dS�t�||| �}|dkr`nt|d �} | �d��| ����W�dS�t |||d�}|����||| fW�S��ty��} �zt�t| �d ���W�Y�d�} ~ d�S�d�} ~ ww�)Nz/etc/cyberpanel/mysqlPasswordr����r� mysqlhostrP���� mysqlportr����)r����r^���z-This database or user is already taken. [404]z"Not able to create database. [404])r����r����r����z [ApplicationInstallerdbCreation])r����r����r�����readr���� LOCALHOST�REMOTE�PORTr���� generate_passr���r�����filterrK���r����r����r����createDatabase�saver>���r?���r@���rA���)r#���r���r�����passFiler�����jsonDatar����r����r����r����r����rU���r����rB���r$���r$���r%���r����C��sR����� � � ��zApplicationInstaller.dbCreationc�����������!��� ���C���sb ���zh|�j�d�}|�j�d�}|�j�d�}||�_|�j�d�}|�j�d�}|�j�d�}|�j�d�}ttjd�}zd } t�| �} | �d �dksA|�����W�n�t j yP���|�����Y�nw�t|d�}|�d��|����d dl m}�d|��d�} d|j�d�}|d�| �}t�|��d dlm}�d|��d�}z|�|�}W�n���d}Y�tj�|�s�t|d�}|�d��|����|�d��d}d|�_zYtjj|d�}|jj}|jj|�_|dkr�|�j�d�}|j�d�d�|�d�}n|j}|jj j!|jj"�#���$��kr�nt%d��t|d�}|�d��|����|��&||j�\}}}|j|�_W�nz�t%�y��}�zmt'jj|d�}|j}|j|�_|dk�r:|�j�d�}d|�d �|�d�}nd|�d �}|��d!�}d"|���} t�| |��|j j!|j"�#���$��k�r]nt%d��t|d�}|�d��|����|��&||�\}}}d#|j�|�_W�Y�d�}~nd�}~ww�d$|�d!�} t�| |��|}|�d%�dk�r�t%d&��d'|�} t�| |��|��(|||�d k�r�t%d(��t|d�}|�d)��|����z|��d*|��d+|�j�d,����} W�n���d-|�} Y�t�| |�}tj�tj)��r�t*�+t,|���|�d.�dk�rt%|��t|d�}|�d/��|����|��d0|��d1|��d2|��d3t-j.��d4t-j/��d5|��� } t�| |�}tj�tj)��r=t*�+t,|���|�d.�dk�rIt%|��|dk�rZ|�j�d�}|d�|�}n|}|��d6|��d7|��d8|��d9|��d:|��d;|��� } t�| |�}tj�tj)��r�t*�+t,|���|�d.�dk�r�t%|��t|d�}|�d<��|����|��d=�|�} t�| |�}tj�tj)��r�t*�+t,|���|�d.�dk�r�t%|��t|d�}|�d>��|����|��d?�|�} t�| |�}tj�tj)��r�t*�+t,|���|�d.�dk�r�t%|��ze|�j�d@��rc|�j�d@�dAk�r(|��dB�|�} t�| |�}|�d.�dk�r't%|��n;|�j�d@�dCk�rJ|��dD�|�} t�| |�}|�d.�dk�rIt%|��n|��dE�|�} t�| |�}|�d.�dk�rct%|��W�n���Y�z�|�j�dF�dGk�r�dH|�} t�| |�}|�d.�dk�r�t%|��t|d�}|�dI��|����dJ|�} t�| |�}|�d.�dk�r�t%|��nB|�j�dF�dKk�r�dL|�} t�| |�}|�d.�dk�r�t%|��t|d�}|�dM��|����dN|�} t�| |�}|�d.�dk�r�t%|��W�n���Y�zG|�j�dO�dPk�r;|�j�dQ�}t0t1|��D�]1}|��dR�||�|f�} t�| |�}|�d.�dk�r(t%|��|��dS�||�|f�} t�| |�}�q W�n�t%�yX�}�zt*�+dTt,|����W�Y�d�}~nd�}~ww�t|d�}|�dU��|����W�d S��t%�y��}�z:tj�tj)��s�zt2�3||��t4jj|dV�} | �5���W�n���Y�t|�jd�}|�t,|�dW���|����W�Y�d�}~d S�d�}~ww�)XNrY���rZ���r���� blogTitle� adminUser� adminPasswordr����r^���z wp --infozWP-CLI root dir:rO���r_���r�����virtualHostUtilitiesrc���rd���z/usr/local/CyberCP/bin/python z!/plogical/virtualHostUtilities.pyz) changePHP --phpVersion 'PHP 8.0' --path ra���z/usr/local/lsws/lsphp80/bin/phpz#PHP 8.0 missing installing now..,20�80rg���rh���rj���rJ���rk���rl���rm���rn���ro���� index.htmlzrm -f rp���rt���rq���rr���rs���rv���zDownloading WordPress Core,30zD -d error_reporting=0 /usr/bin/wp core download --allow-root --path=� --version=� WPVersionz%wp core download --allow-root --path=zSuccess:�Configuring the installation,40�7 -d error_reporting=0 /usr/bin/wp core config --dbname=� --dbuser=� --dbpass=� --dbhost=r~���z --dbprefix=wp_ --path=z= -d error_reporting=0 /usr/bin/wp core install --url="http://z" --title="z" --admin_user="z" --admin_password="z" --admin_email="z " --path=zInstalling LSCache Plugin,80zU -d error_reporting=0 /usr/bin/wp plugin install litespeed-cache --allow-root --path=zActivating LSCache Plugin,90zV -d error_reporting=0 /usr/bin/wp plugin activate litespeed-cache --allow-root --path=�updates�Disabledza -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE false --raw --allow-root --path=zMinor and Security Updatesz[ -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE minor --allow-root --path=z` -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE true --raw --allow-root --path=�appsSetz$WordPress + LSCache + Classic Editorz5wp plugin install classic-editor --allow-root --path=z#Activating Classic Editor Plugin,90z6wp plugin activate classic-editor --allow-root --path=z!WordPress + LSCache + WooCommercez2wp plugin install woocommerce --allow-root --path=z Activating WooCommerce Plugin,90z3wp plugin activate woocommerce --allow-root --path=�SavedPluginsT�AllPluginsListzJ -d error_reporting=0 /usr/bin/wp plugin install %s --allow-root --path=%szK -d error_reporting=0 /usr/bin/wp plugin activate %s --allow-root --path=%sz!Error in istall plugin bucket: %sry���r����r����)6r!���r���r����rI���r����r���rQ���rR���r����� subprocess�CalledProcessErrorr����r�����plogical.virtualHostUtilitiesr��� cyberPanelrF���r����rb���r����rJ���rK���r����r����r ���r����r����r����r����ri���r����r����r����r����r����r����r����r>���r����r���r����� debugPathr?���r@���rA���r���r����r�����ranger����r���r����r���r����)!r#���rY���rZ���r���r����r����r����r����r����rG����outoutr����r���completePathToConfigFile�execPathrb���r����r����r����r����r����rJ���r����r����r����rB���� IndexFile�FinalPHPPathrU���r����� AllPluginList�ir����r$���r$���r%���r9���r��s��� �� �� 0 , ��� � � ����� ��z%ApplicationInstaller.installWordPressc�������������� ���C���sd���z=|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d �} |�j�d �} | |�_ttjd�}t| d�}|�d��|����d } d |�_z[tj j |d�}|jj}|jj |�_|dkrw|�j�d�}|j�d�d�|�d�} n|jd�} |jjj|jj������kr�ntd��t| d�}|�d��|����|��| |j�\}}}|j|�_W�nY���tj j |d�}|j}|j |�_|dkr�|�j�d�}d|�d�|�d�} nd|�d�} |jj|j������kr�ntd��t| d�}|�d��|����|��| |�\}}}d|j �|�_Y�| �d�dk�rtd��d| �}t�||��|��| | |�dk�r)td��d| �d�}t�||��ddlm}�d |��d!�}|�||�}tj� |��sat| d�}|�d"��|����|�!d#��t"j#|�d$�}tj� |��s�t�$��tj%k�r�t|�jd�}|�d%��|����W�dS�t| d�}|�d&��|����t�&��}d'|��d(|��d)| ���}t�||��d*| |f�| �}t�||��d+| �| �}t�||��t| d�}|�d,��|����|dk�r�|�j�d�}|}n|}t| d�}|�d-��|����|��d.�| �d/�|�d0�|�d1�|�d2�|�d3�|�d4�|�d5�|�d6�|�d7�| �}t�||��d| �d8�}t�||��t| d�}|�d9��|����W�dS��t�y��}�zfd|�d:�}t�'��tj(k�s]t�'��tj)k�r`d;}nd<}tj� |��s{d=|�d>�|�d.�|�}t�||��zt*�+||��t,j j |d?�}|�-���W�n���Y�t|�jd�}|�t.|�d@���|����W�Y�d�}~dS�d�}~ww�)ANrX���rY���rZ����shopName� firstName�lastName�databasePrefixr]���r\���r���r^���r_���rg���rh���rj���rJ���rk���rl���rm���rn���ro���rp���rq���rO���rr���rs���r���rv���rt���r��ra���rc���rd���z#PHP 8.3 missing installing now..,20�83rf���z�Your server is currently using OpenLiteSpeed, please switch your website to use Apache otherwise Prestashop installation will not work. [404]z/Downloading and extracting PrestaShop Core..,30z@wget https://github.com/PrestaShop/PrestaShop/releases/download/z/prestashop_z.zip -P z unzip -o %sprestashop_%s.zip -d zunzip -o %sprestashop.zip -d r��z*Installing and configuring PrestaShop..,60r���zinstall/index_cli.php --domain=z! --db_server=localhost --db_name=z --db_user=z --db_password=z --name='z' --firstname=z --lastname=z --email=z --password=�installry���rz���r{���r|���� chown -R r~���r����r����)/r!���r���r����rI���r����r����r����r����r ���r����r����r����r����ri���r����rJ���r����r����r����r����r����r����r>���r����r���rR���r���rF���r����r����rb���r����rK���r����r���r����r����r�����fetch_latest_prestashop_versionr����r����r����r���r����r���r����rA���)r#���rX���rY���rZ���r��r��r��r ��r]���r\���r���r����r����r����r����r����rJ���r����r����r����rG���rb���r����r����r�����pVersionr����rB���r����r����r����r$���r$���r%���r;������s0�� ���������������� ��z&ApplicationInstaller.installPrestaShopc�����������������C���s���dS�)Nr���):r!���r���r ���r����r����r����r����ri���r����rJ���r����r����r����r����r����r����r>���r����r����r����r����r����r���r���rQ���rR���rF���r�����getpass�getuserr���r�����hashlib�md5�encode� hexdigest�MySQLdb.cursors�cursors�MySQLdb�connect�SSCursor�cursor�executer?���r@���rA���rI���rL���r����r����r����r���r�����printr���r����r���r����)r#���rY���r\����prefixrZ����siteNamer���r����r����r����rJ���r����r����r����r����r����rG���rU���r&��� joomlaPath�salt� password_hashr-���mysql�connr1��rB���r����r����r����r����r$���r$���r%���r:������s���z"ApplicationInstaller.installJoomlac�����������������C���s8���za|�j�d�rlt�|�j�d�d��dd�l}ddlm}�dttdd���}d �|� d |�j�d���d�d��ttdd���}|� |�j�d�|�j�d �d|dddddd|d��t|d����}|� d�dkrlt�|�j�d�d|���W�dS�t�|�j�d�d��|�j�d�}|�j�d�|�j�d<�dttdd���|�j�d<�|�j�d�|�j�d<�|�j�d�|�j�d<�|�j�d�|�j�d<�|�j�d �|�j�d<�|�����t|�j�d�d����}|� d�dkr�||�j�d<�td|���||�j�d<�t�|�j�d�d ��zJdd!lm}�dd"lm}�dd�l} |jj|�j�d�d#�} |�j�d=�|�j�d=�|�j�d=�|�j�d=�|�j�d=�|�j�d=�|�j�d=�|�j�d$=�|| | �|�j��d%�}|����W�n���Y�t���tjk�s;t���tjk�r>d&}nd'}t|d����} | � d(�dk�r`t|d)�}|�d*��|����W�d�S�W�d�S��t�y��}�z,|�j�d�|�j�d+<�dd,lm }�|��}|�!d|�j���t�|�j�d�d-t|����W�Y�d�}~d�S�d�}~ww�).N� createSiter���zCreating this application..,10r���r����/home/cyberpanel/�����'��rg���z [a-zA-Z]+ri���r����r]���zPHP 7.4rP���rX����Defaultr����r����rO���z-Failed to create application. Error: %s [404]zInstalling WordPress.,50rY����titler�����userNamer����r\���r����r����z,Failed to install WordPress. Error: %s [404]zCompleted [200].)� WPDeployments)r���rh���r ��)�owner�configz/var/spool/cron/rootz/var/spool/cron/crontabs/rootzWPAutoUpdates.pyr����zV0 12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/WPAutoUpdates.py r����r����z %s [404].)"r!���r?���r�����rer��r��rA���r����join�findall�createVirtualHostr����r����rR���r9���r>����cloudAPI.modelsrB���websiteFunctions.modelsr���r����r����r�����dumpsr����r���r����r����r����r����r����r����r�����submitWebsiteDeletion)r#���rE��r��r���r����rU����currentTemprB��r���r����r�����wpDeploy� localCronPath�cronDatar@���rB���r����r����r$���r$���r%����DeployWordPress��s���� .�� ��(��z$ApplicationInstaller.DeployWordPressc�����������!��� ���C���s����z_|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d �} |�j�d �} |�j�d�}||�_ttjd�}t|d�} | �d ��| ����d}d|�_z[tj j |d�}|jj}|jj |�_|dkr||�j�d�}|j�d�d�|�d�}n|jd�}|jjj|jj������kr�ntd��t|d�} | �d��| ����|��||j�\}}}|j|�_W�nY���tj j |d�}|j}|j |�_|dkr�|�j�d�}d|�d�|�d�}nd|�d�}|jj|j������kr�ntd��t|d�} | �d��| ����|��||�\}}}d|j �|�_Y�d|�j�}t�|��|�d�dk�r td��tj�|��s1d|�}t�||��|��||�dk�r>td��t|d�} | �d��| ����d | |f�}t�||��t|d�} | �d!��| ����|dk�rs|�j�d�}|}n|}t|d�} | �d"��| ����d#|�d$�|�d%�|�}t�||��d&|�}t�||��d&|�}t�||��d'||f�}t�||��d(| |||f�}d)||||||f�}d*|�d+�}t�||��t|d�} | �d,��| ����z:dd�lm}�dd�l }|j!d-||d.|j"d/�}|�#��}|�$d0||f���|�$d1||f���|�$d2||f���|����W�n�t�y5�}�z t%�&t'|���W�Y�d�}~nd�}~ww�d3|�}t�|��dd4l(m)}�|d�d��}|�*|�j��t|d�} | �d5��| ����W�dS��t�y��}�zpd|�d6�}t�+��tj,k�st�+��tj-k�r�d7}nd8}tj�|��s�d#|�d$�|�d%�|�}t�||��zt.�/||��t0j j |d9�} | �1���W�n���Y�d:|�j�}t�|��t|�jd�} | �t'|�d;���| ����W�Y�d�}~dS�d�}~ww�)<NrX���rY���rZ���r��r��r]���r[���r\����whmcsinstallerpath�whmcslicensekeyr���r^���r_���rg���rh���rj���rJ���rk���rl���rm���rn���ro���rp���zchmod 755 %srq���rO���rr���rs���r���rv���z#Extracting WHMCS Installer zip..,30zunzip -qq %s -d %sr��z%Installing and configuring WHMCS..,60r#��r~���r���z]curl %s/install/install.php?step=2 --insecure --silent --output /dev/null --show-error --failz0mv %s/configuration.php.new %s/configuration.phpa��� curl %s/install/install.php?step=4" -H 'Content-Type: application/x-www-form-urlencoded' --data "licenseKey=%s&databaseHost=localhost&databasePort=&databaseUsername=%s&databasePassword=%s&databaseName=%s" --compressed --insecure --silent --output /dev/null --show-error --fail ap�� curl %s/install/install.php?step=5" -H 'Content-Type: application/x-www-form-urlencoded' --data "firstName=%s&lastName=%s&email=%s&username=%s&password=%s&confirmPassword=%s" --compressed --insecure --silent --output /dev/null --show-error --fail rt���r"��z!Update whmcs urls to siteurl..,70r���i���)�hostr�����passwd�port�cursorclasszHuse %s;UPDATE tblconfiguration SET value='%s' WHERE setting='SystemURL';zEuse %s;UPDATE tblconfiguration SET value='%s' WHERE setting='Domain';zKuse %s;UPDATE tblconfiguration SET value='%s' WHERE setting='SystemSSLURL';zchmod 400 %s/configuration.phpr����ry���rz���r{���r|���r����zchmod 750 %sr����)2r!���r���r����rI���r����r����r����r����r ���r����r����r����r����ri���r����rJ���r����r����r����r����r����r����r>���r����r���r���rF���rR���rK���r����r,��r-��r.��r/��r0��r1��r2��r?���r@���rA���r����r����r����r����r����r����r���r����r���r����)!r#���rX���rY���rZ���r��r��r]���r[���r\����whmcs_installer�whmcs_licensekeyr���r����r����r����r����r����rJ���r����r����r����rG���r����r����r����r-��r9��r:��r1��rB���r����r����r����r$���r$���r%����installWhmcsy��s,�� �� � � � � � ��� ��z!ApplicationInstaller.installWhmcsc�������������� ���C���sb���z�ddl�m}�dd�l}|�jd�}t|d�}|�d��|����i�}|�jd�}|�jd�|d<�|�jd�|d<�d|d <�|�jd �|d <�|�jd�|d<�d|d <�d|d<�d|d<�d|d<�|�jd�|d<�|�jd�}tj � tj�rst �dt|������z@tjj|d�d�}|jdkr�d|_|����tjj|�jd�d�} t�|j| |�jd��dkr�t|d�}|�d��|����W�W�dS�W�n��t�yt�} �z�tj � tj�r�t �dt| ������|��}|�||�}|�|j�} | d�dkr�t|d�}|�d| d����|����W�Y�d�} ~ W�dS�t �d| ���| d�} �t|d����}tj � tj��rt �d|���|�d �d!k�r'n5|�d"�d!k�rGt|d�}|�d|���|����W�Y�d�} ~ W�dS�t|d�}|�d#��|����t� d$���qt|d�}|�d%��|����W�Y�d�} ~ nd�} ~ ww�d&}g�}z-|�jd'�dk�r�t!jj|�jd'�d�}|�|j"�}d(}t#t$|��D�] }|�%||����q�W�n�t�y��} �zW�Y�d�} ~ nd�} ~ ww�|�jd�}d)tt&d*d+���|�jd<�||�jd,<�||�jd-<�|��'��� �t|�jd�d����}|�d �d!k�r�n0|�d"�d!k�rt|d�}|�d.|���|����W�dS�t|d�}|�d/��|����t� d$���q�t|d�}|�d0��|����tjj|�jd�d�}|�jd1�d2k�rZ|�jd3�}d4|�jd��d5�|�d6�}|�jd���d6|���}nd4|�jd��d5�}|�jd�}t(||�jd7�|||�jd8�|�jd9�|�jd:�d;�}|����t|d�}|�d<��|����W�d�S��t�y��} �zt �d=t| ����W�Y�d�} ~ dS�d�} ~ ww�)>Nr���r����r���r^���zCreating Website...,10rY���r����zPHP 8.0r����r����r����rP����ssl� dkimCheck�openBasedir� mailDomain� apacheBackend�adminIDz&Data passed to wordpressInstallNew is rh���zPHP 7.3��pk� currentACLzYou dont own this site.[404]z9Error in finding existing site in wordpressInstallNew is �statusz*Failed to Create Website: error: %s. [404]�errorMessage�Creating website result....%sr����z%Info web creating lastline ....... %sr����rO���r�����Creating Website....,20�����Installing WordPress....,30F�pluginbucketTr<��r=��r>��r��r��z+Failed to install WordPress: error: %s[404]zInstalling WordPress....,50zWordPress installed..,70rZ���rj���rJ���rn���ro���rk���r����r���Plugins�Themes)rC��r@��rJ����FinalURL�AutoUpdates� PluginUpdates�ThemeUpdateszWordPress installed..,[200]z!Error WP web creating ....... %s))r����r����r����r"���r����r����r����r!���rI���rJ���rK���r���r��r?���r@���rA���r���r����r����r����r����r���r����checkOwnershipri���r>���r����r����r����r����rR���r����r����r���rD��r��r�����appendr���r9���r���)r#���r����r����r���r����� DataToPassrM���UserIDr����rX���rB����ab� coreResult�coreResult1� reutrntempath�lastLiner��r���bucktobj�pluginlisttr���webobjrJ���r�����Finalurl�wpobjr$���r$���r%���r-���c��s��� �� � � ��*��� � � ��z(ApplicationInstaller.wordpressInstallNewc����������� ��� ���C���s����z_|�j�d�}|�j�d�}|�j�d�}|�j�d�dkr&d|||f�}t�|�}W�d�S�|�j�d�dkrMd}|�j�d �D�]}d ||f�}q4d||||f�}t�|�}W�d�S�d|||�j�d�|f�}t�|�}W�d�S��ty{�}�zt�dt|����W�Y�d�}~d S�d�}~ww�)Nr���VhuserrJ����Themer�����hsudo -u %s %s -d error_reporting=0 /usr/bin/wp theme update --all --skip-plugins --skip-themes --path=%s�selectedrg���� Themearray�%s %s�esudo -u %s %s -d error_reporting=0 /usr/bin/wp theme update %s --skip-plugins --skip-themes --path=%s�!Error WP UpdateWPTheme ....... %sr����r"���r���rQ���r>���r?���r@���rA���) r#���r��r��rJ���rG���� stdoutput� ThemeList�pluginrB���r$���r$���r%���r.������s4��� �����z"ApplicationInstaller.UpdateWPThemec����������� ��� ���C���s����z_|�j�d�}|�j�d�}|�j�d�}|�j�d�dkr&d|||f�}t�|�}W�d�S�|�j�d�dkrMd}|�j�d �D�]}d ||f�}q4d||||f�}t�|�}W�d�S�d|||�j�d�|f�}t�|�}W�d�S��ty{�}�zt�d t|����W�Y�d�}~dS�d�}~ww�)Nr��r��rJ���r���r����r���r���rg����pluginarrayr���zfsudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin update %s --skip-plugins --skip-themes --path=%sr���r���r���r���) r#���r��r��rJ���rG���r����pluginsList�plugrB���r$���r$���r%���r/�����s4��� �����z#ApplicationInstaller.UpdateWPPluginc����������� ��� ���C���s����zI|�j�d�}|�j�d�}|�j�d�}|�j�d�dkr7d}|�j�d�D�]}d||f�}qd ||||f�}t�|�}W�d�S�d |||�j�d�|f�}t�|�}W�d�S��tye�}�zt�d t|����W�Y�d�}~dS�d�}~ww�)Nr��r��rJ���r���r���rg���r���r���zesudo -u %s %s -d error_reporting=0 /usr/bin/wp theme delete %s --skip-plugins --skip-themes --path=%sz Error WP DeleteThemes ....... %sr���r���) r#���r��r��rJ���r���r���rG���r���rB���r$���r$���r%���r0���:��s*��� ����z!ApplicationInstaller.DeleteThemesc�������������� ���C���s����zJ|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}|dkr;d}|D�]}d||f�}d ||||f�}t�|�} q"W�d�S�d ||||f�}t�|�} W�d�S��tyf�} �zt�d t| ����W�Y�d�} ~ dS�d�} ~ ww�)Nr��r��rJ���r���r���r���rg���r���zfsudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin delete %s --skip-plugins --skip-themes --path=%sz!Error WP DeletePlugins ....... %sr���r���)r#���r��r��rJ���r���r���r���r���rG���r���rB���r$���r$���r%���r1���S��s0��� �����z"ApplicationInstaller.DeletePluginsc�������������� ���C���s����zH|�j�d�}|�j�d�}|�j�d�}|�j�d�}d||||f�}t�|�}|�d�dkr9d||||f�}t�|�}W�d�S�d ||||f�}t�|�}W�d�S��tyd�}�zt�d t|����W�Y�d�}~dS�d�}~ww�)Nr��r��rJ���r���zesudo -u %s %s -d error_reporting=0 /usr/bin/wp theme status %s --skip-plugins --skip-themes --path=%szStatus: ActiverO���zisudo -u %s %s -d error_reporting=0 /usr/bin/wp theme deactivate %s --skip-plugins --skip-themes --path=%szgsudo -u %s %s -d error_reporting=0 /usr/bin/wp theme activate %s --skip-plugins --skip-themes --path=%sz&Error WP ChangeStatusThemes ....... %sr���)r"���r���rQ���rR���r>���r?���r@���rA���)r#���r��r��rJ���r���rG���r���rB���r$���r$���r%���r2���o��s.��� � ����z'ApplicationInstaller.ChangeStatusThemesc�����������#��� ���C���s���zYddl�m}�dd�l}tjj|�jd�d�}t�|j j �}d|�}|j}|��d|��d�}t� ||j j�}|�d�} t�d | ���t����d dttdd ��f�} | |�_d| ���}t�|��d|j j��d|j j��d| ���}t�|��|�jd�}||�_t|d�}|�d��|����i�} |�jd�}|�jd�| d<�|j j| d<�|j j | d<�|j jj| d<�d| d<�d| d<�d| d<�d| d<�d| d <�|�jd!�}|��}|� || �}|�!|j"�}t#j�$d"�r�t�d#|���|d�} �t|d$��%��}|�&d%�d&kr�n/|�&d'�d&k�rt|d�}|�d(|���|����W�dS�t|d�}|�d)��|����t'�(d*��q�t|d�}|�d+��|����t|d�}|�d,��|����t)jj|�jd�d-�}|��*||�\}}}t|d�}|�d.��|����|j j+}|�jd�}|j}|j }t�|�}d|�}d/|j+��d0�}|��d1|��d2| ���}t�||j�dk�r�t,d3��|��d4|��d5|��d6|��d7t-j.��dt-j/��d8|��� }t�||j�dk�r�t,d9��|��d:|���}t� ||j j��d�}|��d;|��d<| ��d=�}t�||j j�dk�r�t,d>��|��d?|���}t� ||j j��0��d&��1d@dA�}dB|��d| ��dC�}t�||j j�dk�rt,dD��dE|��dF| ��dC�}t�||j j�dk�r-t�dG��|��dH|��d8|���}t�||j�dk�rEt,dI��d|j��d|j��d| ���}t�|��|��d;|��dJ| ��d=�}t�||j�dk�rpt,dK��z dL| �}t�||j��W�n���Y�dM|��dN�}t�||j��dO| ��dP|��dC�}t�||j�dk�r�t,dQ��dE| ��dF|��dC�}t�||j j�dk�r�t�dG��|��dR|��dS|j2��dT|��dU�}t�||j�dk�r�t,dV��|��dR|��dW|j2��dT|��dU�}t�||j�dk�r�t,dX��|��dR|��dY|��dZ|��dU�}t�||j�dk�rt,d[��dd\l3m4} �| �5���t||�jd]�d^|�jd��d_|�jd��d`�}!|!�6���dM| ���}t�|��t7|!|da��6���t|d�}|�db��|����W�d�S��t,�y��}"�z&dM|�j���}t�|��t|�jd�}|�t|"���d'���|����W�Y�d�}"~"dS�d�}"~"ww�)cNr���r�����WPidra���/usr/local/lsws/lsphp%s/bin/phpz* -d error_reporting=0 /usr/bin/wp --path='z+' core version --skip-plugins --skip-themesr����zOld site wp version:%s�%s/%s�/usr/local/CyberCP/tmpr=��r>��rs���r#��r~���r���r���r^���zCreating Website...,15� StagingDomainrY���r����r����r����r?��r����rP���r[��r\��r]��r^��r`��z/usr/local/CyberCP/debugrf��r����r����rO���r����z(Failed to Create Website: error: %s[404]rg��rh��ri��zCreating DataBase....,30rh���zCreating Staging....,50rn���rz���z7 -d error_reporting=0 /usr/bin/wp core download --path=r��z!Failed to download wp core. [404]r��r��r ��r ��z --path=z#WP Core congiruations failed. [404]z^ -d error_reporting=0 /usr/bin/wp config get table_prefix --skip-plugins --skip-themes --path=�S -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=� db export �/dbexport-stage.sqlz1Failed to export database from master site. [404]�^ -d error_reporting=0 /usr/bin/wp theme path --skip-plugins --skip-themes --allow-root --path=�themesrg����cp -R rk���z;Failed to copy wp-content from master to temp folder. [404]�cp -f �/.htaccess z2While staging creation .htaccess file did not copyz: -d error_reporting=0 /usr/bin/wp config set table_prefix z1Failed to set table prefix on staging site. [404]� --quiet db import z0Failed to import database on staging site. [404]�rm -f %s/dbexport-stage.sqlrt���z/wp-contentzmv z/wp-content z:Failed to copy wp-content from temp to staging site. [404]�U -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=� "�" "rE����search-replace failed 1. [404]� "www.�search-replace failed 2. [404]� "https://� " "http://�search-replace failed 3. [404]r����StagingNamerp���z%s)rC��r@��rJ���rm��)�wpsiterC��zStaging site created,[200])8r����r����r����r���r����r����r"���r����getPHPStringrC��r����rJ���r���rQ���r����r����r?���r@���r����CreateSecureDirrA���r����tempPathrF���r���r����r����r����r!���r����rX���rA��r����r����r����rI���rK���r����rR���r����r����r���r����ri���r>���r���r����r����� splitlinesr����rm���plogical.installUtilitiesr����reStartLiteSpeedr����r ���)#r#���r����r����r~���phpr���path_to_wordpressrG���� Wp_version�old_wp_versionr���r���r����rs��rM��rt��ru��rv��rw��rx��ry��r����� dbNameRestorer����r����r����ri���rJ���� PHPVersion�StagingPath�TablePrefix� WpContentPathr���r���rB���r$���r$���r%���r3������s(�� � 0�� � ��z%ApplicationInstaller.CreateStagingNowc�������������� ���C���s����z�|�j�d�|�_|�j�d�|�_|�j�d�|�_tjj|�jd�}tjj|�jd�}t����ddt t dd��f�|�_d |�j���}t� |��d |jj��d|jj��d|�j���}t� |��d dlm}�|�|jj�}d|�}t�|�jd��|��d|j��d|�j��d�}t� ||jj�d kr�td��|��d|j���}t�||jj����d��dd�}t�|�jd��d|j��d|�j��d�}t� ||jj�d kr�td��d|j��d|�j��d�}t� ||jj��d |jj��d|jj��d|�j���}t� |��t�|�jd ��|��d|j��d!|�j��d�}t� ||jj�d k�r td"��zd#|�j�}t� |��W�n���Y�t�|�jd$��d|�j��d%|���}t� ||jj�d k�r:td&��|��d'|j��d(|j��d)|j��d*�}t� ||jj�d k�rZtd+��|��d'|j��d,|j��d)|j��d*�}t� ||jj�d k�rztd-��|��d'|j��d.|j��d/|j��d*�}t� ||jj�d k�r�td0��d d1lm}�|����d2|�j���}t� |��t�|�jd3��W�d S��t�y��} �zd2|�j���}t� |��d4t | ��} t�|�j| ��W�Y�d�} ~ d�S�d�} ~ ww�)5Nr���� statgingIDr���ra��r���r���r=��r>��rs���r#��r~���r���r���r���r���zCreating database backup..,10r���r���r���z7Failed to create database backup of staging site. [404]r���rO���r���rg���z Moving staging site content..,20r���z /wp-content/ rk���z9Failed copy wp-content from staging to temp folder. [404]r���r���zImporting database..,60r���z8Failed to import database backup into master site. [404]r���zMoving content..,80z/wp-content/* z/Failed to copy wp-content to master site. [404]r���r���r���rE���r���r���r���r���r���r���r���rt����Completed.[200]z %s. [404])r!���r���r���r���r���r����r����r���r���rA���r���r���r���rF���rC��r�����managePHP.phpManagerr���r���r����r?���r����rJ���r>���rQ���r���r����rm��r���r���r���)r#����StagingSite�WPSiterG���r���r���r��r���r���rB����mesgr$���r$���r%���r4���g ��s���� �� """ ��z'ApplicationInstaller.DeploytoProductionc����������� ��� ���C���sv���z�ddl�m}�dd�l}|�jd�|�_t�|�jd��tjj |�jd�d�}t jj |�jd�d�}|�jd�}z|�jd �}|�jd �}W�n���d}d�}Y�ddlm}�d |j j��d�} |j } |�| �}| j}|j} | j}|�|�}d|�}|dk�rQt�|�jd��d|��d|��d| ���}t|��t�|d�d�d�d�\}}t|��|�d�dkr�|�d�}nt|��d|��d|��d| ���}t�|d�d�d�d�\}}|�d�dkr�|�d�}nt|��tj�tj�r�t�d|�����t����tt dd��}dd|f�|�_!d|�j!���}t�|d�d�d�d�\}}|dk�rt|��d |j j��d!|j j��d|�j!���}t�|d�d�d�d�\}}|dk�r0t|��t�|�jd"��d|��d#|�j!��d$�}t�|d�d�d�d�\}}|dk�rUt|��i�}|j"|d%<�|j#|d&<�|j$|d'<�|j%|d(<�|j&|d)<�|j'|d*<�|j|d+<�||d,<�||d-<�||d.<�||d/<�| j(|d0<�| j)|d1<�| j*|d2<�| j+|d3<�| j|d4<�| j,|d5<�| j-|d6<�d7|�d8�t.�/d9��|d:<�d;|d<�||d <�||d<<�|j0|d=d>�}d?tt dd���}t1|d@�}|�2|��|�3���t�4|dA��dB|��d|�j!���}t�|d�d�d�d�\}}|dk�rt|��dC|���}t�|d�d�d�d�\}}|dk�r t|��t�|�jdD��dE|| |�j!f�}t�|d�d�d�d�\}}|dk�rCt|��tj�tj��rPt�|��dF|| |�j!f�}t�|d�d�d�d�\}}|dk�rlt|��tj�tj��ryt�|��t�|�jdG��tj�tj��r�t�dH|�����dI||| |�j!|f�}tj�tj��r�t�|��t�|d�d�d�d�\}}|dk�r�t|��tj�tj��r�t�|��t�|�jdJ��dK}t�|d�d�d�d�\}}|dk�r�t|��dL|d:���dM|�j!���}t�|d�d�d�d�\}}|dk�rt|��t5||j6| j6|dN�}|�7���dO|�j!���}|dk�r!t|��dP|d:���dQ�}t�|d�d�d�d�\}}|dk�r=t|��t�|�jdR��ddS|d:���dQ�|j6fW�S�|dTk�r�t����tt dd��}dd|f�|�_!d|�j!���}t�|d�d�d�d�\}}|dk�r�t|��d |j j��d!|j j��d|�j!���}t�|d�d�d�d�\}}|dk�r�t|��t�|�jd"��d|�j!��d$�}t�||d�d�d�\}}|dk�r�t|��i�}|j"|d%<�|j#|d&<�|j$|d'<�|j%|d(<�|j&|d)<�|j'|d*<�|j|d+<�dU|d,<�dU|d-<�||d.<�||d/<�| j(|d0<�| j)|d1<�| j*|d2<�| j+|d3<�| j|d4<�| j,|d5<�| j-|d6<�d7|�d8�t.�/d9��|d:<�dV|d<�||d <�||d<<�|j0|d=d>�}d?tt dd���}t1|d@�}|�2|��|�3���t�4|dA��dB|��d|�j!���}t�|d�d�d�d�\}}|dk�rzt|��dC|���}t�|d�d�d�d�\}}|dk�r�t|��t�|�jdD��dE|| |�j!f�}t�|d�d�d�d�\}}|dk�r�t|��tj�tj��r�t�|��dF|| |�j!f�}t�|d�d�d�d�\}}|dk�r�t|��tj�tj��r�t�|��t�|�jdJ��dW|�}dK}t�|d�d�d�d�\}}|dk�r t|��dL|d:���dM|�j!���}t�|d�d�d�d�\}}|dk�r,t|��t5||j6| j6|dN�}|�7���tj�tj��rGt�|��dO|�j!���}t�|d�d�d�d�\}}|dk�rat|��dP|d:���dQ�}t�|d�d�d�d�\}}|dk�r}t|��t�|�jdR��ddS|d:���dQ�|j6fW�S�t�|�jd��d|��d|��dX| ���}t�|d�d�d�d�\}}|�d�dk�r�|�d�}nt|��tj�tj��r�t�d|�����d|��d|��dY| ���}t�|d�d�d�d�\}}|�d�dk�r�|�d�}nt|��t����tt dd��}dd|f�|�_!d|�j!���}t�|d�d�d�d�\}}|dk�r$t|��d |j j��d!|j j��d|�j!���}t�|d�d�d�d�\}}|dk�rHt|��t�|�jd"��i�}|j"|d%<�|j#|d&<�|j$|d'<�|j%|d(<�|j&|d)<�|j'|d*<�|j|d+<�||d,<�||d-<�||d.<�||d/<�| j(|d0<�| j)|d1<�| j*|d2<�| j+|d3<�| j|d4<�| j,|d5<�| j-|d6<�d7|�d8�t.�/d9��|d:<�dZ|d<�||d <�||d<<�|j0|d=d>�}d?tt dd���}t1|d@�}|�2|��|�3���t�4|dA��dB|��d|�j!���}t�8|�dk�r�td[��dC|���}t�8|�dk�r td\��t�|�jd]��tj�tj��r!t�d^|�����dI||| |�j!|f�}tj�tj��r8t�|��t�|d�d�d�d�\}}|dk�rLt|��tj�tj��rYt�|��t�|�jdJ��dK}t�|d�d�d�d�\}}|dk�rvt|��dL|d:���dM|�j!���}t�|d�d�d�d�\}}|dk�r�t|��t5||j6| j6|dN�}|�7���tj�tj��r�t�|��dO|�j!���}t�|d�d�d�d�\}}|dk�r�t|��dP|d:���dQ�}t�|d�d�d�d�\}}|dk�r�t|��t�|�jdR��ddS|d:���dQ�|j6fW�S��t�y:�}�z4t�d_t|����z dO|�j!���}t�8|��W�n���Y�t�|�jt|���d`���dt|�d�fW��Y�d�}~S�d�}~ww�)aNr���r���r���zCreating BackUp...,10r���ra��r`��� Backuptype�BackupDestination�SFTPID�Localra���rc���rd���r����1zGetting database...,20�sudo -u r���zZ -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=rP����Error:rO���r����zZ -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=z DB Name: r=��r>��r���r���rs���r#��r~���zCreating Backup Directory...,40z mkdir -p rz����WPtitle� WPAutoUpdates� WPFinalURL�WPPluginUpdates�WPThemeUpdates� WPowner_id� WPsitepath�DatabaseName�DatabaseUser� RandomPath� WebDomain� WebadminEmail�WebphpSelection�Webssl�Webstate� WebVHuser� Webpackage_id�Webadmin_idzbackup-�-z%m.%d.%Y_%H-%M-%S�namezBoth Website and DataBase�SFTP_ID����)�indentr<��r^���i���r���zrm -r zCopying website data.....,50z#sudo -u %s cp -R %s* %s/public_htmlz)sudo -u %s cp -R %s.[^.]* %s/public_html/zCopying database.....,70zDB Name Dump: z�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/%s.sqlz Compressing backup files.....,80zmkdir -p /home/backup/ztar -czvf /home/backup/z.tar.gz -P )rC���WPSiteID� WebsiteIDrD��rt���zchmod 600 /home/backup/�.tar.gzr���� /home/backup/�2zNot availabe�Website Backupz/home/%sz� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=�DataBase Backupz(Failed to copy config file to temp path.z"Failed to remove config temp file.zCopying DataBase.....,70zDB Name MySQL Dump: zError WPCreateBackup ....... %s�. [404])9r���r���r����r!���r���r?���r����r���r����r����r���r����rb���rC��ri����,WrapGetPHPVersionFromFileToGetVersionWithPHPr����rJ���r���r3��r���rQ���rR���r����r>���rI���rK���r��r@���r���r���rA���r���r���r@��rn��rm��ro��rp���owner_idr����r����r[���state� package_id�admin_idr�����strftimerK��r����r����r�����chmodr����idr����rF���) r#���r���r����r����Adminobjr���r���r���rb���r����r����� PhpVersion�VHuserr���� websitedomainr���r��rG���� retStatusr����DataBaseName�DataBaseUserr���rU����stdoutrD���json_object� configPath�file� backupobj�websitepathrB���r$���r$���r%���r5���� ��s��� � � � ��z#ApplicationInstaller.WPCreateBackupc�����������^��� ���C���s&��� z�dd�l�}ddlm}�ddlm}�ddlm}�dd�l}tj � tj�r-t �d|�jd����|�jd�|�_t �|�jd��|�jd �}|�jd �}|�jd�}|�jd�} tjj|d�} |�| j�}|d �}|d�} |d�}|d�}|d�}z|jj|d�d�}W�n���|jjdd�}Y�|j}tjj|d�d�}|j}|d�}|d�}|d�}tj � tj�r�t �dt|������|dk�rtjj|d�}|�|j�}|d�}|d�}|d�}|d�}tj � tj�r�t �dt|������dd�l}|���}|�|�����|j |||d ��tj � tj��r t �d!��d"} |�!| �\}!}"}#tj � tj��r t �d#��d$}$d%}%d&|%���} |�!| �\}!}"}#|"�"���#���$��}&tj � tj��rIt �d'|&�����d(|&��d)�}'t�%|'d*d+��d,}'t�%|'d*d+��d-}'t�&|'d*d+�}(tj � tj��rxt �d.|(�����|�'��})t �|�jd/��d0|�}*d1||f�}+t �d2��dd3l(m)},�|,�*���d4|$��d5t|,j+���d6|+��d7t,�-����d8|*��� }'|�!|'�\}!}"}#|"�"���#���$��}-|#�"���#���$��}.tj � tj��r�t �d9|'�����|.�r�t �d:|.�����nt �d;|-�����|)�r�|)�.���|�r�|�.���d<|*�}'t�%|'��n�|d=k�r�|d>�}/|d?�}0tjj|d�}|�|j�}|d@�}1|1dAk�r.|dB�}2n|1dCk�r6dD}2n|1dEk�r=dF}2|dG�}3|dH�}4|j/�0��}5|5j1dI|2|3|4dJdK�}6d0|/�}7z |6�2|0|/|7��W�n�t3�y}�}8�zt �dLt|8����W�Y�d�}8~8nd�}8~8ww�d<|7�}'t�%|'��tj � tj��r�t �dM|�����t,�4���tt5dNdO��}9dPdQ|9f�|�_6dR|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��dT||�j6f�}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��tj � tj��rtj � dU|�����rt �dVt|"������t �dWt|�j6������t �|�jdX��dY|�j6�}'t�&|'d�d�d�dS�\}:}"|:dk�r%t3|"��dZ|�j6||�j6f�}'t�&|'d�d�d�dS�\}:}"|:dk�rBt3|"��tj � tj��rxt �d[t|"������d\|�j6��d]�}'t�&|'d�d�d�dS�\}:}"tj � tj��rxt �d^t|"������|d_k�r�|d`k�r�t7|�jd ��dak�r�t8jj|d�};|;j9j:}<|;j9j;}=|;j }>|;j<}?ddbl=m>}@�dc|;j9j?��dd�}A|@�@|A|;j9j?�}Bde|�j6| |f�}Cdf|<|B|>|Cf�}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��t �|�jdg��t �|�jdh��di|B��dj�|<|>||?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�rt3|"��di|B��dl�|<|>|?|?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r/t3|"��di|B��dm�|<|>|?|?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�rRt3|"��dn|<��d6|B��do|>���}'t�&|'d�d�d�dS��dp|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��ddqlBmC}D�|D�D���� n|drk�r6|d`k�r�t7|�jd ��dak�r�t8jj|d�};tEjj|;jFd�}Et8jjG|Eds��H��}F|Fdk�r�dt|Ej?||�Adu�d���f�}Gz/t8jj|G|Edv�}H|;j9j:}<|Hj9j;}=|Hj }>|>}Iddbl=m>}@�dc|;j9j?��dd�}A|@�@|A|;j9j?�}B|G}JW�n$���|;j<}J|;j }I|;j9j:}<ddbl=m>}@�dc|;j9j?��dd�}A|@�@|A|;j9j?�}BY�dw|�j6| f�}Kdx|<|K|If�}'t�&|'d�d�d�dS�\}:}"|:dk�rAt3|"��dy|<|K|If�}'t�&|'d�d�d�dS�\}:}"|:dk�r\t3|"��dn|<��d6|B��do|I���}'t�&|'d�d�d�dS��dp|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"���n|d`k�r4t7|�jd ��dak�r4i�}L|dz�|Ld{<�||Ld|<�d}|Ld~<�|d�|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�||Ld�<�||Ld�<�z|d��}M|M�Idu�}N|Nd��}Od�}PW�n�t3�y��}8�zd�}PW�Y�d�}8~8nd�}8~8ww�|�jd��d`k�r |}?n dP||�jd��f�}?|�jd��|Ld�<�|�jd��|Ld�<�|��}Q|Q�J| |L�}R|�|RjK�}St �d�|S���|Sd�}T �tL|Td���"��}Ut �d�|U���|U�Ad��dak�rRn"|U�Ad��dak�rft �|�jd�|U���W�dS�t �|�jd���tM�Nd����q;t �|�jd���t8jj|?d��}V|Vj9j:}<|Vj9j;}=|Vj }>|�O|=�}Wd�|W�}Bt,�4���tt5dNdO��}9dPdQ|9f�|�_6dR|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��d�|Vj9j:��d8|Vj9j:��d6|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��t �|�jd���d�|<||�j6f�}'t�&|'d�d�d�dS�\}:}"|:dk�r t3|"��d�|<|�j6f�}'t�&|'d�d�d�dS�\}:}"|:dk�r$t3|"��d�|<��d8|<��d6|�j6��du|��d�� }'t�&|'d�d�d�dS�\}:}"|:dk�rHt3|"��d�|<|�j6||�j6f�}'t�&|'d�d�d�dS�\}:}"|:dk�rft3|"��t �|�jd���|Pd�k�rzdw|�j6| f�}Knd�|�j6| f�}Kdx|<|K|>f�}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��dy|<|K|>f�}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��t �|�jdh��d�|<|>||?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��d�|<|>|?|?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��dn|<��d�|>���}'t�&|'d�d�d�dS��dp|�j6���}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r*t3|"��ddqlBmC}D�|D�D����no|d`k� r�t7|�jd ��dak� r�t8jj|d�};tEjj|;jFd�}Et8jjG|Eds��H��}F|Fdk� r�dt|Ej?||�Adu�d���f�}Gz+t8jj|G|Edv�}H|;j9j:}<|Hj }>|>}I|G}Jddbl=m>}@�dc|;j9j?��dd�}A|@�@|A|;j9j?�}BW�n&���|;j<}J|;j }I|I}>|;j9j:}<ddbl=m>}@�dc|;j9j?��dd�}A|@�@|A|;j9j?�}BY�tj � tj��r�t �d�|>�����dn|<��d6|B��d��|>�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��|"�Pd��}Xdn|<��d6|B��d��|>�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� rt3|"��|"�Pd��}Ydn|<��d6|B��d��|>�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� rBt3|"��|"�Pd��}Zdw|�j6| f�}Kdx|<|K|If�}'t�&|'d�d�d�dS�\}:}"|:dk� rit3|"��dy|<|K|If�}'t�&|'d�d�d�dS�\}:}"|:dk� r�t3|"��d�|Y��d�|I��d��}'t�&|'|<d�d�dS�\}:}"|:dk� r�t3|"��d�|X��d�|I��d��}'t�&|'|<d�d�dS�\}:}"|:dk� r�t3|"��d�|Z��d�|I��d��}'t�&|'d�d�d�dS�\}:}"|:dk� r�t3|"��de|�j6| |f�}[dn|<��d6|B��d��|>|[f�}'t�&|'d�d�d�dS�\}:}"|:dk� rt3|"��t �|�jd���t �|�jdh��dn|<��d6|B��d��|I||Jf�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� r7t3|"��dn|<��d6|B��dm�|I|J|Jf�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� r\t3|"��dn|<��d6|B��do|I���}'t�&|'d�d�d�dS��tj � tj�� s�dp|�j6���}'t�&|'d�d�d�dS�\}:}"|:dk� r�t3|"���n|d`k� r�t7|�jd ��dak� r�i�}L|dz�|Ld{<�||Ld|<�d}|Ld~<�|d�|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�|d��|Ld�<�||Ld�<�||Ld�<�d|Ld�<�z|d��}M|M�Idu�}N|Nd��}Od�}PW�n�t3�y �}8�zd�}PW�Y�d�}8~8nd�}8~8ww�|�jd��d`k�r|}?n dP||�jd��f�}?|�jd��|Ld�<�|�jd��|Ld�<�|��}Q|Q�J| |L�}R|�|RjK�}St �d�|S���|Sd�}T �tL|Td���"��}Ut �d�|U���|U�Ad��dak�r^n"|U�Ad��dak�rrt �|�jd�|U���W�dS�t �|�jd���tM�Nd����qGt �|�jd���t8jj|?d��}V|Vj9j:}<|Vj9j;}=|Vj }>dd�lQmR}\�dc|Vj9j?��dd�}Ad�}]|]d�|d����d���|A�}]t�S|]��ddbl=m>}@�dc|Vj9j?��dd�}A|@�@|A|Vj9j?�}Bd�|<|B|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��|"�Pd��}Xd�|<|B|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�rt3|"��|"�Pd��}Yd�|<|B|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r4t3|"��|"�Pd��}Zt �|�jd���|Pd�k�rMdw|�j6| f�}Knd�|�j6| f�}Kdx|<|K|>f�}'t�&|'d�d�d�dS�\}:}"|:dk�rot3|"��dy|<|K|>f�}'t�&|'d�d�d�dS�\}:}"|:dk�r�t3|"��d�|<|B|X|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��d�|<|B|Y|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��d�|<|B|Z|>f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak�r�t3|"��de|�j6| |f�}[t �|�jdá�d�|<|B|>|[f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� rt3|"��t �|�jdh��di|B��dj�|<|>||?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� r?t3|"��di|B��dm�|<|>|?|?f�}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� rbt3|"��dn|<��d6|B��do|>���}'t�&|'d�d�d�dS��tj � tj�� s�dp|�j6���}'t�&|'d�d�d�dS�\}:}"|"�Adk�dak� r�t3|"��ddqlBmC}D�|D�D���tj � tj�� s�|dk� s�|d=k� r�d�|*���}'t�%|'��t �|�jdơ�W�d�S��t3�y�}8�z;t �d�t|8����ztj � tj�� s�dp|�j6���}'t�%|'��W�n���Y�t �|�jt|8���dȝ��dt|8�fW��Y�d�}8~8S�d�}8~8ww�)�Nr���r���r����)�Packagez&Restore WP backup Now ....... start:%s�Domainr���zRestoring backup...,10� DesSiteID�backupidr`��ra��r���r���r���z.sqlr���r���r?��)�packageNamer���r���r���r���zStarting sftp download �SFTP�Hostname�Username�Password�PathzMaking sftp connection to )r[���r\����SFTP Connected successfully..�=ssh-keygen -t rsa -b 2048 -f ~/.ssh/cyberpanelbackup -q -N ''�SSH key generated..�~/.ssh/cyberpanelbackup�~/.ssh/cyberpanelbackup.pubr�����Key from remote server �echo "�" >> ~/.ssh/authorized_keysrH���T�Qawk '!seen[$0]++' ~/.ssh/authorized_keys > temp && mv temp ~/.ssh/authorized_keys�cat ~/.ssh/authorized_keys�'Updated content of authorized key file �Downloading Backups...,15z/home/cyberpanel/%s.tar.gzz%s/%s.tar.gz�Downloading start�� SSHServer�#scp -o StrictHostKeyChecking=no -i � -P r���� root@r~���� Command used to retrieve backup �(Error in scp command to retrieve backup �*Success in scp command to retrieve backup zmv %s /home/backup/�S3�uploadfilename� BucketName�Provider� Backblaze�EndUrl�Amazonz"https://s3.us-east-1.amazonaws.com�Wasabizhttps://s3.wasabisys.com� AccessKey� SecertKey�s3F)�endpoint_url�aws_access_key_id�aws_secret_access_key�verifyzError in downloadfile: ..%sz Backup type: r=��r>��r���r���rs���rP���zcp -R /home/backup/%s* %sr���z&Backup file is present and downloaded zExtracting to zExtracting Backup File...,30zmkdir %s/abz$sudo tar -xvf %s/%s.tar.gz -C %s/abzOutput of archive zls -lh z/abzListing files r���rg���rO���ra���rc���rd���z!%s/ab/usr/local/CyberCP/tmp/%s/%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %szRestoreing Data Base...,70zReplacing URLs...,90zsudo -u %s z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"r���z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "https://%s" "http://%s"z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"r���zl -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp litespeed-purge all --path=rt���r���r���)rC��z%s%srk���)rm��rC��z+%s/ab/usr/local/CyberCP/tmp/%s/public_html/zsudo -u %s cp -R %s* %szsudo -u %s cp -R %s.[^.]* %sr���r@��ri���z6.0r��r���r����r����Emailr����PasswordByPassr����AutomaticUpdatesr���rk��r���rl��r����r����r���r���rj���r���rJ���rZ���z WP Creating website result....%sr����z%Error WP creating lastline ....... %sr����r����z,Failed to Create WordPress: error: %s. [404]zCreating WordPress....,20rh��zRestoring site ....,30)rm��r���r#��zExtracting Backup File...,40z$sudo -u %s cp -R /home/backup/%s* %szsudo -u %s mkdir %s/abr}���r���z*sudo -u %s tar -xvf %s/%s.tar.gz -C %s/abzCopying Data File...,60z7%s/ab/usr/local/CyberCP/tmp/%s/public_html/public_html/z�sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"z�sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"z] /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=z$WP Path where things are happening: z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%sr����z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%sz� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%sz9sed -i "s/define( 'DB_USER', '.*' );/define( 'DB_USER', 'z' );/" z wp-config.phpz9sed -i "s/define( 'DB_NAME', '.*' );/define( 'DB_NAME', 'zAsed -i "s/define( 'DB_PASSWORD', '.*' );/define( 'DB_PASSWORD', 'z� -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %szRestoring Database...,70za -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"r_��)�vhostzQ/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/virtualHostUtilities.pyz changePHP --phpVersion 'r���z ' --path z�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config set DB_NAME %s --skip-plugins --skip-themes --path=%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config set DB_USER %s --skip-plugins --skip-themes --path=%sz�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp config set DB_PASSWORD %s --skip-plugins --skip-themes --path=%szRestoring Data Base...,80z�sudo -u %s %s -d error_reporting=0 -d memory_limit=350M -d max_execution_time=400 /usr/bin/wp --skip-plugins --skip-themes --path=%s db import %szrm -rf /home/backup/r���z#Error RestoreWPbackupNow ....... %sr���)Tr����r���r���r����r�����packages.modelsr����boto3rI���rJ���rK���r���r��r?���r@���r!���r���r����r���r����r����r����rD��r���r���rA��rA���r����paramiko� SSHClient�set_missing_host_key_policy� AutoAddPolicyr/���exec_commandr����r�����striprF���rQ���� open_sftp�WebTerminal.CPWebSocketr���findSSHPort�DEFAULT_PORTr����fetchIPr����r�����Session�client� download_filer>���r���r���r���r����r���rC��r����r����rm��r����rb���ri���r����rR���r���r���r���r���r���r����r�����split�submitWorpressCreationr����r����r����r����r���r�����plogical.vhostr)���popenExecutioner)^r#���r����r���r����r���r+��r���r���� DomainNamer����r���rD���BackUpFileName�oldtemppath�DatabaseNameold�DumpFileName�oldurl�packgobj�packegs�WebOwnerobj�WebOwner� BackupTyper����RemoteBackupID�RemoteBackupOBJ�RemoteBackupconf�HostNamer���r���r��r,���ssh�ssh_keygen_command�stdinr����stderr�remote_private_key�remote_public_key�public_key_contentrG����updatedAuth�sftp� loaclpath� remotepathr��� successRet�errorRetr��r���provider�EndURlr��r ��r����r8���FinalZipPathrB���r���rU���r���r���r���� newWPpath�newurlrb���r����r���unzippathdbr���r|���ag�finalurl�WPobj�WPpath�Newurl� unzippathrs���oldpath�abc�newpath�oldhomeru��rv��rw��rx��ry��� NewWPsiter����Finaldbname�Finaldbuser� Finaldbpasswd� unzippath2r)��r��r$���r$���r%���r6������s��� ,�������� n ��� ��������V #� � � � � 3 � ��� � � � ��� � � � ��� ���� ��� ��� � � � � � ���� � � ���z'ApplicationInstaller.RestoreWPbackupNowc�����������������C���s8���||�d�}t�|�jd�}|�t|���d���|����d�S�)N�d���r^���z/% of file is downloaded from remote server..,50)r����r���r����r����r����)r#����transferred�total� percentager����r$���r$���r%����UpdateDownloadStatus���s���z)ApplicationInstaller.UpdateDownloadStatusc�����������#��� ���C���s>���z�|�j�d�}|�j�d�}|�j�d�}|�j�d�}|�j�d�}||�_t|d�}|�d��|����dd lm}�|jj|d �}t jj|j d�} t�| j �d�} t���}|�t�����d }t�d|�����d�} t| �}tj�|�}|j| |j |d��tj�tj�r�t�d��d}|�|�\}}}tj�tj�r�t�d��d}d}d|���}|�|�\}}}|� ���!���"��}t#|�dk�r�t|d�}|�d��|����W�dS�tj�tj�r�t�d|�����d|��d�}t�$|dd��d}t�$|dd��d}t�|dd�}tj�tj��rt�d|�����|�%��}t�&|�jd ��d!|���}d"|��d#|���}t�d$��dd%l'm(}�|�)���d&|��d't*|j+���d(|��d)t,�-����d*|��� }|�|�\}}}|� ���!���"��}|� ���!���"��}tj�tj��r�t�d+|�����|�r�t�d,|�����t|d�}|�d,|��d-���|����z|jd"|��d#|���d!|���|�j.d.��W�n<�t/�y��}�z't�d/t*|���d0���t|d�}|�d/t*|���d0���|����W�Y�d�}~W�dS�d�}~ww�t�d1|�����|�r�|����|�r�|����tj�d2��s�d3}t�$|��d4|��d5|���}t�$|��dd6l0m1} �| ��}!|!�2d7|i|�}"t|d�}|�d8��|����t3�4d9��t�|"j5�d:�dk�rTt|d�}|�d;t�|"j5�d<���d=���|����d>|���}t�$|��W�dS�tj�tj��rdt�d?|����� �|!�6d7|i�}"t�|"j5�}"tj�tj��r�t�d@t*|"������|"dA�dBk�r�|"dC�dDk�r�t|d�}|�dE��|����d>|���}t�$|��W�dS�|"dA�dBk�r�|"dC�dFk�r�t|d�}|�d;t*|"dG����d=���|����d>|���}t�$|��W�d�S�t|d�}|�|"dG���dH���|����t3�4dI���qe�t/�y�}�zt|�jd�}|�t*|�d0���|����W�Y�d�}~dS�d�}~ww�)JNr����folder� backupfiler���r����r^���zDownload started..,30r���)�OneClickBackupsra��)r����ipz/root/.ssh/cyberpanelr����r����)r[����pkeyr��r��r��r��r��� ���z*Failed to get content of public key. [404]r��r��r ��rH���Tr ��r��r��r ��r<��z cpbackups/rk���r��r��r��r��r���r��r~���r��r���.)�callbackzFailed to download file r����r��z/home/backupzmkdir /home/backupzmv /home/cyberpanel/z /home/backup/)� BackupManager� backupFilezDownload finished..,60����� restoreStatusz Failed to restore backup. Error � error_messager���zrm -f /home/backup/z(Name of of the backup file downloaded: zResponce from status function: �abortrP����running� CompletedzSuccessfully Restored. [200]�Errorrd��z,60rx���)7r!���r���r����r����r�����IncBackups.modelsrv��r����r����r����sftpUserr����r����rD��r,��r-��r.��r/��r���rQ���r����r����RSAKey�from_private_keyr/��rI���rJ���rK���r��r?���r@���r0��r����r����r1��r����rF���r2��r����r3��r��r4��rA���r5��r���r6��rs��r>����backup.backupManagerr|��� submitRestorer����r����r����r��)#r#���r���rt��ru��r���r����r����rv���ocb�nbdrw��rM���private_key_path�key_content�key_file�keyrN��rO��r���rP��rQ��rR��rS��rG���rT��rU��rV��rW��r��rX��rY��rB���r|��r����r����r$���r$���r%���r8������s�� , � �� � ���z#ApplicationInstaller.StartOCRestore)N)&�__name__� __module__�__qualname__r����r����r����� MauticVersion� PrestaVersionr���rC���r7����staticmethodrM���rW���r=���r+���r*���r����r����r����r����r9���r;���r:���rQ��rZ��r-���r.���r/���r0���r1���r2���r3���r4���r5���r6���rs��r8���r$���r$���r$���r%���r���#���s�����- ,�z+R /��_�D���Z�k�"!�^c���}���������������������������p r���c������������������C���s���t�jdd�}�|�jddd��|�jddd��|�jddd��|�jd dd��|�jd dd��|�jddd��|�jddd��|�jd dd��|�jddd��|�jddd��|�jddd��|�jddd��|�jddd��|�jddd��|����}|jdkr�i�}|j|d<�|j|d<�|j|d<�|j|d<�|j |d<�|j |d<�|j|d<�|j|d<�|j |d<�|j|d<�|j|d<�t|j�|d <�|jd�kr�|j|d!<�d"|d#<�nd$|d#<�td�|�}|����d�S�d�S�)%Nz CyberPanel Application Installer)�description�functionzSpecify a function to call!)�helpz--tempStatusPathrg���z --appsSetz--domainz--emailz --passwordz--pluginUpdatesz--themeUpdatesz--titlez --updatesz --userNamez --versionz--pathz--createSiterQ��ri���r���r ��r]���r\���� pluginUpdates�themeUpdatesr@��r��rA���versionr;��rJ���rj���rZ���r���)�argparse�ArgumentParser�add_argument� parse_argsr���ri���r���r ��r]���r\���r���r���r@��r��rA��r���r����r;��rJ���r���rQ��)�parser�argsr!����air$���r$���r%����mainz��sJ��� �r����__main__)7r���r����rI����sys�shutilr�����ior���r,���ApachController.ApacheVhostsr����loginSystem.modelsr���r���r����plogical.aclr���rJ���rr���django�environ� setdefault�setup� threadingr����plogical.CyberCPLogFileWriterr ���r?���r��rJ��r ���r���r���r ���r���r���r���r����plogicalr����plogical.mysqlUtilitiesr����databases.modelsr���r���r����plogical.processUtilitiesr����randomr���r(��r���r���r���r���r$���r$���r$���r%����<module>���s����(�����������������������������������������������������- �
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings