Skip to content

Commit cfb19b9

Browse files
authored
Merge pull request #672 from devforth/next
docs: update docs for the s3-compatible adapter
2 parents d72ce3c + aee3de0 commit cfb19b9

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ pnpm add @adminforth/storage-adapter-s3-compatible
2323

2424
Provides S3 compatible interface for object storage services such as MinIO, Wasabi, Cloudflare R2 or other third-party S3 providers.
2525

26+
>‼️Since levelDb is used for storing keys of objects that should/shouldn't be deleted, so this is important to use docker volume on deployed application, so you will not loose this data after re-deploy
27+
28+
>‼️It is not recomended to use the same Key/value adapter for the adapter multiple instances, because it can cause unpredictable behavior of cleanup scheduler
2629
2730
### Cloudflare R2 setup example
2831

2932
This adapter requires key/value adapter. For example, we will be using levelDb adapter.
30-
>‼️Since levelDb is used for storing keys of objects, that should/shouldn't be deleted, so this is important to use docker volume on deployed application, so you will not loose this data after re-deploy
3133
```bash
3234
pnpm add @adminforth/key-value-adapter-leveldb
3335
```
@@ -54,8 +56,8 @@ R2_BUCKET_REGION=auto
5456
region: process.env.R2_BUCKET_REGION as string,
5557
s3ACL: "private",
5658
cleanupKeyValueAdapter: new LevelDBKeyValueAdapter({
57-
dbPath: './cloudflare_r2_storage_keys',
58-
});,
59+
dbPath: './stores/cloudflare_r2_storage_keys',
60+
}),
5961
forcePathStyle: true,
6062
cleanupCheckInterval: '30m',
6163
cleanupGracePeriod: '5d'
@@ -73,7 +75,7 @@ R2_BUCKET_REGION=auto
7375
-e MINIO_ROOT_PASSWORD=minioadmin \
7476
minio/minio server /data --console-address ":9001"
7577
```
76-
2) Create bucket
78+
2) Go to http://127.0.0.1:9000 and create bucket
7779
3) Setup adapter:
7880
```ts
7981
import LevelDBKeyValueAdapter from '@adminforth/key-value-adapter-leveldb';
@@ -85,7 +87,9 @@ R2_BUCKET_REGION=auto
8587
bucket: 'adminforth-dev-demo',
8688
region: 'us-east-1',
8789
s3ACL: 'private',
88-
cleanupKeyValueAdapter: levelDbAdapter,
90+
cleanupKeyValueAdapter: new LevelDBKeyValueAdapter({
91+
dbPath: './stores/minio_storage_keys',
92+
}),
8993
forcePathStyle: true,
9094
cleanupCheckInterval: '30m',
9195
cleanupGracePeriod: '5d'

0 commit comments

Comments
 (0)