Skip to content

Commit

Permalink
strapi: add cloud storage
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 24, 2024
1 parent 6772d0c commit 28aa45c
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 3 deletions.
25 changes: 22 additions & 3 deletions cms/config/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
const useCloudStorage =
typeof process.env.STORAGE_ACCOUNT === "string" &&
typeof process.env.STORAGE_ACCOUNT_KEY === "string" &&
typeof process.env.STORAGE_URL === "string" &&
typeof process.env.STORAGE_CONTAINER_NAME === "string";

export default ({ env }) => ({
'management': {
management: {
enabled: true,
resolve: './src/plugins/management'
resolve: "./src/plugins/management",
},
});
upload: {
enabled: useCloudStorage,
config: {
provider: "strapi-provider-upload-azure-storage",
providerOptions: {
account: env("STORAGE_ACCOUNT"),
accountKey: env("STORAGE_ACCOUNT_KEY"), //either account key or sas token is enough to make authentication
serviceBaseURL: env("STORAGE_URL"), // optional
containerName: env("STORAGE_CONTAINER_NAME"),
defaultPath: "uploads",
},
},
},
});
254 changes: 254 additions & 0 deletions cms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.4",
"strapi-provider-upload-azure-storage": "^3.3.0",
"styled-components": "^5.3.11",
"uuid": "^9.0.0"
},
Expand Down

0 comments on commit 28aa45c

Please sign in to comment.