snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy
Creative Commons Zero v1.0 Universal
546 stars 29 forks source link

Netlify Redirects #337

Closed miklb closed 1 year ago

miklb commented 1 year ago

howdy! So glad to see your recent posts in the feed reader.

I'm trying to start fresh with a new indie domain and am using Eleventy on Netlify for the time being.

My current rewrites are

[[redirects]]
  from = "/.well-known/host-meta*"
  to = "https://fed.brid.gy/.well-known/host-meta.*"

[[redirects]]
  from = "/.well-known/webfinger*"
  to = "https://fed.brid.gy/.well-known/webfinger.*"

I'm putting the cart a bit before the horse in getting this configured before fully implementing mf2 and starting to post again, but I'm also using it as motivation.

It appears webfinger is working, but I still get the Next step: add the .well-known redirects message.

Any thoughts on what's amiss?

domain is michaelbishop.me

miklb commented 1 year ago

Just realized I was using meta* and not meta.* in the from redirect. Changing that now to see if that was the issue.

snarfed commented 1 year ago

Hey, welcome back! Thanks for trying Bridgy Fed!

Right now, it looks like eg https://michaelbishop.me/.well-known/webfinger?x=y redirects to https://www.michaelbishop.me/.well-known/webfinger?x=y (note the www), which then 404s.

miklb commented 1 year ago

OK, so now it's reporting

https://michaelbishop.me/.well-known/webfinger?resource=acct:michaelbishop.me@michaelbishop.me
  redirected to:
https://fed.brid.gy/.well-known/webfinger*?resource=acct:michaelbishop.me@michaelbishop.me
  returned HTTP 404
miklb commented 1 year ago

is it because I have the acct:michael@michaelbishop.me in the h-card?

snarfed commented 1 year ago

HTTP redirects are unrelated to what's in your h-card. Let me look again...

snarfed commented 1 year ago

Looks like that error message is right, your site is now redirecting to https://fed.brid.gy/.well-known/webfinger*?... with a literal * character at the end of the path. You'll want to remove that 😁

aciccarello commented 1 year ago

Here are the netlify redirects I am using for my site

[[redirects]]
  from = "/.well-known/host-meta*"
  to = "https://fed.brid.gy/.well-known/host-meta:splat"
  status = 302
[[redirects]]
  from = "/.well-known/webfinger*"
  to = "https://fed.brid.gy/.well-known/webfinger"
  status = 302

https://github.com/aciccarello/ciccarello.me/blob/de10157f08f35f7bdf70eefdf48eaec16687ca9c/netlify.toml#L55-L62

miklb commented 1 year ago

oh my. I assumed they would pick up the wildcard. Thank you.

miklb commented 1 year ago

@aciccarello's rules pass with flying colors for me. @snarfed I'll send a PR if you'd like to add this to the docs with a link to the Netlify Rewrites/Redirects page https://docs.netlify.com/routing/redirects/

I did one in the browser while I was here. Thanks again

snarfed commented 1 year ago

@miklb the commit ^ looks great! Want to open a PR? You'll want to fix the indent of the first line inside the <pre>, otherwise I'll happily merge.

candidexmedia commented 1 year ago

@aciccarello you're a life saver!

For the _redirects method, its:

/.well-known/webfinger*            https://fed.brid.gy/.well-known/webfinger          302
/.well-known/host-meta*             https://fed.brid.gy/.well-known/host-meta:splat           302