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

feat: Cloudflare R2 provider #277

Merged
merged 4 commits into from
Nov 27, 2024
Merged

Conversation

l4r-s
Copy link
Contributor

@l4r-s l4r-s commented Jul 27, 2024

Talked about this already on Twitter.
I think I could fix the bug I mentioned there.

Let me know if there is something that needs work or is unclear :)

Copy link

vercel bot commented Jul 27, 2024

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

Name Status Preview Comments Updated (UTC)
next-video-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 5:59pm

@luwes
Copy link
Collaborator

luwes commented Aug 7, 2024

thank you for this great contribution! I'll have a look soon.

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 56.47841% with 131 lines in your changes missing coverage. Please review.

Project coverage is 85.52%. Comparing base (199e158) to head (eb9adc9).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/providers/cloudflare-r2/provider.ts 53.74% 105 Missing ⚠️
src/utils/r2.ts 60.00% 18 Missing ⚠️
src/providers/cloudflare-r2/transformer.ts 50.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #277      +/-   ##
==========================================
- Coverage   88.88%   85.52%   -3.37%     
==========================================
  Files          32       35       +3     
  Lines        2601     2902     +301     
  Branches      362      362              
==========================================
+ Hits         2312     2482     +170     
- Misses        286      417     +131     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

endpoint: string;
accountId: string;
bucket?: string;
bucketUrlPublic?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any way bucketUrlPublic can be constructed from endpoint, accountId and bucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without a Cloudflare API Token (R2_CF_API_TOKEN) to my knowledge no.

There are two ways for public access:

  • r2.dev subdomain
  • custom domain
    Both must be enabled first on a bucket level.

If a Cloudflare API Token is given to the provider the r2.dev subdomain will be enabled when creating the bucket (if none is given). Making it usable instantly without manual interaction.

src/config.ts Outdated Show resolved Hide resolved
src/config.ts Outdated Show resolved Hide resolved
@l4r-s
Copy link
Contributor Author

l4r-s commented Aug 25, 2024

sorry for my late comments. Let me know if there is anything else :)

@luwes luwes merged commit cce3347 into muxinc:main Nov 27, 2024
8 checks passed
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.

3 participants