An open API service indexing awesome lists of open source software.

https://github.com/firmanjs/minio-demo


https://github.com/firmanjs/minio-demo

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

## Minio Demo

Simple minio demo using aws s3 style and package

## How To Run
```sh
# copy environment variable
cp .env.sample .env

# build minio with docker compose
docker-compose -f minio.yml up --build
```

### Minio Setup

After completing the Minio build, open it in the browser and log in to the Minio console.
Open with your favorite browser like Chrome or Mozilla

* [Minio Console](http://localhost:9001)

login with username and password your setup in env:
```txt
username: minio // adjust it to the env you setup
password: minio1234 // adjust it to the env you setup
```

### Create New Bucket

Follow steps below:

1. Click `Bucket` tab and click create bucket button in right side :
* Name = `belajar`
Screenshot 2023-09-23 at 08 21 18



2. Toogle versioning info you want versioning the bucket
Screenshot 2023-09-23 at 08 19 49



3. Create bucket tab then click bucket which was made earlier
Screenshot 2023-09-23 at 08 21 46



4. Set Bucket Access policy, click the bucket name `belajar` in summary tab set access policy set the public for example case
Screenshot 2023-09-23 at 08 22 00

### Create Access Keys

Follow steps below:

1. Click on `Access Keys` in the left menu for create an access key to your bucket storage then click `Create access key` button.
Screenshot 2023-09-23 at 08 22 30



2. You will see that the default Access key and Secret key are generated then click created
Screenshot 2023-09-23 at 08 22 43



3. You will copy Access key and Secret key or download for backup, if your forgotten
Screenshot 2023-09-23 at 08 23 05
dont forget fill the env
```sh
AWS_ACCESS=
AWS_SECRET=
```



4. After created go back to list and click detail
Screenshot 2023-09-23 at 08 42 47



5. And add rule like this you can copy in file policy.example.json, dont forget rename to your bucket definition
Screenshot 2023-09-23 at 08 43 16

Now you have successfully finished the minio configuration. You can do testing using postman at this URL
```bash
# via postman
[POST] http://localhost:1000/save-to-minio
body form data image

# via curl
curl --location 'http://localhost:1000/save-to-minio' \
--form 'image=@"/path"'
```