Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Serve web content out of Earthstar documents right from the pub #13

Open
cinnamon-bun opened this issue Apr 11, 2021 · 0 comments
Open
Labels
enhancement New feature or request figure out

Comments

@cinnamon-bun
Copy link
Member

cinnamon-bun commented Apr 11, 2021

Right now pubs do 2 things:

  1. Sync with clients using the Earthstar sync protocol
  2. Serve a barebones HTML UI for poking around the workspaces

We could add a new mode for serving websites right out of Earthstar documents.

If you visited a URL like, say...

https://mypub.com/gateway/+gardening.123/mywebsite/index.html

then the pub could just serve your HTML files, images, etc directly.

See also: earthstar-project/earthstar#116 Support a publishing use-case

See also: https://github.com/earthstar-project/earthstar-fetch/tree/initial-implementation for URL format ideas

Security issues

We might want to either disable javascript using a content security policy, or make sure there's nothing tricky that can be done with arbitrary javascript in a page.

Right now the pub doesn't even use cookies or authenticate you so there's not much harm you could do. It would be neat if you could publish a full-fledged app this way including its javascript.

We also need Invite-only workspaces so that people can read and help host the data without getting the ability to write to it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request figure out
Projects
None yet
Development

No branches or pull requests

1 participant