tiddly-wiki-server icon indicating copy to clipboard operation
tiddly-wiki-server copied to clipboard

Choose backend

Open linonetwo opened this issue 2 years ago • 3 comments

To make tw data available to be used by other dapp, I want to make a tw plugin for https://github.com/CommunitySolidServer/CommunitySolidServer

It can use plugin mechanism to provide API. So I think we can use tiddly-wiki-server as API layer, and save to that server. This requires switch backend from sqlite to that server, via built-in or ipc or http.

linonetwo avatar May 20 '23 07:05 linonetwo

I don't know of a good way to support runtime plugins in Rust apps, but I could certainly add:

  • A trait that defines a storage backend, and
  • an interface for running the server with that trait.

This would let you create a project that implements that trait against Solid, pass that to a setup function, and get a functioning web server.

Would that work?

nathanielknight avatar May 23 '23 21:05 nathanielknight

This is OK, just use this as a rust crate, and implement all CRUD. After user login at solid, proxy all request to tiddlywiki server, and server save data to solid.

How do you handle auth, do you support header based auth?

linonetwo avatar May 24 '23 06:05 linonetwo

So far I've implemented auth in the reverse proxy that I put in front of this service (I use Caddy and Authelia). There's an open issue for auth (#6 ) but I think it should probably be implemented as Tower middleware and I haven't had time to dig into how that works.

nathanielknight avatar May 31 '23 04:05 nathanielknight