26. November 2012

by

In: OpenSUSE, Tech

Kommentare deaktiviert für jappix needs php-mbstring and will fail on SLES11

jappix is a fine piece of xmpp (jabber) based community building software.
Sadly, its installer needs php-mbstring (for SLES 11 SP2, this is php5-mbstring or php53-mbstring depending on your php choice). Sadly, it hides any error messages before requiring this crucial library. You will never know until you investigate closely.

Or as some person on the web paraphrased in German: was meinst du mit testsuite?
Software should not behave that way. Test suites and installers like jappix‘ setup.php should know how to handle missing dependencies and show them to users.

Debian is not affected. By luck or purpose, debian ships mbstring with the basic php package.

10. Juli 2012

by

In: horde, Tech

Kommentare deaktiviert für Horde 5 enters release cycle – First Alpha of Sesha Inventory App available

All’s well that ends well. During the last few days, the first alpha releases of the Horde Framework and some of its core apps hit the announcement list. Horde 5 sports a completely revamped user interface which allows a much tighter integration of the portal dashboard, ajax mode applications like the IMP Webmailer or traditional mode applications (whups ticketing etc).

Horde 5 has a completely renewed user interface (Image shows the IMP 6 webmailer)

While IMP, turba and the Ingo Mailfilter are already available as alpha packages, the calendar (kronolith) is not yet done.

However, today Horde release the first alpha version of the sesha inventory app. I have been working on sesha and related packages since horde 4, but things dragged on.

Sesha allows to organize any kind of items in a searchable inventory. First you have to define properties like age, weight, length or location of an item.

A defined group of properties makes up a category, something like an inventory type: Books, DVDs, network interfaces or computer monitors all have very different sets of properties. With sesha, there is no limit on the things you can put into your catalog. Just create categories of properties and finally add stock.

Sesha has been released under the GNU General Public License and may be used free of charge.

10. Mai 2012

by

In: Allgemein, horde, OpenSUSE, Tech

4 comments

Dear folks, I am very pleased to announce:
The Sesha Inventory application is ready for Horde 5 and it is in good shape. Sesha is a simple inventory keeping application which originally developed by Bo Daley and Andrew Coleman on Horde 3. The product was never officially released but it went into production at several sites. Sesha release cycle can now start together with the Horde 5 Alpha release cycle.

Sesha inventory can be configured to hold any number of stock categories with any number and type of attributes.
Like the original version, Sesha for Horde 5 can provide its stock categories as ticket queues for the horde ticketing application whups.
There are a lot of plans and ideas for upcoming versions but for this time the focus was on finishing a releasable product.There are no surprises for existing users of Horde 3 based sesha. Most work happened invisibly under the hood:

  • The Horde_Template library was exchanged by new Horde_View code
  • A migration script for database was added
  • Users can keep their original Horde 3 Sesha tables and data.
  • The sql backend driver was completely reworked into a driver based on the Horde_Rdo ORM library The new Driver Api provides enhanced search capabilities but the current frontend doesn’t make use of it. I do not plan to add any features to the classic view but start working on an Ajax view once the Horde 5 Redesign is completed. This may ship with Sesha 1.1 later on.
  • Object oriented code has replaced complicated hashes in many places

The Horde Rdo library is the new work horse inside Sesha. Rdo means Rampage Data Objects and is a lightweight ORM layer by Horde founder Chuck Hagenbuch. It maps database tables to PHP Objects. This is similar to the ActiveRecord pattern. Each database row can be turned into one Rdo item. For Sesha and another – non-public – software project, some enhancements went into the Rdo library for Horde 5:

  • Rdo now provides a caching factory or root object which speeds up creation of mapper objects
  • Methods for add, removing or checking many-to-many relations have been added
  • A number of edge case bugs have been fixed

I think the Horde 5 release cycle will start with alpha1 releases sometime in May. I know we’re a little late but it’s worth the wait.
That said, I welcome any early testing or updates of the language files. Provided everything works as expected, Sesha will be shipped with Horde 5 for OpenSUSE 12.2

