]> _ Git - fluidbook-toolbox.git/commitdiff
Merge branch 'backpack5' into serverExt
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 11:42:38 +0000 (12:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 11:42:38 +0000 (12:42 +0100)
# Conflicts:
# app/Models/FluidbookCollection.php
# app/Models/FluidbookPublication.php

1  2 
.docker/dev/docker-compose.yml
.docker/docker-compose.yml
app/Console/Commands/WorkshopMigration.php
app/Fluidbook/Packager/Download.php
app/Jobs/FluidbookDocumentUpload.php
app/Models/FluidbookExternalInstallServer.php

Simple merge
Simple merge
Simple merge
Simple merge
index f395fc606da237c43a77281b5a2cb7e22ae762ce,5a9e7614f37b3467b350a614344e6db8a60a2022..ee1ae3adec45cdb33cb39b2886174c0a96b87f66
@@@ -87,37 -83,9 +87,40 @@@ class FluidbookExternalInstallServer ex
          if ($this->getProtocol() === 'hosting') {
              return new Local($this, '/mnt/hosting/');
          }
+         if ($this->getProtocol() === 'ushosting') {
+             return new Local($this, '/application/usstorage/hosting/');
+         }
      }
  
 +    public static function verifyServerConnexion($id, $data = [])
 +    {
 +        $server = self::find($id);
 +        $protocol = $data['protocol'] ?? $server->protocol;
 +        $usr = $data['username'] ?? $server->username;
 +        $pwd = $data['password'] ?? $server->password;
 +        $host = $data['host'] ?? $server->host;
 +
 +        if($protocol !== "hosting") {
 +            if(!$host) {
 +                throw new \Exception('Host missing');
 +            } else {
 +                try {
 +                    $connection = ssh2_connect($host, 22);
 +                } catch (\Exception $e) {
 +
 +                }
 +                try {
 +                    self::$isValidConnexion = ssh2_auth_password($connection, $usr, $pwd);
 +                } catch (\Exception $e) {
 +
 +                }
 +                ssh2_disconnect($connection);
 +            }
 +        } else {
 +            self::$isValidConnexion = file_exists("/mnt/hosting/status");
 +        }
 +
 +        return self::$isValidConnexion;
 +    }
 +
  }