diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43d7ca7e..42475ae3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,8 @@ jobs: WASABI_SECRET: ${{ secrets.WASABI_SECRET }} BACKBLAZE_ACCESS_KEY: ${{ secrets.BACKBLAZE_ACCESS_KEY }} BACKBLAZE_SECRET: ${{ secrets.BACKBLAZE_SECRET }} + CLOUDIAN_ACCESS_KEY: ${{ secrets.CLOUDIAN_ACCESS_KEY }} + CLOUDIAN_SECRET: ${{ secrets.CLOUDIAN_SECRET }} run: | docker compose up -d sleep 10 diff --git a/docker-compose.yml b/docker-compose.yml index 4cd5e9f7..51967c32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,4 +20,6 @@ services: - BACKBLAZE_ACCESS_KEY - BACKBLAZE_SECRET - WASABI_ACCESS_KEY - - WASABI_SECRET \ No newline at end of file + - WASABI_SECRET + - CLOUDIAN_ACCESS_KEY + - CLOUDIAN_SECRET \ No newline at end of file diff --git a/src/Storage/Device/Cloudian.php b/src/Storage/Device/Cloudian.php new file mode 100644 index 00000000..ec88322f --- /dev/null +++ b/src/Storage/Device/Cloudian.php @@ -0,0 +1,48 @@ +headers['host'] = $bucket.'.'.'s3'.'.'.$region.'.cloudian.com'; + } + + /** + * @return string + */ + public function getName(): string + { + return 'Cloudian Storage'; + } + + /** + * @return string + */ + public function getType(): string + { + return Storage::DEVICE_CLOUDIAN; + } + + /** + * @return string + */ + public function getDescription(): string + { + return 'Cloudian Storage'; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..cf4a346d 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -21,6 +21,8 @@ class Storage const DEVICE_LINODE = 'linode'; + const DEVICE_CLOUDIAN = 'cloudian'; + /** * Devices. * diff --git a/tests/Storage/Device/CloudianTest.php b/tests/Storage/Device/CloudianTest.php new file mode 100644 index 00000000..16250e48 --- /dev/null +++ b/tests/Storage/Device/CloudianTest.php @@ -0,0 +1,34 @@ +root = '/root'; + $key = $_SERVER['CLOUDIAN_ACCESS_KEY'] ?? ''; + $secret = $_SERVER['CLOUDIAN_SECRET'] ?? ''; + $bucket = 'utopia-storage-tests'; + + $this->object = new Cloudian($this->root, $key, $secret, $bucket, Cloudian::EU_CENTRAL_1, Cloudian::ACL_PRIVATE); + } + + protected function getAdapterName(): string + { + return 'Cloudian Storage'; + } + + protected function getAdapterType(): string + { + return $this->object->getType(); + } + + protected function getAdapterDescription(): string + { + return 'Cloudian Storage'; + } +}