27. März 2012

by

In: OpenSUSE, Tech

2 comments

Companies maintaining production servers often have a desire for stable, long-living Operating System and Software distributions. The idea is that once set up, things should not break and major upgrades should only be needed in long intervals and at points in time which best suit business operation. In the SUSE family of operating systems, openSUSE is the young and adventurous (fast-paced, community driven) branch while the SUSE Linux Enterprise (SLE Server and SLE Desktop) crowd is a stable, paid-for building block you can depend your mission critical data on. Enterprise platforms have a certain drawback: To maintain stability, they don’t ship the latest-greatest software packages and they try to stick to a certain set of core options and extensions.

For PHP Software, the Open Buildservice server:php:applications repository is one of the primary sources for up to date versions of software like PHPUnit, phpmyadmin, Horde Groupware or wordpress. While it is acceptable and desirable to have a stable and well-maintained (though old) version of apache or mysql, you don’t want to sit on an aged version of web applications or libraries and frameworks for developers.

Today, this repository switched to build against the new SLE11 SP2 code base. SLE11 comes with two PHP options: The php5-* packages which ship PHP 5.2 and the php53-* packages which ship PHP 5.3
Currently, some packages will not build as they require „php-{something}“ which is provided by multiple packages. We are working on resolving this.

The switch was needed because more and more packages rely on a more recent version of PEAR or PHP 5.3 features which simply cannot be provided in Service Pack 1 installations without adding extra repositories like server:php and server:php:extensions (unsupported, recent PHP 5.3 built against SLE11).

Please keep in mind that software from OBS is generally not supported by your SLE license.

19. März 2012

by

In: Tech

Kommentare deaktiviert für PHP goes git

Today the main PHP development branch has moved to the git version control system. In the past, PHP has been developed on cvs and svn. The move to git is very common these days. Git is, for example, the version control system used by the linux kernel developers and the Horde Application Framework.

PHP uses the github infrastructure for the public repository, which currently holds 52 branches. It will be interesting to see how they will convert their commit email script to git.

The public PHP git repository is available under http://github.com/php/php-src

15. März 2012

by

In: OpenSUSE

Kommentare deaktiviert für php5.3 packages in SLES 11 SP2

SLES 11 SP2 ships php5.3 binaries but the default package php5 still installs php5.2 which already has reached upstream end of life and should be considered unsupported by any means. Recent versions of phpunit and other developer tools won’t provide all features on php5.2 any more.
You must use apache2-mod_php53, php53, php53-mysql and so on if you want to use php on SLES.

2. März 2012

by

In: horde, OpenSUSE

Kommentare deaktiviert für Installing Horde 4 pear packages to a custom pear location (SUSE)

When installing horde to a custom pear location, you need to run the pear of your custom location, not the system pear with the custom location’s config.

So the steps would be:

 
1  mkdir /srv/horde 
2  pear config-create /srv/horde/ /srv/horde/pear.conf 
3  pear -c /srv/horde/pear.conf install PEAR 

as the install docs say but then:

4 /srv/horde/pear/pear -c /srv/horde/pear.conf channel-discover pear.horde.org 
5 /srv/horde/pear/pear -c /srv/horde/pear.conf run-scripts horde/Horde_Role 
6 /srv/horde/pear/pear -c /srv/horde/pear.conf install --alldeps horde/groupware 

Otherwise running the Horde_Role script will fail saying

config-set (horde_dir, /srv/horde/, user) failed, channel pear.php.net

This was experienced on SLES11SP1, SLES11SP2 and openSUSE Factory.

I did not test this for any debian based products yet.

22. Februar 2012

by

In: horde, OpenSUSE, Tech

Kommentare deaktiviert für Horde 5 is coming / Horde 3 support ends

