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: improved subdomain-url handling #211

Merged
merged 10 commits into from
Jun 10, 2024
Merged

feat: improved subdomain-url handling #211

merged 10 commits into from
Jun 10, 2024

Conversation

lidel
Copy link
Member

@lidel lidel commented May 24, 2024

This PR implements cleanup described in #185 (comment) and close #185 for good.

  • removed implicit tests based on SubdomainLocalhostGatewayURL = http://localhost
    • subdomain tests are now run only against origins defined via --subdomain-url
    • --subdomain-url defaults to http://example.com:8080 now
  • DNSLink gateway tests are no longer tied to origin passed via --subdomain-url
    • turn "subdomain dnslink" fixtures into "domain" ones
  • cleanup tooling/helpers/subdomain.go – mangling of Host, URL and Path happens there and in ./tooling/test/run.go, we should refactor tests to set Path + optional Host header`; proxy tests should be in separate file that can be disabled
  • produce dnslink fixtures in IPFS_NS_MAP format
  • e2e kubo CI reports no Failures

- removed implicit tests based on SubdomainLocalhostGatewayURL
- subdomain tests are now run only against origins defined via
  `--subdomain-url`
- DNSLink gateway tests are no longer tied to origin passed via
  `--subdomain-url`
@lidel lidel force-pushed the fix-subdomain-url branch from 555514a to 3e74a1a Compare May 24, 2024 20:24
Copy link
Contributor

github-actions bot commented May 24, 2024

Results against Kubo master:
(check the action's summary for the full results)

Summary

Tests Failures Errors Skipped
1306 0 0 0

Copy link
Contributor

github-actions bot commented May 24, 2024

Results against Kubo latest:
(check the action's summary for the full results)

Summary

Tests Failures Errors Skipped
1306 0 0 0

@lidel lidel force-pushed the fix-subdomain-url branch 14 times, most recently from d985e27 to 120678c Compare May 25, 2024 01:25
- splitting into subdomain and dnslink gateway variants
- towards avoiding running everything three times
- keep custom Host header when defined
@lidel lidel force-pushed the fix-subdomain-url branch from 120678c to 822698a Compare May 25, 2024 01:32
lidel added 6 commits May 26, 2024 21:18
these concepts should not mix, and dnslinks should be testable
independent of --subdomain-url

i also added more useful export format for them, compatible with
IPNS_NS_MAP used by Boxo/Kubo/Rainbow
towards fixing underlying issue
all-in-one command for running local kubo with all fixtures in
This replaces magic helpers.UnwrapSubdomainTests with explicit
spec preset named proxy-gateway, which can be enabled/disabled
the same way as other presets.

While it was nice to run every test in both proxy modes,
it was extremely noisy and hard to debug once things went wrong.

By having explicit tests in *_proxy_test.go it is easy to skip them
where proxy functionality is not relevant.

Other:

- Send meaningful User-Agent
- Sent detached path in HTTP Connect proxy tunnel tests (instead of full
  URL – in tunnel mode we pretend we talk to remote server on the other
  end of tunnel, and not send full URL like it is done in plain proxy
  mode)
Copy link
Contributor

github-actions bot commented Jun 7, 2024

v0.6.0

Changed

  • The --gateway-url now defaults to http://127.0.0.1:8080 to ensure no confusion with subdomain gateway feature.
  • The --subdomain-url now defaults to http://localhost:8080, making it more friendly for local development.
    • We also simplified the way --subdomain-url works. We no longer run implicit tests
      against http://localhost in addition to the URL passed via
      --subdomain-url. To test more than one domain, run test multiple times.
  • DNSLink fixtures no longer depend on --subdomain-url and use unrelated *.example.org domains instead.

@lidel
Copy link
Member Author

lidel commented Jun 7, 2024

@simulified cute, reported.

A picture for future reference, in case the exploit from #211 (comment) (comment above) gets deleted ;-)
2024-06-08_01-32

lidel added 2 commits June 9, 2024 19:25
This is important UX change. We no longer ship with default URLs.

User has to provide explicit one, or the test suite will refuse to run.
This ensures misconfigurations and testing different gateway endpoint
than desired do not happen.

Explicit is better than implicit.
@lidel lidel marked this pull request as ready for review June 10, 2024 18:48
@lidel lidel changed the title fix: subdomain-url handling feat: improved subdomain-url handling Jun 10, 2024
@lidel lidel merged commit 3e23e98 into main Jun 10, 2024
12 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.

bug: gateway-conformance subdomains are inflexible and setup is not clear
1 participant