Tool to configure multi-user using Cloudant and NoteSelf

417 views
Skip to first unread message

Danielo Rodríguez

unread,
May 16, 2017, 10:20:44 AM5/16/17
to TiddlyWiki
Hello to everyone,

After several days reading CouchDB documentation, Cloudant documentation and a couple of tickets to Cloudant support I found
the way to configure ONE SINGLE cloudant account for several users. 
However the process is tough,  and requires technical knowledge. Because of that I'm proud to present:


It is a small ad-hoc tool designed to make this process easy (or at least easier). It is a bit rough, and the UI must be polished, but I expect it to work for most users.
Pre requisites should be obvious:
  • Being familiar with NoteSelf
  • Have a Cloudant account
  • Have that account configured to be used along with NoteSelf
What does this tool do?
  • Configure Cloudant with the required parameters to activate multi-user scenario
  • Allows the creation of new users
  • Allows to grant access to each database (AKA notebook) individually to each user

Users are created globally and then each user should be granted to each database individually. Except your main user, which is added as admin to every database.

NoteSelf will work just fine with any user you create, however it does not sets the logged in user as author automatically. This will come in a future release.

Hope this makes this kind of configuration easier for those that want to try it out.

Arlen Beiler

unread,
May 16, 2017, 5:05:26 PM5/16/17
to TiddlyWiki
Thank you Danielo, this looks promising. One thing that I wish Noteself (and TiddlyWiki for that matter) would do would be to immediately notify all open instances of any new changes instead of waiting 60 seconds. Also wondering what to do about edit conflicts. Nevertheless, this looks great :)

--
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+unsubscribe@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/8066d98e-aba8-4c5b-9e1b-87eefc034f63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
May 17, 2017, 4:36:34 AM5/17/17
to TiddlyWiki
Hello Arlen


One thing that I wish Noteself (and TiddlyWiki for that matter) would do would be to immediately notify all open instances of any new changes instead of waiting 60 seconds.


NoteSelf (Pouch + Couch) does exactly that. Changes are notified more or less instantly, but we have to wait until tiddlywiki ask us for new tiddlers, which happens each 60 seconds. Of course I could push the tiddler to tiddlywiki at the moment it arrives, but this will trigger the sync mechanism of tiddlywiki, which in turn will send the tiddler back to the sync-adaptor (TiddlyPouch) potentially producing unexpected behaviors. 
I opened an issue on github to improve this behavior:


If you want to contribute or track the resolution of this go an give the issue a thumbs up.
 
Also wondering what to do about edit conflicts. Nevertheless, this looks great :)

Pouchdb tries to resolve conflicts automatically, and it usually succeeds. Take a look here for technical details


Mat

unread,
May 17, 2017, 6:11:11 AM5/17/17
to TiddlyWiki
Really cool you're pushing on with what can be a new paradigm for TW.

When I try to log into Chrome, it gets stuck (first picture here below), i.e nothing happens when I click the green button.
I do use the correct username/password because I do succeed in logging in to Cloudant outside of the NS context.

In FF, I get to the next step but the second picture here comes up. Do I need a db explicitly titled "_users"?

Win10.

<:-)















Auto Generated Inline Image 1
Auto Generated Inline Image 2

Mat

unread,
May 17, 2017, 6:13:56 AM5/17/17
to TiddlyWiki
Oh, and in FF, after clicking "create _users" I get


Auto Generated Inline Image 1

@TiddlyTweeter

unread,
May 17, 2017, 7:32:48 AM5/17/17
to TiddlyWiki
Mat wrote...
Really cool you're pushing on with what can be a new paradigm for TW.

Dead right.

NoteSelf is already a working app. Its also already a very strong proof of concept. The approach solves several issues simultaneously. And the multi-user direction will add even more power to that.

Danielo is just one smart dude doing this. He's demonstrated the underlying architecture of NoteSelf has great practical potential for TW.

My 2 cents
Josiah

Danielo Rodríguez

unread,
May 17, 2017, 9:36:09 AM5/17/17
to TiddlyWiki
Hello Mat


El miércoles, 17 de mayo de 2017, 12:11:11 (UTC+2), Mat escribió:
Really cool you're pushing on with what can be a new paradigm for TW.


Thank for your kind words and for trying the tool. It really helps
 
When I try to log into Chrome, it gets stuck (first picture here below), i.e nothing happens when I click the green button.

That's weird, but can be due to the more strict cross-domain rules chrome has, but I think that is not the problem (read below)
 
I do use the correct username/password because I do succeed in logging in to Cloudant outside of the NS context.

Usually, the first point of failure. If you log into Cloudant, and after that you open or refresh the page, does it log in automatically?

 

In FF, I get to the next step but the second picture here comes up.

That is the expected behavior.
 
Do I need a db explicitly titled "_users"?

That is exactly what the message says. Is it not clear? I thought it was. Having such database is mandatory for this to work properly

Oh, and in FF, after clicking "create _users" I get

That is also very weird. It may be another error that is not being properly captured and that other error message is displayed instead. Have you followed the instructions on the linked video? This tool requires CORS to be enabled on your cloudant account. BUT if NoteSelf works with your cloudant account this should work too.


It will really help me if you can open your chrome developer tools, try to login and provide an screenshot of the console tab and the network tab.
Many thanks. 

Stephen Wilson

unread,
May 18, 2017, 3:51:00 AM5/18/17
to TiddlyWiki
Interesting! I'll have to have a look at that.
Quick question, and a simple 'NO' will suffice for an answer but.....
Can I put noteself lftiddlywikis on tiddlyspot?

Stephen

Danielo Rodríguez

unread,
May 18, 2017, 7:07:03 AM5/18/17
to TiddlyWiki
Hello Stephen


El jueves, 18 de mayo de 2017, 9:51:00 (UTC+2), Stephen Wilson escribió:
Interesting! I'll have to have a look at that.
Quick question, and a simple 'NO' will suffice for an answer but.....
Can I put noteself lftiddlywikis on tiddlyspot?

The empty edition of NoteSelf is nothing but an HTML file. You can serve it from any host provider, this includes tiddlyspot, yes.

Regards

Stephen Wilson

unread,
May 19, 2017, 4:23:16 AM5/19/17
to TiddlyWiki
Hello Danielo,

I have run into the same problem as Mat on both FF and Chrome, 'Server Admin access is required for this request'.  I have tried logging into to cloudant and refreshing but get the same result.  I have created a _users datbase as well but still get told I need don't have one.  CORS is on.

Console Tab:

Network Tab





I have also attempted to upload a blank noteself to a tiddlyspot using the tiddlyspot save mechanism and get:

This happens if I drag the pouch plugin over as well.


Stephen

Danielo Rodríguez

unread,
May 19, 2017, 8:01:04 AM5/19/17
to TiddlyWiki


Hello to everyone that has tested the library.
There was a bug where every login attempt and petition to the cloudant service was using my personal username/account. Very convenient for me, but some kind of problem for everyone else.
It should be fixed now. 
Hope you can give it a second try

Mat

unread,
May 19, 2017, 8:45:44 AM5/19/17
to tiddl...@googlegroups.com
@Danielo
 
I may have found my mistake, or at least one! In your video you point to a few databases but I had assumed that "one db = one notebook", i.e that the databases you point to were mere examples of notebooks you had installed.

But, if I now understand right,  _users is required. [Edit: previously I also said "and _replicator " to which Danielo replies that _replicator should NOT be necessary]

If this insight is correct, I suggest a test in the NoteSelf-Cloudant configurator for _replicator similar to _users, and if _replicator is missing then this is created also.

So, now I get the setup to work with Firefox!

 

 
Do I need a db explicitly titled "_users"?

That is exactly what the message says. Is it not clear? I thought it was. Having such database is mandatory for this to work properly

Well that message is clear per se - but in your first post here you typed very clear prerequisite instructions where this was not mentioned. So when I don't succeed it made me think that maybe this "_users" requirement means something is wrong.


It will really help me if you can open your chrome developer tools, try to login and provide an screenshot of the console tab and the network tab. 

E-mailing you a few shots.


<:-)

Mat

unread,
May 19, 2017, 8:55:06 AM5/19/17
to TiddlyWiki
@Danielo
My post here above was written before I read Ste's and your post just above.

However, as noted, I still (now) don't get it to work on Chrome. See personal email with screendumps.

<:-)

Danielo Rodríguez

unread,
May 19, 2017, 9:03:08 AM5/19/17
to TiddlyWiki


El viernes, 19 de mayo de 2017, 14:45:44 (UTC+2), Mat escribió:
@Danielo
 
I may have found my mistake, or at least one! In your video you point to a few databases but I had assumed that "one db = one notebook", i.e that the databases you point to were mere examples of notebooks you had installed.

That is correct. Right now one "db = one notebook". The _users db is just one exception.
 

But, if I now understand right, both _replicator and _users are required!

Never heard about the _replicator db. Should not be necessary, I don't have such db.
 

If this insight is correct, I suggest a test in the NoteSelf-Cloudant configurator for _replicator similar to _users, and if _replicator is missing then this is created also.

So, now I get the setup to work with Firefox!
 


 
That is exactly what the message says. Is it not clear? I thought it was. Having such database is mandatory for this to work properly

Well that message is clear per se - but in your first post here you typed very clear prerequisite instructions where this was not mentioned. So when I don't succeed it made me think that maybe this "_users" requirement means something is wrong.

That detail is not included on the pre-requisites intentionally. The target of the tool is to help you configure your cloudant account. Creating the required _users database is one of the things the tool is made for. For that reason, if it does not exist we warn the user and offer one solution, which is clicking the button that creates that database. This should be something like a wizard (like windows installers) 
Ej: You need an _users db, click here to fix this problem - click - done. Next step. You need to enable this database, click here to fix this problem - click - done. Next step.

If you feel confused about any of those messages/situations maybe the message should be more clear. I don't want to create the database silently because I want to give the user the choice.
 

E-mailing you a few shots.


Thanks I'll take a look. Have you tried with the latest version ? I just fixed one stupid bug.

Thanks Mat

Stephen Wilson

unread,
May 19, 2017, 9:11:10 AM5/19/17
to TiddlyWiki
Works like a charm.  New user set up.

Mat

unread,
May 19, 2017, 9:56:50 AM5/19/17
to TiddlyWiki
On Friday, May 19, 2017 at 3:03:08 PM UTC+2, Danielo Rodríguez wrote:
Never heard about the _replicator db. Should not be necessary, I don't have such db.

Hm, OK but in the video you do (time 1:05 and 4:00)

 
 "_users"

That detail is not included on the pre-requisites intentionally. The target of the tool is to help you configure your cloudant account. Creating the required _users database is one of the things the tool is made for.

That makes sense. Again, it is because it didn't work for me that I was guessing that OK, maybe that was also a prerequisite. I'm telling this not to "justify myself" but to make a point that users can draw this erroneous conclusion, as I did, when the setup doesn't work.

 
E-mailing you a few shots.
Thanks I'll take a look. Have you tried with the latest version ? I just fixed one stupid bug.

Yes, the shots are from latest version.

<:-)

Dmitri Lapin

unread,
Aug 11, 2017, 9:08:37 AM8/11/17
to TiddlyWiki
Hello to everyone,

I'm trying to find a way to switch users. Once I entered credentials I can't make authentication dialog display again.
Can anyone please suggest a solution to switch users? Preferably some icon in page toolbar that will open credentials dialog.

Thanks!

Danielo Rodríguez

unread,
Aug 17, 2017, 5:18:34 AM8/17/17
to TiddlyWiki
Currently there is no logout method. It's something should definitely exist. I'll try to add it as soon as possible
Reply all
Reply to author
Forward
0 new messages