Skip to content

Commit

Permalink
feat: Allow to switch betweem multiple STRAPI_MEDIA_LIBRARY_PROVIDERs
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Dec 5, 2023
1 parent 0357f5b commit a8dd8a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
22 changes: 12 additions & 10 deletions cms/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ module.exports = ({env}) => ({
enabled: true,
resolve: './src/plugins/map-field'
},
upload: {
config: {
provider: "strapi-provider-upload-do",
providerOptions: {
key: env('DO_SPACE_ACCESS_KEY'),
secret: env('DO_SPACE_SECRET_KEY'),
endpoint: env('DO_SPACE_ENDPOINT'),
space: env('DO_SPACE_BUCKET'),
}
...(env('STRAPI_MEDIA_LIBRARY_PROVIDER') === 'digitalocean' && {
upload: {
config: {
provider: "strapi-provider-upload-do",
providerOptions: {
key: env('DO_SPACE_ACCESS_KEY'),
secret: env('DO_SPACE_SECRET_KEY'),
endpoint: env('DO_SPACE_ENDPOINT'),
space: env('DO_SPACE_BUCKET'),
}
},
},
},
}),
});
1 change: 1 addition & 0 deletions infrastructure/base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ locals {
CMS_URL = "${module.staging.app_url}/cms/"
STRAPI_ADMIN_API_BASE_URL = "${module.staging.app_url}/cms/api"
STRAPI_ADMIN_MAPBOX_ACCESS_TOKEN = var.mapbox_api_token
STRAPI_MEDIA_LIBRARY_PROVIDER = "digitalocean"

# DigitalOcean Spaces to store media content
DO_SPACE_ACCESS_KEY = var.do_spaces_client_id
Expand Down

0 comments on commit a8dd8a5

Please sign in to comment.