openSUSE:WebYaST Installation

Aller à : navigation, rechercher
Language.png Cette page n'est pas encore traduite (ou pas complètement)

Cet article a besoin d'être traduit. Merci de participer au travail si vous en avez le temps et la compétence.
Si vous cherchez quelque chose à faire, regardez les autres Pages à traduire.

Installation avec le one click ( La version courte )

La façon la plus simple est d'utiliser le one-click install qui est déjà installé sur votre openSUSE.

Installation

Utilisez simplement votre navigateur web (firefox ou autre) avec l'URL suivante :

Le navigateur vous demandera de démarrer l'installation via le one-click install. Démarrer l'installation et laissez vous guider.

Démarrer et gérer WebYaST

WebYaST est une application web qui fonctionne sur deux serveurs http sur votre système. Pour démarrer et gérer ces serveurs, il existe un bel applet Qt qui peut être lancé, par exemple sous KDE :

Qwebyast2.jpeg

Après avoir démarré l'applet WebYaST, l'icône WebYaST apparait dans la barre :

Qwebyast-disabled.png WebYaST est desactivé

Qwebyast-enabled.png WebYaST est activé

Avec un clic droit, vous pouvez gérer WebYaST :

Qwebyast-2.jpeg

Avec cet applet, vous pouvez ausi démarrer WebYaST dans votre navigateur. Après avoir accepté la clé GPG, connectez-vous avec votre compte “root”, comme si vous utilisiez YaST.

Installation and running from packages (RPM) ( the long story )

Installation

A build service project is located here

Repositories with up to date packages is located here

As some additional packages (e.g. nginx) are needed which are not on openSuSE 11.3 you should add a repositories ( e.g. factory ) in order to provide these packages. Current version need only ruby extension repository.

Web-YaST core contains following packages:

  • server side (running on managed system)
    • webyast-base-ws (core service)
  • client side (serving html pages to a browser)
    • webyast-base-ui (the web client)

On top of that, modules can be added which provide management functionality:

  • webyast-*-ws (web service plugins)
  • webyast-*-ui (web client plugins modules)

See the complete list of packages for details on available packages and modules.

All other needed packages (ruby-rpam, rubygem-gettext, yast2-core with newer version,...) are located in this repository too and will be installed due the dependencies of the yast2-web* packages.


How to use the YaST-Webservice

Starting and access

After you have installed these packages you can start the YaST-Webservice-Server with

rcyastws start

The server is running as “localhost:4984″ with which you can connect with a web browser:

http://localhost:4984

This “pure” web page shows the available modules which can be used via the REST interface.

Configuration

Additional configuration stuff like

  • setup Hostname and Port
  • setup HTTPS connection
  • granting permissions for an single user

can be found here in the configuration part.

NOTE: This has already been done while the RPM-package installation.


How to use the YaST-Webclient

After you have started the YaST-Webservice-Server you also can start the YaST-Webclient:

rcyastwc start

Now you can use any browser and connect with 'http://<name of your computer>:54984' to your computer. The default rights of the YaST Webservice are set to root only. So you can login with the root password of that machine.


Testsuite Subpackages

WebYaST testsuite files are packaged into separate *-testsuite subpackages. These packages are not needed at runtime (for normal WebYaST use) and therefore they should not be installed by default.

These packages only provide the ability to verify some (ideally all) functions of WebYaST itself.

How to run the tests (under a non-root user):

 # change the directory to the selected WebYaST plugin (or the main application)
 cd /srv/www/yast/vendor/plugins/<plugin_to_test>
 # set the location of the main application directory
 export RAILS_PARENT=/srv/www/yast
 # set the path to testing DB (any writable location for the current user)
 export TEST_DB_PATH=~/webyast_test.sqlite3
 # set the test mode
 export RAILS_ENV=test
 # create the testing DB
 rake db:create
 rake db:schema:load
 # and finally run the tests
 rake

When testing is finished the testing DB file (~/webyast_test.sqlite3 in this case) can be safely removed.

Note: Because the log file is not accessible for unprivileged users all log messages are be printed on the console. This includes also simulated errors which are used to test some unexpected situations, therefore when an error message is printed it does not mean that there is a problem. The actual result is the summary printed in color (if the current terminal supports colors), e.g.:

57 tests, 88 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications

If there is an error the message is printed either in red or yellow color.


Installation from source (GIT) ( the logest story )

Install the WebYaST REST Service component

See REST service for technical implementation details. This page is about installing from source and enabling yastws (and root) to run it.

The packaged WebYaST rest-service uses https and lighttpd as http server - deployment of these features is not covered by this document.

Download the source code

git clone git://gitorious.org/opensuse/yast-rest-service.git

WebYaST is now on Gitorious and has its own developers group. Commenting other people code is really easy on Gitorious and lots of communication takes place this way.

