|
CNR.com |
The purpose of this document is to provide high-level, semi-technical information about the CNR Client to the CNR community.PurposeThe CNR Client serves the following purposes:
This represents a big change in terms of how the user interacted with the original CNR client and how the user will interact with the new CNR Client. In the original CNR client, the user could interact with the website because the CNR client could display web content. The original CNR client also had ancillary UI to facilitate interaction with the user's account details and services. While this functionality was useful, it was also limited to a small set of Javascript functionality and was dependent on KDE to provide the under pinning of the CNR client code base. A major design criterion of the new CNR Client is to be easily ported to all of the major Linux distributions and as such, has to be lightweight in terms of functionality and in terms of its dependency tree. For this we chose to develop an entirely new application using the QT framework. The intent of this Client is to assist the web site with installation services and leaves the searching, browsing, and purchasing aspects to the web browser. CompositionThe CNR Client is a simple GUI application based on the QT application framework. It can run as root or the same system permission level as the user that executes it. It has no KDE dependencies so as to be easily portable to Gnome systems. It will also eventually have a command line interface so as to not require X to function. Client InitializationWhen the Client is first launched on the user's system, it must complete several actions to properly initialize itself before it can to perform its functions. Below is a list of those actions in chronological order.
CNR Client GUIThe CNR GUI is a single window with a multi-tab structure with an interface for managing software, viewing action history, and configuring the CNR Client settings. Across the bottom of the window will be several buttons that will vary depending on which tab is selected. Manage SoftwareThe Manage Software tab is made up of two distinct views whose primary function is to allow the user to see what software is installed on their machine, what software has available updates and the ability to remove or update software from the machine. The distinct views are the list view and the tree view. (coming soon) The list view displays every package on the machine and because there is generally a one-to-one mapping of packages to products, it can be said that this view shows all products as well. If there are packages on the system that the Client does not recognize, they will be displayed without a product name. The tree view will display a list of only the top level products, applications, and packages that have been installed by the user to the machine through CNR. Each node in the tree view will be expandable to show the list of packages associated with each product dependencies. (coming soon) Both views will display the following set of columns in addition to the Product name:
Additionally, both views will allow the user to select one or many records from the view to be acted on. The user can use a right mouse menu or the buttons at the bottom of the view to engage in an action on the selected products. The buttons for this tab are:
Software InstallationThe installation of software can be initiated through two methods:
If the user is coming from the browser, clicking on an installation link on CNR.com will cause the browser to download a mime document and then to pass that document to the Client because the mime-type for the document will be registered with the OS and the browser as belonging to the CNR Client application. The mime document will contain XML that looks like the following sample and is referred to as a .cnr file due to the file extension. <?xml version="1.0" encoding="UTF-8"?> <cnr-client> <product-id>195</product-id> <product-name>9menu</product-name> <action>INSTALL</action> <user-auth-token>5B2433C1-9AE0-AFFA-997A-E7F85E5FC58B</user-auth-token> </cnr-client> The XML elements are:
The Client will parse the XML and then determine if the requested product is supported by the distribution the user is using. If the product is supported by the distribution, the Client will shell out to apt to have it traverse the dependency tree and return a result set of packages needed to install the requested product. If the product is not supported by the distribution, the Client will inform the user of the situation and cancel the install request. Then the Client will call the web service api "GetProductActionRequest" for each package in the dependency result set and will pass up the product ID extracted from the .cnr file and the package-bin ID (identifies each package associated with the product install). Next, the server will consider the api request(s) and will attempt to authorize the installation of each package by checking to see if there are any requisites that need to be fulfilled before the installation can proceed. Requisites are such things as EULAs or ownership of a package (in the case where a package is not free) or a license in the case of a service based product. If a package has requisites, then the server will next check to see if a user-auth token was passed up with the product ID. If no user-auth token was passed up or the token is invalid, the server will respond to the Client with a resolution URL that when opened in the web browser will include a sign in prompt along with the appropriate interface to fulfill the requisite (display a EULA or begin the ecommerce process). When the user signs in, the server will check the product requisites against the user account to see if the requisites were fulfilled previously; it is the same functionality as if a user-auth token is included and is valid. If the package requires that a EULA be accepted, the user must accept it in order to proceed with the installation. If the user does not accept it, then the install request is cancelled. If the package requires that the user purchase it, then the user must complete an ecommerce transaction before the install can proceed. If no ecommerce transaction is completed, then the install request is also cancelled. If the package requires that a license to a service be purchased, then the user must complete an ecommerce transaction or the install will be cancelled. Once the requisites have been fulfilled, the server will respond with a new .cnr file so that the client will request the same action, only now that the requisites have been fulfilled, the server will authorize the installation, which is the same behavior when the package set has no requisites to fulfill. In this case, the response from the server is still a URL, but it is a download URL instead of a resolution URL. The Client downloads the packages from the server using the URL returned to it in the GetProductActionRequest response. Once the package set has been downloaded, the Client will verify that the size of the downloaded packages are the same as what the server sent and it will verify that the package sign sent by the CNR server is valid to protect against man-in-the-middle attacks. At this point the CNR Client has valid packages to fulfill the package solution set for the requested product, the Client will shell out to dpkg to install the packages. Once that process is completed, the installation is complete and the Client UI will be updated to reflect the completion of the process. Then the Client will call the ProductActionReport API to inform the server on the result of the installation request. Software RemovalThe removal of a product from the user's machine is initiated from the CNR Client by selecting the product to remove and then clicking on the Uninstall button. When the Uninstall button is clicked on the Client will shell out to apt-get and dpkg to remove the specified package from the user's machine. Once that process is completed, the Client will update its UI. Software UpdateThe user selecting a product that has an update available and clicking on the Update button initiates the updating of a product on the user's machine from the CNR Client. From that point on, the process is the same as the standard installation process. The CNR Client knows there are updates by comparing the packages that are installed on the user's machine to the index of packages the server gives it once every 24 hours. The packages that have a higher version on the server indicate that there is an update available and so the Client displays that status. History Tab - In ProgressThis tab will show a history of the last actions performed by the Client on this machine. The default configuration is to show the last 100 actions, but this setting can be increased or decreased by the user to suit their preference. The columns displayed are as follows:
The buttons for this tab are:
Configuration Tab - In ProgressOn this tab the user will be able to change the appearance and aspects of the CNR Client. The interface will have a list of configuration modules to the left and a workspace in the body of the interface. The list of modules includes:
CNR Command Line Interface - In ProgressThe CNR Client will have a command line interface so that the user can perform some of the same functions as the GUI without a dependency on X. |
There are no comments on this document