Cloud Storage
Cloudflare R2
Section titled “Cloudflare R2”For cloud storage, WeaveAI uses Cloudflare R2, which is S3-compatible object storage. To integrate cloud storage, please follow the steps below.
Creating the bucket
Section titled “Creating the bucket”This bucket will be used to store all AI generated content from users such as images, videos, and audio. Everything in this bucket is protected via Signed URLs.
- Go to Cloudflare
- Sign up or log in to your account
- From the menu on the left, under Build, navigate to Storage & databases → R2 object storage → Overview
- Click on Create bucket
- Bucket name:
name your bucket - Location:
Automatic - Default Storage Class:
Standard
- Bucket name:
- Click Create bucket
- Take a note of the bucket name
Creating the public bucket
Section titled “Creating the public bucket”This bucket will be used to store your site’s branding files like logos and favicon. The process of creating the bucket is the same as the first one, so follow the same guide above to create a second bucket. Once you’ve created the bucket, you need to make it public, please follow the steps below.
- Navigate to the second bucket you created, and go to Settings
- Under Custom Domains, click Add
- Add your domain (e.g.
branding.your-domain.com) and click Continue- In order to make a bucket public, you need to associate a domain with it, and your domain must be added to Cloudflare beforehand
- Alternatively, you can click Enable on Public Development URL in order to make the bucket public, and use the domain URL from Cloudflare instead
- Click Connect domain
- The bucket is now publicly available. Take a note of the:
- Public bucket URL (e.g.
branding.your-domain.com) - Public bucket name
- Public bucket URL (e.g.
Creating the API token
Section titled “Creating the API token”Once you’ve created the two buckets, you will need to create an API token in order to be able to access them.
- Go back to the R2 object storage → Overview section
- Find API Tokens on your screen and click on Manage
- Click Create Account API token
- Token name:
name your token e.g. R2 Token for WeaveAI buckets - Permissions:
Object Read & Write: Allows the ability to read, write, and list objects in specific buckets. - Specify bucket: Select
Apply to specific buckets onlyand select the two buckets you created in the previous steps - TTL:
Forever
- Token name:
- Click Create Account API Token
- Save the following parameter values:
- Access Key ID
- Secret Access Key
- Go back to the R2 object storage → Overview section, and copy your Account ID
Add the values to the WeaveAI admin dashboard
Section titled “Add the values to the WeaveAI admin dashboard”- Now that we successfully created the bucket and the access token, you should have the following information:
- Account ID
- Access Key ID
- Secret Access Key
- Bucket Name - the name of the bucket you created first
- Branding Bucket Name - the name of the public bucket
- Branding Public URL -
https://branding.your-domain.comorhttps://pub-*.r2.dev
- Add each key to its respective field in the Admin Dashboard → Site Settings → Cloud Storage section