After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786679 - Make it easier to consume the RHEL Developer Suite subscription
Make it easier to consume the RHEL Developer Suite subscription
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: installer
unspecified
Other All
: Normal enhancement
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on: 777133 787678 788884
Blocks:
 
 
Reported: 2017-08-23 13:16 UTC by Debarshi Ray
Modified: 2017-10-12 19:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mockups (by Allan) (558.26 KB, image/png)
2017-08-23 13:16 UTC, Debarshi Ray
  Details
Reference code to download a RHEL ISO from developers.redhat.com (11.60 KB, text/plain)
2017-08-23 13:20 UTC, Debarshi Ray
  Details
wizard-source: Group the sources into local files, and everything else (4.54 KB, patch)
2017-09-07 11:47 UTC, Debarshi Ray
none Details | Review
wizard-source: Separate the groups of sources using headings (3.28 KB, patch)
2017-09-07 11:47 UTC, Debarshi Ray
none Details | Review
wizard-source: Align each page separately, instead of the whole widget (1.64 KB, patch)
2017-09-07 11:47 UTC, Debarshi Ray
none Details | Review
wizard: Let the WizardSource expand if it wants to (1.10 KB, patch)
2017-09-07 11:48 UTC, Debarshi Ray
none Details | Review
downloader, wizard: Support a custom filename for downloaded media (2.70 KB, patch)
2017-09-07 11:48 UTC, Debarshi Ray
none Details | Review
wizard: Allow a custom filename when sanity-checking downloadable URIs (1.52 KB, patch)
2017-09-07 11:48 UTC, Debarshi Ray
none Details | Review
wizard: Wire the custom filename to the URI validator (2.22 KB, patch)
2017-09-07 11:49 UTC, Debarshi Ray
none Details | Review
wizard: Wire the custom filename to the downloader (1.64 KB, patch)
2017-09-07 11:49 UTC, Debarshi Ray
none Details | Review
configure: Require json-glib and webkitgtk+ (1.49 KB, patch)
2017-09-07 11:49 UTC, Debarshi Ray
none Details | Review
configure: Require gtk+ >= 3.22.20 (1.35 KB, patch)
2017-09-07 11:49 UTC, Debarshi Ray
none Details | Review
wizard, wizard-source: Support gratis RHEL boxes (20.53 KB, patch)
2017-09-07 11:50 UTC, Debarshi Ray
none Details | Review
wizard-source: Group the sources into local files, and everything else (4.54 KB, patch)
2017-09-15 16:25 UTC, Debarshi Ray
reviewed Details | Review
wizard-source: Separate the groups of sources using headings (3.42 KB, patch)
2017-09-15 16:25 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard-source: Move the file selection button next to the heading (6.21 KB, patch)
2017-09-15 16:26 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard-source: Align each page separately, instead of the whole widget (1.79 KB, patch)
2017-09-15 16:26 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard: Let the WizardSource expand if it wants to (1.10 KB, patch)
2017-09-15 16:26 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard, wizard-source: Don't align & margin WizardSource (3.41 KB, patch)
2017-09-15 16:27 UTC, Debarshi Ray
accepted-commit_now Details | Review
downloader, wizard: Support a custom filename for downloaded media (2.70 KB, patch)
2017-09-15 16:27 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard: Allow a custom filename when sanity-checking downloadable URIs (1.52 KB, patch)
2017-09-15 16:28 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard: Wire the custom filename to the URI validator (2.22 KB, patch)
2017-09-15 16:28 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard: Wire the custom filename to the downloader (1.71 KB, patch)
2017-09-15 16:28 UTC, Debarshi Ray
accepted-commit_now Details | Review
configure: Require json-glib and webkitgtk+ (1.49 KB, patch)
2017-09-15 16:29 UTC, Debarshi Ray
accepted-commit_now Details | Review
configure: Require gtk+ >= 3.22.20 (1.35 KB, patch)
2017-09-15 16:29 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard-source: Add a WebView with progress indication (4.55 KB, patch)
2017-09-15 16:29 UTC, Debarshi Ray
none Details | Review
wizard, wizard-source: Support gratis RHEL boxes (21.70 KB, patch)
2017-09-15 16:30 UTC, Debarshi Ray
none Details | Review
wizard-source: Add a WebView with progress indication (6.85 KB, patch)
2017-09-21 17:26 UTC, Debarshi Ray
none Details | Review
wizard: Rename a method (1.77 KB, patch)
2017-09-26 19:29 UTC, Debarshi Ray
accepted-commit_now Details | Review
wizard, wizard-source: Support gratis RHEL boxes (26.10 KB, patch)
2017-09-26 19:29 UTC, Debarshi Ray
none Details | Review
wizard, wizard-source: Support gratis RHEL boxes (26.10 KB, patch)
2017-09-26 19:44 UTC, Debarshi Ray
none Details | Review
build: Require webkitgtk+ and json-glib (1.64 KB, patch)
2017-10-02 11:58 UTC, Felipe Borges
none Details | Review
wizard, wizard-source: Support gratis RHEL boxes (26.14 KB, patch)
2017-10-06 18:04 UTC, Debarshi Ray
none Details | Review
wizard-source: Group the sources into local files, and everything else (4.54 KB, patch)
2017-10-10 18:21 UTC, Debarshi Ray
committed Details | Review
wizard-source: Separate the groups of sources using headings (3.39 KB, patch)
2017-10-10 18:21 UTC, Debarshi Ray
committed Details | Review
wizard-source: Move the file selection button next to the heading (6.16 KB, patch)
2017-10-10 18:22 UTC, Debarshi Ray
committed Details | Review
wizard-source: Align each page separately, instead of the whole widget (1.79 KB, patch)
2017-10-10 18:22 UTC, Debarshi Ray
committed Details | Review
wizard: Let the WizardSource expand if it wants to (1.10 KB, patch)
2017-10-10 18:23 UTC, Debarshi Ray
committed Details | Review
wizard, wizard-source: Don't align & margin WizardSource (3.41 KB, patch)
2017-10-10 18:24 UTC, Debarshi Ray
committed Details | Review
downloader, wizard: Support a custom filename for downloaded media (2.70 KB, patch)
2017-10-10 18:24 UTC, Debarshi Ray
committed Details | Review
wizard: Allow a custom filename when sanity-checking downloadable URIs (1.52 KB, patch)
2017-10-10 18:25 UTC, Debarshi Ray
committed Details | Review
wizard: Wire the custom filename to the URI validator (2.22 KB, patch)
2017-10-10 18:25 UTC, Debarshi Ray
committed Details | Review
wizard: Wire the custom filename to the downloader (1.71 KB, patch)
2017-10-10 18:25 UTC, Debarshi Ray
committed Details | Review
configure: Require json-glib and webkitgtk+ (1.49 KB, patch)
2017-10-10 18:26 UTC, Debarshi Ray
committed Details | Review
build: Require webkitgtk+ and json-glib (1.66 KB, patch)
2017-10-10 18:27 UTC, Debarshi Ray
committed Details | Review
configure: Require gtk+ >= 3.22.20 (1.36 KB, patch)
2017-10-10 18:27 UTC, Debarshi Ray
committed Details | Review
wizard-source: Add a WebView with progress indication (7.04 KB, patch)
2017-10-10 18:28 UTC, Debarshi Ray
committed Details | Review
wizard: Rename a method (1.77 KB, patch)
2017-10-10 18:28 UTC, Debarshi Ray
committed Details | Review
wizard, wizard-source: Support gratis RHEL boxes (27.27 KB, patch)
2017-10-10 18:29 UTC, Debarshi Ray
committed Details | Review
build: Require webkitgtk+ and json-glib (2.78 KB, patch)
2017-10-12 15:31 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-08-23 13:16:01 UTC
Created attachment 358234 [details]
Mockups (by Allan)

