refactoring

This commit is contained in:
Saeed Vaziry
2023-08-04 18:28:04 +02:00
parent 8444323cf4
commit 643318fcfc
349 changed files with 3189 additions and 2729 deletions

View File

@ -3,8 +3,8 @@
namespace App\Jobs\Installation;
use App\Models\Server;
use App\SSHCommands\CreateUserCommand;
use App\SSHCommands\GetPublicKeyCommand;
use App\SSHCommands\System\CreateUserCommand;
use App\SSHCommands\System\GetPublicKeyCommand;
use Throwable;
class Initialize extends InstallationJob
@ -13,13 +13,10 @@ class Initialize extends InstallationJob
protected ?string $asUser;
protected bool $defaultKeys;
public function __construct(Server $server, string $asUser = null, bool $defaultKeys = false)
public function __construct(Server $server, string $asUser = null)
{
$this->server = $server->refresh();
$this->asUser = $asUser;
$this->defaultKeys = $defaultKeys;
}
/**
@ -38,7 +35,7 @@ public function handle(): void
protected function authentication(): void
{
$this->server
->ssh($this->asUser ?? $this->server->ssh_user, $this->defaultKeys)
->ssh($this->asUser ?? $this->server->ssh_user)
->exec(
new CreateUserCommand(
$this->server->authentication['user'],