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

gateway: migrate subdomain and dnslink code #149

Closed
1 task
lidel opened this issue Feb 1, 2023 · 3 comments · Fixed by #153
Closed
1 task

gateway: migrate subdomain and dnslink code #149

lidel opened this issue Feb 1, 2023 · 3 comments · Fixed by #153
Assignees
Labels
effort/days Estimated to take multiple days, but less than a week P1 High: Likely tackled by core team if no one steps up topic/gateway Issues related to HTTP Gateway

Comments

@lidel
Copy link
Member

lidel commented Feb 1, 2023

Logic that parses Host header and translates it to content path is still in Kubo.

We need to migrate it as well, because the gateway binary for Saturn MUST also support subdomain (for dweb.link) and DNSLink gateways (for things like https://en.wikipedia-on-ipfs.org).

Ref.

Other ToDos:

  • Update CAR Gateway example to support subdomains on localhost
@lidel lidel added P1 High: Likely tackled by core team if no one steps up effort/days Estimated to take multiple days, but less than a week topic/gateway Issues related to HTTP Gateway labels Feb 1, 2023
@lidel
Copy link
Member Author

lidel commented Feb 1, 2023

@hacdias this is lower priority than PoC examples (#141 and #142), but something we will need for the production binary for dweb.link.

Not sure how tricky this is, but these additional types of gateways are essentially wrappers executed before passing request to the path one.

I think this is a good patter/model to follow in our library.
See mux and childMux in this file.

@hacdias
Copy link
Member

hacdias commented Feb 2, 2023

(Oops, moving on...)

I think this is a good patter/model to follow in our library. See mux and childMux in this file.

@lidel Any reason to do so instead of doing the common middleware pattern we see in Go?

func Middleware(http.Handler) http.Handler

*http.Mux is a http.Handler but the opposite is not necessarily true. That is how I implemented it right now, but I can change if there's any reason to use a different pattern that what is common in the Go-land.

@lidel
Copy link
Member Author

lidel commented Feb 2, 2023

@hacdias don't remember, possible it is this way only for legacy reasons (subdomains were bolted-on years after path gateway was an ossified thing, did nto want to change too much because we had virtually no tests for anything gateway related back then).

If you can switch Kubo to middleware pattern and have subdomain sharness pass, then we can clean this up 👍

@lidel lidel closed this as completed in #153 Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week P1 High: Likely tackled by core team if no one steps up topic/gateway Issues related to HTTP Gateway
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants