mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-25 00:50:32 +00:00
update
This commit is contained in:
parent
fec0b9d337
commit
59756d1a0a
2 changed files with 53 additions and 0 deletions
37
web/app/Installers/Server/Applications/DovecotInstaller.php
Normal file
37
web/app/Installers/Server/Applications/DovecotInstaller.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Installers\Server\Applications;
|
||||
|
||||
class DovecotInstaller
|
||||
{
|
||||
public $rubyVersions = [];
|
||||
|
||||
public $logFilePath = '/var/log/phyre/dovecot-installer.log';
|
||||
|
||||
public function setLogFilePath($path)
|
||||
{
|
||||
$this->logFilePath = $path;
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
|
||||
$commands = [];
|
||||
$commands[] = 'echo "Installing dovecot..."';
|
||||
$commands[] = 'apt-get install -y dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd';
|
||||
|
||||
$shellFileContent = '';
|
||||
foreach ($commands as $command) {
|
||||
$shellFileContent .= $command . PHP_EOL;
|
||||
}
|
||||
|
||||
$shellFileContent .= 'echo "All packages installed successfully!"' . PHP_EOL;
|
||||
$shellFileContent .= 'echo "DONE!"' . PHP_EOL;
|
||||
$shellFileContent .= 'rm -f /tmp/dovecot-installer.sh';
|
||||
|
||||
file_put_contents('/tmp/dovecot-installer.sh', $shellFileContent);
|
||||
|
||||
shell_exec('bash /tmp/dovecot-installer.sh >> ' . $this->logFilePath . ' &');
|
||||
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Livewire;
|
||||
|
||||
use App\Filament\Enums\ServerApplicationType;
|
||||
use App\Installers\Server\Applications\DovecotInstaller;
|
||||
use App\Installers\Server\Applications\NodeJsInstaller;
|
||||
use App\Installers\Server\Applications\PHPInstaller;
|
||||
use App\Installers\Server\Applications\PythonInstaller;
|
||||
|
@ -245,6 +246,21 @@ class Installer extends Page
|
|||
}),
|
||||
|
||||
Wizard\Step::make('Step 3')
|
||||
->description('Configure your email server')
|
||||
->schema([
|
||||
|
||||
|
||||
|
||||
])->afterValidation(function () {
|
||||
|
||||
$dovecotInstaller = new DovecotInstaller();
|
||||
$dovecotInstaller->setLogFilePath(storage_path($this->install_log_file_path));
|
||||
$dovecotInstaller->install();
|
||||
|
||||
dd(storage_path($this->install_log_file_path));
|
||||
}),
|
||||
|
||||
Wizard\Step::make('Step 4')
|
||||
->description('Finish installation')
|
||||
->schema([
|
||||
|
||||
|
|
Loading…
Reference in a new issue