edit: finally figured it out (i swear i looked for a long time before posting) — if you create a nor

edit: finally figured it out (i swear i looked for a long time before posting) — if you create a normal cloudflare API token, and pick workers R2 as the scopes, it won't show an Access Key ID, even if it's transferred to be an R2-speicifc token with per-bucket access controls. you have to start at the R2 token UI in order to create a token that will show an Access Key ID for usage w/ the s3-compatible api
17 Replies
Fimey
Fimey7mo ago
I have a r2 bucket setup. Would it be possible to allow other cloudflare users to upload/manage the bucket? I know you can do that for domaikns but I don't see anything "team" related for r2. Thanks in advance!
Jan Piotrowski (janpio)
We are thinking about moving a analytics ingestion function from Lambda to Cloudflare. Our products send small JSON payload to the endpoint, that runs on Lambda. There we use Kinesis Firehose to write the data to S3 in batches. The function calls a Kinesis JS SDK function and can return, and in the background those events are collected and then written to S3 in nice batches. Does something similar exist for R2? Doesn't sound like the best idea to just write to R2 on each request probably.
Hello, I’m Allie!
Maybe #queues-beta
Jan Piotrowski (janpio)
Ah yes, that sounds promising. There even is an example that is pretty close: https://developers.cloudflare.com/queues/examples/send-errors-to-r2/
gold3n
gold3n7mo ago
Is it possible to limit the users based on how much bandwidth they used in a given time frame?
Hello, I’m Allie!
By bandwidth or requests? Cloudflare doesn't bill on bandwidth anyway
Zora
Zora7mo ago
If your zone's on a paid plan, you can set a custom error response for 404 errors https://developers.cloudflare.com/rules/custom-error-responses/ and then include <meta http-equiv="refresh" content="0; url=[redirect url]> in the html
Custom error responses (beta) · Cloudflare Rules docs
Custom error responses, powered by the Ruleset Engine, allow you to define custom responses for errors returned by an origin server or by a Cloudflare …
Zora
Zora7mo ago
yeah, unfortunately it can only be used in the api and not the dashboard
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
gold3n
gold3n7mo ago
by bandwidth yes
Unsmart
Unsmart7mo ago
Why would you want to block someone by bandwidth? That doesnt make any sense. If you want to block someone though regardless of how you would need to do it yourself and use your own db for tracking whatever metric you want. Cloudflare does offer rate limiting rules though they are very very basic and arent really usable on the free plan tbh.
gold3n
gold3n7mo ago
it does make sense in my case anyway. Like when you don't want a single user to absorb your whole dataset at once
Unsmart
Unsmart7mo ago
rate limits make more sense
gold3n
gold3n7mo ago
rate limites are just the number of requests, each file is huge so it wont work
Adel
Adel7mo ago
Hi everyone, I have seen notice while making bucket public for reading the object and I don't want to read files using presigned urls how much is bad ?
Karew
Karew7mo ago
Can you rephrase this question?
ahmed
ahmed7mo ago
Hi, I am getting CORS error on R2 bucket connected through custom domain. I have added the CORS policy which has been working fine for me on other buckets but not on a particular bucket's. Is it because the files were uploaded before the CORS policy was added? If yes, how can I fix this?
Want results from more Discord servers?
Add your server