Real-time updates to wiki

140 views
Skip to first unread message

Patrice Neff

unread,
Jun 30, 2021, 8:31:59 AM6/30/21
to tiddl...@googlegroups.com
Hi all,

I have some questions about using the Node.js version of Tiddlywiki. To give
some context on the insanity I'm trying to achieve, let me give you some
background first.

I use TiddlyWiki as a standalone HTML page. As my principal tools I use
TiddlyWiki desktop on Mac (which has unfortunately become a bit unstable on M1,
something I'll want to investigate separately) and Quine on iPad and iPhone.

I have tried going the Node route a few times, but have always given up on it,
as I couldn't find a good way to use it on mobile without having to download
the entire wiki every time. My two main wikis are currently 10 MB and 6 MB in
size, which on mobile adds up. Also I never found a good way to have those
wikis offline.

One slightly crazy thing I do with my wiki is that I synchronise quite a bit of
data into it. For example I have a homepage generator that downloads some
cartoons (storage is with `_canonical_uri` but there is still a wiki update as
well) or a script that regularly puts in Google calendar events into my wiki,
so that I have a natural place to put meeting notes. I have created this myself
as a Python tool.

When doing this, I would love for my wiki to be automatically updated in the
browser, to avoid write conflicts, and even just to avoid having to remember to
re-open the wiki regularly.

I am aware that solving this issue with the desktop mode is going to be almost
impossible, so I am assuming I'll need to migrate to the server setup. The
questions that I would love your collective insights on are specifically these:

1. Is there a good iOS mobile setup with a server-side Tiddlywiki?

2. What is the best way to write to a server-side wiki programmatically? Would
you write the `.tid` files directly, or use the import functionality, or
something else entirely?

3. Is there a way to push changes automatically to connected clients without
requiring a full wiki reload? I seem to remember having seen this at some
point.

Thank you for all your help.

Patrice

TW Tones

unread,
Jun 30, 2021, 7:06:08 PM6/30/21
to TiddlyWiki
Patrice,

You ask A serious question here, I hope others will help. First some quick points.
  • What ever solution the wiki needs to be hosted somewhere all your required devices can access
    • Alternatively you could use a sync process 
  • Only Bob offers tiddler level locks out of the box ie multi-user/access
  • One trick is to install bob on your mobile device, (not too easy) android can use termux to install it in
    • Then you connect your mobile to you local area network and access it from your desktop browser as well. But it goes with you when you leave home.
  • Unfortunately you should move to a node version if you are going to include a lot of images or other media.
  • I am working on a method to allow login and logout or checkout and check in on single file tiddlywikis, which could insist it is only editable on one "device/browser at a time" where ever it is hosted.
  • I recently discovered w3schools free spaces allows you to host a single file tiddlywiki on the internet which gives you a url that only works if you are logged into spaces. It may do more than this.
  • If you have a standard hosting service, you can use tw-receiver with php. There are various ways to use cloud storage, Google Drive and Dropbox.

Regards
Tones


Patrice Neff

unread,
Jul 1, 2021, 3:48:29 AM7/1/21
to tiddl...@googlegroups.com
Hi Tones,

Thank you for your response. The topic does indeed seem to be a difficult one.

> - What ever solution the wiki needs to be hosted somewhere all your
> required devices can access

Agreed. I handle that so far with my NAS, which I have exposed as an SSH
server. Doing the same thing over HTTP(s) would be trivial.

> - Alternatively you could use a sync process

That could be a very interesting approach if feasible. For example syncing
between a standlone HTML file and a folder of .tid files might solve most of my
problems. But I imagine that sync to be rather difficult to implement.

Or has this been done before?

> - Only Bob offers tiddler level locks out of the box ie multi-user/access

Good to know. I had looked at Bob in the past, but never got it running fully.
I shall retry it.

> - One trick is to install bob on your mobile device, (not too easy)
> android can use termux to install it in
> - Then you connect your mobile to you local area network and access
> it from your desktop browser as well. But it goes with you when you leave
> home.

That is why I specifically mentioned iOS as my devices, as I don't have this
option.

> - Unfortunately you should move to a node version if you are going to
> include a lot of images or other media.

Surprisingly I have been fine with that so far. I use the `_canonical_uri`
field and currently manage about 1,700 attachments in my main wiki.

> - I am working on a method to allow login and logout or checkout and
> check in on single file tiddlywikis, which could insist it is only editable
> on one "device/browser at a time" where ever it is hosted.

Interesting approach! My syncing process though has the opposite goal, as I
would really like to keep adding to the wiki in the background, while I have
the wiki open and sometimes editing in the UI.

Thanks,
Patrice

Jeremy Ruston

unread,
Jul 1, 2021, 4:02:04 AM7/1/21
to tiddl...@googlegroups.com
Hi Patrice

1. Is there a good iOS mobile setup with a server-side Tiddlywiki?

I’ve successfully run the Node.js configuration of TiddlyWiki using a JavaScript IDE app called Play.js. There are some instructions here:


2. What is the best way to write to a server-side wiki programmatically? Would
  you write the `.tid` files directly, or use the import functionality, or
  something else entirely?

Use the HTTP interface, perhaps via Curl or wget:


3. Is there a way to push changes automatically to connected clients without
  requiring a full wiki reload? I seem to remember having seen this at some
  point.

Non-system tiddlers are synced from the server to the client automatically, but by default it is done by polling so it takes a few seconds for the latest changes to appear.

Best wishes

Jeremy.



Thank you for all your help.

Patrice

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/20210630102437.e7swusu5qltkwdrl%40nimrod.local.

PMario

unread,
Jul 1, 2021, 4:11:28 AM7/1/21
to TiddlyWiki
Hi Patrice,
That's an interesting setup. ... If you write a .tid file into the store area at a default node server, you still have to restart the server and reload the clients. ... I don't know "bob" so I can't say if this situation can be handled there.

On the other hand you did mention python, so I assume you should be able to directly send new content to the server using the tiddlyweb protocol.

The new prerelease contains a new setting for the listenCommand. which allows you to enable Server Sent Events.
So if you send new content to this server it will automatically transferred to connected clients.

So you can upload a new image to your file store and then send a new tiddler with a _canonical_uri to the server, which will make it available to the clients.

The existing implementation of SSE is _not_ a multiuser environment yet. But with some tweaks it can be one in the future.

-mario

Patrice Neff

unread,
Jul 1, 2021, 8:19:25 AM7/1/21
to tiddl...@googlegroups.com
Hi Jeremy,

> I’ve successfully run the Node.js configuration of TiddlyWiki using a
> JavaScript IDE app called Play.js. There are some instructions here:
>
> https://groups.google.com/g/tiddlywiki/c/V0mQdPFR8Wg/m/xIorh3rDBQAJ

That is pretty crazy (good crazy though). I need to try this.

> > 2. What is the best way to write to a server-side wiki programmatically?
> > Would you write the `.tid` files directly, or use the import
> > functionality, or something else entirely?
>
> Use the HTTP interface, perhaps via Curl or wget:
>
> https://tiddlywiki.com/#WebServer%20API%3A%20Put%20Tiddler <https://tiddlywiki.com/#WebServer%20API:%20Put%20Tiddler>

Very cool, thank you.

>
> > 3. Is there a way to push changes automatically to connected clients without
> > requiring a full wiki reload? I seem to remember having seen this at some
> > point.
>
> Non-system tiddlers are synced from the server to the client automatically, but by default it is done by polling so it takes a few seconds for the latest changes to appear.

Ok, so that sounds like it should work then.

I'll run a few experiments, shall finally take the plunge to the server
version, and will keep the list posted.

Best,
Patrice
Reply all
Reply to author
Forward
0 new messages