The spring 2012 release of the Horde Application Suite and Framework will probably be called Horde 5. In a recent discussion the majority of developers agreed on a new major revision for some changes that some view as minor backward compatibility break. Currently planned features include:

  • New standard UI for „traditional view“
  • Move of Ajax code from specific apps to a common framework
  • Release of a small inventory management app (sesha)
  • complete configuration via UI (likely)
  • Webmail: Write support for smartphone view
  • Calendar: Resource calendar support for ajax view

At the same time, Horde 3 will no longer receive any support. Horde 3 has been around since 2005 and really has reached its end of life.

Since the Horde 4 release, The Horde 3 family of applications has only received critical bugfixes and security updates, the last being released this february. You should really consider updating to Horde 4 – the transition from Horde 3 to Horde 4 has been tested and done by numerous people and the transition from Horde 4 to Horde 5 should run smoothly as both releases are PEAR based.

I have already removed all things horde3 from OpenSUSE-Factory. OpenSUSE 12.2 will not ship Horde 3 any longer. Depending on packaging progress, openSUSE 12.2 will very likely ship Horde 5 or the most recent Horde 4 release. Horde 4 maintainence will continue.

Horde 3 Packages in the server:php:applications repository (see here) will be available at least until openSUSE 12.1 runs out of maintainence. I won’t give these much attention though. Please also note Eleusis Password Manager will be dropped with currently no planned replacement.

22. Februar 2012

by

In: horde, Tech

Kommentare deaktiviert für Horde Config: How to fill dropdowns with application data with configspecial

Horde provides system wide customisation and configuration of applications through php configuration files. These files can be edited by hand or written from an administrator config UI. This ui is automatically generated from a file called conf.xml located in your $application/config/ directory.

The config xml allows dropdowns, multiselect fields, tick boxes, radio buttons and even conditionally adding or removing a field or inserting a valid php expression.

For example a  dropdown box in the horde base application’s config is generated by this snippet:

2
   
    0
    1
    2
    3
   
  

This is all nice but what if you need to provide application data rather than static values? The answer is configspecial


    

How does that work?

calls the horde api. the „application“ part tells you which application’s api to call. You can either reference an application by its registry name (horde, imp, kronolith, turba…) or by its api name (horde,mail, calendar, addressbook)

What’s the difference? When you call turba, you get turba. When you call addressbook, you can hook into whatever application provides addressbook. For example, spam handling and ticket queues have been implemented by multiple applications. You can even implement your own handlers for any existing api.

The called application must have a method configSpecialValues() in its lib/Application.php class file. This method gets called and its only parameter is the „name“ property from the xml. In our example it’s „sources“. This method will return an array of source names to use in your config screen.

    /**
     * Returns values for  configuration settings.
     *
     * @param string $what  The configuration setting to return.
     *
     * @return array  The values for the requested configuration setting.
     */

    public function configSpecialValues($what)
    {
        switch ($what) {
        case sources:
            try {
                $addressbooks = Turba::getAddressBooks(Horde_Perms::READ);
            } catch (Horde_Exception $e) {
                return array();
            }
            foreach ($addressbooks as &$addressbook) {
                $addressbook = $addressbook['title'];
            }

            $addressbooks[''] = _("None");
            return $addressbooks;
        }
    }

Et voila – you have a list of addressbooks to choose from.

18. Februar 2012

by

In: Allgemein

Kommentare deaktiviert für The Author

The author is a developer and trainer in perl and PHP with several years of professional experience in both areas. While leaning strongly towards solutions involving the horde framework he also solved problems with perl catalyst, moose, CakePHP, wordpress, facebook api, PHP Symfony and Zend Framework.

Get my GPG key for secure communication.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)

mQGiBEcMloQRBADafXIRRYJN8V0k3KNtWq/TFxyEAKC+PvBfBE4evBPsGzS21BV0
xagaa2X6v2IAXFGGnc4CUzgKC11JN+EknEHuEumYCshFnqYLcy+26GPm5YF1Md0c
Yf7cdfx7eT5bE745Bzj4XSn7SlE+KRNERO5d9L4aJ4mcU2cOaqId5B52lwCg+e6F
+Efh6lPrUKZdLKjsOw5Qg4MD/30D3P/s8MUOhGRintjLtYpPu7YtAr48cjo1oDdS
5zhjUUG8tNhQzdGC3bNrVbo6P9cEJj6kikiu5xA1Hah+vLYajSINthB0CHBJgqO3
90UkkDdwaOiAzlo8Yfjqm7ti1l67snE6q7jCxbFDO7dcXFIV0AiGZ9vSsRU7c2+l
IDLmA/47k3Q3lEc8otiic52vZzuaRUGd7wU/IRlNNK3Fz4C+vkXk6awtoezRuDjH
QrOCyFMowGeiCg5h62o0YxPs6Y89DWZl0JESGeRoRjR71j2oTas9kQGoALy0VsbN
PtxzOjRKN2oRATIxz2SIyDQJaEIFNhvc0xF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jVSD3L/TdmyvVIrWlc6kiRWJjr4UlGCHtzPn+C
aE6LSaSUy6rCNp6ISQQYEQIACQUCRwyLmAIbDAAKCRBBEDAy+NzZRWLQAJ470qQy
qm/FwkcLJGKef30Q5bvpkwCfa67x45Uz9JhVm5eDjhFaiQUQkM8=
=5AYj
—–END PGP PUBLIC KEY BLOCK—–

18. Februar 2012

by

In: Allgemein, horde, Tech

Kommentare deaktiviert für Distributed applications with Horde 4

Synopsis

Horde’s powerful RPC API has been used numerous times to allow integration of horde-based data into external applications or remote sites. It also provides an easy to set up basis for distributed applications with headless workers. In this article I will give you a brief introduction on how to build a scalable distributed architecture based on Horde 4.

Distributed Architecture

Assumptions:

  •  You want your application to be scalable over several hosts. We call the controlling instance the master and the reacting instances the workers.
  •  You don’t want to keep a lot of state on the worker. Adding or removing a worker instance should not require complicated setup. Most cloud layers like OpenStack assume worker instances to be virtually stateless. The master is the single source of truth and should be able to rebuild any broken or lost worker setup from stored information.
  • You are working in a hostile environment, e.g. the internet. Firewall only allows select ports and data has to travel over lines you cannot trust. You want to resort to https transport with real certificates.

The master:

I won’t go into too many  details on the master setup this time. Create a basic app from the skeleton as the horde wiki describes. Separate a communication driver for worker Api calls from the driving logic in your app and don’t couple them too tightly. Usually you want small commits of changes to both the master’s idea and the worker’s reality and you want to check back if everything worked out. This doesn’t scale well on large-scale changes though.

Sometimes you want to make complex changes to the „truth“ or „theory“ in the master’s db before you commit them to the worker world out there.

Accessing the worker from the master:

The core piece of your communication with the worker are just a few lines of code

   protected function callWorker(WorkerInstance $worker, $callMethod, array $parameters = array()) {
       try {
            $http = new Horde_Http_Client(array('request.username' => $worker->rpcuser, 'request.password' => $worker->rpcuserpass, 'request.timeout' => 20 ));
            $response = Horde_Rpc::request(
                    'xmlrpc',
                    'https://' . $worker->worker_hostname . '/' . $worker->worker_subdir .'/rpc.php',
                    $callMethod,
                    $http,
                    array($parameters)
            );
        }
        catch (Exception $e) {
            throw new Appname_Exception($e);
        }
        return $response;
    }

This is a dumbed down version for demonstration purposes. You might want to model WorkerInstance based on Horde_Rdo, the horde ORM layer. It is desirable to evaluate lazy relations and lazy attributes. This has important performance implications but more on this in another post. We’re also selling consulting 😉

Worker setup:

We want a stateless worker instance. Obviously, this is theory. Truth is: You need a unique IP and you probably want a unique hostname. Nowadays cloud layers can provide that level of configuration. How about a horde instance without db?

horde/config/registry.local.php

You want the worker to talk under a specific api name. Add a block to your registry.local.php

 'myvpnworkerworker' => array (
        'name' => _("someworkerfooname"), /* we can even drop the _() as nobody will localize this */
        'provides' => 'myvpnworkerapp',
    )

