[TW5] Presenting: the MultiUser wiki plugin (formerly Gatekeeper and TiddlyWebSockets)

338 views
Skip to first unread message

Jed Carty

unread,
Nov 8, 2017, 3:38:48 PM11/8/17
to TiddlyWiki
NOTE: This only works on the node version of tiddlywiki.

Because I am not using them separately and I don't know of a good reason to separate them for now, I combined the two plugins into one and made them work well.

With this plugin you can have a multi-user tiddlywiki when running on node. It is pretty much like the demo from before but this one works better. And prevents multiple browsers from editing the same tiddler. And hopefully just runs smoother in general.

The code can probably be made a bit more efficient in some places but it is ready for beta testing. I have designed in with the idea of having a single tiddlywiki process serving multiple wikis and being able to selectively server specific tiddlers to each connected browser, but those features aren't ready yet.

This plugin has three distinct parts that I don't know if I should split into separate plugins or not since they don't do much on their own:

A file system monitoring component that watches for changes and pushes the changes to connected wikis as they happen, so you don't need to refresh the server.
A web sockets component that could be used to connect to any web socket server, but for now it only connects the browser to the node process for two-way communication.
An annoying but necessary bit of code that determines which changes need to get pushed to which wikis and what to ignore to prevent infinite updating loops. If I never touch this code again I will be happy.

Does anyone have an opinion about if any of the pieces should get their own plugin?

As part of this I had to add some more hooks to the navigator widget. I will make a pull request on GitHub because it doesn't affect what the navigator widget does at all but it was necessary for this, so maybe other people will find it useful.

Jed Carty

unread,
Nov 8, 2017, 3:41:28 PM11/8/17
to TiddlyWiki
I forgot to add the link to the GitHub repo. It has installation instructions. https://github.com/OokTech/TW5-MultiUser

Sylvain Naudin

unread,
Nov 8, 2017, 4:44:40 PM11/8/17
to TiddlyWiki


Le mercredi 8 novembre 2017 21:41:28 UTC+1, Jed Carty a écrit :
I forgot to add the link to the GitHub repo. It has installation instructions. https://github.com/OokTech/TW5-MultiUser

Hi Jed, for sure I'll test this new repo. Great news ! (I read previous thread).
So we don't need to test Gatekeeper anymore ?

Sylvain

Jed Carty

unread,
Nov 8, 2017, 4:45:41 PM11/8/17
to TiddlyWiki
No, everything from Gatekeeper is included in this new version.

TonyM

unread,
Nov 8, 2017, 5:02:42 PM11/8/17
to TiddlyWiki
Jed,

I see no reason for the plugin to be divided for the solution you have given us, however see my coments why I think you may
 
This plugin has three distinct parts that I don't know if I should split into separate plugins or not since they don't do much on their own: 

A file system monitoring component that watches for changes and pushes the changes to connected wikis as they happen, so you don't need to refresh the server.

Could this be used to monitor and notify the tiddlywiki of other files, say to auto catalogue files placed in a folder? I could go a long way with this.

A web sockets component that could be used to connect to any web socket server, but for now it only connects the browser to the node process for two-way communication.

Can we use this to integrate with other solutions and services? 


Does anyone have an opinion about if any of the pieces should get their own plugin?

 
One idea I had that could use the architecture of your solution was a separate log of every tiddler that changes, such that all changes could be retrieved, as a result of the activities of multiple users on multiple wikis.

Lovely work,

I will be testing this in coming days.

Tony
 

Sylvain Naudin

unread,
Nov 8, 2017, 5:05:24 PM11/8/17
to tiddl...@googlegroups.com


Le mercredi 8 novembre 2017 22:45:41 UTC+1, Jed Carty a écrit :
No, everything from Gatekeeper is included in this new version.

OK, so I just test it but didn't see any save function when I create a new tiddler, like node.js version. If I manualy save, it download file like standolone. But I can see tid file in subfolder tiddlers.. If I refresh my TW in browser, I don't see anu tiddler previously created..

Edit : if a reload with another port (:8081 for example), I can see history tiddler now.
If I edit a tiddler on my mobile phone, I can see your icon lock.


coda coder

unread,
Nov 8, 2017, 5:17:07 PM11/8/17
to TiddlyWiki


On Wednesday, November 8, 2017 at 4:02:42 PM UTC-6, TonyM wrote:
Jed,

I see no reason for the plugin to be divided for the solution you have given us, however see my coments why I think you may
 
This plugin has three distinct parts that I don't know if I should split into separate plugins or not since they don't do much on their own: 

A file system monitoring component that watches for changes and pushes the changes to connected wikis as they happen, so you don't need to refresh the server.

Could this be used to monitor and notify the tiddlywiki of other files, say to auto catalogue files placed in a folder? I could go a long way with this.

A web sockets component that could be used to connect to any web socket server, but for now it only connects the browser to the node process for two-way communication.

Can we use this to integrate with other solutions and services? 


Jed,

Yeah, I'm with Tony on this... BIG +1

I'd certainly like to monitor (watch) folders for other things.  The results (a message) is posted to TW to announce the event and a button clicked to send a "start this script" (exec in node?) on the server side (same machine usually).

THAT would be seriously useful.  I think I read a post here where someone was asking about running apps using TW as the client.

Any showstopper security issues doing something like this?
 

Sylvain Naudin

unread,
Nov 8, 2017, 5:33:59 PM11/8/17
to TiddlyWiki
For your information, if I delete a tiddler, I can see on other device "Missong tiddler - clic to create" on river in live mode. But if I recreate the same tddler, It can't refresh this message and we can see error log on terminal.

But it's real live mode for normal editing. Congrats and keep working on it ! Thanks Jed.

TonyM

unread,
Nov 8, 2017, 6:13:26 PM11/8/17
to TiddlyWiki
Coda,

Outside the tiddlywiki node js platform Jed is building this for, I almost have a practical way of exporting commands from tiddlywiki to the Operating system. Node or single file.

My only hump is to export files with my desired file extension without being forced to use txt .tid and .json (cry for help)

This may not seem exactly on topic, but it is simply the inverse of "to monitor and notify the tiddlywiki of other files"

That is a tiddlywiki based generation of those files.

Regards
Tony

coda coder

unread,
Nov 8, 2017, 10:23:56 PM11/8/17
to TiddlyWiki


On Wednesday, November 8, 2017 at 5:13:26 PM UTC-6, TonyM wrote:
Coda,

Outside the tiddlywiki node js platform Jed is building this for, I almost have a practical way of exporting commands from tiddlywiki to the Operating system. Node or single file.


And then you'll need the "watch" plugin to pick it up and know what to do with it -- or am I missing something?
 
My only hump is to export files with my desired file extension without being forced to use txt .tid and .json (cry for help)

TonyM

unread,
Nov 8, 2017, 11:50:15 PM11/8/17
to TiddlyWiki
Coda,

Yup, I write, and something is watching, I'm watching and something is writing to me.

I can imagine keeping a repository of code segments, batch commands, scripts which I export in with the nominated file name and extension, even perhaps import and export "files" that send mail, create other files, run compilers and builds, analyse logs, obtain statistics - the sky is the limit. If I can only choose the extension myself.

The thing is just in time, is often a good working model, I open my wiki and process a backlog, then close my wiki.

Tony

BJ

unread,
Nov 9, 2017, 12:40:04 AM11/9/17
to TiddlyWiki
hi Jed,
Sounds like the watch component could be useful when developing plugins using node.

BJ

Stephen Wilson

unread,
Nov 9, 2017, 5:52:05 AM11/9/17
to TiddlyWiki
AWSOME!!!!
The big question for me then becomes one of hosting.
Where can I stick a nodejs server for not much/ free?

Jed Carty

unread,
Nov 9, 2017, 6:37:41 AM11/9/17
to TiddlyWiki
Keep in mind that what I made is currently designed to only be used on a local network, there is no authentication or privacy or security of any kind. I am planning on adding privacy and security features but I was planning on making it so that tiddlywiki could be multiuser for about 2 years and I just got around to making it, so me planning to do something doesn't come with any promise of a timeframe.

That said, I wouldn't trust a service that offered free node servers. I am looking at available options but I may just put my effort into developing Dodo (another project of mine that will hopefully take care of the hosting problem) and not worry about finding a server to use.

Lost Admin

unread,
Nov 9, 2017, 9:23:56 AM11/9/17
to TiddlyWiki
I do think the WebSockets plugin deserves to be on it's own. I can see it being used without the Node version of TiddlyWiki to interface with other services. I'm not specifically sure what but a situation where TiddlyWiki is used to create the webside and gets served from an otherwise static web server.

