From caf1bfd23b86804a46a471c7b3631607ddc65d7d Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 6 Aug 2024 09:59:46 +0300 Subject: [PATCH] docs: fixes to notification and file module guides (#8451) --- .../architectural-modules/file/s3/page.mdx | 99 +++++++++++++------ .../notification/send-notification/page.mdx | 2 +- .../_sections/s3/aws-bucket-acl.mdx | 14 +++ .../resources/app/troubleshooting/s3/page.mdx | 11 +++ www/apps/resources/generated/files-map.mjs | 4 + www/apps/resources/generated/sidebar.mjs | 15 +++ www/apps/resources/sidebar.mjs | 10 ++ 7 files changed, 122 insertions(+), 33 deletions(-) create mode 100644 www/apps/resources/app/troubleshooting/_sections/s3/aws-bucket-acl.mdx create mode 100644 www/apps/resources/app/troubleshooting/s3/page.mdx diff --git a/www/apps/resources/app/architectural-modules/file/s3/page.mdx b/www/apps/resources/app/architectural-modules/file/s3/page.mdx index c2d09ed7e7..87707e6d6e 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -1,4 +1,5 @@ -import { Table, Tabs, TabsList, TabsContent, TabsContentWrapper, TabsTrigger } from "docs-ui" +import S3BucketAcl from "../../../troubleshooting/_sections/s3/aws-bucket-acl.mdx" +import { Table, Tabs, TabsList, TabsContent, TabsContentWrapper, TabsTrigger, DetailsList } from "docs-ui" export const metadata = { title: `S3 File Module Provider`, @@ -22,45 +23,64 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - [AWS account](https://console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin). - - [S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) with the "Public Access setting" enabled. - - [AWS user with AmazonS3FullAccess permissions](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-and-attach-iam-policy.html). - - [AWS user access key ID and secret access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey). - - Change your [bucket's policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/add-bucket-policy.html) to the following: - - ```json - { - "Version": "2012-10-17", - "Id": "Policy1397632521960", - "Statement": [ - { - "Sid": "Stmt1397633323327", - "Effect": "Allow", - "Principal": { - "AWS": "*" - }, - "Action": "s3:GetObject", - "Resource": "arn:aws:s3:::{bucket_name}/*" - } - ] - } - ``` - - Make sure to replace `{bucket_name}` with the name of the bucket you created. + - Create [AWS user with AmazonS3FullAccess permissions](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-and-attach-iam-policy.html). + - Create [AWS user access key ID and secret access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey). + - Create [S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) with the "Public Access setting" enabled: + 1. On your bucket's dashboard, click on the Permissions tab. + 2. Click on the Edit button of the Block public access (bucket settings) section. + 3. In the form that opens, don't toggle any checkboxes and click the "Save changes" button. + 4. Confirm saving the changes by entering `confirm` in the pop-up that shows. + 5. Back on the Permissions page, scroll to the Object Ownership section and click the Edit button. + 6. In the form that opens: + - Choose the "ACLs enabled" card. + - Click on the "Save changes" button. + 7. Back on the Permissions page, scroll to the "Access Control List (ACL)" section and click on the Edit button. + 8. In the form that opens, enable the Read permission for "Everyone (public access)". + 9. Check the "I understand the effects of these changes on my objects and buckets." checkbox. + 10. Click on the "Save changes" button. - [Install MinIO](https://min.io/docs/minio/linux/index.html). - Change port to `9001` using the [console address](https://min.io/docs/minio/linux/reference/minio-server/minio-server.html#minio.server.-console-address) and [address](https://min.io/docs/minio/linux/reference/minio-server/minio-server.html#minio.server.-address) CLI options. - - [MinIO bucket with public access policy](https://min.io/docs/minio/linux/administration/console/managing-objects.html#creating-buckets). - - [MinIO access and secret access key](https://min.io/docs/minio/linux/administration/console/security-and-access.html#id1). + - Create [MinIO access and secret access key](https://min.io/docs/minio/linux/administration/console/security-and-access.html#id1). + - Create a [MinIO bucket](https://min.io/docs/minio/linux/administration/console/managing-objects.html#creating-buckets) with public access policy: + - Go to the bucket's dashboard. + - Under the Summary section, click on the pencil icon next to Access Policy. + - In the pop-up, choose Custom from the dropdown. + - In the editor, enter the following: + + ```json highlights={[["15", "{bucketname}", "Replace with the bucket's name."]]} + { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "s3:GetObject" + ], + "Effect": "Allow", + "Principal": { + "AWS": [ + "*" + ] + }, + "Resource": [ + "arn:aws:s3:::{bucketname}/*" + ] + } + ] + } + ``` + + Make sure to replace `{bucket_name}` with the name of the bucket you created. You can edit the access policy under the Summary section of your bucket's dashboard. - - [DigitalOcean account](https://cloud.digitalocean.com/registrations/new). - - [DigitalOcean Spaces bucket](https://docs.digitalocean.com/products/spaces/how-to/create/). - - [DigitalOcean Spaces access and secret access keys](https://docs.digitalocean.com/products/spaces/how-to/manage-access/#access-keys). + - Create [DigitalOcean account](https://cloud.digitalocean.com/registrations/new). + - Create [DigitalOcean Spaces bucket](https://docs.digitalocean.com/products/spaces/how-to/create/). + - Create [DigitalOcean Spaces access and secret access keys](https://docs.digitalocean.com/products/spaces/how-to/manage-access/#access-keys). @@ -139,7 +159,7 @@ module.exports = { The base URL to upload files to. - For AWS S3, the endpoint is of the format `https://{bucket}.s3.{region}.amazonaws.com` - - For MinIO, it's the URL to the MinIO server. + - For MinIO, it's the URL to the MinIO server with the bucket's name. For example, `https://{server-domain}/{bucket}`. - For DigitalOcean Spaces, it's either the Origin Endpoint or the CDN endpoint of your Spaces Object Storage bucket. @@ -192,6 +212,8 @@ module.exports = { The bucket's region code. + + For MinIO, use `us-east-1`. @@ -227,7 +249,7 @@ module.exports = { The URL to the AWS S3 (or compatible S3 API) server. - - For AWS S3, the endpoint is of the format `{bucket}.s3.{region}.amazonaws.com` + - For AWS S3, the endpoint is of the format `https://s3.{region}.amazonaws.com` - For MinIO, it's the URL to the MinIO server. - For DigitalOcean Spaces, it's the Spaces Origin Endpoint. @@ -310,3 +332,16 @@ module.exports = { + +--- + +## Troubleshooting + + + } + ]} +/> diff --git a/www/apps/resources/app/architectural-modules/notification/send-notification/page.mdx b/www/apps/resources/app/architectural-modules/notification/send-notification/page.mdx index e38d6a3298..e3f10db3d8 100644 --- a/www/apps/resources/app/architectural-modules/notification/send-notification/page.mdx +++ b/www/apps/resources/app/architectural-modules/notification/send-notification/page.mdx @@ -47,7 +47,7 @@ export default async function productCreateHandler({ const notificationModuleService: INotificationModuleService = container.resolve(ModuleRegistrationName.NOTIFICATION) - await notificationModuleService.create({ + await notificationModuleService.createNotifications({ to: "shahednasser@gmail.com", channel: "email", template: "product-created", diff --git a/www/apps/resources/app/troubleshooting/_sections/s3/aws-bucket-acl.mdx b/www/apps/resources/app/troubleshooting/_sections/s3/aws-bucket-acl.mdx new file mode 100644 index 0000000000..b8e4056219 --- /dev/null +++ b/www/apps/resources/app/troubleshooting/_sections/s3/aws-bucket-acl.mdx @@ -0,0 +1,14 @@ +Your AWS S3 bucket must have public access to buckets enabled. To do that: + +1. On your bucket's dashboard, click on the Permissions tab. +2. Click on the Edit button of the Block public access (bucket settings) section. +3. In the form that opens, don't toggle any checkboxes and click the "Save changes" button. +4. Confirm saving the changes by entering `confirm` in the pop-up that shows. +5. Back on the Permissions page, scroll to the Object Ownership section and click the Edit button. +6. In the form that opens: + - Choose the "ACLs enabled" card. + - Click on the "Save changes" button. +7. Back on the Permissions page, scroll to the "Access Control List (ACL)" section and click on the Edit button. +8. In the form that opens, enable the Read permission for "Everyone (public access)". +9. Check the "I understand the effects of these changes on my objects and buckets." checkbox. +10. Click on the "Save changes" button. diff --git a/www/apps/resources/app/troubleshooting/s3/page.mdx b/www/apps/resources/app/troubleshooting/s3/page.mdx new file mode 100644 index 0000000000..f56e6df13b --- /dev/null +++ b/www/apps/resources/app/troubleshooting/s3/page.mdx @@ -0,0 +1,11 @@ +import S3BucketAcl from "../_sections/s3/aws-bucket-acl.mdx" + +export const metadata = { + title: `S3 Module Provider Errors`, +} + +# {metadata.title} + +## AWS: The bucket does not allow ACLs + + diff --git a/www/apps/resources/generated/files-map.mjs b/www/apps/resources/generated/files-map.mjs index e3d57a38b3..5fd64729a7 100644 --- a/www/apps/resources/generated/files-map.mjs +++ b/www/apps/resources/generated/files-map.mjs @@ -1003,6 +1003,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/app/troubleshooting/page.mdx", "pathname": "/troubleshooting" }, + { + "filePath": "/www/apps/resources/app/troubleshooting/s3/page.mdx", + "pathname": "/troubleshooting/s3" + }, { "filePath": "/www/apps/resources/app/upgrade-guides/page.mdx", "pathname": "/upgrade-guides" diff --git a/www/apps/resources/generated/sidebar.mjs b/www/apps/resources/generated/sidebar.mjs index 9bbf3eef65..0982b51a04 100644 --- a/www/apps/resources/generated/sidebar.mjs +++ b/www/apps/resources/generated/sidebar.mjs @@ -7188,6 +7188,21 @@ export const generatedSidebar = [ "children": [] } ] + }, + { + "loaded": true, + "isPathHref": true, + "title": "Integrations", + "hasTitleStyling": true, + "children": [ + { + "loaded": true, + "isPathHref": true, + "path": "/troubleshooting/s3", + "title": "S3 Module Provider Errors", + "children": [] + } + ] } ] } diff --git a/www/apps/resources/sidebar.mjs b/www/apps/resources/sidebar.mjs index 5e697e30c7..3a647b7822 100644 --- a/www/apps/resources/sidebar.mjs +++ b/www/apps/resources/sidebar.mjs @@ -1779,6 +1779,16 @@ export const sidebar = sidebarAttachHrefCommonOptions([ }, ], }, + { + title: "Integrations", + hasTitleStyling: true, + children: [ + { + path: "/troubleshooting/s3", + title: "S3 Module Provider Errors", + }, + ], + }, ], }, ],