Merge pull request #11731 from strapi/fix/providerDocs

Fix provider config examples for v4
This commit is contained in:
Alexandre BODIN 2021-12-01 09:10:44 +01:00 committed by GitHub
commit 68af6a332e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 95 additions and 71 deletions

View File

@ -44,15 +44,17 @@ npm install strapi-provider-email-amazon-ses --save
module.exports = ({ env }) => ({
// ...
email: {
provider: 'amazon-ses',
providerOptions: {
key: env('AWS_SES_KEY'),
secret: env('AWS_SES_SECRET'),
amazon: 'https://email.us-east-1.amazonaws.com',
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
config: {
provider: 'amazon-ses',
providerOptions: {
key: env('AWS_SES_KEY'),
secret: env('AWS_SES_SECRET'),
amazon: 'https://email.us-east-1.amazonaws.com',
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...

View File

@ -44,15 +44,17 @@ npm install strapi-provider-email-mailgun --save
module.exports = ({ env }) => ({
// ...
email: {
provider: 'mailgun',
providerOptions: {
apiKey: env('MAILGUN_API_KEY'),
domain: env('MAILGUN_DOMAIN'), //Required if you have an account with multiple domains
host: env('MAILGUN_HOST', 'api.mailgun.net'), //Optional. If domain region is Europe use 'api.eu.mailgun.net'
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
config: {
provider: 'mailgun',
providerOptions: {
apiKey: env('MAILGUN_API_KEY'),
domain: env('MAILGUN_DOMAIN'), //Required if you have an account with multiple domains
host: env('MAILGUN_HOST', 'api.mailgun.net'), //Optional. If domain region is Europe use 'api.eu.mailgun.net'
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...

View File

@ -30,22 +30,26 @@ npm install strapi-provider-email-nodemailer --save
```js
module.exports = ({ env }) => ({
// ...
email: {
provider: 'nodemailer',
providerOptions: {
host: env('SMTP_HOST', 'smtp.example.com'),
port: env('SMTP_PORT', 587),
auth: {
user: env('SMTP_USERNAME'),
pass: env('SMTP_PASSWORD'),
config: {
provider: 'nodemailer',
providerOptions: {
host: env('SMTP_HOST', 'smtp.example.com'),
port: env('SMTP_PORT', 587),
auth: {
user: env('SMTP_USERNAME'),
pass: env('SMTP_PASSWORD'),
},
// ... any custom nodemailer options
},
settings: {
defaultFrom: 'hello@example.com',
defaultReplyTo: 'hello@example.com',
},
// ... any custom nodemailer options
},
settings: {
defaultFrom: 'hello@example.com',
defaultReplyTo: 'hello@example.com',
},
},
// ...
});
```

View File

@ -45,13 +45,15 @@ npm install strapi-provider-email-sendgrid --save
module.exports = ({ env }) => ({
// ...
email: {
provider: 'sendgrid',
providerOptions: {
apiKey: env('SENDGRID_API_KEY'),
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
config: {
provider: 'sendgrid',
providerOptions: {
apiKey: env('SENDGRID_API_KEY'),
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...

View File

@ -45,10 +45,12 @@ npm install strapi-provider-email-sendmail --save
module.exports = ({ env }) => ({
// ...
email: {
provider: 'sendmail',
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
config: {
provider: 'sendmail',
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...

View File

@ -14,13 +14,15 @@ See the [using a provider](https://docs.strapi.io/developer-docs/latest/plugins/
module.exports = ({ env }) => ({
// ...
upload: {
provider: 'aws-s3',
providerOptions: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
Bucket: env('AWS_BUCKET'),
config: {
provider: 'aws-s3',
providerOptions: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
Bucket: env('AWS_BUCKET'),
},
},
},
},

View File

@ -16,15 +16,17 @@ See the [using a provider](https://docs.strapi.io/developer-docs/latest/plugins/
module.exports = ({ env }) => ({
// ...
upload: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
delete: {},
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
delete: {},
},
},
},
// ...

View File

@ -6,15 +6,21 @@ This provider has only one parameter: `sizeLimit`.
**Example**
`./extensions/upload/config/settings.json`
`./config/plugins.js`
```json
{
"provider": "local",
"providerOptions": {
"sizeLimit": 100000
}
}
```js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'local',
providerOptions: {
sizeLimit: 100000,
},
},
},
// ...
});
```
The `sizeLimit` parameter must be a number. Be aware that the unit is in bytes, and the default is 1000000. When setting this value high, you should make sure to also configure the body parser middleware `maxFileSize` so the file can be sent and processed. Read more [here](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#configuration)

View File

@ -14,12 +14,14 @@ See the [using a provider](https://docs.strapi.io/developer-docs/latest/plugins/
module.exports = ({ env }) => ({
// ...
upload: {
provider: 'rackspace',
providerOptions: {
username: env('RACKSPACE_USERNAME'),
apiKey: env('RACKSPACE_KEY'),
region: env('RACKSPACE_REGION'),
container: env('RACKSPACE_CONTAINER'),
config: {
provider: 'rackspace',
providerOptions: {
username: env('RACKSPACE_USERNAME'),
apiKey: env('RACKSPACE_KEY'),
region: env('RACKSPACE_REGION'),
container: env('RACKSPACE_CONTAINER'),
},
},
},
// ...