ReadOnly TiddlyWiki

856 views
Skip to first unread message

Tony Grosinger

unread,
Oct 26, 2015, 1:00:02 PM10/26/15
to TiddlyWiki
I am running a TW5 on node.js and have it password authenticated. This means in order to view or edit a username and password must be entered. Is there a way to instead have read access for anyone but require authentication before editing?

Ideally, it would be nice to also specify some Tiddlers as publicly read/write, some as publicly read only, and some as completely private.

Alex Burner

unread,
Oct 26, 2015, 1:07:57 PM10/26/15
to tiddl...@googlegroups.com
+1 
(just trying to subscribe to updates)

Tobias Beer

unread,
Oct 27, 2015, 4:41:21 AM10/27/15
to tiddl...@googlegroups.com
Hi Tony,

Perhaps create an issue at the repo?
Sounds like a good, but sophisticated enhancement for the node server environment.

On the other hand, I'm not sure it is recommended to use node
to actually serve a wiki over the web, atm. But, that may change with this.

There could be additional parameters in TiddlyWiki.info
to specify publicContent and privateContent folders
and a global parameter for all other content set to private / public,
default being public, imho.

Best wishes,

— tb

Tony Grosinger

unread,
Oct 27, 2015, 10:28:32 AM10/27/15
to TiddlyWiki
I just found this issue which I will peruse as time permits and leave my comments there. Thanks @tobibeer

RichShumaker

unread,
Dec 9, 2015, 3:27:16 PM12/9/15
to TiddlyWiki
Hey Everyone,

I followed this thread to the end and over to GitHub.  Read my own posts at Github about RasPi and Node TW5, heheh.  I laugh as I ran into huge roadblocks to my deployment on the RasPi for the Node version of TW5.  It was more me not being able to get around or over the issues and I had a solution that worked 'okay'.  I currently use Bidix.php on the server for HTML version of TW5, not very advanced.  The cool thing is that I can spawn TiddlyWiki's using this method very easily.

I am trying to 'present' or 'export' TiddlyWiki 5 HTML to either Static HTML or view only TW5.
I have a feeling there is a simple button that I click to do this and I apologize ahead of time,  I did research and I could not find it.

I know this is not what Tony is trying to do as he is using Node and would like something I call Tiddler Types inside Node.
I envision Tiddlers Types to include Readable, Editable, Viewable(I call it the CHMOD 777 heheh).
I am not sure this is actually the 'way' you would do it or what you would call them.

I was just building a website using HTML TW5 and I wondered how hard it is to 'export to web' or 'lock for web'.
Since TW5 is a single downloadable file anyone can have your site by simply downloading.  Which is an amazing feature.
Is there an easy way to export the Tiddlers as individual HTML files to allow you to create a 'website'?
Or is there a theme that would allow you to lock out the edit and modification stuff?(Undoing this might be the hardest part as once you turn it on how would you turn it off?)

For Classic TW I used what was called presentation mode TiddlyWiki for RSdC Version 3, then lost my password, the site still works great even if I can't update it.
This Classic TW would allow you to make updates using an Admin log in screen.  Then you could modify and save it once you logged in.

Thanks everyone for your help.

Rich Shumaker

Matabele

unread,
Dec 12, 2015, 1:36:17 AM12/12/15
to TiddlyWiki
Hi

It would appear that this problem could be easily solved by exporting a static html version (which is by nature RO) from an editable nodejs version:

tiddlywiki --verbose --load mywiki.html --rendertiddlers <filter> <template> <pathname>

Locking/unlocking of individual tiddlers by user/group permissions is another matter :-)

regards

On Wednesday, 9 December 2015 22:27:16 UTC+2, RichShumaker wrote:

I am trying to 'present' or 'export' TiddlyWiki 5 HTML to either Static HTML or view only TW5.

Felix Küppers

unread,
Dec 12, 2015, 5:33:33 AM12/12/15
to tiddl...@googlegroups.com
Hi Rich,


Or is there a theme that would allow you to lock out the edit and modification stuff?(Undoing this might be the hardest part as once you turn it on how would you turn it off?)

my suggestion would be to use a dedicated tiddler for turning the wiki on and off

  1. create a tiddler that is named e.g. "backend"
  2. this tiddler contains two buttons
    1. one button named "web" that turns off the visibility of toolbar buttons etc. using action widgets
    2. one button named "admin" that turns on everything (= rw)
    3. both buttons also trigger a wiki save event
  3. once you click "web", all edit buttons are removed and the wiki is saved.
  4. Close and reopen the wiki, it will be in web mode (read only)
  5. NOW TO YOUR QUESTION: how to turn it back to being editable?
    1. in the browser's adress bar add  a "#backend" behind the wiki url
    2. The tiddler "backend" opens
    3. click on "admin"
    4. the wiki will be rw

Hope this technique helps.

-Felix

RichShumaker

unread,
Dec 12, 2015, 1:39:50 PM12/12/15
to TiddlyWiki
Thanks Felix that method makes sense to me. I need to explore implementing it now. This method doesn't stop a 'save as' to get the entire TW5.

Is there an HTML dump inside TiddlyWiki? A Tiddlers 'export' method? Something that converts all TW5 content pages to individual static HTML pages? I know this bloats everything. Except it defeats the functionality of TW5. That is both good and bad thing depending on how you look at it.

Felix Küppers

unread,
Dec 13, 2015, 7:33:28 AM12/13/15
to tiddl...@googlegroups.com
Hi Rich,

> Is there an HTML dump inside TiddlyWiki? A Tiddlers 'export' method? Something that converts all TW5 content pages to individual static HTML pages?

If you want to do a static export of all tiddlers you should follow
Matabeles advice and execute the nodejs command he provided

> This method doesn't stop a 'save as' to get the entire TW5.

You could create a startup module that exports after the story module
and conditionally disables the save handlers…

$tw.rootWidget.addEventListener("tm-auto-save-wiki", function() {});
$tw.rootWidget.addEventListener("tm-save-wiki", function() {});

…if the admin tiddler has not been loaded into the river (via #backend
in the url);

This way the save will be disabled completely.

-Felix

Tobias Beer

unread,
Dec 13, 2015, 8:22:45 AM12/13/15
to TiddlyWiki
Hi Felix,
 
You could create a startup module that exports after the story module
and conditionally disables the save handlers…

    $tw.rootWidget.addEventListener("tm-auto-save-wiki", function() {});
    $tw.rootWidget.addEventListener("tm-save-wiki", function() {});

…if the admin tiddler has not been loaded into the river (via #backend
in the url);

This way the save will be disabled completely.

Not sure this approach is necessary, since you can simply remove the buttons or modify the save settings in the same startup module... but, would you have some code-snippet that does what you suggest, i.e. loading the ore save-listeners depending on whether or not we start the wiki with the "backend" tiddler?

Best wishes,

Tobias. 

Felix Küppers

unread,
Dec 13, 2015, 8:49:32 AM12/13/15
to TiddlyWiki
Hi Tobias,
 
Not sure this approach is necessary, since you can simply remove the buttons or modify the save settings in the same startup module...

Yes, that is what I thought in the beginning as well because autosave could be simply turned off/on but this is not bulletproof against e.g. external plugins triggering a save, hence my suggestion (see code below).
 
but, would you have some code-snippet that does what you suggest, i.e. loading the ore save-listeners depending on whether or not we start the wiki with the "backend" tiddler?

Below is an extract of the code I am using, I also added it as attachment to this post. If you create a js tiddler with this code and restart your wiki you won't be able to save unless you directly start the wiki with "#backend" added to it.

-Felix
 
/*\

title: foobar.js
type: application/javascript
module-type: startup

@preserve

\*/


(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

// Export name and synchronous status
exports
.name = "foobar";
exports
.platforms = ["browser"];
exports
.after = ["story"];
exports
.synchronous = true;

exports
.startup = function() {

 
var tObj = $tw.wiki.getTiddler("$:/StoryList");
 
var isSavingEnabled = tObj.fields["list"].indexOf("backend") >= 0;
 
  alert
("Saving enabled? " + isSavingEnabled);
 
 
if(!isSavingEnabled) {
   
   
// otherwise disable save and autosave

    $tw
.rootWidget.addEventListener("tm-auto-save-wiki", function() {});
    $tw
.rootWidget.addEventListener("tm-save-wiki", function() {});

           
 
};

};

})();



startup.js
Reply all
Reply to author
Forward
0 new messages