对于AWS S3连接的Directus 9文件存储适配器,有什么指南吗



我正在尝试连接AWS S3以存储Directus 9的文件。找不到任何关于如何编辑.env文件的信息。

以下是我在.env 中的文件存储设置

####################################################################################################
### File Storage
# A CSV of storage locations (eg: local,digitalocean,amazon) to use. You can use any names you'd like for these keys ["local"]
STORAGE_LOCATIONS="local,S3"
STORAGE_LOCAL_DRIVER="local"
STORAGE_LOCAL_ROOT="./uploads"
## S3 Example (location name: DigitalOcean)
# STORAGE_DIGITALOCEAN_DRIVER="s3"
# STORAGE_DIGITALOCEAN_KEY="abcdef"
# STORAGE_DIGITALOCEAN_SECRET="ghijkl"
# STORAGE_DIGITALOCEAN_ENDPOINT="ams3.digitaloceanspaces.com"
# STORAGE_DIGITALOCEAN_BUCKET="my-files"
# STORAGE_DIGITALOCEAN_REGION="ams3"
## Google Cloud Storage Example (location name: Google)
# STORAGE_GOOGLE_DRIVER="gcs"
# STORAGE_GOOGLE_KEY_FILENAME="abcdef"
# STORAGE_GOOGLE_BUCKET="my-files"
## AWS S3 Storage Settings (My settings)
STORAGE_S3_DRIVER="s3"
STORAGE_S3_KEY="******"
STORAGE_S3_SECRET="*******"
STORAGE_S3_BUCKET="*******"
STORAGE_S3_REGION="ap-south-1"
STORAGE_S3_ENDPOINT="s3.amazonaws.com"
STORAGE_S3_ROOT="/uploads"
#STORAGE_S3_ACL=

注意:"AWS S3存储设置(我的设置("是我为AWS S3设置的。

以下链接是我迄今为止发现的内容:https://docs.directus.io/getting-started/glossary.html#storage-适配器

提前谢谢。

我通过以下代码开始工作:

更改:

  1. 删除";本地";来自STORAGE_LOCATIONS
  2. 隐藏STORAGE_LOCAL_DRIVER和STORAGE _LOCAL_ROOT
  3. 在"我的设置"中将S3替换为AMAZON
####################################################################################################
### File Storage
# A CSV of storage locations (eg: local,digitalocean,amazon) to use. You can use any names you'd like for these keys ["local"]
STORAGE_LOCATIONS="amazon"
#STORAGE_LOCAL_DRIVER="local"
#STORAGE_LOCAL_ROOT="./uploads"
## S3 Example (location name: DigitalOcean)
# STORAGE_DIGITALOCEAN_DRIVER="s3"
# STORAGE_DIGITALOCEAN_KEY="abcdef"
# STORAGE_DIGITALOCEAN_SECRET="ghijkl"
# STORAGE_DIGITALOCEAN_ENDPOINT="ams3.digitaloceanspaces.com"
# STORAGE_DIGITALOCEAN_BUCKET="my-files"
# STORAGE_DIGITALOCEAN_REGION="ams3"
## Google Cloud Storage Example (location name: Google)
# STORAGE_GOOGLE_DRIVER="gcs"
# STORAGE_GOOGLE_KEY_FILENAME="abcdef"
# STORAGE_GOOGLE_BUCKET="my-files"
## AWS S3 Storage Settings (My settings)
STORAGE_AMAZON_DRIVER="s3"
STORAGE_AMAZON_KEY="******"
STORAGE_AMAZON_SECRET="*******"
STORAGE_AMAZON_BUCKET="*******"
STORAGE_AMAZON_REGION="ap-south-1"
STORAGE_AMAZON_ENDPOINT="s3.amazonaws.com"
STORAGE_AMAZON_ROOT="/uploads"
#STORAGE_AMAZON_ACL=

最新更新