dotsmesh / dotsmesh-web-app

This is the source code of the Dots Mesh web app. It's officially hosted on dotsmesh.com, and also available on your own hosts.
https://about.dotsmesh.com
GNU General Public License v3.0
80 stars 4 forks source link

Using SRV DNS record instead of fixed Subdomain #2

Open ghost opened 4 years ago

ghost commented 4 years ago

https://github.com/dotsmesh/dotsmesh-web-app/blob/32c762730db279f63ff3e1d7ba224dd9f8d0084d/app/library/core.js#L28

That method could still be used as a fall back if no SRV Record is defined and with https://dns-js.com/ we can Query the DNS Records of a domain. Pretty simple we could check if a SRC Record is set for dotsmesh.example.com and use the address it points to.

ivopetkov commented 4 years ago

Unfortunately, dns-js does not work entirely in the browser. Its current implementation makes calls to https://www.dns-js.com/api.aspx and that's not good for the privacy of the users.

I haven't been able to find a JS API that supports DNS queries and that's why I've chosen the dotsmesh.example.com approach.

ghost commented 4 years ago

Well problem is their is no JS nativ way to do this. The only Way to do this would be to A host a DNS over HTTPS provider or use the one from Cloudflare or Google.

ivopetkov commented 4 years ago

I think we are good now with the "dotsmesh." subdomain, and we can easily add alternatives in the future when they become stable enough. Fortunately, Java Script is actively improved in recent years.

okpierre commented 4 years ago

Hi @flammehawk I'm trying to understand the install process.

Are you saying dotsmesh subdomain is required to get this running or can I use any subdomain?

I'm interested in trying this app

ghost commented 4 years ago

@okpierre Yes the Subdomain is required.

okpierre commented 4 years ago

@flammehawk Thanks! I think that requirement may stop many users from using this

ivopetkov commented 4 years ago

The "dotsmesh.example.com" requirement helps the discovery of the server that hosts the example.com profiles and groups. This is done on the client and no central authority or other services are required - just replace "matt." with "dotsmesh." in "matt.dotsmesh.com" and you got the server name.

No matter the discovery mechanism, there are other requirements for the server:

And if you have a website hosted on example.com, this might be hard to do. So there better be another place that is available entirely to your Dots Mesh setup. And I think that dotsmesh.example.com seems like a good place.

Nevertheless, I'm open to discussions and improvements.