From: Vincent Vanwaelscappel Date: Thu, 13 Mar 2025 16:11:57 +0000 (+0100) Subject: wip #7387 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3a60da41930691471538a55afd1dde7f251067bd;p=fluidbook-toolbox.git wip #7387 @2 --- diff --git a/app/Http/Controllers/Admin/Operations/ServerOperation.php b/app/Http/Controllers/Admin/Operations/ServerOperation.php index d40c9dd15..301303fa4 100644 --- a/app/Http/Controllers/Admin/Operations/ServerOperation.php +++ b/app/Http/Controllers/Admin/Operations/ServerOperation.php @@ -23,6 +23,9 @@ trait ServerOperation $this->crud->setEditView('vendor.backpack.crud.edit-external-server'); } + /** + * @throws \Exception + */ protected function run(Request $request, $id) { $req = $request->toArray(); diff --git a/app/Models/FluidbookExternalInstallServer.php b/app/Models/FluidbookExternalInstallServer.php index d04a3c963..712989ef2 100644 --- a/app/Models/FluidbookExternalInstallServer.php +++ b/app/Models/FluidbookExternalInstallServer.php @@ -12,6 +12,7 @@ use Cubist\Backpack\Magic\Fields\SelectFromArray; use Cubist\Backpack\Magic\Fields\Table; use Cubist\Backpack\Magic\Fields\Textarea; use Cubist\Backpack\Magic\Models\ExternalServer; +use Cubist\Net\Transfer\Driver; use Cubist\Net\Transfer\Local; use Cubist\Util\Files\Files; use Cubist\Util\Json; @@ -160,7 +161,7 @@ class FluidbookExternalInstallServer extends ExternalServer } /** - * @return \Cubist\Net\Transfer\Driver + * @return Driver */ public function getTransferDriver() { @@ -186,6 +187,9 @@ class FluidbookExternalInstallServer extends ExternalServer return trim(str_replace('\n', '', shell_exec('dig +short @1.1.1.1 ' . $hostname . ' | tail -1'))); } + /** + * @throws \Exception + */ public static function verifyServerConnexion(array $data) { $isHosting = static::isHostingProtocol($data['protocol']); @@ -213,7 +217,9 @@ class FluidbookExternalInstallServer extends ExternalServer $server->setRawAttributes($data); $driver = $server->getTransferDriver(); - $check = $driver->checkConnexion($data); + $check = $driver->checkConnexion(); + + dddd($server->getSettings()); $res = []; @@ -276,14 +282,6 @@ class FluidbookExternalInstallServer extends ExternalServer ]; } - public function getSettings() - { - $res = parent::getSettings(); - // Force passive mode - $res['ftp_mode'] = '1'; - return $res; - } - /** * @param $protocol * @return bool