mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 09:51:37 +00:00
fix custom vhost update (#164)
This commit is contained in:
parent
f03a029e36
commit
aaef73d89d
@ -7,6 +7,7 @@
|
|||||||
use App\Helpers\HtmxResponse;
|
use App\Helpers\HtmxResponse;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
use App\Models\Site;
|
use App\Models\Site;
|
||||||
|
use App\SSH\Services\Webserver\Webserver;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -25,7 +26,10 @@ public function index(Server $server, Site $site): View
|
|||||||
|
|
||||||
public function getVhost(Server $server, Site $site): RedirectResponse
|
public function getVhost(Server $server, Site $site): RedirectResponse
|
||||||
{
|
{
|
||||||
return back()->with('vhost', $server->webserver()->handler()->getVHost($site));
|
/** @var Webserver $handler */
|
||||||
|
$handler = $server->webserver()->handler();
|
||||||
|
|
||||||
|
return back()->with('vhost', $handler->getVHost($site));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateVhost(Server $server, Site $site, Request $request): RedirectResponse
|
public function updateVhost(Server $server, Site $site, Request $request): RedirectResponse
|
||||||
@ -35,7 +39,9 @@ public function updateVhost(Server $server, Site $site, Request $request): Redir
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$server->webserver()->handler()->updateVHost($site, false, $request->input('vhost'));
|
/** @var Webserver $handler */
|
||||||
|
$handler = $server->webserver()->handler();
|
||||||
|
$handler->updateVHost($site, false, $request->input('vhost'));
|
||||||
|
|
||||||
Toast::success('VHost updated successfully!');
|
Toast::success('VHost updated successfully!');
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
|
@ -70,7 +70,7 @@ public function updateVHost(Site $site, bool $noSSL = false, ?string $vhost = nu
|
|||||||
$this->getScript('nginx/update-vhost.sh', [
|
$this->getScript('nginx/update-vhost.sh', [
|
||||||
'domain' => $site->domain,
|
'domain' => $site->domain,
|
||||||
'path' => $site->path,
|
'path' => $site->path,
|
||||||
'vhost' => $this->generateVhost($site, $noSSL),
|
'vhost' => $vhost ?? $this->generateVhost($site, $noSSL),
|
||||||
]),
|
]),
|
||||||
'update-vhost',
|
'update-vhost',
|
||||||
$site->id
|
$site->id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user