TW5 able to trigger/run bash script yet?

121 views
Skip to first unread message

Dave

unread,
Oct 11, 2018, 6:16:28 PM10/11/18
to TiddlyWiki
I understand that the node.js versions of TW (and the new "Bob" I think)have file system access, but I was wondering if the regular variety has made any progress towards this capability yet. 

The thing that made me think this might now be possible is I discovered the "copy-to-clipboard" macro just now and thought "hey, that's pretty close to interacting with the system files..."


So, can we do this yet?
a) have TW5 run a bash script
b) be able to send info to a running TW5 instance *from* a bash script (I doubt this one, but you never know...)
c) (if b can't work) be able to read a text file on the file system (maybe in a "safe" folder that a system root user could write to)


Just wondering,
-Dave

Jeremy Ruston

unread,
Oct 11, 2018, 6:28:10 PM10/11/18
to tiddl...@googlegroups.com
Hi Dave

Funnily enough, a couple of weeks ago I started work on just what you propose: the ability under Node.js to execute external tasks and pipe data in and out. It's early days, but the work can be seen here:


I'm currently working on extending it to support connecting to existing processes via sockets, adding better error support and the ability to trigger things from the browser. Eventually I'd like to support streaming so that one could have processes that emit tiddlers at asynchronous intervals.

Alternatively, you can read and write tiddlers to a running TW5 Node.js instance using the same HTTP API that the browser uses. See https://tiddlywiki.com/prerelease/#WebServer%20API

Best wishes

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e806a69e-ce0b-4334-87df-50a3ca3a43b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave

unread,
Oct 11, 2018, 7:39:35 PM10/11/18
to TiddlyWiki
So that's a "no" for executing a script from a regular vanilla TW?


"emitting tiddlers" <-- sounds dangerous, ha ha

Jeremy Ruston

unread,
Oct 12, 2018, 5:32:56 AM10/12/18
to tiddl...@googlegroups.com
Hi Dave

So that's a "no" for executing a script from a regular vanilla TW?

No, browsers do not allow JavaScript to interact with the system to launch processes because of security concerns, and it’s inconceivable that they would add the ability. The only general purpose approach that is supported by browsers is to have the script running on the server.

Best wishes

Jeremy.



"emitting tiddlers" <-- sounds dangerous, ha ha

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

TonyM

unread,
Oct 12, 2018, 9:41:34 AM10/12/18
to TiddlyWiki
Dave,

As even file based tiddlywiki can export files such as tid and json file you can have what I call a sentenial running on the host monitoring files that appear that meet a predifined filename then process that file which may contain bash scripts or in my working example windows command files which are then executed.

As you say bob offers something similar to execute host commands.

Thus it is not imposible only a little convoluted.

By the way if you look closely the way timimi plugin and related software works, I believe it will be posible to build some host execution or commands eventualy. Of course you want some security built in to stop a website or browser hack from command execution or you will be "owned".

Regards
Tony

Dave

unread,
Oct 12, 2018, 2:36:31 PM10/12/18
to TiddlyWiki
Thank you both :)
Reply all
Reply to author
Forward
0 new messages