tiddlyhost / tiddlyhost-com

Rails application for creating and hosting TiddlyWiki sites, plus resources for deploying it to https://tiddlyhost.com/
Other
184 stars 17 forks source link

Multi user support #191

Closed TimotheeMathieu closed 2 years ago

TimotheeMathieu commented 2 years ago

Is there a multi-user support that allows multiple users and not only the admin account to edit and add tiddlers ?

By the way thanks, tiddlyhost is awesome.

simonbaird commented 2 years ago

Since Tiddlyhost saves the whole file at once, whoever saved last could potentially overwrite the other person's changes, so currently there's not a good solution for multi-user editing.

Maybe some day, but not any time soon.

simonbaird commented 2 years ago

Actually #72 might help a little. It doesn't solve the overwriting problem, but it would let you share a token or a password that would allow others to update a site, without needing to have your account password.

TimotheeMathieu commented 2 years ago

Ok, I was not sure whether you used the one file variant or the nodejs approach to tiddlywiki (with individual tiddlers saved separately), I did not read the code.

Yes a shared password could also do the trick, and to avoid overwriting I wonder whether we could either limit to one connection at a time or something like that ? The idea would be to have something that says "someone is already editing the wiki, please try again later".

TimotheeMathieu commented 2 years ago

In the end, I found a solution using an alternative hosting service : github. I made a nodejs tiddlywiki in a repo, at each push a github workflow will automatically build the static html and then it will be hosted in a github page.

This solution is not ideal as contibutors have to be more geeky than what is actually needed: they have to clone the repo, install tiddlywiki, do their change and then PR, but the good point is that I get version control for each individual tiddler and I don't have to worry about any overwriting because github will handle the merging process.

willwray commented 2 years ago

(Commenting on a closed issue as I've gone through a similar process)

The new put saver makes multi-editing more robust, with a warning on save if there are conflicting edits. I guess that's a start for a couple of collaborators logging in with the same login, as that's no different from one user logging in from multiple devices, right. Then, in combination with other issues linked here, it looks possible for a couple of users to save with different user names (and password, or api key, or some credential).

I set up a tiddlyhost'ed wiki to test this as a simple way to collaborate on a project, but then can't use it for my work use case...

So, I set up a github workflow similar to Timothee, but without PRs and trying to automate by using the github saver plugin and triggering a github action on a save, which then runs node.js to split out and merge any tiddler changes, and then publishes the result to github pages. The idea was that a couple of users would open the gh pages url, configure the github saver, then go ahead with edits and saves. However, with no automatic syncing, diverging edits can have merge conflicts. The only way to sync is to refresh the page, reconfigure the github saver, and continue. Not great.

Now I've switched to trying to get a self-hosted tiddlyhost up and running, but out of my depth and hitting problems - I'll open a new issue for that.

Thanks for reviving this service - I've claimed a couple of my old tiddlyspot sites, nice to have had them preserved here. Much appreciated.

simonbaird commented 2 years ago

I think there's some potential for a future version of Tiddlyhost to support giving other Tiddlyhost users permission to write to your site, but I don't have a clear plan for it yet.