From a2f04b68597bc888f93a2ff5d4a5b6b8b67118bf Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Fri, 3 May 2024 18:40:58 +0200 Subject: [PATCH 1/4] fix: Fixed test branch --- .github/workflows/cron_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron_tests.yml b/.github/workflows/cron_tests.yml index c576cf7..c434646 100644 --- a/.github/workflows/cron_tests.yml +++ b/.github/workflows/cron_tests.yml @@ -2,7 +2,8 @@ name: "Daily tests" on: pull_request: push: - branches: [main] + branches: + - master schedule: - cron: "25 08 * * *" From 286d24d2d84d7627f845ed93551d3037dc192737 Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Fri, 3 May 2024 18:41:33 +0200 Subject: [PATCH 2/4] fix: Fixed ddev generated label Fixes #38 --- .minioImageBuild/Dockerfile | 3 ++- .minioImageBuild/ddev-entrypoint.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.minioImageBuild/Dockerfile b/.minioImageBuild/Dockerfile index c1808a5..de980ac 100644 --- a/.minioImageBuild/Dockerfile +++ b/.minioImageBuild/Dockerfile @@ -1,4 +1,5 @@ -# ddev-generated +#ddev-generated + FROM minio/minio:latest COPY ddev-entrypoint.sh /usr/bin/ddev-entrypoint.sh diff --git a/.minioImageBuild/ddev-entrypoint.sh b/.minioImageBuild/ddev-entrypoint.sh index 6e58428..c5d73dc 100755 --- a/.minioImageBuild/ddev-entrypoint.sh +++ b/.minioImageBuild/ddev-entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/sh -# ddev-generated +#ddev-generated + mkdir -p ~/.minio/certs/CAs cp -ar /mnt/ddev-global-cache/mkcert/* ~/.minio/certs/CAs From d986bbd7762fc2716a164a7bb89f279069bf571d Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Fri, 3 May 2024 18:41:57 +0200 Subject: [PATCH 3/4] chore(Docs): Updated readme --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d6f4c0f..b9b07a1 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,72 @@ It's based on [MinIO official image](https://hub.docker.com/r/minio/minio) and [ ## Configuration -### MinIO bucket +### MinIO console Login to MinIO console `https://.ddev.site:9090` login with credentials `ddevminio:ddevminio` and create a bucket. -### Composer package +### File access -Your project will most likely require the [AWS PHP SDK](https://packagist.org/packages/aws/aws-sdk-php). You can install it like this +Project docker instances can access MinIO api via `http://minio:10101` + +DDEV Router is configured to proxy the requests to `https://.ddev.site:10101` to MinIO S3 Api. + +Example URLs for accessing files are + +| Bucket | File path | Internal URL | External URL | +|----------|------------------------|--------------------------------------------------|-----------------------------------------------------------------| +| `photos` | `vacation/seaside.jpg` | `http://minio:10101/photos/vacation/seaside.jpg` | `https://.ddev.site:10101/photos/vacation/seaside.jpg` | +| `music` | `tron/derezzed.mp3` | `http://minio:10101/music/tron/derezzed.mp3` | `https://.ddev.site:10101/music/tron/derezzed.mp3` | + +## Connecting from PHP + +### Installation + +Since MinIO is S3 compatible you can use [AWS PHP SDK](https://packagist.org/packages/aws/aws-sdk-php). Install it with composer: ```bash $ ddev composer require aws/aws-sdk-php ``` -Project docker instances can access MinIO api via `http://minio:10101` -### Public access +### Basic usage -DDEV Router is configured to proxy the requests to `https://.ddev.site:10101` to MinIO S3 Api. +```php + 'http://minio:10101', + 'credentials' => [ + 'key' => 'ddevminio', + 'secret' => 'ddevminio', + ], + 'region' => 'us-east-1', + 'version' => 'latest', + 'use_path_style_endpoint' => true, +]); + +$bucketName = 'ddev-minio'; + +if (!$s3->doesBucketExist($bucketName)) { + $s3->createBucket([ + 'Bucket' => $bucketName, + ]); +} + +$s3->putObject([ + 'Bucket' => $bucketName, + 'Key' => 'ddev-test', + 'Body' => 'DDEV Minio is working!', +]); + +$object = $s3->getObject([ + 'Bucket' => $bucketName, + 'Key' => 'ddev-test', +]); + +echo $object['Body']; +``` ## Commands From 5d5d177a1892945c6142e109853cdfd3d3410d6e Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Fri, 3 May 2024 18:59:09 +0200 Subject: [PATCH 4/4] chore(Docs): Updated readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9b07a1..685b93f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ # ddev-minio - use MinIO object storage in DDEV -![GitHub release (with filter)](https://img.shields.io/github/v/release/oblakstudio/ddev-minio) -[![Daily tests](https://github.com/oblakstudio/ddev-minio/actions/workflows/cron_tests.yml/badge.svg)](https://github.com/oblakstudio/ddev-minio/actions/workflows/cron_tests.yml) +![GitHub release (with filter)](https://img.shields.io/github/v/release/ddev/ddev-minio) +[![Daily tests](https://github.com/ddev/ddev-minio/actions/workflows/cron_tests.yml/badge.svg)](https://github.com/ddev/ddev-minio/actions/workflows/cron_tests.yml) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg) @@ -13,6 +13,13 @@ This repository provides MinIO add-on to [DDEV](https://ddev.readthedocs.io). It's based on [MinIO official image](https://hub.docker.com/r/minio/minio) and [DDEV custom compose files](https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/) +## Installation + +```bash +$ ddev get ddev/ddev-minio +$ ddev restart +``` + ## Configuration ### MinIO console