horde/config/conf.php

This is stripped down to just the important lines
$conf['auth']['params']['htpasswd_file'] = '/not/in/webroot/passwords.secret';
 $conf['auth']['params']['encryption'] = 'plain'; /* In real world, you want to use some encryption instead */
 $conf['auth']['driver'] = 'http'; /* We want authentication by http layer after all */

We want the server to be stateless and not to rely on external data. We don’t want a local mysqld running and we don’t want a remote ldap either. We will store the credentials in a .htpasswd style file. For demonstration purposes, we use plain authentication.

The file would look like this:

passwd.passwd would look like this: 

rpcuser:totallysecretrpcuserpass
adminuser:adminpass
localdebuguser:secretlocaldebugpass

We also want to get rid of any components which cannot work without an sql backend

$conf['log']['priority'] = 'DEBUG';
$conf['log']['ident'] = 'HORDE';
$conf['log']['name'] = LOG_USER;
$conf['log']['type'] = 'syslog';
$conf['log']['enabled'] = true;
$conf['log_accesskeys'] = false;

As the worker will probably only show the admin UI to localhost or VPN, you want to log any debug relevant data locally into a file
$conf['prefs']['driver'] = 'Session';
$conf['alarms']['driver'] = false;

We don’t want user prefs or alarms on the worker. You might consider setting up some basic email delivery and sending alarms by mail. I won’t cover this here.

$conf['datatree']['driver'] = 'null';
$conf['group']['driver'] = 'Mock';

Datatree support is sql-only. Datatree is mostly legacy support and it isn't particularly fast either. There is no guarantee future horde revisions will support datatree. You don't want it. Period. You don't want groups either. The primary user of your instance is the RPC user.
$conf['perms']['driver'] = 'Null'

Only the master speaks to your worker and this must be ensured on the ssl/https layer. No need for a perms backend

$conf['cache']['driver'] = 'File';

If we use caching at all, we want to use a primitive one.

$conf['lock']['driver'] = 'Null';
$conf['token']['driver'] = 'Null';

Horde_Locks is a cool library. Ben Klang wrote it in 2008 when I was working in a non-public project that needed it and I mailed some stuff to him. But it’s sql-only. We don’t want it here.
Horde_Tokens are essential for a lot of verification tasks but the worker is not the single source of truth.

$conf['vfs']['type'] = 'File';

You probably don’t want a vfs at all. Vfs means state.

$conf['sessionhandler']['type'] = 'Builtin';

Anything but sql. You probably don’t want sessions.

This should be the key parts to make your stock horde installation not want a database at all.

The RPC Worker app.

The key to your RPC worker app is Api.php

This is the entry point for any Horde RPC calls.

Basically it works this way:

  • The upper layer of array() is internal to the horde rpc request layer
  • In our client example we wrapped our params into an additional array() to facilitate optional parameters. This means any method in Api.php accepts an array as the single parameter. You could also use a fixed list of parameters with optionals in the rear positions.
  • While the horde registry calls applications apis as ‚domain/function‘, the rpc api calls them as domain.function. Examples are horde.listApis and myvpnapp.fetchData

Any function  you can call from the outside is a method in Fooworkername_Api in Fooworkername/lib/Api.php.

Concurrency and queueing:

Horde is written in PHP. PHP is generally lacking in thread safety and doesn’t support real forking from within an apache module. You can however fork and detach processes using shell_exec. Horde ships some classes which help you use PHP in a shell environment but sometimes you want to resort to shell scripts or perl or anything else because it already exists or is more suitable to the job. shell_exec allows you use all of these. Usually you want your api calls to return fast. This doesn’t scale well. Make sure your individual call usually finishes in predictable worst case scenarios in 1/3 of the client’s response timeout. In our example we chose 20 seconds for timeout. Mind network latency and external script worst case runtime.

