Running TiddlyWiki inside Peergos

Hi all,
I work on a project called Peergos.
Can think of it as a global filesystem where people have total control over their data.
Has some nice properties like P2P connectivity, E2E encryption, fine grained access control strong meta-data protection (And self-hostable).
Project

Recently I added the ability to build Apps. I thought TiddlyWiki would be a good App to install.
It took all of about 10 code line changes to get it working in development. I made slight edits to put.js and http.js to handle sending binary data.

Code here

But I did need to amend the CSP of the Peergos Appā€™s sandbox to allow ā€˜unsafe-evalā€™. Iā€™m not keen on making that change.

A question for the Developers:
Has this CSP issue come up before. Has there been any discussion on a workaround or proposed long-term solution?
Perhaps integrate a WASM compiled JS engine (like Quick.js) in combination with using ā€˜wasm-unsafe-evalā€™?

5 Likes

Awesome! Welcome @Kev.

I work at Fission and have done some TW experiments with IPFS too. Great to see Peergos playing.

@jeremyruston can weigh in on this, but TW is pretty heavy on JS (to put it mildly) and also looks at being very backwards compliant.

So I donā€™t think this is on the roadmap at all.

2 Likes

Hi @boris,

Thanks for the input.
The more I think about it, the more I think there is another way. The plan is to modify Peergos and remove all of my changes to TW such that a vanilla install will work unmodified in Peergos.

1 Like

Welcome @Kev to the community, this could be a lovely complement to TiddlyWiki.

I have to leave the full technical picture to others but thought it may be relevant that the Javascript components can be delivered separately from the other components of tiddlywiki. They come together in the browser of course to provide the complete solution.

I presume you are playing with the single file version only?

I would be happy to play and review but would need a ā€œturn keyā€ solution.

  • There is prior work using the beaker browser
  • The Aforementioned Fission and the File Uploads plugin

If and when we have a mature solution, I am interested in pursuing a network of independent sites which could allow a form of social network where we as individuals own our node in that network.

  • I see tiddlywiki as a node
  • Sitting on one or more hosts like the one you seem to allude to

Thanks @TW_Tones for the reply.
Yes, what you have outllined is how i hope things will develop. The single file version makes sharing permissions simpler.
Peergos already allows a user to publish a folder as a WWW root and it will appear at: .peergos.me like: my example
You can find more info on Peergos from fosdem2022 video
I will post again once i have made the necessary improvements to Peergos to run TW unmodified.

Hi @Kev congratulations on your work on Peergos, itā€™s beautifully put together. And thank you for featuring TiddlyWiki.

I donā€™t think it has come up before, but it is something Iā€™m interested in. I wrote some brief notes over at GitHub:

2 Likes

Updating thread now that the changes to Peergos required are finally deployed to peergos.net. Of course you can self-host as well.
Check it out and tell me if you find it useful.
You will find instructions on how to install the app at this location: github.com/Peergos/example-apps
Once installed all you have to do is upload a TW html file into a folder, select the file, and choose edit in ā€¦
Note: saving changes currently takes way too long. It is a known issue & working on it.
Use an anchor tag to link to another TW file. If linking to another Peergos userā€™s TW file, prefix url path with /peergos/

enjoy :slight_smile:

3 Likes