Since March 2016, it is possible to obtain an unsupported copy of Red Hat Enterprise Linux (or RHEL) for gratis [1] covered by the RHEL Developer Suite subscription. It would be nice to make it easier to set up such RHEL VMs for developers who might want easy access to a RHEL environment for development and QE.

[1] https://developers.redhat.com/blog/2016/03/31/no-cost-rhel-developer-subscription-now-available/
Comment 1 Debarshi Ray 2017-08-23 13:20:20 UTC
Created attachment 358236 [details]
Reference code to download a RHEL ISO from developers.redhat.com

The developers.redhat.com website seems to be free software [1] and is supposed to have an API to programmatically access parts of it. However, documentation is hard to come by. Attached is a piece of code that documents how to download a RHEL ISO.

[1] https://github.com/redhat-developer/developers.redhat.com
Comment 2 Debarshi Ray 2017-08-29 19:43:29 UTC
I have pushed a wip/rishi/rhel branch with some initial incomplete code. I'll start attaching the patches here once it is more functional.
Comment 3 Debarshi Ray 2017-09-07 11:47:18 UTC
Created attachment 359336 [details] [review]
wizard-source: Group the sources into local files, and everything else
Comment 4 Debarshi Ray 2017-09-07 11:47:34 UTC
Created attachment 359337 [details] [review]
wizard-source: Separate the groups of sources using headings
Comment 5 Debarshi Ray 2017-09-07 11:47:49 UTC
Created attachment 359338 [details] [review]
wizard-source: Align each page separately, instead of the whole widget
Comment 6 Debarshi Ray 2017-09-07 11:48:02 UTC
Created attachment 359339 [details] [review]
wizard: Let the WizardSource expand if it wants to
Comment 7 Debarshi Ray 2017-09-07 11:48:20 UTC
Created attachment 359340 [details] [review]
downloader, wizard: Support a custom filename for downloaded media
Comment 8 Debarshi Ray 2017-09-07 11:48:44 UTC
Created attachment 359342 [details] [review]
wizard: Allow a custom filename when sanity-checking downloadable URIs
Comment 9 Debarshi Ray 2017-09-07 11:49:03 UTC
Created attachment 359343 [details] [review]
wizard: Wire the custom filename to the URI validator
Comment 10 Debarshi Ray 2017-09-07 11:49:18 UTC
Created attachment 359344 [details] [review]
wizard: Wire the custom filename to the downloader
Comment 11 Debarshi Ray 2017-09-07 11:49:33 UTC
Created attachment 359345 [details] [review]
configure: Require json-glib and webkitgtk+
Comment 12 Debarshi Ray 2017-09-07 11:49:49 UTC
Created attachment 359346 [details] [review]
configure: Require gtk+ >= 3.22.20
Comment 13 Debarshi Ray 2017-09-07 11:50:05 UTC
Created attachment 359347 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes
Comment 14 Debarshi Ray 2017-09-07 11:55:37 UTC
This is quite functional now. Things that remain to be done:
(a) Use RHEL logo when downloading the ISO
(b) Move the file chooser button to match the mockups
(c) Update the management of the header bar buttons

At the moment, I am not planning to auto-enrol the installed VM through Red Hat's subscription manager. This is because there is no way to securely pass the credentials from the point where the user enters them in the web view to the post installation stage where the enrollment needs to happen. We'll have to revisit this when things change.
Comment 15 Debarshi Ray 2017-09-07 15:42:56 UTC
I was going to attach screenshots, but since I already made a screencast, let's use that: https://rishi.fedorapeople.org/gnome-boxes-rhel-00.webm
Comment 16 Debarshi Ray 2017-09-15 16:25:39 UTC
Created attachment 359853 [details] [review]
wizard-source: Group the sources into local files, and everything else
Comment 17 Debarshi Ray 2017-09-15 16:25:59 UTC
Created attachment 359854 [details] [review]
wizard-source: Separate the groups of sources using headings
Comment 18 Debarshi Ray 2017-09-15 16:26:18 UTC
Created attachment 359855 [details] [review]
wizard-source: Move the file selection button next to the heading
Comment 19 Debarshi Ray 2017-09-15 16:26:35 UTC
Created attachment 359856 [details] [review]
wizard-source: Align each page separately, instead of the whole widget
Comment 20 Debarshi Ray 2017-09-15 16:26:59 UTC
Created attachment 359857 [details] [review]
wizard: Let the WizardSource expand if it wants to
Comment 21 Debarshi Ray 2017-09-15 16:27:20 UTC
Created attachment 359858 [details] [review]
wizard, wizard-source: Don't align & margin WizardSource
Comment 22 Debarshi Ray 2017-09-15 16:27:41 UTC
Created attachment 359859 [details] [review]
downloader, wizard: Support a custom filename for downloaded media
Comment 23 Debarshi Ray 2017-09-15 16:28:06 UTC
Created attachment 359860 [details] [review]
wizard: Allow a custom filename when sanity-checking downloadable URIs
Comment 24 Debarshi Ray 2017-09-15 16:28:26 UTC
Created attachment 359861 [details] [review]
wizard: Wire the custom filename to the URI validator
Comment 25 Debarshi Ray 2017-09-15 16:28:45 UTC
Created attachment 359862 [details] [review]
wizard: Wire the custom filename to the downloader
Comment 26 Debarshi Ray 2017-09-15 16:29:04 UTC
Created attachment 359863 [details] [review]
configure: Require json-glib and webkitgtk+
Comment 27 Debarshi Ray 2017-09-15 16:29:21 UTC
Created attachment 359864 [details] [review]
configure: Require gtk+ >= 3.22.20
Comment 28 Debarshi Ray 2017-09-15 16:29:52 UTC
Created attachment 359865 [details] [review]
wizard-source: Add a WebView with progress indication
Comment 29 Debarshi Ray 2017-09-15 16:30:06 UTC
Created attachment 359866 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes
Comment 30 Debarshi Ray 2017-09-15 16:32:03 UTC
(In reply to Debarshi Ray from comment #14)
> This is quite functional now. Things that remain to be done:
> (a) Use RHEL logo when downloading the ISO

Done.

> (b) Move the file chooser button to match the mockups

Done.

> (c) Update the management of the header bar buttons

To do.

I am ready for some initial feedback on the structure and layout of the patches.
Comment 31 Felipe Borges 2017-09-20 09:35:26 UTC
Review of attachment 359853 [details] [review]:

it makes sense.

Could you please hold these commits a bit so we can push the feature as a whole?
Comment 32 Felipe Borges 2017-09-20 09:36:12 UTC
Review of attachment 359854 [details] [review]:

sure.
Comment 33 Felipe Borges 2017-09-20 09:38:02 UTC
Review of attachment 359855 [details] [review]:

ok
Comment 34 Felipe Borges 2017-09-20 09:38:43 UTC
Review of attachment 359856 [details] [review]:

sure.
Comment 35 Felipe Borges 2017-09-20 09:39:27 UTC
Review of attachment 359857 [details] [review]:

could be part of the previous commit, but don't bother. :)
Comment 36 Felipe Borges 2017-09-20 09:40:23 UTC
Review of attachment 359858 [details] [review]:

ok
Comment 37 Felipe Borges 2017-09-20 09:41:39 UTC
Review of attachment 359859 [details] [review]:

sure.
Comment 38 Felipe Borges 2017-09-20 09:42:29 UTC
Review of attachment 359860 [details] [review]:

ok
Comment 39 Felipe Borges 2017-09-20 09:43:44 UTC
Review of attachment 359861 [details] [review]:

sure.
Comment 40 Felipe Borges 2017-09-20 09:44:09 UTC
Review of attachment 359862 [details] [review]:

sure.
Comment 41 Felipe Borges 2017-09-20 09:45:23 UTC
Review of attachment 359863 [details] [review]:

I hope we can revert that once the developer portal has an OAuth-like authentication. Btw, did you contact them regarding that? Maybe we could open another bug for that (for the future).
Comment 42 Felipe Borges 2017-09-20 09:46:58 UTC
Review of attachment 359864 [details] [review]:

Thanks for digging into this!
Comment 43 Debarshi Ray 2017-09-20 09:51:30 UTC
(In reply to Felipe Borges from comment #31)
> Review of attachment 359853 [details] [review] [review]:
> 
> it makes sense.
> 
> Could you please hold these commits a bit so we can push the feature as a
> whole?

Yes, of course.
Comment 44 Debarshi Ray 2017-09-20 09:53:13 UTC
Thanks for all the reviews!

(In reply to Felipe Borges from comment #35)
> Review of attachment 359857 [details] [review] [review]:
> 
> could be part of the previous commit, but don't bother. :)

Ok, I will do that.

(I split the UI file changes to make them more understandable. Sometimes I find it challenging to understand XML diffs. :)
Comment 45 Felipe Borges 2017-09-20 10:01:27 UTC
Review of attachment 359865 [details] [review]:

* Can we somehow (maybe by injecting a stylesheet) tweak the page to:

  1. Drop the cookies notification div;
  2. Center the view into the login form;
  3. Turn the white background into black (or better, make it match the @theme_bg_color of the gtk+ theme?)

* the right click exposes a disfunctional context menu. I think webkit has an API to drop/customize it.

* If I close the wizard and open it again the webview is still showing the old page. I see that you don't want to destroy/create it every time but we could load "about:blank" when the wizard gets dismissed?!? 

* Related to the previous point, it will keep history, so right click -> [BACK] can go back to something else. This is related to the context menu I mentioned in the paragraph above.

* Could we filter the domain and restrict the browsing to login specific bits? I could choose to login with my Twitter account, click on the twitter logo at their login page and turn Boxes into a Twitter client. (maybe not a bug, but a feature ;-) )

* The back button (at the headerbar) is sensitive, but it doesn't really go back to anywhere.
Comment 46 Debarshi Ray 2017-09-20 10:06:41 UTC
(In reply to Felipe Borges from comment #41)
> Review of attachment 359863 [details] [review] [review]:
> 
> I hope we can revert that once the developer portal has an OAuth-like
> authentication. Btw, did you contact them regarding that? Maybe we could
> open another bug for that (for the future).

When I spoke with them a few months ago, they were friendly but it was difficult to get them to commit to actually do something. I am hoping that once we have an initial iteration of this feature, we can talk to them more concretely.

It is not clear to me whether they will or will not support OAuth in future. It seemed that they don't do it on purpose, but it wasn't clear. Something to bring up again, I guess.

There are a few other things we need:

(i) It would be nice if the portal didn't randomly return JSON and XML.

(ii) We need a way to auto-subscribe the installed VM through subscription-manager. Since the express installation uses a kickstart file, we cannot just put the password in plain text there. The subscription password is the same as the portal's log-in password, so it's risky. subscription-manager supports something called an activation key. It was not clear whether we can use a short lived key to subscribe the VM. The portal developers, and the subscription-manager developers are disjoint sets. So there is a communication gap to be bridged. :)
Comment 47 Felipe Borges 2017-09-20 11:25:28 UTC
(In reply to Debarshi Ray from comment #46)
>
> (ii) We need a way to auto-subscribe the installed VM through
> subscription-manager. Since the express installation uses a kickstart file,
> we cannot just put the password in plain text there. The subscription
> password is the same as the portal's log-in password, so it's risky.
> subscription-manager supports something called an activation key. It was not
> clear whether we can use a short lived key to subscribe the VM. The portal
> developers, and the subscription-manager developers are disjoint sets. So
> there is a communication gap to be bridged. :)

To put on record what we just spoke IRL, I suggest:

  * A Spice channel for the keyring which would allow the host to expose its keyring to the guests? (some spice dev could drop a comment clarifying the feasibility of it)

  * A key exchange throughout the webdav channel (guest's agent generates a pair, passes its public key to the host which encrypts the authentication data and passes it back to the guest to feed it to the subscription-manager cli).
Comment 48 Debarshi Ray 2017-09-20 11:33:13 UTC
(In reply to Felipe Borges from comment #45)
> Review of attachment 359865 [details] [review] [review]:
> 
> * Can we somehow (maybe by injecting a stylesheet) tweak the page to:
> 
>   1. Drop the cookies notification div;
>   2. Center the view into the login form;
>   3. Turn the white background into black (or better, make it match the
> @theme_bg_color of the gtk+ theme?)
> 
> * the right click exposes a disfunctional context menu. I think webkit has
> an API to drop/customize it.

I'll look into these.

> * If I close the wizard and open it again the webview is still showing the
> old page. I see that you don't want to destroy/create it every time but we
> could load "about:blank" when the wizard gets dismissed?!? 

Good point.

> * Related to the previous point, it will keep history, so right click ->
> [BACK] can go back to something else. This is related to the context menu I
> mentioned in the paragraph above.
> 
> * Could we filter the domain and restrict the browsing to login specific
> bits? I could choose to login with my Twitter account, click on the twitter
> logo at their login page and turn Boxes into a Twitter client. (maybe not a
> bug, but a feature ;-) )
> 
> * The back button (at the headerbar) is sensitive, but it doesn't really go
> back to anywhere.

Yes, I haven't touched the header bar buttons because I wasn't sure about certain aspects of their behaviour. Thanks for clearing those up in real life. :)
Comment 49 Debarshi Ray 2017-09-21 16:47:36 UTC
(In reply to Felipe Borges from comment #45)
> Review of attachment 359865 [details] [review] [review]:
> 
> * Can we somehow (maybe by injecting a stylesheet) tweak the page to:
> 
>   1. Drop the cookies notification div;
>   2. Center the view into the login form;
>   3. Turn the white background into black (or better, make it match the
> @theme_bg_color of the gtk+ theme?)

As you pointed out, the developers.redhat.com log-in page can lead to a bunch of social media sites for alternate log-in mechanisms. Do you want to do these things for those websites too? While the Red Hat portal is somewhat under our control, I am worried about fiddling with a whole array of 3rd party sites. It might lead to random breakage.

For the cookies notification, I learnt about http://prebake.eu/ from #webkitgtk+. I don't know if we can leverage it somehow in this case, but I don't know the legal ramifications either. The portal does ask a few questions after log-in when a user downloads an image for the first time. Here is a brief explanation of the law:
  https://www.cookielaw.org/the-cookie-law/

> * the right click exposes a disfunctional context menu. I think webkit has
> an API to drop/customize it.

Yes, we can use WebKitWebView::context-menu to customize it. We probably only want to hide a few menu items (eg., back, forward, stop and reload) and not completely disable the menu. We still want copy, cut, paste, etc..
Comment 50 Debarshi Ray 2017-09-21 17:26:56 UTC
Created attachment 360205 [details] [review]
wizard-source: Add a WebView with progress indication

Hide some menu-items from the right-click context menu.
Comment 51 Debarshi Ray 2017-09-26 19:29:31 UTC
Created attachment 360483 [details] [review]
wizard: Rename a method
Comment 52 Debarshi Ray 2017-09-26 19:29:56 UTC
Created attachment 360484 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes
Comment 53 Debarshi Ray 2017-09-26 19:40:06 UTC
Changes:

* Working header bar buttons.

* Used a spinner when the initial JSON/XML is downloaded.

* Removed a few non-working and undesired items from the WebView's right-click context menu.

* Cookies get cleared before the WebView is re-used.

* The page gets reset before the WebView is re-used.

I didn't do anything about restricting / disabling the links in the social media pages, or hiding the cookie law banner.
Comment 54 Debarshi Ray 2017-09-26 19:44:22 UTC
Created attachment 360489 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes

I only re-attached the patches that changed to reduce noise. I hope I got them right.

They are also in gnome-boxes:wip/rishi/rhel.
Comment 55 Christophe Fergeau 2017-09-28 11:14:52 UTC
(In reply to Felipe Borges from comment #47)
> (In reply to Debarshi Ray from comment #46)
> >
> > (ii) We need a way to auto-subscribe the installed VM through
> > subscription-manager. Since the express installation uses a kickstart file,
> > we cannot just put the password in plain text there. The subscription
> > password is the same as the portal's log-in password, so it's risky.
> > subscription-manager supports something called an activation key. It was not
> > clear whether we can use a short lived key to subscribe the VM. The portal
> > developers, and the subscription-manager developers are disjoint sets. So
> > there is a communication gap to be bridged. :)
> 
> To put on record what we just spoke IRL, I suggest:
> 
>   * A Spice channel for the keyring which would allow the host to expose its
> keyring to the guests? (some spice dev could drop a comment clarifying the
> feasibility of it)
> 
>   * A key exchange throughout the webdav channel (guest's agent generates a
> pair, passes its public key to the host which encrypts the authentication
> data and passes it back to the guest to feed it to the subscription-manager
> cli).

Wondering if https://libvirt.org/formatsecret.html could be leveraged to pass this data to the guest? The kickstart file could be put in an encrypted qcow2 volume with an 'ephemeral' secret (assuming the guest being able to access the unencrypted text file is not an issue).
Comment 56 Felipe Borges 2017-10-02 11:58:05 UTC
Created attachment 360762 [details] [review]
build: Require webkitgtk+ and json-glib

This is the meson counterpart of commit b1bdcc8.
Comment 57 Debarshi Ray 2017-10-03 18:34:37 UTC
(In reply to Felipe Borges from comment #56)
> Created attachment 360762 [details] [review] [review]
> build: Require webkitgtk+ and json-glib
> 
> This is the meson counterpart of commit b1bdcc8.

Oops! I totally forgot that we can now build with Meson too.
Comment 58 Felipe Borges 2017-10-06 16:36:26 UTC
Review of attachment 360205 [details] [review]:

It is looking good. Thanks!
Comment 59 Felipe Borges 2017-10-06 16:36:54 UTC
Review of attachment 360483 [details] [review]:

sure!
Comment 60 Felipe Borges 2017-10-06 16:57:24 UTC
Review of attachment 360489 [details] [review]:

Other than the nitpicks here, I think we are ready to go. We might (and probably will) come across bugs/issues here, but I think we are ready to ship this feature.

Thanks a lot for your work!

::: src/wizard-source.vala
@@ +359,3 @@
         });
+
+        var rhel_id = "http://redhat.com/rhel/7.4";

I hope this works over https.

What do we do in the future releases? Bump the version or offer to select which version (if previous version will be offered, of course)?

@@ +564,3 @@
+        var product_code = extract_xpath (contents, "string(/products/product/productCode)", true);
+        if (product_code != "rhel")
+            throw new Boxes.Error.INVALID ("Failed to parse JSON: productCode is not a VALUE");

nitpick: s/JSON/XML/
Comment 61 Debarshi Ray 2017-10-06 18:00:14 UTC
(In reply to Felipe Borges from comment #60)
> Review of attachment 360489 [details] [review] [review]:
> ::: src/wizard-source.vala
> @@ +359,3 @@
>          });
> +
> +        var rhel_id = "http://redhat.com/rhel/7.4";
> 
> I hope this works over https.

It probably doesn't matter.

The http://redhat.com/rhel/7.4 is the ID of the RHEL 7.4 operating system in osinfo-db. Specifically this file:
  /usr/share/osinfo/os/redhat.com/rhel-7.4.xml

So, it's just an ID that looks like a URI, but doesn't actually point to a network location. Explanation below.

> What do we do in the future releases? Bump the version or offer to select
> which version (if previous version will be offered, of course)?

The high level objective is to show a Shadowman in the wizard's MAIN page, and while the RHEL ISO gets downloaded from the portal. I couldn't find a way to ask libosinfo for a Shadowman logo without specifying an OsinfoOs.

For the other sources, the OsinfoOs is either retrieved from the InstallerMedia for ISOs, or it is obtained from the OsinfoDb while getting a list of all known URLs. However, we can't do that for the Red Hat developer portal. We are neither starting from a local ISO, nor do we have a well-known static URL that can be added to osinfo-db. The download URL from the portal is time-bombed, and won't work after the timeout expires.

Therefore:

(a) I hard-coded the ID of a relatively new edition of RHEL to get a Shadowman for the wizard's MAIN page.

(b) I used the ID to get a RHEL 7.4 OsinfoOs from the database. Once we have the download URL from the portal I insert a "fake" RHEL 7.4 entry in media_urls_store so that a logo can be shown during the download.

It's a bit ugly, but osinfo-db still has entries for really old OSes, and we don't care about the exact 7.4 version number either.

Let me know if there's a better way to get the logo?

> @@ +564,3 @@
> +        var product_code = extract_xpath (contents,
> "string(/products/product/productCode)", true);
> +        if (product_code != "rhel")
> +            throw new Boxes.Error.INVALID ("Failed to parse JSON:
> productCode is not a VALUE");
> 
> nitpick: s/JSON/XML/

Fixed.
Comment 62 Debarshi Ray 2017-10-06 18:04:44 UTC
Created attachment 361057 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes
Comment 63 Christophe Fergeau 2017-10-09 07:38:37 UTC
(In reply to Debarshi Ray from comment #61)
> 
> The high level objective is to show a Shadowman in the wizard's MAIN page,

Regarding usage of the shadowman logo, https://git.gnome.org/browse/gnome-boxes/tree/README.logos#n163 puts some conditions to its use (just fyi, I have no idea how your changes look, and if they conform to what is in that document :)
Comment 64 Felipe Borges 2017-10-09 08:58:29 UTC
(In reply to Christophe Fergeau from comment #63)
> (In reply to Debarshi Ray from comment #61)
> > 
> > The high level objective is to show a Shadowman in the wizard's MAIN page,
> 
> Regarding usage of the shadowman logo,
> https://git.gnome.org/browse/gnome-boxes/tree/README.logos#n163 puts some
> conditions to its use (just fyi, I have no idea how your changes look, and
> if they conform to what is in that document :)

Thanks for pointing this out. I think Debarshi's implementation is compliant with these conditions.
Comment 65 Debarshi Ray 2017-10-10 18:21:25 UTC
Created attachment 361265 [details] [review]
wizard-source: Group the sources into local files, and everything else
Comment 66 Debarshi Ray 2017-10-10 18:21:52 UTC
Created attachment 361266 [details] [review]
wizard-source: Separate the groups of sources using headings
Comment 67 Debarshi Ray 2017-10-10 18:22:19 UTC
Created attachment 361267 [details] [review]
wizard-source: Move the file selection button next to the heading
Comment 68 Debarshi Ray 2017-10-10 18:22:55 UTC
Created attachment 361268 [details] [review]
wizard-source: Align each page separately, instead of the whole widget
Comment 69 Debarshi Ray 2017-10-10 18:23:24 UTC
Created attachment 361269 [details] [review]
wizard: Let the WizardSource expand if it wants to
Comment 70 Debarshi Ray 2017-10-10 18:24:03 UTC
Created attachment 361270 [details] [review]
wizard, wizard-source: Don't align & margin WizardSource
Comment 71 Debarshi Ray 2017-10-10 18:24:35 UTC
Created attachment 361271 [details] [review]
downloader, wizard: Support a custom filename for downloaded media
Comment 72 Debarshi Ray 2017-10-10 18:25:05 UTC
Created attachment 361272 [details] [review]
wizard: Allow a custom filename when sanity-checking downloadable URIs
Comment 73 Debarshi Ray 2017-10-10 18:25:30 UTC
Created attachment 361273 [details] [review]
wizard: Wire the custom filename to the URI validator
Comment 74 Debarshi Ray 2017-10-10 18:25:57 UTC
Created attachment 361274 [details] [review]
wizard: Wire the custom filename to the downloader
Comment 75 Debarshi Ray 2017-10-10 18:26:34 UTC
Created attachment 361275 [details] [review]
configure: Require json-glib and webkitgtk+
Comment 76 Debarshi Ray 2017-10-10 18:27:14 UTC
Created attachment 361276 [details] [review]
build: Require webkitgtk+ and json-glib
Comment 77 Debarshi Ray 2017-10-10 18:27:40 UTC
Created attachment 361277 [details] [review]
configure: Require gtk+ >= 3.22.20
Comment 78 Debarshi Ray 2017-10-10 18:28:15 UTC
Created attachment 361278 [details] [review]
wizard-source: Add a WebView with progress indication
Comment 79 Debarshi Ray 2017-10-10 18:28:40 UTC
Created attachment 361279 [details] [review]
wizard: Rename a method
Comment 80 Debarshi Ray 2017-10-10 18:29:01 UTC
Created attachment 361280 [details] [review]
wizard, wizard-source: Support gratis RHEL boxes
Comment 81 Debarshi Ray 2017-10-10 18:36:04 UTC
Changes:

* webkit_web_context_set_preferred_languages was used to set the Accept-Language request header to the list returned by g_get_language_names.

* If the cached JSON/XML is corrupt, then try to get a fresh copy from the server. In the rare case that (i) a server bug or network problem leads to a corrupt JSON/XML, the user can try again, or (ii) if the user manages to manually corrupt the cache, then the code will automatically override it.

That's all from my end. I don't have anything else coming up.

I have reattached all the patches so that they cleanly apply. I tried to retain the statuses of the ones that were unchanged. I hope I didn't mess it up.
Comment 82 Debarshi Ray 2017-10-10 18:37:12 UTC
Review of attachment 361276 [details] [review]:

Do you want to squash this with attachment 361275 [details] [review]? At least we need to update the commit hash in the commit message. :)
Comment 83 Debarshi Ray 2017-10-11 09:55:13 UTC
(In reply to Debarshi Ray from comment #82)
> Review of attachment 361276 [details] [review] [review]:
> 
> Do you want to squash this with attachment 361275 [details] [review] [review]? At
> least we need to update the commit hash in the commit message. :)

Done, after discussing in #boxes on GIMPNet. I am holding back from reattaching the patches to avoid bugzilla noise. Updated gnome-boxes:wip/rishi/rhel.
Comment 84 Felipe Borges 2017-10-11 11:18:52 UTC
Review of attachment 361280 [details] [review]:

lgtm!

::: src/wizard-source.vala
@@ +375,3 @@
+        //
+        // Ideally, distributions would be a first-class object in libosinfo, so
+        //

Thanks for these comments.
Comment 85 Felipe Borges 2017-10-12 13:23:53 UTC
Review of attachment 361278 [details] [review]:

sorry, I missed this one. Looks good!
Comment 86 Debarshi Ray 2017-10-12 15:31:56 UTC
Created attachment 361430 [details] [review]
build: Require webkitgtk+ and json-glib

Squashed attachment 361275 [details] [review] and attachment 361276 [details] [review]
Comment 87 Debarshi Ray 2017-10-12 15:45:44 UTC
I filed bug 788886 for automatically subscribing the VMs, and dumped comment 47 and comment 55 into it.

Thanks for all the reviews and suggestions!