Bug 37616 - Show app license agreement on startup of app appliances
Show app license agreement on startup of app appliances
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Setup wizard
UCS 4.0
Other Linux
: P5 enhancement (vote)
: UCS 4.0-1-errata
Assigned To: Alexander Kläser
Erik Damrose
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-26 10:02 CET by Nico Gulden
Modified: 2015-04-16 10:50 CEST (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Gulden univentionstaff 2015-01-26 10:02:10 CET
Some apps have a LICENSE_AGREEMENT file. The content is shown before the app is installed in the App Center and the user has to confirm it or the app will not be installed.

App appliances of such apps do not show the license agreement at any point and the user does not have to confirm it. This behaviour should be changed in a way that the LICENSE_AGREEMENT is shown during the setup process of the virtual appliance.

The ISVs trust that every user has confirmed the LICENSE_AGREEMENT and we should take care that this is also true for the app appliances.
Comment 1 Alexander Kläser univentionstaff 2015-04-07 12:23:17 CEST
Fixed. As discussed with Eric, I added the UCR variable umc/web/appliance/data_path. This variable is handled as a prefix, i.e., given the according prefix (the prefix could point directly to the cached app center data directory, e.g., "/var/cache/univention-management-console/appcenter/horde_20131118."... note the "." at the end of the string). The python module automatically checks for the (localized) LICENSE_AGREEMENT file which is then passed over to the JavaScript module part. I added descriptions for all three UCR variables that can be used for app appliances (the previous two variable descriptions were missing).

univention-system-setup (8.1.66-30):
r59613 | Bug #37616: add descriptions for app appliance UCR variables
r59612 | Bug #37616: allow to display a license agreement in the ApplianceWizard

I also adapted the appcenter package in order to avoid license loading during an import of the app_center python module itself. When starting an app appliance, the LDAP server is not runnig, i.e., loading the license would lead to waiting for ca. 10sec until a warning would be written into the log files that the license could not be loaded.

univention-management-console-module-appcenter (4.1.20-19):
r59611 | Bug #37616: avoid loading of license object during import of app_center

Packages are building.
Comment 2 Alexander Kläser univentionstaff 2015-04-07 12:36:44 CEST
Added YAML files... package versions are still missing.

r59614 | Bug #37616: add YAML files
Comment 3 Alexander Kläser univentionstaff 2015-04-07 12:39:32 CEST
(In reply to Alexander Kläser from comment #2)
> Added YAML files... package versions are still missing.
> 
> r59614 | Bug #37616: add YAML files

Fixed.

r59615 | Bug #37616: adapt package versions
Comment 4 Florian Best univentionstaff 2015-04-08 13:42:11 CEST
This [svn r59611] breaks that the correct UUID is sent to the maintainer when uninstalling a App.
Comment 5 Florian Best univentionstaff 2015-04-08 16:02:24 CEST
(In reply to Florian Best from comment #4)
> This [svn r59611] breaks that the correct UUID is sent to the maintainer
> when uninstalling a App.
I would just add LICENSE.reload() in some __init__ method. E.g. Application.__init__() or in Instance.init() (and in univention-{add,remove}-app).
Comment 6 Alexander Kläser univentionstaff 2015-04-09 16:34:01 CEST
(In reply to Florian Best from comment #5)
> (In reply to Florian Best from comment #4)
> > This [svn r59611] breaks that the correct UUID is sent to the maintainer
> > when uninstalling a App.
> I would just add LICENSE.reload() in some __init__ method. E.g.
> Application.__init__() or in Instance.init() (and in
> univention-{add,remove}-app).

The following fix should be fine:

r59674 | Bug #37616: make sure that the license is loaded when accessing the UUID
Comment 7 Erik Damrose univentionstaff 2015-04-14 11:12:59 CEST
OK: The license page looks very good. I also like the icon.

Reopen: 
umc/python/setup/util.py:load_values(lang=None)

The current code searches for files with suffix _<locale>" and then for "LICENSE_AGREEMENT" without a locale suffix as a fallback. But some apps only ship a _DE and _EN license agreement. What happens when we add another language? What if an app only ships a _EN file? In my opinion, the default search sequence should be _<locale>, _EN, <no suffix>

The license is only loaded if lang is not None and the UCRV is set. But not every call to load_values from __init__.py supplies the language. This might be the reason i cannot get an english license to load if i switch on the first setup page from german to english.

I also think the license should be displayed in its own container, which may then contain scrollbars. Currently, the whole page is extended and i have to scroll down to reach the back/next buttons if a large agreement file is displayed.
Comment 8 Alexander Kläser univentionstaff 2015-04-14 12:15:21 CEST
(In reply to Erik Damrose from comment #7)
> OK: The license page looks very good. I also like the icon.
> 
> Reopen: 
> umc/python/setup/util.py:load_values(lang=None)
> 
> The current code searches for files with suffix _<locale>" and then for
> "LICENSE_AGREEMENT" without a locale suffix as a fallback. But some apps
> only ship a _DE and _EN license agreement. What happens when we add another
> language? What if an app only ships a _EN file? In my opinion, the default
> search sequence should be _<locale>, _EN, <no suffix>

Good idea to add an additional fallback to EN. This is indeed also the logic that is used in the App Center:

> [...]
> for localised_file_ext in [file_ext + '_%s' % loc, file_ext, file_ext + '_EN']:
> [...]

> The license is only loaded if lang is not None and the UCRV is set. But not
> every call to load_values from __init__.py supplies the language. This might
> be the reason i cannot get an english license to load if i switch on the
> first setup page from german to english.

The problem here is that the values are not reloaded upon language selection. I added an explicit reload of the values.

> I also think the license should be displayed in its own container, which may
> then contain scrollbars. Currently, the whole page is extended and i have to
> scroll down to reach the back/next buttons if a large agreement file is
> displayed.

I fixed its height in the same manner as the software grid is set.

r59772 | Bug #38116: fine tunings for license loading of agreement
Comment 9 Erik Damrose univentionstaff 2015-04-14 14:37:01 CEST
(In reply to Alexander Kläser from comment #8)
OK: fallback logic
OK: reload works, license language changes depending on chosen language
OK: license displayed with maximum height
OK: yaml
-> Verified