TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8k stars 1.18k forks source link

Feature to toggle Tiddlers to private/public? #2323

Closed robrechtdr closed 6 years ago

robrechtdr commented 8 years ago

Given a public TiddlyWiki5 instance, is it possible for a user who has writing access[1] to toggle a Tiddler to private mode[2]?

Note that this functionality is different (and much more convenient imo) from the per-Tiddler encryption plugin and looks desirable to be implemented in TiddlyWiki5 entirely.

This is an extremely important feature because right now if people want to use TiddlyWiki as a public profile space and use it for personal stuff, you need to juggle two wikis. This is so inconvient it keeps you from using it as a public platform at all[3].

P.S. : Another related, useful but less essential feature (probably more desireable as a plugin) is having a draft/publish state such that when you edit a Tiddler your content is first stored as a draft. Saving just saves the draft, only publishing makes the edited content viewable by users with read-only access.


[1] I.e. a User who confirmed the wiki-wide password. [2] Only viewable by people who confirmed the wiki-wide password. [3] Having an audience drives you to keep the quality high, while if the quality isn't high enough a wiki is not so useful.

Jermolene commented 8 years ago

Hi @robrechtdr I considered pretty much the functionality that you suggest but ended up going with the all-or-nothing approach you see today. My concern was that it might be difficult for users to be certain that the tiddlers they expect are encrypted. It's hard to provide a user interface that makes things clear, and so I went with the simpler option.

If you're managing a public and private wiki the other approach is to use a static HTML export for publishing stuff. That way you get a lot of control over how you publish, and your visitors don't have to download all the JS when they are just viewing the site.

Anyhow, if you wanted to experiment, all the pieces are present in the core, and I'd encourage you to explore if you're comfortable with JavaScript.

robrechtdr commented 8 years ago

Hi Jeremy,

I haven't yet noticed and find it hard to imagine a significant discrepancy between interfaces from different applications in terms of ease to ascertain if an individual item (for this application a Tiddler) is encrypted or not. Could you elaborate?

If a user wanted to check the encryption of a Tiddler they'd just open an incognito browser session and search for a private Tiddler in their wiki, if they can't find it, then they've shown it's inaccessible right?

And even if some users don't feel like doing the described test or feel the need to test it for every single Tiddler they encrypted they could just simply not use the per-Tiddler private/public mode.

I feel like I'm missing something.

ldvjava commented 8 years ago

Hi robrechtdr, I'm also finding a solution for toggle private/public. no result, so I want to do it by myself:) The solution provide by Jermolene is a solution which I have ever consider about. But static export can only got a static html without dynamic animate which is cool for TiddlyWiki.

Jermolene commented 8 years ago

Hi @ldvjava you can also export a tiddlywiki with a filtered subset of the current tiddlers, allowing you to export just the public tiddlers.

First, create a new template tiddler called $:/_publicexport:

\define saveTiddlerFilter()
[is[tiddler]] -[[$:/boot/boot.css]] -[[$:/HistoryList]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]]  
[all[shadows+tiddlers]tag[public]]
+[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}

Then invoke the export with a button like this:

<$button message="tm-download-file" param="$:/_publicexport">
export public
</$button>
Jermolene commented 8 years ago

Apologies @ldvjava I made a typo in the above response, now corrected.

sukima commented 8 years ago

I answered on the google groups about this. I ended up implementing the same idea @Jermolene had. I also showed the relevant files I used to do it in this gist

