From c96632e959522b6864e5f9c49dc38b610973af8c Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:03:59 +0500 Subject: [PATCH 01/14] Add Cloudflare R2 guide for Object Storage --- .../architectural-modules/file/s3/page.mdx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) 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 e94aa3dbaed1a..7d07b85284b25 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -97,6 +97,44 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat 4. Click ALL for "Allowed Operations", click the "Review" button, then the "Save policy" button. + + 1. Create a [Cloudflare free account](https://supabase.com/dashboard/sign-in) if you don’t have. + 2. Set up your R2 bucket: + - Navigate to R2 Object Storage in your dashboard + - Click "Create bucket" + - Enter a unique bucket name + - Select "Automatic" for location + - Choose "Standard" for storage class + - Confirm by clicking "Create bucket" + 3. Configure public access: + - Open your bucket's Settings + - Locate the Public Access section + - Enable R2.dev subdomain access + - Type 'allow' to confirm + - Copy the Public R2.dev Bucket URL for your `S3_FILE_URL` + 4. Set up your credentials: + + - Find your Account ID in the R2 dashboard's top right corner + - [Generate API tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): + - Select **Create API token** + - Edit the **R2 Token** name + - Under **Permissions**, select appropriate permission types + - Optionally scope token to specific buckets for Object Read/Write permissions + - Click **Create API Token** + - Save the generated token as your **`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`** + - Record your bucket name for configuration + - Save your public bucket URL for reference + + ```scheme + S3_FILE_URL="https:// @@ -170,6 +208,7 @@ module.exports = { - 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. - for Supabase, it's `https://{uniqueID}.supabase.co/storage/v1/object/public/{bucket}`. You can retrieve the `uniqueID` from [Storage Settings](https://supabase.com/docs/guides/storage/s3/authentication?queryGroups=language&language=javascript#s3-access-keys) page in the Endpoint URL. + - For Cloudflare R2, it's `Public R2.dev Bucket URL`. @@ -223,6 +262,8 @@ module.exports = { The bucket's region code. For MinIO, use `us-east-1`. + + For Cloudflare, use `auto`. @@ -262,6 +303,7 @@ module.exports = { - For MinIO, it's the URL to the MinIO server. - For DigitalOcean Spaces, it's the Spaces Origin Endpoint of the format `https://{region}.digitaloceanspaces.com`. - For Supabase, it's the Endpoint URL in the [Storage Settings](https://supabase.com/docs/guides/storage/s3/authentication?queryGroups=language&language=javascript#s3-access-keys). + - For Cloudflare, it's `https://{your-account-id}.r2.cloudflarestorage.com`. From eef9cf82792a12d802e31521a403d739cd5003b8 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:34:27 -0800 Subject: [PATCH 02/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7d07b85284b25..3407befae6cc8 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -98,7 +98,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - 1. Create a [Cloudflare free account](https://supabase.com/dashboard/sign-in) if you don’t have. + 1. Create a [Cloudflare account](https://dash.cloudflare.com/sign-up). 2. Set up your R2 bucket: - Navigate to R2 Object Storage in your dashboard - Click "Create bucket" From f15bb01fae8b5cff30e902e222fc4fd3dbfae2a4 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:34:50 -0800 Subject: [PATCH 03/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3407befae6cc8..163cf700e36c9 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -100,7 +100,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat 1. Create a [Cloudflare account](https://dash.cloudflare.com/sign-up). 2. Set up your R2 bucket: - - Navigate to R2 Object Storage in your dashboard + - Navigate to R2 Object Storage in your dashboard. You may need to provide your credit-card information. - Click "Create bucket" - Enter a unique bucket name - Select "Automatic" for location From 4bca599b8d2fdebf5c3829246bd4c13a2a4ae493 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:35:10 -0800 Subject: [PATCH 04/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 163cf700e36c9..8f1de46e44a6c 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -107,7 +107,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Choose "Standard" for storage class - Confirm by clicking "Create bucket" 3. Configure public access: - - Open your bucket's Settings + - On your bucket's dashboard, click on the Settings tab. - Locate the Public Access section - Enable R2.dev subdomain access - Type 'allow' to confirm From 83838c67f57396ac48ca88acd7b79ac5b8494f36 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:35:28 -0800 Subject: [PATCH 05/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 8f1de46e44a6c..9a50a2ed57dd6 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -108,8 +108,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Confirm by clicking "Create bucket" 3. Configure public access: - On your bucket's dashboard, click on the Settings tab. - - Locate the Public Access section - - Enable R2.dev subdomain access + - Scroll down to the Public Access section, and click on "Allow Access" in the "R2.dev subdomain" card. - Type 'allow' to confirm - Copy the Public R2.dev Bucket URL for your `S3_FILE_URL` 4. Set up your credentials: From 33e389837bbf2e40f0c2a09323ee2767d99d7a55 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:35:59 -0800 Subject: [PATCH 06/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9a50a2ed57dd6..2ba8e1d60bd55 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -119,7 +119,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Edit the **R2 Token** name - Under **Permissions**, select appropriate permission types - Optionally scope token to specific buckets for Object Read/Write permissions - - Click **Create API Token** + - Once done, click the "Create API Token" button. - Save the generated token as your **`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`** - Record your bucket name for configuration - Save your public bucket URL for reference From f3def28986a8db5761ddebe25b637378b4f68c89 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:36:22 -0800 Subject: [PATCH 07/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2ba8e1d60bd55..81c6535a7db72 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -116,7 +116,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Find your Account ID in the R2 dashboard's top right corner - [Generate API tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): - Select **Create API token** - - Edit the **R2 Token** name + - Edit the "R2 Token" name - Under **Permissions**, select appropriate permission types - Optionally scope token to specific buckets for Object Read/Write permissions - Once done, click the "Create API Token" button. From 57e7bef29899be8363b264c3f20cd473e0029987 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:36:37 -0800 Subject: [PATCH 08/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 81c6535a7db72..0fb966031b804 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -115,7 +115,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Find your Account ID in the R2 dashboard's top right corner - [Generate API tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): - - Select **Create API token** + - Select "Create API token" - Edit the "R2 Token" name - Under **Permissions**, select appropriate permission types - Optionally scope token to specific buckets for Object Read/Write permissions From 34e76b3c2998620c38fccd45c68917a80c1a7362 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:37:08 -0800 Subject: [PATCH 09/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0fb966031b804..31b4acaed3a78 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -120,7 +120,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Under **Permissions**, select appropriate permission types - Optionally scope token to specific buckets for Object Read/Write permissions - Once done, click the "Create API Token" button. - - Save the generated token as your **`S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`** + - You'll receive an access key ID and a secret access key. Save them to use them later for the `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` environment variables. - Record your bucket name for configuration - Save your public bucket URL for reference From cbad88fa5c962d5d310d9b609d9238912cf6b231 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:39:36 -0800 Subject: [PATCH 10/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 31b4acaed3a78..518719fdf5803 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -111,7 +111,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Scroll down to the Public Access section, and click on "Allow Access" in the "R2.dev subdomain" card. - Type 'allow' to confirm - Copy the Public R2.dev Bucket URL for your `S3_FILE_URL` - 4. Set up your credentials: + 4. Retrieve credentials: - Find your Account ID in the R2 dashboard's top right corner - [Generate API tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): From 3350e2f79392c121022fb699e9534d151e1c7f4e Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:39:49 -0800 Subject: [PATCH 11/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 518719fdf5803..8f58e711e4fdf 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -114,7 +114,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat 4. Retrieve credentials: - Find your Account ID in the R2 dashboard's top right corner - - [Generate API tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): + - [Go to API tokens page](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): - Select "Create API token" - Edit the "R2 Token" name - Under **Permissions**, select appropriate permission types From 6b83e727467cc23e481c2b8cf7aa2d8dec51dbd4 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:40:18 -0800 Subject: [PATCH 12/14] Update www/apps/resources/app/architectural-modules/file/s3/page.mdx Co-authored-by: Shahed Nasser --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8f58e711e4fdf..d120dfadb8b62 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -118,7 +118,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Select "Create API token" - Edit the "R2 Token" name - Under **Permissions**, select appropriate permission types - - Optionally scope token to specific buckets for Object Read/Write permissions + - You can optionally specify the buckets that this API token has access to under the "Specify bucket(s)" section. - Once done, click the "Create API Token" button. - You'll receive an access key ID and a secret access key. Save them to use them later for the `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` environment variables. - Record your bucket name for configuration From 4014931afa13cdabf00cf16fcf256f4b6ad4bb00 Mon Sep 17 00:00:00 2001 From: Ehtisham Afzal <106005092+ehtisham-afzal@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:44:38 +0500 Subject: [PATCH 13/14] suggestions applied on pull req #10497 --- .../app/architectural-modules/file/s3/page.mdx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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 d120dfadb8b62..8666d33a6321b 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -117,22 +117,11 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - [Go to API tokens page](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): - Select "Create API token" - Edit the "R2 Token" name - - Under **Permissions**, select appropriate permission types + - Under Permissions, select Object Read & Write permission types - You can optionally specify the buckets that this API token has access to under the "Specify bucket(s)" section. - Once done, click the "Create API Token" button. - You'll receive an access key ID and a secret access key. Save them to use them later for the `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` environment variables. - - Record your bucket name for configuration - - Save your public bucket URL for reference - - ```scheme - S3_FILE_URL="https:// From 3bd28656f32cb37178a5e3f0010b0baf2e98efc7 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 8 Jan 2025 09:43:45 +0200 Subject: [PATCH 14/14] Update page.mdx --- www/apps/resources/app/architectural-modules/file/s3/page.mdx | 2 -- 1 file changed, 2 deletions(-) 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 8666d33a6321b..5c25de31c3469 100644 --- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx +++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx @@ -112,8 +112,6 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat - Type 'allow' to confirm - Copy the Public R2.dev Bucket URL for your `S3_FILE_URL` 4. Retrieve credentials: - - - Find your Account ID in the R2 dashboard's top right corner - [Go to API tokens page](https://dash.cloudflare.com/?to=/:account/r2/api-tokens): - Select "Create API token" - Edit the "R2 Token" name