]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7387 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Mar 2025 16:11:57 +0000 (17:11 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 13 Mar 2025 16:11:57 +0000 (17:11 +0100)
app/Http/Controllers/Admin/Operations/ServerOperation.php
app/Models/FluidbookExternalInstallServer.php

index d40c9dd151a2b83c89fe9b7e579fbc47c43a0dde..301303fa41229a96c0ba59b79ebbd61bd5da9b79 100644 (file)
@@ -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();
index d04a3c96391698414bac21ef1bd53d45c2843e87..712989ef271800c240af8267bc7aba750c1f00b0 100644 (file)
@@ -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