|
@@ -19,6 +19,7 @@ class Route_Install extends RouteBase {
|
|
|
$this->menu();
|
|
$this->menu();
|
|
|
SE_Layout::dol();
|
|
SE_Layout::dol();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private function menu() {
|
|
private function menu() {
|
|
|
$serversList = $this->fetchActiveLicences();
|
|
$serversList = $this->fetchActiveLicences();
|
|
|
?>
|
|
?>
|
|
@@ -198,6 +199,27 @@ jQuery(document).ready(function () {
|
|
|
echo'<pre>cmd: '. $cmd . ': (return:'.$ret.')'."\n";print_r($out);echo'</pre>';
|
|
echo'<pre>cmd: '. $cmd . ': (return:'.$ret.')'."\n";print_r($out);echo'</pre>';
|
|
|
exit;
|
|
exit;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (0) {//'1' == V::get('DBG_ENCODER_TEST_IP', '', $_REQUEST)) {
|
|
|
|
|
+ $phpFiles = array();
|
|
|
|
|
+ $phpFiles[] = 't.php';
|
|
|
|
|
+ $cmd = "cd {$installPath}/SE && echo '<?php' > t.php ; echo 'echo \"test\\n\";' >> t.php ";
|
|
|
|
|
+ //$cmd = "cd {$installPath}/SE && rm t.php ";
|
|
|
|
|
+ V::exec($cmd, $out, $ret);
|
|
|
|
|
+ DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+
|
|
|
|
|
+ $cmd = "cd {$installPath}/SE && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder --phpversion {$phpVersion} -b- ";
|
|
|
|
|
+ //$mac = '38:c9:86:31:80:77';
|
|
|
|
|
+ //$cmd .= " --mac {$mac}";
|
|
|
|
|
+ foreach ($appLicenceInfo->domains as $domain) {
|
|
|
|
|
+ $cmd .= " --domain {$domain} ";
|
|
|
|
|
+ }
|
|
|
|
|
+ $cmd .= " " . implode(" ", $phpFiles);
|
|
|
|
|
+ V::exec($cmd, $out, $ret);
|
|
|
|
|
+ DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
+ if (0 !== $ret) throw new Exception("Error at encode files");
|
|
|
|
|
+ if (empty($out)) throw new Exception("No output for encode files command");
|
|
|
|
|
+ exit;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
$phpFiles = array();
|
|
$phpFiles = array();
|
|
@@ -224,7 +246,9 @@ jQuery(document).ready(function () {
|
|
|
|
|
|
|
|
$skipPhpFiles[] = 'se-lib/DataSourceException.php';
|
|
$skipPhpFiles[] = 'se-lib/DataSourceException.php';
|
|
|
$skipPhpFiles[] = 'se-lib/Core/Pdo.php';
|
|
$skipPhpFiles[] = 'se-lib/Core/Pdo.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/Cron.php';
|
|
|
$skipPhpFiles[] = 'se-lib/Router.php';
|
|
$skipPhpFiles[] = 'se-lib/Router.php';
|
|
|
|
|
+ $skipPhpFiles[] = 'se-lib/RouteBase.php';
|
|
|
$skipPhpFiles[] = 'se-lib/HttpException.php';
|
|
$skipPhpFiles[] = 'se-lib/HttpException.php';
|
|
|
$skipPhpFiles[] = 'se-lib/DebugExecutionTime.php';
|
|
$skipPhpFiles[] = 'se-lib/DebugExecutionTime.php';
|
|
|
|
|
|
|
@@ -285,7 +309,7 @@ jQuery(document).ready(function () {
|
|
|
$cmds = array();
|
|
$cmds = array();
|
|
|
$cmds[] = "if [ -d {$installPath} ] ; then rm -rf '{$installPath}'; fi";
|
|
$cmds[] = "if [ -d {$installPath} ] ; then rm -rf '{$installPath}'; fi";
|
|
|
$cmds[] = "mkdir {$installPath}";
|
|
$cmds[] = "mkdir {$installPath}";
|
|
|
- $cmds[] = "cd {$installPath} && git clone git@biuro.biall-net.pl:plabudda/se.git .";
|
|
|
|
|
|
|
+ $cmds[] = "cd {$installPath} && git clone ssh://git@biuro.biall-net.pl:2222/plabudda/se.git .";
|
|
|
$cmds[] = "cd {$installPath} && echo `git show-ref --head|head -1|head -c 8` > SE/VERSION ";
|
|
$cmds[] = "cd {$installPath} && echo `git show-ref --head|head -1|head -c 8` > SE/VERSION ";
|
|
|
//echo'<pre>cmds: ';print_r($cmds);echo'</pre>';
|
|
//echo'<pre>cmds: ';print_r($cmds);echo'</pre>';
|
|
|
foreach ($cmds as $cmd) {
|
|
foreach ($cmds as $cmd) {
|
|
@@ -295,13 +319,13 @@ jQuery(document).ready(function () {
|
|
|
}
|
|
}
|
|
|
$this->_encodeSource($appLicenceInfo);
|
|
$this->_encodeSource($appLicenceInfo);
|
|
|
// 1763: $exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder -b-
|
|
// 1763: $exec='cd '.$installer_dir.' && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder -b-
|
|
|
-// '.INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT).'
|
|
|
|
|
-// -r *.php
|
|
|
|
|
-// -x superedit-DB_PROCEDURES_CREATE.php
|
|
|
|
|
-// -x INI.php
|
|
|
|
|
|
|
+// '.INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT).'
|
|
|
|
|
+// -r *.php
|
|
|
|
|
+// -x superedit-DB_PROCEDURES_CREATE.php
|
|
|
|
|
+// -x INI.php
|
|
|
// -x .config_base_structure.php
|
|
// -x .config_base_structure.php
|
|
|
// ';
|
|
// ';
|
|
|
-//
|
|
|
|
|
|
|
+//
|
|
|
// INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT):
|
|
// INSTALL_SES_PROCESY_A::get_same_domains_for_install($h->SERVER_ADDRESS_SHORT):
|
|
|
// $res2=DB::query("select SERVER_ADDRESS_SHORT from SES_PROCESY5_A where SERVER_ADDRESS_IP='".$h->SERVER_ADDRESS_IP."'");
|
|
// $res2=DB::query("select SERVER_ADDRESS_SHORT from SES_PROCESY5_A where SERVER_ADDRESS_IP='".$h->SERVER_ADDRESS_IP."'");
|
|
|
// while($h2=DB::fetch($res2)) {
|
|
// while($h2=DB::fetch($res2)) {
|
|
@@ -479,6 +503,7 @@ ssh {$sshHostUsr} '[ ! -d /Library/Server/Web/Data/Sites/Default/SE.test/se-lib
|
|
|
ssh {$sshHostUsr} 'mv /Library/Server/Web/Data/Sites/Default/SE ~/bup.se.upgrade/bup.{$dateStr}';
|
|
ssh {$sshHostUsr} 'mv /Library/Server/Web/Data/Sites/Default/SE ~/bup.se.upgrade/bup.{$dateStr}';
|
|
|
ssh {$sshHostUsr} 'mv /Library/Server/Web/Data/Sites/Default/SE.test /Library/Server/Web/Data/Sites/Default/SE';
|
|
ssh {$sshHostUsr} 'mv /Library/Server/Web/Data/Sites/Default/SE.test /Library/Server/Web/Data/Sites/Default/SE';
|
|
|
";
|
|
";
|
|
|
|
|
+ // sudo for mv?
|
|
|
V::exec($cmd, $out, $ret);
|
|
V::exec($cmd, $out, $ret);
|
|
|
DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
|
|
DBG::_(true, true, "cmd: {$cmd} (return: {$ret})", $out, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
if (0 !== $ret) throw new Exception("Cannot run remote command using rsa key! #{$ret}");
|
|
if (0 !== $ret) throw new Exception("Cannot run remote command using rsa key! #{$ret}");
|
|
@@ -515,7 +540,10 @@ ssh {$sshHostUsr} 'mv /Library/Server/Web/Data/Sites/Default/SE.test /Library/Se
|
|
|
|
|
|
|
|
$cmd = 'ls -1a';
|
|
$cmd = 'ls -1a';
|
|
|
$cmd = "
|
|
$cmd = "
|
|
|
-[ ! -d ~/.ssh ] && mkdir ~/.ssh || echo 'OK ~/.ssh exists';
|
|
|
|
|
|
|
+[ ! -d ~/.ssh ] && mkdir ~/.ssh;
|
|
|
|
|
+[ ! -d ~/.ssh ] && echo 'ERROR ~/.ssh not exists and cannot be created';
|
|
|
|
|
+[ ! -f ~/.ssh/authorized_keys ] && echo '{$rsaPubKey}' > ~/.ssh/authorized_keys;
|
|
|
|
|
+[ ! -f ~/.ssh/authorized_keys ] && echo 'ERROR ~/.ssh/authorized_keys not exists and cannot be created';
|
|
|
cat ~/.ssh/authorized_keys| grep '{$rsaPubKey}' && echo 'OK' || echo '{$rsaPubKey}' >> ~/.ssh/authorized_keys;
|
|
cat ~/.ssh/authorized_keys| grep '{$rsaPubKey}' && echo 'OK' || echo '{$rsaPubKey}' >> ~/.ssh/authorized_keys;
|
|
|
chmod 600 ~/.ssh/authorized_keys;
|
|
chmod 600 ~/.ssh/authorized_keys;
|
|
|
";
|
|
";
|