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 gives listen address instead of diallable one. #9232

Closed
3 tasks done
Jorropo opened this issue Aug 29, 2022 · 3 comments · Fixed by #9233
Closed
3 tasks done

Gateway gives listen address instead of diallable one. #9232

Jorropo opened this issue Aug 29, 2022 · 3 comments · Fixed by #9233
Assignees
Labels
dif/easy kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP

Comments

@Jorropo
Copy link
Contributor

Jorropo commented Aug 29, 2022

Checklist

Installation method

built from source

Version

Kubo version: 0.15.0-dev
Repo version: 12
System version: amd64/linux
Golang version: go1.19 X:boringcrypto

Config

{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Origin": [
        "*"
      ]
    }
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [],
    "AppendAnnounce": null,
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip4/128.199.219.111/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip6/2604:a880:1:20::203:d001/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip6/2400:6180:0:d0::151:6001/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip6/2604:a880:800:10::4a:5001/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": null
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "100GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": true,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": true,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "12D3KooWQpscgjKc5VRMhFCs1ckNLgNAbpbzhSPxd4tAN4HtEKhc"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": null,
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": [
      {
        "Addrs": [],
        "ID": "12D3KooWAX5YqEMQMaXVskNJBM9k5ryyALPgUB3FLinzEnWjp8oN"
      },
      {
        "Addrs": [
          "/ip4/163.172.31.60/udp/4001/quic",
          "/ip6/2001:bc8:2a21::1/udp/4001/quic"
        ],
        "ID": "12D3KooWAuMTLB3XF8MJKRLqNxZF5cTjHP29LrhCzsr5rAqvRXHG"
      },
      {
        "Addrs": [
          "/ip4/51.158.153.191/udp/4001/quic",
          "/ip6/2001:bc8:1600:3:208:a2ff:fe0c:7596/udp/4001/quic"
        ],
        "ID": "12D3KooWSYHne66EbyJYrBtRmBMfMTzwba7e6deAzzLHD6FwSYba"
      },
      {
        "Addrs": [
          "/ip4/192.168.0.199/udp/4001/quic"
        ],
        "ID": "12D3KooWHomLYjy41b6jbKhCmeXkVmK5QfZ4fV7pGLDmrEYYBTVK"
      },
      {
        "Addrs": [
          "/ip4/3.134.223.177/tcp/6745"
        ],
        "ID": "12D3KooWN8vAoGd6eurUSidcpLYguQiGZwt4eVgDvbgaS7kiGTup"
      }
    ]
  },
  "Pinning": {},
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Routing": {
    "Type": "dhtserver"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 1000,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "EnableHolePunching": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {
      "Enabled": false
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {
        "QUIC": false,
        "Websocket": true
      },
      "Security": {}
    }
  },
  "apply": "flatfs"
}

Description

$ cat ~/.ipfs/gateway 
http://0.0.0.0:8080

I should be a diallable address not a listen one, for example:

$ cat ~/.ipfs/gateway 
http://127.0.0.1:8080
@Jorropo Jorropo added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization dif/easy P0 Critical: Tackled by core team ASAP and removed need/triage Needs initial labeling and prioritization labels Aug 29, 2022
@Jorropo Jorropo self-assigned this Aug 29, 2022
@Jorropo
Copy link
Contributor Author

Jorropo commented Aug 29, 2022

Same issue with /api file btw.

@lidel
Copy link
Member

lidel commented Aug 29, 2022

The good news is that the default produced by ipfs init is 127.0.0.1:

kubo/config/init.go

Lines 126 to 127 in d577980

API: Strings{"/ip4/127.0.0.1/tcp/5001"},
Gateway: Strings{"/ip4/127.0.0.1/tcp/8080"},

@Jorropo Did you set 0.0.0.0 manually?
I think 0.0.0.0 for Gateway happens only in our Docker image (where ~/.ipfs/gateway has lower significance), so I think its P1 and not P0, right?

@Jorropo
Copy link
Contributor Author

Jorropo commented Aug 29, 2022

@lidel yes I did.
I have a patch for 0.15 ready, I'm adding sharness right now.

Jorropo added a commit to Jorropo/go-ipfs that referenced this issue Aug 29, 2022
Jorropo added a commit to Jorropo/go-ipfs that referenced this issue Aug 29, 2022
Jorropo added a commit to Jorropo/go-ipfs that referenced this issue Aug 30, 2022
Jorropo added a commit to Jorropo/go-ipfs that referenced this issue Aug 30, 2022
Jorropo added a commit to Jorropo/go-ipfs that referenced this issue Aug 30, 2022
ajnavarro pushed a commit that referenced this issue Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dif/easy kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants