mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-09-19 23:31:12 +00:00
update
This commit is contained in:
parent
33ec3b9b21
commit
f3e898fa0c
18
web/Modules/Email/PostInstall.php
Normal file
18
web/Modules/Email/PostInstall.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Modules\Email;
|
||||
|
||||
use App\ModulePostInstall;
|
||||
|
||||
class PostInstall extends ModulePostInstall
|
||||
{
|
||||
public $supportLog = true;
|
||||
public function run()
|
||||
{
|
||||
$installDockerShellFile = base_path('Modules/Email/shell-scripts/install-docker.sh');
|
||||
|
||||
shell_exec("chmod +x $installDockerShellFile");
|
||||
shell_exec("bash $installDockerShellFile >> $this->logFile &");
|
||||
|
||||
}
|
||||
}
|
14
web/Modules/Email/shell-scripts/get-available-port.sh
Normal file
14
web/Modules/Email/shell-scripts/get-available-port.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
netstat -aln | awk '
|
||||
$6 == "LISTEN" {
|
||||
if ($4 ~ "[.:][0-9]+$") {
|
||||
split($4, a, /[:.]/);
|
||||
port = a[length(a)];
|
||||
p[port] = 1
|
||||
}
|
||||
}
|
||||
END {
|
||||
for (i = 3000; i < 65000 && p[i]; i++){};
|
||||
if (i == 65000) {exit 1};
|
||||
print i
|
||||
}
|
||||
'
|
20
web/Modules/Email/shell-scripts/install-docker.sh
Normal file
20
web/Modules/Email/shell-scripts/install-docker.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
sudo apt-get update -y
|
||||
sudo apt-get install ca-certificates curl -y
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
|
||||
# Add the repository to Apt sources:
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install docker-compose docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "Done!"
|
|
@ -233,15 +233,13 @@ class Backup extends Model
|
|||
}
|
||||
}
|
||||
|
||||
// Export Phyre Panel ENV
|
||||
$getEnv = Dotenv::createArrayBacked(base_path())->load();
|
||||
$backupStructure = [
|
||||
'database'=>$database,
|
||||
'env'=>$getEnv,
|
||||
'config'=>PhyreConfig::getAll()
|
||||
];
|
||||
file_put_contents($backupTempPath.'/backup.json', json_encode($backupStructure, JSON_PRETTY_PRINT));
|
||||
$shellFileContent .= 'echo "Backup Phyre Panel ENV"'. PHP_EOL;
|
||||
$shellFileContent .= 'cp '.base_path().'/.env '.$backupTempPath.'/.env'. PHP_EOL;
|
||||
$shellFileContent .= 'echo "Backup Phyre Panel Config"'. PHP_EOL;
|
||||
$shellFileContent .= 'cp '.base_path().'/phyre-config.ini '.$backupTempPath.'/phyre-config.ini'. PHP_EOL;
|
||||
|
||||
// Export Phyre Panel Hosting Subscription
|
||||
$findHostingSubscription = HostingSubscription::all();
|
||||
|
|
|
@ -18,4 +18,15 @@ class PhyreConfig
|
|||
return $default;
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
// Parse without sections
|
||||
$configIni = base_path() . "/phyre-config.ini";
|
||||
if (file_exists($configIni)) {
|
||||
$iniArray = parse_ini_file($configIni);
|
||||
return $iniArray;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue