Skip to content

Commit fdc54f5

Browse files
committed
docs: add example for the MinIO with S3 compatible adapter
AdminForth/1703/make-s3-adapter-support-url-pa
1 parent b334485 commit fdc54f5

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

adminforth/documentation/docs/tutorial/06-Adapters/04-storage-adapters.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,36 @@ R2_BUCKET_REGION=auto
6262
}),
6363
```
6464

65+
### MinIO setup
66+
67+
1) If you don't have running instanse, then run it with command
68+
```bash
69+
docker run \
70+
-p 9000:9000 \
71+
-p 9001:9001 \
72+
-e MINIO_ROOT_USER=minioadmin \
73+
-e MINIO_ROOT_PASSWORD=minioadmin \
74+
minio/minio server /data --console-address ":9001"
75+
```
76+
2) Create bucket
77+
3) Setup adapter:
78+
```ts
79+
import LevelDBKeyValueAdapter from '@adminforth/key-value-adapter-leveldb';
80+
81+
new AdminForthAdapterS3CompatibleStorage({
82+
accessKeyId: 'minioadmin',
83+
secretAccessKey: 'minioadmin',
84+
endpoint: 'http://localhost:9000',
85+
bucket: 'adminforth-dev-demo',
86+
region: 'us-east-1',
87+
s3ACL: 'private',
88+
cleanupKeyValueAdapter: levelDbAdapter,
89+
forcePathStyle: true,
90+
cleanupCheckInterval: '30m',
91+
cleanupGracePeriod: '5d'
92+
}),
93+
```
94+
6595
## Local Storage Adapter
6696

6797
```bash

0 commit comments

Comments
 (0)