-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Even when explicitely set, the subdomain gateway config still include ipfs.io, gateway.ipfs.io and dweb.link #7317
Comments
Isn't this the same as #7281? |
It's related but not the same. #7281 is about the default config being not explicit and a surprising user experience This issue is about the config not being honored as it should (extra gateways are added without the possibility to avoid it). |
Ah, got it. So, in this case, you can disable these gateways, but you need to explicitly map A better solution may be to add a |
AFAIK those implicit entries were included so canonical gateways work in HTTP Proxy mode: $ chromium --user-data-dir=$(mktemp -d) --proxy-server="http://127.0.0.1:8080" "http://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR" ..but I don't think many people will use it due to HSTS limitations, nor care if we remove them and ask for manual add if someone wants to use HTTP proxy. If anything, just remove them, adding additional flag would be an overkill. |
Hooo, I see. Well you still need to know that they are there in the first place (that is, read the code) ;) What about simply doing something like: diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go
index 143435106..5eb25d686 100644
--- a/core/corehttp/hostname.go
+++ b/core/corehttp/hostname.go
@@ -55,20 +55,26 @@ func HostnameOption() ServeOption {
if err != nil {
return nil, err
}
- knownGateways := make(
- map[string]config.GatewaySpec,
- len(defaultKnownGateways)+len(cfg.Gateway.PublicGateways),
- )
- for hostname, gw := range defaultKnownGateways {
- knownGateways[hostname] = gw
- }
- for hostname, gw := range cfg.Gateway.PublicGateways {
- if gw == nil {
- // Allows the user to remove gateways but _also_
- // allows us to continuously update the list.
- delete(knownGateways, hostname)
- } else {
- knownGateways[hostname] = *gw
+
+ var knownGateways map[string]config.GatewaySpec
+ if len(cfg.Gateway.PublicGateways) > 0 {
+ knownGateways = make(
+ map[string]config.GatewaySpec,
+ len(cfg.Gateway.PublicGateways),
+ )
+
+ for hostname, gw := range cfg.Gateway.PublicGateways {
+ if gw != nil {
+ knownGateways[hostname] = *gw
+ }
+ }
+ } else {
+ knownGateways := make(
+ map[string]config.GatewaySpec,
+ len(defaultKnownGateways),
+ )
+ for hostname, gw := range defaultKnownGateways {
+ knownGateways[hostname] = gw
}
} |
Yeah, just dropping the defaults (except localhost) sounds reasonable). |
cc @mburns in case removal of implicit config impacts dweb.link deployment scripts |
@lidel we were explicit just in case a change like this landed. Thanks for the heads up. 🚢 |
@lidel : please check if this can be closed out or if there are any updates needed. |
This closes #7317 by removing hardcoded PL hostnames from default config, making the localhost the only implicit gateway hostname.
go-ipfs v0.5.1
https://github.com/ipfs/go-ipfs/blob/master/core/corehttp/hostname.go#L37-L42
It seems ok to me to implicitly accept
localhost
when no public gateway is defined but including the Protocol Labs gateway as well seems too much. At least when explicitly defined, those should not be included as well.The text was updated successfully, but these errors were encountered: