Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgeagoiz/strapi-provider-storage-appwrite
Appwrite provider for Strapi CMS
https://github.com/jorgeagoiz/strapi-provider-storage-appwrite
appwrite appwrite-storage strapi
Last synced: 2 days ago
JSON representation
Appwrite provider for Strapi CMS
- Host: GitHub
- URL: https://github.com/jorgeagoiz/strapi-provider-storage-appwrite
- Owner: jorgeAgoiz
- License: mit
- Created: 2024-04-27T15:37:24.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-05T10:31:51.000Z (8 months ago)
- Last Synced: 2024-12-17T00:50:11.524Z (8 days ago)
- Topics: appwrite, appwrite-storage, strapi
- Language: JavaScript
- Homepage:
- Size: 110 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# strapi-provider-storage-appwrite
## Resources
- [LICENSE](LICENSE)
## Links
- [Strapi website](https://strapi.io/)
- [Strapi documentation](https://docs.strapi.io)
- [Appwrite website](https://www.appwrite.io/)
- [Appwrite documentation](https://www.appwrite.io/docs)
- [Github repository](https://github.com/jorgeAgoiz/strapi-provider-storage-appwrite)## Installation
```bash
# using yarn
yarn add strapi-provider-storage-appwrite# using npm
npm install strapi-provider-storage-appwrite --save
```## Configuration
- `provider` defines the name of the provider, in this case we must put "strapi-provider-storage-appwriter".
- `providerOptions` is passed down during the construction of the provider. (ex: `new StorageClient(config)`).
- `providerOptions.apiUrl` RESTful endpoint to manage your Appwrite project.
- `providerOptions.projectId` ID of your Appwrite project.
- `providerOptions.bucketId` ID of your Appwrite bucket.
- `sizeLimit` maximum size limit for your files on bytes.See the [documentation about using a provider](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#using-a-provider) for information on installing and using a provider. To understand how environment variables are used in Strapi, please refer to the [documentation about environment variables](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#environment-variables).
### Provider Configuration
`./config/plugins.js` or `./config/plugins.ts` for TypeScript projects:
```js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: "strapi-provider-storage-appwrite",
providerOptions: {
apiUrl: env("APPWRITE_API_ENDPOINT"),
projectId: env("APPWRITE_PROJECT_ID"),
bucketId: env("APPWRITE_BUCKET_ID"),
},
sizeLimit: 1000000000,
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
checkFileSize: {},
},
},
},
// ...
});
```### Security Middleware Configuration
Due to the default settings in the Strapi Security Middleware you will need to modify the `contentSecurityPolicy` settings to properly see thumbnail previews in the Media Library. You should replace `strapi::security` string with the object bellow instead as explained in the [middleware configuration](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.html#loading-order) documentation.
`./config/middlewares.js`
```js
module.exports = [
// ...
{
name: "strapi::security",
config: {
contentSecurityPolicy: {
directives: {
"default-src": ["'self'"],
"img-src": [
"'self'",
"data:",
"blob:",
env("APPWRITE_API_DIRECTIVE"),
// Example: "https://cloud.appwrite.io"
],
},
},
},
},
// ...
];
```