Bug 8217

Summary: Improve set up process ease of use
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: brian avery <brian.avery>
Status: VERIFIED FIXED QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: Medium CC: alexandru.costinx.roman, belen.barros.pena, jessica.zhang, stanciux.mihail
Version: 1.8   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Belen Barros Pena 2015-08-27 12:39:48 UTC
The existing Toaster set up process requires users to:

1. Set a user name and password for the Django admin interface
2. Set the directory where Toaster will store build artifacts such as logs
3. Set the directory where Toaster will check out the layers required for builds
4. Set the build directory

The above is too complicated. Step 1 causes no trouble, or maybe just little trouble by comparison with steps 2 to 4. It's very difficult to properly explain those steps in the CLI, so Brian Avery has suggested that it would be better if the Toaster setup script set defaults for all those values, which users can later change using the Django admin interface. This would potentially allow a one-step Toaster setup: you run a script, and Toaster comes up.
Comment 1 Belen Barros Pena 2015-08-27 12:40:43 UTC
This sounds like an excellent idea, except for one bit: the Django admin interface username and password. Brian's suggestion is to set up default credentials.

That approach will cause trouble. The problem with default user names and passwords is that users do not know they exist, and when they find out they exist, they don't know what they are. It is hard to make users aware that such default credentials exist. Classic example of the problem in our very own mailing list:

https://lists.yoctoproject.org/pipermail/yocto/2015-July/025405.html

Even if we were to make them available somehow in the Toaster UI (the landing page) and the Toaster manual, this does not guarantee users will see them. Mainly because they are not necessarily looking for them at the time they are presented (in the case of the landing page). There is also the small detail of people not changing the default credentials [1], which to add insult to injury, will probably need to be published in the Toaster manual. 

A default username and password is the same as no authentication, so my suggestion was to have the admin interface accessible without login, or require people to create the super user as part of the log in process.  This would require tampering with the Django auth system, since out of the box it requires a superuser account, and we don't really have time for this kind of thing right now. 

So my second suggestion would be to keep the superuser set up step, so that 1) users are aware that the username and password exist, and 2) they have a better chance of recalling them when needed (since they created them themselves). 

Much better to be transparent and keep users in control by allowing them to set their own credentials. No person that I know of has been prevented from using Toaster due to the Django super suser set up step, but I am sure some people will get pretty pissed of when they try to access the Django admin interface only to find that they have no idea what the log in credentials are.

So I hope we can leave the super user creation as is and make the Toaster set up a two-step thing. 

[1] http://dl.acm.org/citation.cfm?id=1179576.1179598
Comment 2 Belen Barros Pena 2015-08-27 12:44:44 UTC
This enhancement will require significant changes to the manual, particularly to section 3

http://www.yoctoproject.org/docs/1.8/toaster-manual/toaster-manual.html#toaster-manual-setup-and-use
Comment 3 Belen Barros Pena 2015-09-02 15:45:55 UTC
After a quick chat during our public call, we are leaning towards not setting a super user at all, and provide instructions in the manual on how to create it after the fact.
Comment 5 Alexandru Roman 2015-11-06 14:32:16 UTC
Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1