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 }) => ({ module.exports = ({ env }) => ({
// ... // ...
email: { email: {
provider: 'amazon-ses', config: {
providerOptions: { provider: 'amazon-ses',
key: env('AWS_SES_KEY'), providerOptions: {
secret: env('AWS_SES_SECRET'), key: env('AWS_SES_KEY'),
amazon: 'https://email.us-east-1.amazonaws.com', secret: env('AWS_SES_SECRET'),
}, amazon: 'https://email.us-east-1.amazonaws.com',
settings: { },
defaultFrom: 'myemail@protonmail.com', settings: {
defaultReplyTo: 'myemail@protonmail.com', defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
}, },
}, },
// ... // ...

View File

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

View File

@ -30,22 +30,26 @@ npm install strapi-provider-email-nodemailer --save
```js ```js
module.exports = ({ env }) => ({ module.exports = ({ env }) => ({
// ...
email: { email: {
provider: 'nodemailer', config: {
providerOptions: { provider: 'nodemailer',
host: env('SMTP_HOST', 'smtp.example.com'), providerOptions: {
port: env('SMTP_PORT', 587), host: env('SMTP_HOST', 'smtp.example.com'),
auth: { port: env('SMTP_PORT', 587),
user: env('SMTP_USERNAME'), auth: {
pass: env('SMTP_PASSWORD'), 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 }) => ({ module.exports = ({ env }) => ({
// ... // ...
email: { email: {
provider: 'sendgrid', config: {
providerOptions: { provider: 'sendgrid',
apiKey: env('SENDGRID_API_KEY'), providerOptions: {
}, apiKey: env('SENDGRID_API_KEY'),
settings: { },
defaultFrom: 'myemail@protonmail.com', settings: {
defaultReplyTo: 'myemail@protonmail.com', defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
}, },
}, },
// ... // ...

View File

@ -45,10 +45,12 @@ npm install strapi-provider-email-sendmail --save
module.exports = ({ env }) => ({ module.exports = ({ env }) => ({
// ... // ...
email: { email: {
provider: 'sendmail', config: {
settings: { provider: 'sendmail',
defaultFrom: 'myemail@protonmail.com', settings: {
defaultReplyTo: 'myemail@protonmail.com', 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 }) => ({ module.exports = ({ env }) => ({
// ... // ...
upload: { upload: {
provider: 'aws-s3', config: {
providerOptions: { provider: 'aws-s3',
accessKeyId: env('AWS_ACCESS_KEY_ID'), providerOptions: {
secretAccessKey: env('AWS_ACCESS_SECRET'), accessKeyId: env('AWS_ACCESS_KEY_ID'),
region: env('AWS_REGION'), secretAccessKey: env('AWS_ACCESS_SECRET'),
params: { region: env('AWS_REGION'),
Bucket: env('AWS_BUCKET'), 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 }) => ({ module.exports = ({ env }) => ({
// ... // ...
upload: { upload: {
provider: 'cloudinary', config: {
providerOptions: { provider: 'cloudinary',
cloud_name: env('CLOUDINARY_NAME'), providerOptions: {
api_key: env('CLOUDINARY_KEY'), cloud_name: env('CLOUDINARY_NAME'),
api_secret: env('CLOUDINARY_SECRET'), api_key: env('CLOUDINARY_KEY'),
}, api_secret: env('CLOUDINARY_SECRET'),
actionOptions: { },
upload: {}, actionOptions: {
delete: {}, upload: {},
delete: {},
},
}, },
}, },
// ... // ...

View File

@ -6,15 +6,21 @@ This provider has only one parameter: `sizeLimit`.
**Example** **Example**
`./extensions/upload/config/settings.json` `./config/plugins.js`
```json ```js
{ module.exports = ({ env }) => ({
"provider": "local", // ...
"providerOptions": { upload: {
"sizeLimit": 100000 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) 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 }) => ({ module.exports = ({ env }) => ({
// ... // ...
upload: { upload: {
provider: 'rackspace', config: {
providerOptions: { provider: 'rackspace',
username: env('RACKSPACE_USERNAME'), providerOptions: {
apiKey: env('RACKSPACE_KEY'), username: env('RACKSPACE_USERNAME'),
region: env('RACKSPACE_REGION'), apiKey: env('RACKSPACE_KEY'),
container: env('RACKSPACE_CONTAINER'), region: env('RACKSPACE_REGION'),
container: env('RACKSPACE_CONTAINER'),
},
}, },
}, },
// ... // ...