sambecker / exif-photo-blog

Photo blog, reporting 🤓 EXIF camera details (aperture, shutter speed, ISO) for each image.
https://photos.sambecker.com
685 stars 108 forks source link

Introduce Cloudflare R2 storage adapter #48

Closed sambecker closed 7 months ago

sambecker commented 7 months ago

Request: #12 #18 #42

vercel[bot] commented 7 months ago

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

Name Status Preview Comments Updated (UTC)
exif-photo-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2024 5:50pm
photos-sambecker ✅ Ready (Inspect) Visit Preview Jan 21, 2024 5:50pm
XahidEx commented 6 months ago

Is it a must to enable the R2.dev subdomain? I have a custom domain.

sambecker commented 6 months ago

Just updated the integration @XahidEx you should now be able to use custom domains through the more general NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_DOMAIN environment variable.

Can you configure and let me know if it works as expected?

XahidEx commented 6 months ago

Just updated the integration @XahidEx you should now be able to use custom domains through the more general NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_DOMAIN environment variable.

Can you configure and let me know if it works as expected?

⚠ Sending SIGTERM signal to static worker due to timeout of 60 seconds. Subsequent errors may be a result of the worker exiting. ⨯ Static worker exited with code: null and signal: SIGTERM

It did build before. But It's kinda gets stuck while static page generation now. Also used r2.dev subdomain. Screenshot_20240122-134958_Firefox

sambecker commented 6 months ago

I believe this is a separate issue. Can you try building without static generation?

XahidEx commented 6 months ago

I believe this is a separate issue. Can you try building without static generation?

I was able to deploy it before. Just before the recent change. r2.dev also worked. Just didn't work with a custom domain. Now It's not working with either. Somehow the issue might be connected

sambecker commented 6 months ago

For clarification is main not building with Cloudflare R2, or is this on a customized branch?

XahidEx commented 6 months ago

For clarification is main not building with Cloudflare R2, or is this on a customized branch?

Ay! Tried the main branch!

sambecker commented 6 months ago

Restarted static page generation for /p/u4Da2NDi because it took more than 60 seconds

I'm not sure how you saw this error on main. Nothing should be statically generated on that branch. Any ideas where that's coming from (thus far, I've only seen it originating from generateStaticParams)? Is this still the error you're seeing?

I am experimenting with static generation on the static branch but that code is not ready for production.

Does that make sense?

Last question: does next build work locally?

XahidEx commented 6 months ago

Restarted static page generation for /p/u4Da2NDi because it took more than 60 seconds

I'm not sure how you saw this error on main. Nothing should be statically generated on that branch. Any ideas where that's coming from (thus far, I've only seen it originating from generateStaticParams)? Is this still the error you're seeing?

I am experimenting with static generation on the static branch but that code is not ready for production.

Does that make sense?

Last question: does next build work locally?

Used vercel

sambecker commented 6 months ago

I can't open that link—is it just building the latest commit on main?

XahidEx commented 6 months ago

I can't open that link—is it just building the latest commit on main?

Yes + also tried the static branch. Having the same issue. Before this latest commit to main I was able to deploy as well.

sambecker commented 6 months ago

Can you find the last commit that was able to build correctly? Is it one behind main?

XahidEx commented 6 months ago

Can you find the last commit that was able to build correctly? Is it one behind main?

#abf3fc3

sambecker commented 6 months ago

I can't seem to find any significant changes since #abf3fc3.

I have two projects (one that uses Cloudflare, one that uses Vercel Blob) that are both building off main, and only have 13 static pages (despite having different photo counts), because photos are not meant to be statically generated.

CleanShot 2024-01-22 at 16 58 01@2x

Your error message says that it's failing to build 85 pages, which makes me think different code is running.

Are there any other error messages you can share? If your code is public, can you share a link?

sambecker commented 6 months ago

By the way, I am seeing similar errors on my static branch, which uses ppr and is still experimental, in case that's helpful:

CleanShot 2024-01-22 at 17 05 36@2x

sambecker commented 6 months ago

Last questions:

  1. Do you still have AWS/Vercel Blob configuration in place (i.e., environment variables like NEXT_PUBLIC_AWS_S3_BUCKET or BLOB_READ_WRITE_TOKEN), and if so, do those connect to valid stores?
  2. What value do you have for NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_DOMAIN? It should be a full host name without "https," i.e., the value should look like, "pub-2039849...23048.r2.dv" or "my-custom-domain.com"
XahidEx commented 6 months ago

Thank you. Now It's working ❤️ (Just crashed twice while uploading new photos. But still It did work. Also facing internal error 500) I'm just using R2 now. I used aws + Vercel blog before. But now It's all fresh r2. I'm using this repo as it is, latest version

sambecker commented 6 months ago

So glad you were able to get it working.

Feel free to open a new issue if uploading keeps breaking.