The solution here is decoupling:

  • Don’t make any UI element depend on live data from the worker
  • make a service/daemon or cron job collect worker state at short intervals and serialize these data points in time stamped files or directories
  • Create an api entry point to collect most recent state/results
  • Collect results of all workers from a commandline script, daemon, cron job or service in reasonable sequences.
  • Don’t expect most tasks immediately but add them to a queue. Horde_Queue may help you with that task.

Choose wisely where to call existing external apps and where to resort to PHP and the Horde Framework to solve common data collection, processing, formatting and returning tasks.

Remember to have fun.

The author is severly biased towards all things horde and has used horde classes and applications to solve various work-for-hire problems. The Horde Framework is one of the oldest and mature php projects and drives mission critical collaboration and data retrieval software all over the globe.

22. November 2011

by

In: Allgemein, OpenSUSE, Tech

Kommentare deaktiviert für Using socat or netcat to debug unix sockets like telnet for tcp

Sometimes you want to debug a service with a clear text protocol, but it uses unix sockets instead of INET sockets.

Surprisingly, there is little info on this around the net.

An easy solution would be socat:

socat UNIX-CONNECT:/var/run/blabla/nameofthe.sock STDIN

EDIT: Linux consultant Stefan Seyfried pointed out, that from openSUSE 12.1 onwards you can also use netcat. The new opensuse version ships netcat-openbsd.

The syntax is:

nc -U /var/run/blabla/namedersocket.sock

3. September 2011

by

In: OpenSUSE, Tech

1 comment

OpenSUSE Ambassador Roger Luedecke has just started a petition towards the Hewlett-Packackard Company (HP) to release the WebOS source code under the GPL license. Luedecke says, „I care deeply about this very important issue“. WebOS is a mobile operating system based on Linux and was originally developed by handheld computer producer Palm, who are now a subsidy of HP. According to Luedecke, HP is know to be FOSS friendly to a remarkable degree. There are hopes that his petition might trigger some action at HP, though nothing can be forced. That’s why the openSUSE community is asked to support this petition. Luedecke writes: „Ultimately we can’t pressure them in regards to a technology they own, not so far as I know. But its worth a shot.“

Sign the petition at change.org

1. September 2011

by

In: Allgemein, OpenSUSE, Tech

5 comments

Today, openSUSE Program Manager Andreas Jaeger announced that openSUSE will stop shipping Sun Java in the upcoming 12.1 release.
Distribution users will now only be offered the GPLed openJDK. In a recent announcement, Oracle declared openJDK to be the new official reference implementation for Java SE7. Along with that move, Oracle dropped the „Distributor’s License for Java (DLJ)“ which was required for redistributing Sun Java. Users depending on Sun/Oracle Java are now required to download it directly from the oracle website. Since the acquisition of sun by oracle, the companny has been known for questionable moves which alienate parts of the opensource community. Among these was the OpenOffice dispute which led to the departure of many developers to form LibreOffice. The former sun-owned mysql database has also seen a fork called MariaDB. According to Jaeger, openSUSE will continue to provide the existing packages in the Java:sun:Factory project but will not update them anymore and won’t ship them with the new distribution. Users are urged to switch to either openJDK or the versions available directly from Oracle.

30. August 2011

by

In: horde, OpenSUSE, Tech

Kommentare deaktiviert für Horde Project pushes libraries to the frontpage

As you might know, the horde project does not only release a set of production quality software (and an interesting bunch more which are not yet release quality) but also provides over 80 well-designed loosely coupled libraries which help you build websites, business applications or even commandline tools. To stress that point, the Horde Project now put a link to the list of components right on their frontpage. Use Horde_Rdo, a lightweight ORM layer or use the RFC-compliant Imap_Client library which performs equally or even better compared to PHP’s interpreter extension written in c. Horde_Auth, a versatile and pluggable authentication layer, has recently been featured in a series of blog posts by lead developer Jan Schneider.
Like in Symfony or Zend Framework, Components are released along with a PHPUnit based test suite adapted in the Horde_Test class and can be obtained individually through the Horde Pear Channel.