element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.01k stars 1.96k forks source link

IPFS deployment #18921

Open olanod opened 3 years ago

olanod commented 3 years ago

Your use case

Element being the face of a decentralized protocol would be a perfect fit for an official decentralized deployment on IPFS .

Ideally as part of the CI process and normal release cycle of a new version of the web front-end there should be a task that uploads the newly created files to a server that can pin the files on IPFS and publishes the hash in a visible public place(e.g. in the github repo as a badge, as simple link, as a text file part of the releases).

Optional would be for app.element.io to use this deployment as the official one pointing the CNAME to an IPFS gateway. As an extra side effect, people that host their own home server with a copy of element, now would only have to update some DNS records to point to the latest hash instead of hosting the files manually.

One last pending bit that can be a separate issue is how a custom.site can use a separate config for customizability that applies only to that domain. I imagine a well known DNS TXT record could be used for that but its something up for discussion.

Have you considered any alternatives?

No response

Additional context

No response

planetoryd commented 1 year ago

This would reduce the trust on element web hosters, since all the data on IPFS are content-addressed.

t3chguy commented 1 year ago

people that host their own home server with a copy of element, now would only have to update some DNS records to point to the latest hash instead of hosting the files manually.

Except then they wouldn't be able to have their own config.json pointing at their own homeserver

t3chguy commented 1 year ago

Don't IPFS Gateways host sites at URLs like https://ipfs.io/ipfs/<hash>/ - if so then the Origin would be the same between various sites and thus leak encryption keys & anything stores in Local Storage & IndexedDB between them.

olanod commented 1 year ago

Except then they wouldn't be able to have their own config.json pointing at their own homeserver

The DNS TXT record hack I mentioned could be the way people personalize things for their own domain, the record could have the config already or a URL/IPFS-CID that contains the custom configuration for the current domain. When the domain is a gateway or no special TXT record was found we load some default config that points to matrix.org?

t3chguy commented 1 year ago

The DNS TXT record hack

Webapps (Web Javascript) can't make DNS queries, you'd need an extra backend service which becomes an SPOF and/or privacy leak.

olanod commented 1 year ago

There is DoH(DNS over HTTPS) and services like google's allow us to do DNS queries from the browser(e.g fetch('https://dns.google/resolve?name=example.com'))

t3chguy commented 1 year ago

or privacy leak.