TW5 with multiple node.js instances using Google Drive as a data store

177 views
Skip to first unread message

Greg Hodgins

unread,
Dec 26, 2016, 8:31:17 PM12/26/16
to tiddl...@googlegroups.com
Hello and happy holidays all.  I am a new TW user.  My initial excitement remains with TiddlyMap as it gets me closer than I have ever been to a vision of dynamically displaying what now believe I understand is a concept map vs. a mind map.  Mind maps always left documenting some components of information systems shy of my vision. In retrospect their only providing a single parent was probably the limitation.  Anyhow, I'm just starting to work with both and am very excited.  So excited I've whiled away hours and hours over the Christmas vacation so far. :-)

Not only has TiddlyMap caught my attention but so has TW for more than just TM.  I can really see TM providing value for various Tiddlers I might create.

I thought I would drop a quick note and let you know what I whiled away the hours on. I didn't get to the real work while I tried to get the "right" implementation to fit my needs - or what I think my needs are.  I won't go into all the details now or share any scripts.  The reason is they are true hacks at this point.  It's been a few years since I really delved into Linux, but I recall, not with all that much fondness, the trouble in sifting through various configurations that seem to constantly be changing. You never know which one is the correct path to follow.  Do I use init.d or upstart as an example.  There are so many variants in commands/implementations.

Anyhow, I digress.  I just want to share what I have done in the hope that others might benefit, or I will benefit by others telling me not to do what I am doing before I have a problem. ;-)  I also have one final gap that someone might have a clever suggestion for.

Here is what I have done (although it was not a direct path).  I've installed node.js on my local Windows machine and on an Ubuntu server hosted at AWS.  I installed NGINX as a proxy in order to get SSL working.  I installed google-drive-ocamlfuse and mounted my Google Drive on the Ubuntu server. Obviously it is easily available on the Windows machine.  I appear to be able to use both the local copy offline (local node.js) as well as connect to the Ubuntu instance.  I expect I could have another node.js on Android. My only challenge appears to be a conflicting $__config_tiddlyweb_host.tid that has to be renamed when I am operating local (and the server restarted).  I'm hopeful that I might beat that too.  Maybe something as simple as not syncing said file.

Absolutely no more time to play for the next couple of days so I thought I would throw out this note before shutting down.

All the best everyone.

Many thanks to those that developing these amazing tools!!!

Greg

Tobias Beer

unread,
Dec 27, 2016, 7:13:17 AM12/27/16
to TiddlyWiki
Hi Greg,

Can you perhaps summarize what you're trying to achieve and how the different services / components fit into the picture?

What I would find interesting is an environment where you have different node.js configurations whereas the web-facing env, perhaps AWS, would provide read-only access only while the local server gave you read-write privileges. Otherwise, if all endpoints provide the same read-write capabilites, what auth process do you plan on using so as to protect your web-faging server from visitors whom you don't want to grant write privileges?

Best wishes,

Tobias.

Greg Hodgins

unread,
Dec 28, 2016, 7:39:47 AM12/28/16
to TiddlyWiki
Hi Tobias.

What I was originally trying to achieve was a reliable method of accessing my wikis from anywhere. I'd already read about the node.js deployment method, believed this method had a more robust foundation for storage and access (while still allowing the attractive save as a single file when beneficial) and had it running locally in minutes.  

In retrospect those are the primary reasons I ended up with node.js hosted in the cloud.   I wanted SSL for the obvious reasons and at the end of the day NGINX was pretty simply to deliver on that.  The challenges, as is often the case, was the very specific combined syntax requirements of the NGINX config file (not to mention which of the various files) the tiddlywiki --server command including the paths necessary to support multiple wikis, and then the server config tiddler, which I'm wondering if it is part of TiddlyWeb or not.  I was looking at TiddlyWeb.  Initially didn't understand what it was.  I looked to switch to it, as a more robust multi-user platform (right???), but found it was the original TiddlyWiki not TW5.  I like the prospect of TW5.

So, I wanted a reliable method of accessing wikis from anywhere.  Node.js in the cloud delivered on this front.  Then I decided I wanted to be able to edit it offline.  I'm actually on a two day car trip right now.  I thought of tools I used in the past like rsync but then wondered if perhaps OneDrive or Google Drive might offer a solution.  I already use them both on my laptop.  A quick search revealed the ability to mount Google Drive from Linux. With that done I now appear to have the ability to edit online or offline with offline changes done to Google drive syncing back on connect.

You're correct about the potential conflicts, minimally in the server config tiddler save configuration (none/local vs. https://xyzwiki.domain/path/.  However, currently I am only looking at a single user configuration, so I am just managing that tiddler manually with a startup script on the local version.  It removes the config tiddler on startup, then puts it back on shutdown.  I have not worked with this enough yet to know whether it is reliable.

I can actually see other changes on switching between different clients and potentially local node.js servers being beneficial to change the theme/layout depending on the device, in particular my an Android phone.  However, while I now have node.js on my phone ready to go, it doesn't look like offline access to Google Drive contents from the phone within node.js is going to be a "no brainer" like on the laptop.

To your point making the cloud version read-only for sharing could provide benefit. I do indeed want to share some of the wikis in that fashion.  They can even be encourage to save their own local copy I gather.  However, I also want to be able to edit it via that server when I am on some foreign device with just a browser.  I could start up two instances for this.

So my desires in summary are:

  • Ability to access from any location or device (or as close to this as possible)
  • Ability to make offline changes that sync across all devices

Future considerations/thoughts:

  • Multi-user collaboration on wikis
  • Versions/version control of individual tiddlers

P.S.  Is there a TW roadmap page somewhere?  A page that includes the original and TW5 differences in terms of offshoot development and support - plugins, extensions, hosting options.

Thanks very much.  I appreciate any insight or advice on above.

All the best.

Tobias Beer

unread,
Dec 28, 2016, 4:15:14 PM12/28/16
to TiddlyWiki
Hi Greg,

As I recall, the main aspect for taking TiddlyWiki back to the architectural drawing board was to stop managing it as an application based on DOM manipulation in the browser alone, but to encapsulate the object layer in a pure javascript driven manner, decoupling it from a browser, thus opening the doords to more server- / console-like environments such as node.js... which TiddlyWiki classic didn't quite cater for, with plenty reliance on DOM interaction, eventually built around jQuery.

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages