mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
update vhost and bug fix (#87)
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
use App\SSHCommands\Nginx\ChangeNginxPHPVersionCommand;
|
||||
use App\SSHCommands\Nginx\CreateNginxVHostCommand;
|
||||
use App\SSHCommands\Nginx\DeleteNginxSiteCommand;
|
||||
use App\SSHCommands\Nginx\GetNginxVHostCommand;
|
||||
use App\SSHCommands\Nginx\UpdateNginxRedirectsCommand;
|
||||
use App\SSHCommands\Nginx\UpdateNginxVHostCommand;
|
||||
use App\SSHCommands\SSL\CreateCustomSSLCommand;
|
||||
@ -39,19 +40,30 @@ public function createVHost(Site $site): void
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function updateVHost(Site $site, bool $noSSL = false): void
|
||||
public function updateVHost(Site $site, bool $noSSL = false, ?string $vhost = null): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
new UpdateNginxVHostCommand(
|
||||
$site->domain,
|
||||
$site->path,
|
||||
$this->generateVhost($site, $noSSL)
|
||||
$vhost ?? $this->generateVhost($site, $noSSL)
|
||||
),
|
||||
'update-vhost',
|
||||
$site->id
|
||||
);
|
||||
}
|
||||
|
||||
public function getVHost(Site $site): string
|
||||
{
|
||||
return $this->service->server->ssh()->exec(
|
||||
new GetNginxVHostCommand(
|
||||
$site->domain
|
||||
),
|
||||
'get-vhost',
|
||||
$site->id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
|
Reference in New Issue
Block a user