mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 08:52:35 +00:00
use blade as conmmands template (#444)
* use blade as conmmands template * fix lint * fix ssl
This commit is contained in:
@ -2,16 +2,17 @@
|
||||
|
||||
namespace App\SSH\Services\Firewall;
|
||||
|
||||
use App\SSH\HasScripts;
|
||||
use App\Exceptions\SSHError;
|
||||
|
||||
class Ufw extends AbstractFirewall
|
||||
{
|
||||
use HasScripts;
|
||||
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function install(): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
$this->getScript('ufw/install-ufw.sh'),
|
||||
view('ssh.services.firewall.ufw.install-ufw'),
|
||||
'install-ufw'
|
||||
);
|
||||
$this->service->server->os()->cleanup();
|
||||
@ -22,10 +23,13 @@ public function uninstall(): void
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function addRule(string $type, string $protocol, int $port, string $source, ?string $mask): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
$this->getScript('ufw/add-rule.sh', [
|
||||
view('ssh.services.firewall.ufw.add-rule', [
|
||||
'type' => $type,
|
||||
'protocol' => $protocol,
|
||||
'port' => $port,
|
||||
@ -36,10 +40,13 @@ public function addRule(string $type, string $protocol, int $port, string $sourc
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function removeRule(string $type, string $protocol, int $port, string $source, ?string $mask): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
$this->getScript('ufw/remove-rule.sh', [
|
||||
view('ssh.services.firewall.ufw.remove-rule', [
|
||||
'type' => $type,
|
||||
'protocol' => $protocol,
|
||||
'port' => $port,
|
||||
|
Reference in New Issue
Block a user