This commit is contained in:
Bozhidar 2024-09-17 15:28:35 +03:00
parent 382a38da60
commit 297fe6e6cd
3 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,56 @@
<?php
namespace Modules\Email\App\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Blade;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class SetupDockerEmailServer extends Command
{
/**
* The name and signature of the console command.
*/
protected $signature = 'email:setup-docker-email-server';
/**
* The console command description.
*/
protected $description = 'Command description.';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$this->info('Setting up email server...');
$workPath = '/usr/local/phyre/email/docker';
$moduleServerConfigTemplatesPath = '/usr/local/phyre/web/Modules/Email/server/docker/';
$dockerComposeYaml = file_get_contents($moduleServerConfigTemplatesPath . 'docker-compose.yaml');
$dockerComposeYaml = Blade::render($dockerComposeYaml, [
'containerName' => 'phyre-mail-server',
'hostName'=> 'mail.server11.microweber.me',
'workPath' => $workPath,
]);
shell_exec('mkdir -p ' . $workPath);
file_put_contents($workPath . '/docker-compose.yaml', $dockerComposeYaml);
// dd(shell_exec('docker-compose -f ' . $workPath . '/docker-compose.yaml up -d'));
dd($dockerComposeYaml);
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Modules\Email\App\Filament\Pages;
use Filament\Pages\Page;
class EmailSettings extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-cog';
protected static string $view = 'email::filament.pages.email-settings';
protected static ?string $navigationGroup = 'Email';
protected static ?string $navigationLabel = 'Settings';
}

View file

@ -0,0 +1,7 @@
<x-filament-panels::page>
<div>
Email settings
</div>
</x-filament-panels::page>