ipfs / notes

IPFS Collaborative Notebook for Research
MIT License
401 stars 30 forks source link

Publishing IP addresses #439

Open rendaw opened 4 years ago

rendaw commented 4 years ago

For me the killer IPFS feature is a distributed DNS, which should be IPNS to the best of my understanding. However the name system CLI in go-ipfs at least seems to reject payloads that don't match a certain pattern, I think strings starting with "/ipfs/"? It would be great to be able to use it to give a name to a server, for all the typical uses one would want from DNS (web, mail, ssh, server-server communication, etc). Is there anything preventing this restriction from being relaxed?

I googled for a while and couldn't find any discussion on this topic and TBH I'm not sure this is the right repository, so apologies if it isn't.

aschmahmann commented 4 years ago

@rendaw this is probably fine, although discuss.ipfs.io is good for discussions and go-ipfs is good for go-ipfs specific feature requests.

For me the killer IPFS feature is a distributed DNS

I'm absolutely a big fan of this!

seems to reject payloads that don't match a certain pattern

In go-ipfs ipfs name publish it's valid to paths that look like /ipfs/CID, /ipld/CID or /ipns/{IPNS_ID or DNSLink}, while that could be changed to a more permissive structure /foo/bar I don't think it's necessary to achieve what you're looking for.

a distributed DNS

For many use cases you can already do this by simply using IPFS as is. In particular:

What kind of scenario were you thinking of, do any of these options work for you?

rendaw commented 4 years ago

Awesome! I was worried this wasn't in line with IPFS goals so it's a relief to hear!

My goal is, roughly, a consistent name that I could map to a server that might change over time, so I can hard code the address in scripts or configs, bookmark it, etc. (edit: and without having to get involved with the dns registrar mess)

The last suggestion might work, although it sounds like an extra-protocol extension, so for instance browsers with the IPFS extension wouldn't necessarily know what to do if they encounter it (if the browser gets a url that points to a document containing 34.123.123.4 or whatever, should it display the content, redirect, or show the http response of the ip http request with the current url in the address bar?). In this case I think the setup would be ipns name -> ipfs content addr -> document containing ip?

The peer id one sounds pretty close and tbh I wasn't aware of it, but I think it has these restrictions:

  1. You can only map the current host's ip address, so if I couldn't publish an ip for a different host or a 3rd party server or something.
  2. The peer id is the root key id, which is ephemeral I think by design - in discussions of backing up keys the root key was singled out as "shouldn't be exportable/importable". So if I lost the server and needed to recreate it, or wanted to fail over to another system for maintenance, the id would change.
  3. You can only publish one ip this way, if you have multiple servers you'd have to run multiple instances of ipfs at least.
  4. Not sure on this one, but are /p2p/... paths recognized in the same contexts as other paths? Ex: a hyperlink in a ipfs document containing href="/p2p/Qmxyz".