Jed Carty

unread,
Nov 9, 2017, 12:57:40 PM11/9/17
to TiddlyWiki
Sylvain,

I have not yet made the dirty indicator go away, since I am not using the normal syncadaptor interface I have to remake a lot of pieces and I haven't gotten to that part yet, so the save icon is currently always going to be red.
I just pushed some changes that should fix the problems that you described. The problem was that tiddlers weren't being removed from the list of tiddler info maintained by the server in some cases. This also fixed some problems with handling system tiddlers that I didn't know existed, so thank you!

I am not synchronising the story list or history list because that makes forces everyone using the wiki to have the same story list. So when you delete a tiddler on one wiki and you have the tiddler open on another the open tiddler will switch to the placeholder. I could make it so that it removes the tiddler from the story list if it is being displayed, but that seems like it would introduce a lot of potential errors to worry about so if I make that an option it won't be for a while.

Jed Carty

unread,
Nov 9, 2017, 1:03:45 PM11/9/17
to TiddlyWiki
For splitting up the plugin, I can split them into multiple pieces but I think I should make this work well before I do that because I don't know how to cleanly separate the components yet or a clean way to determine the dependencies. The file system monitor part can't access the browser without the websockets and the third part that works as the glue is wrapped up in both the web sockets and file system monitor at the moment.

But some good news:

The websockets should let you connect to any web socket server.
The file system monitor could be used to react to changes in the wiki without having to hook into the tiddlywiki itself, but I am not sure exactly how this would be used yet so I am not certain what needs to be exposed.

Sylvain Naudin

unread,
Nov 9, 2017, 3:03:41 PM11/9/17
to TiddlyWiki
Hi Jed,



Le jeudi 9 novembre 2017 18:57:40 UTC+1, Jed Carty a écrit :
I have not yet made the dirty indicator go away, since I am not using the normal syncadaptor interface I have to remake a lot of pieces and I haven't gotten to that part yet, so the save icon is currently always going to be red.

If we know that it's OK for testing and we could hide this icon.

 
I just pushed some changes that should fix the problems that you described. The problem was that tiddlers weren't being removed from the list of tiddler info maintained by the server in some cases. This also fixed some problems with handling system tiddlers that I didn't know existed, so thank you!

You're welcome :)
I made new test and git repo and I can now re-create a tiddler previously deleted on a another device without error.


I am not synchronising the story list or history list because that makes forces everyone using the wiki to have the same story list. So when you delete a tiddler on one wiki and you have the tiddler open on another the open tiddler will switch to the placeholder.

I first waiting for a refresh of list river, but it's OK if we don't update this. It's even a feature, if we collaborate on a live document. And you'are right, to people doesn't necessary watch same tiddler at same time. Or you perhaps imagine a specific feature/version to load a foreing TW controled by one people and other client watching it remotely. For example live demo, or PowerPoint presentation.

 
I could make it so that it removes the tiddler from the story list if it is being displayed, but that seems like it would introduce a lot of potential errors to worry about so if I make that an option it won't be for a while.

So don't, I don't care ;)


Regards,
Sylvain

Sylvain Naudin

unread,
Nov 9, 2017, 3:15:54 PM11/9/17
to TiddlyWiki
I've play with import on my smartphone, so I can take photo and create tiddler (ok it's not the most usecase ^^'). I can see my jpg file created in tiddlers folder on my PC, but the image didn't show on my Firefox PC (if for example I transclude jpg on mobile phone in a tiddler which is OK on smartphone).

Jed Carty

unread,
Nov 9, 2017, 5:03:22 PM11/9/17
to TiddlyWiki
It looks like I need to add whatever handles tiddlers with .meta files. 

I haven't had any trouble with importing normal tiddlers but the import hook never seems to be firing. I am not sure I understand how the code I wrote works.

Jed Carty

unread,
Nov 11, 2017, 6:06:02 AM11/11/17
to TiddlyWiki
I still haven't set up .meta file handling yet but I improved some other handling so there are fewer redundant messages sent and all of the npm modules are included in the plugin. So now you just need to install the plugin and don't need to worry about external npm modules.

This means you can use it with the globally installed tiddlywiki with the plugin.

Hopefully this will make it easier to test this.

I updated the readme, but I am not sure if it is clear so let me know if anyone has problems.
Reply all
Reply to author
Forward
0 new messages