Bug 1651621

Summary: Subscription Management from Workstation's desktop menu item requires a running cockpit service
Product: Red Hat Enterprise Linux 8 Reporter: ignusius
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.0CC: cdonnell, csnyder, desktop-qa-list, jsefler, jstavel, mpitt, pkotvan, rhsm-qe, stefw, tbowling
Target Milestone: rcKeywords: Reopened
Target Release: 8.0Flags: cdonnell: needinfo-
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: subscription-manager-1.23.8-7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 01:47:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1651264    
Bug Blocks: 1635157    
Attachments:
Description Flags
Screenshot error none

Description ignusius 2018-11-20 12:22:49 UTC
Created attachment 1507402 [details]
Screenshot error

Description of problem:

Subscription Management doesn't work. 
localhost:9090/subscriptions  -  doesn't open in firefox

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. Install RHEL 8 Beta (Workstation)
2. Start GNOME 
3. Open  Subscription Management in menu

Actual results:


Expected results:


Additional info:

Comment 5 Martin Pitt 2018-11-21 09:56:34 UTC

*** This bug has been marked as a duplicate of bug 1651264 ***

Comment 6 Martin Pitt 2018-12-05 13:52:08 UTC
Unduplicating this. Bug 1651264 tracks the addition of a "cockpit-desktop" helper to cockpit-ws. With this, subscription-manager-cockpit.desktop's Exec= line should look like this:

   Exec=/usr/libexec/cockpit-desktop /cockpit/@localhost/subscriptions/index.html

This will be available in >= 184, so please adjust your dependencies accordingly.

You can test this right now on a RHEL 8 Beta desktop with

   sudo yum install https://piware.de/tmp/cockpit-ws-183.x-1.wip.el8.x86_64.rpm

and modifying the .desktop file accordingly.

Note that this still has some warts:

  * Firefox always opens the privacy statement in a second tab, which we'd like to avoid. Maybe one can pre-create some profile in the temporary home dir?
  * Ideally we would not use Firefox at all, but some webkitgtk wrapper. A few years ago, the webkit library/package shipped with a command line tool that would just pop up a window with a given URL inside it, and no other "chrome" (URL bars, etc.) behind it; but this seems to be gone?
  * Right now, cockpit-desktop supports chrome/chromium and Firefox, but the RHEL 8 beta desktop only installs firefox and webkitgtk. Do we need other browsers?
  * The polkit prompt could be more explanatory.

For these issues I'd really appreciate some help from the desktop team.

Comment 7 Martin Pitt 2018-12-05 16:52:55 UTC
https://github.com/cockpit-project/cockpit/pull/10770 proposes to use a custom WebKit view window using Python3 with GI, which addresses the first two points.

Comment 10 Martin Pitt 2018-12-06 12:18:22 UTC
Note that exception+ is only necessary after December 18. But indeed that's getting a little tight now, and the design is still in flux, so I suppose it can't hurt to ask for it now.

For those who want to play around with this: The RPM in https://bugzilla.redhat.com/show_bug.cgi?id=1651621#c6 uses Firefox. In the mentioned PR #10770 above I also added an embedded WebKit browser. If you want to try this, install this RPM instead:

    sudo yum install https://piware.de/tmp/cockpit-ws-183.x-1.wip-webkit.el8.x86_64.rpm

Comment 11 Allan Day 2018-12-07 08:17:40 UTC
I tried the embedded browser version yesterday. In general it looks good.

You're right that a better description is needed for the polkit dialog, Martin. The best I could come up with is "Authentication is required to manage subscriptions."

Another small point: I'd expect the window title to be the same as the desktop launcher - "Red Hat Subscription Manager".

Comment 12 Martin Pitt 2018-12-07 09:25:11 UTC
> You're right that a better description is needed for the polkit dialog

Unfortunately it cannot be very specific, like "manage subscriptions". The way Cockpit is designed is that it starts a cockpit-bridge process as root (which is what needs the authorization), and then the various pages can do administrative actions through that root bridge. If it would be specific, then cockpit would need to ask for authorization for every single privileged operation (even reading information and every page update), which is not practical.

So it needs to be generic, like "Authentication is required to manage your system with the Web Console" or something such. Although the "web console" term might not be obvious on the desktop... This bit applies to cockpit itself, not subscription-manager, so we can continue that discussion in bug 1651264.

> I'd expect the window title to be the same as the desktop launcher - "Red Hat Subscription Manager".

This is determined by the subscription-manager-cockpit package itself (i. e. *this* bug). I agree that this would be more consistent.

Thanks for the feedback!

Comment 13 Martin Pitt 2018-12-07 14:12:01 UTC
https://github.com/cockpit-project/cockpit/pull/10782 proposes a polkit action with a "proper" description. Allan, do you mind having a look at the strings there?

Comment 14 Stef Walter 2018-12-13 13:44:39 UTC
> Unfortunately it cannot be very specific, like "manage subscriptions". The way Cockpit is designed is that it starts a cockpit-bridge process as root ...

Actually it can be specific. But only if subscription manager was designed differently and did it's own Polkit interaction (as systemd, realmd, and other services do). You are correct though that this cannot be made specific on the Cockpit side.

Comment 16 Martin Pitt 2018-12-14 21:03:08 UTC
I uploaded cockpit 184 to RHEL 8 today which includes cockpit-desktop.

Comment 17 Jan Stavel 2019-01-09 10:21:37 UTC
It works. I have installed gnome.
I have started an application using 'Activities' and string 'Subscription' .
Activities offered me 'SubscriptionManager'.

It runs and looks good.

Regards,
Jan Stavel