Basically I tag any tiddler I want private with the Private tag. Then my tiddlywiki.info file has two build commands in it.

  1. Uses my custom AllPublicTiddlers template (which is pretty much an exact copy of the default AllTiddlers template with the [!tag[Private]] filter added. Which outputs the file index.html.
  2. Uses the default AllTiddlers template as normal. Which outputs the file private.html.

With this the public folks would see index.html which only includes tiddlers which do not have the Private tag. And for the members of my super-secret-special club they can load the private.html version. I can even put the private.html behind HTTP basic auth or in some other secure spot.

Meta

Is this still an issue or can it be closed?

L4D15 commented 8 years ago

I would love to have this feature. I use Tiddlywiki for my roleplaying games, and it would be awesome to be able to point my players to the Tiddlywiki and reveal them tiddlers as we play while I maintain private info away from my players' eyes. As of now, if I share the Tiddlywiki with them, they will get spoiled by seeing more tiddlers than they should before getting to that section of the story.

Any chances this will get implemented?

danielo515 commented 8 years ago

Dear @L4D15, for your particular use case have you considered using my encrypt single tiddler plugin? You can encrypt each tiddler with a different password. In my opinion it could be fun if you encourage your players to discover the password of the next encrypted tiddler. Regards

danielo515 commented 8 years ago

Regarding the main topic, how do you exactly expect the content to be hidden without encryption if you share your entire wiki?

L4D15 commented 8 years ago

Can I later on permanently unencrypt it to make it available without the password?

If that's the case, that could be a good solution!

El 26 ago 2016, a las 18:04, Daniel Rodríguez Rivero notifications@github.com escribió:

Dear @L4D15, for your particular use case have you considered using my encrypt single tiddler plugin? You can encrypt each tiddler with a different password. In my opinion it could be fun if you encourage your players to discover the password of the next encrypted tiddler. Regards

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

L4D15 commented 8 years ago

Maybe making the tiddler readable if you are logged in as the admin/author user, otherwise you can't see its content. There is already a "login" system to allow editing, right? Adding a tag/field/whatever to the tiddler to make it public (everyone see it) or private (only the admin can see it).

El 26 ago 2016, a las 18:05, Daniel Rodríguez Rivero notifications@github.com escribió:

Regarding the main topic, how do you exactly expect the content to be hidden without encryption if you share your entire wiki?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

danielo515 commented 8 years ago

Can I later on permanently unencrypt it to make it available without the password?

That's the default (and by the moment unique) behavior. In fact you have to re-encrypt it if you want to save it encrypted again

danielo515 commented 8 years ago

Maybe making the tiddler readable if you are logged in as the admin/author user, otherwise you can't see its content

My plan is to implement a mechanism that detects when an tiddler and is loaded. Then it tries to unencrypt it with the saved password. If it succeed then it is shown, otherwise it is shown as an encrypted one.

Please keep in mind that that was my first plugin, and both my abilities and TW itself were limited at that time. Maybe because it's simplicity it has been working since TW versions as old as 5.0.7

tobibeer commented 8 years ago

I can imagine a workflow for a "private-mode" or "secret-mode" whereby:

  1. you can flag tiddlers as private (via tag or field)
  2. have an encryption module encrypt all these tiddlers upon saving
    • but possibly decrypt them right away again
      • so you don't have to do that yourself every single time you just wish to save your wiki
  3. whereas encrypted private tiddlers would not ever be listed anywhere until globally decrypted
    • the core would know they're there but not return anything about them in a visible manner

I guess 2. and 3. above are the missing functionalities today, whereas 3. possibly involves major core changes and 2. could simply be another encryption plugin.

danielo515 commented 8 years ago

@tobibeer I have plans to implement 2 on my plugin. It's straightforward and people demand it a lot. But the implementation would differ from what you described. My plan is to unencrypt the encrypted tiddlers to temporary tiddlers, and use an special view template to display them on the original tiddler. That way I don't have to take care about encrypting them again

Regards

tobibeer commented 8 years ago

@danielo515

My plan is to unencrypt the encrypted tiddlers to temporary tiddlers, and use an special view template to display them on the original tiddler.

How would you edit the original(s) then? ...by decrypting them again, individually, with another button / plugin?

turbojava commented 8 years ago

Hi guys, I realized this feature. It works fine for me. My idea is not encrypt/decrypt tiddlers, but to make a filter for login user or public visitor. Detail on: http://www.infobus.com/static/Hack%20Tiddlywiki5%20to%20toggle%20tiddlers%20private%2Fpublic

I know the better way is to make a plugin or direct support by core. It seems difficult to make a plugin, because it need hack a lot of codes in core.

Anyone can help on it? I think it's a useful feature.

pmario commented 6 years ago

@robrechtdr .. Could you solve your problem? If yes, please close the issue!

Jermolene commented 6 years ago

Thanks @pmario. I'm closing this because there is no agreed, actionable proposal.