Even though deploying from sources is pretty straightforward, getting the right packages is not.

Getting the "right" packages

This procedure works for openSUSE 11.1, 11.2 and SLE11 installations.

Ruby on Rails

Add repository with proper version of ruby on rails (2.3.4) . WebYaST is picky about rails version in the tradition of many other rails applications.

zypper addrepo http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.1/ "openSUSE:Tools"

And install rails rubygem

zypper in rubygem-rails-2_3
Other needed packages

We are installing yast-rest-service from source, but we still need some other packages from YaST:Web project.

zypper addrepo http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.2 "YaST:Web"
zypper in rubygem-rcov rubygem-sqlite3 rubygem-test-unit ruby-rpam ruby-dbus ruby-polkit collectd rubygem-static_record_cache

Collectd is needed for gathering data for the Status module, so it's kind of optional. To set it up run

insserv collectd
rccollectd start

Mocha rubygem (needed for running tests) and Gettext are available in the devel:languages:ruby:extensions project. YaST2 DBUS client and server are part of openSUSE (SLE).

zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.2 "devel:languages:ruby:extensions"
zypper in rubygem-mocha rubygem-gettext_rails yast2-dbus-client yast2-dbus-server rubygem-http_accept_language
YaST packages update

Some YaST modules had to be enhanced to handle WebYaST calls. These updates are available in the YaST:Web project, but the update is not straightforward because of a bug in zypper (bnc#522223). Even "zypper in -r REPO package" does not work. We have to find exact versions of packages and give them to zypper on the command line

zypper search -r "YaST:Web" -s yast2-users

or find all of the versions with one search

zypper search -r "YaST:Web" -s yast2

and then install (update) all of them using the versions we found.

zypper in yast2-users-2.17.28.2 yast2-2.17.70.1 yast2-storage-lib-2.17.78 yast2-storage-2.17.78 \
  yast2-registration-branding-openSUSE-2.17.28 yast2-registration-2.17.28 yast2-pkg-bindings-2.17.38 \
  yast2-network-2.17.78.1 yast2-country-data-2.17.34.2 yast2-country-2.17.34.2

Webservice rake tasks

WebYaST developers put all general purpose rake tasks into a single rubygem - webyast-rake-tasks. We install them by

cd yast-rest-service/webservice-tasks
rake package-local
sudo gem install package/webyast-rake-tasks-<version>.gem
cd -

Installing the gem needs to be done as root, insert version matching the created gem above.


Rest service deployment

After all the package updating trouble, deploying rest-service is fairly easy. This will gather policies of all modules and give root permission to use them. Also it will migrate the database and create necessary directories and configuration files, which some modules need.

cd yast-rest-service
sudo rake deploy_devel_all
cd -

Deployment needs to be done as root, since it creates/modifies files in the /etc/ directory.


Start HTTP server

To run the rest-service server as yastws user from the command line, we enter

cd yast-rest-service/webservice
su yastws
script/server -p 4984

Port 4984 is a IANA registered port number.

Skipping base system setup

When we are running Webyast for the first time, the system will take us to a "wizard", which consists of several modules. One of them is also "register SLE" module, which cannot be successfully used on openSUSE. Therefore this line has to be used to skip basesystem setup:

touch /var/lib/yastws/basesystem/finish

Installing the WebYaST web client component

This page is about installing from source.

The packaged WebYaST web-service uses https and lighttpd as http server - deployment of these features is not covered by this document.

Download the source

git clone git://gitorious.org/opensuse/yast-web-client.git

WebYaST is now on Gitorious and has its own developers group. Commenting other people code is really easy on Gitorious and lots of communication takes place this way.

Install needed packages

To generate CSS dynamically from .sass files is rubygem-haml required

zypper in rubygem-haml

Web client rake tasks

Updates stylesheets if necessary from their Sass templates.

rake sass:update 

In order to reduce the size and number of HTTP connections the CSS files should be compressed and bundled together.

cd webclient
rake css:min

The same should be done for javascript files

cd webclient
rake js:base

Status module:

cd ..
cd /plugins/status
rake js:status 

Users module

cd yast-web-client/plugins/users
rake js:users 

Web client deployment

Deploying web-client itself is fairly easy. This will build gettext translations (.po => .mo) and also migrate the database.

cd yast-web-client
rake deploy_devel_all
cd -

openSUSE 11.2 or later

You may encounter problems with gettext when running deploy_devel_all. Instead on OS11.2 or later run:

cd yast-web-client/webclient
rake db:migrate
cd -

Start HTTP server

We can run web-client as any user. To run the web-client server from the command line, enter

cd yast-web-client/webclient
script/server -p 54984

Port 54984 is a IANA registered port number.