Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix, fdr): create a public S3 bucket so that we can share images without public presigned urls #876

Merged
merged 5 commits into from
May 16, 2024

Conversation

dsinghvi
Copy link
Member

Short description of the changes made

This PR creates a public S3 bucket so that we can start storing assets for public docs in this S3 bucket.

What was the motivation & context behind this PR?

  1. Storing objects publically allows us to create stable URLs for images
  2. Having stable URLs for images allows us to cache images better to improve load times on the frontend

How has this PR been tested?

[pending]

Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
fern-dev ✅ Ready (Inspect) Visit Preview May 16, 2024 3:52pm
3 Ignored Deployments
Name Status Preview Updated (UTC)
fern-prod ⬜️ Ignored (Inspect) May 16, 2024 3:52pm
fontawesome-cdn ⬜️ Ignored (Inspect) May 16, 2024 3:52pm
private-docs ⬜️ Ignored (Inspect) May 16, 2024 3:52pm

},
versioned: true,
});
publicBucket.grantPublicAccess();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We create a new public S3 bucket here

bucketName: getEnvironmentVariableOrThrow(PRIVATE_S3_BUCKET_NAME_ENV_VAR),
bucketRegion: getEnvironmentVariableOrThrow(PRIVATE_S3_BUCKET_REGION_ENV_VAR),
urlOverride: process.env.PRIVATE_S3_URL_OVERRIDE_ENV_VAR,
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the public and private s3 bucket URL information is parsed here

@dsinghvi dsinghvi merged commit f14e0a6 into main May 16, 2024
22 checks passed
@dsinghvi dsinghvi deleted the dsinghvi/s3-urls branch May 16, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants