Elektra  0.8.18
libelektra

Elektra serves as a universal and secure framework to access configuration parameters in a global, hierarchical key database.

Elektra

Elektra provides a mature, consistent and easily comprehensible API. Its modularity effectively avoids code duplication across applications and tools regarding configuration tasks. Elektra abstracts from cross-platform-related issues and allows applications to be aware of other applications' configurations, leveraging easy application integration.

Overview

Elektra consists of three parts:

  1. LibElektra is a modular configuration access toolkit to construct and integrate applications into a global, hierarchical key database. The building blocks are:
    • language bindings (inclusive high-level interfaces)
    • GenElektra, the code generator for type-safe bindings
    • plugins for configuration access behaviour and validation
  2. SpecElektra is a configuration specification language that is easy to use and self-contained in the same key database (i.e. written in any of the configuration file formats Elektra supports).
  3. Tools on top of LibElektra for administrators, such as CLI tools and GUIs.

To highlight a few concrete things about Elektra, configuration data can come from any data source, but usually comes from configuration files that are _mounted_ into Elektra similar to mounting a file system. As Elektra is a plugin based framework, there are a lot of storage plugins that support various configuration formats like ini, json, xml, etc. However, there's a lot more to discover like executing scripts (python, lua or shell) when a configuration value changes, or, enhanced validation plugins that won't allow corrupted configuration to reach your application.

As an application developer you get instant access to various configuration formats and the ability to fallback to a default configuration without having to deal with this on your own. As an administrator you can choose your favourite configuration format and mount this configuration for the application. This features easy application integration as any application using Elektra can access any mounted configuration. You can even mount /etc files such as hosts or fstab, so that there is no need to configure the same data twice in different files.

In case you're worried about linking to such a powerful library. The core is a small library implemented in C, works cross-platform, and does not need any external dependencies. There are bindings for other languages in case C is too low-level for you.

Why should I use Elektra?

Contact

Do not hesitate to ask any question on GitHub issue tracker, Mailing List or directly to one of the authors.

Quickstart

If you want to use Elektra for your application, read the application integration tutorial.

Installation

The preferred way to install Elektra is by using packages provided for your distribution. On Debian/Ubuntu, this can be done by running the following command:

```bash sudo apt-get install elektra-bin libelektra-dev ```

This will install the Elektra tools as well as everything needed to develop with Elektra.

If you're not running Debian/Ubuntu, check out the package list, download elektra directly or compile it yourself.

It is preferable to use a recent version: They contain many bug fixes and additional features. See INSTALL for other ways to install Elektra.

Usage

Now that we have Elektra installed, we can start using the kdb command and the qt-gui.

Here a small demo:

![asciicast](https://asciinema.org/a/cantr04assr4jkv8v34uz9b8r.png)

For import/export/mount formats see Plugins. For information about elektrified environment variables, see /src/libgetenv/README.md

Documentation

To get an idea of Elektra, you can take a look at the presentation.

The full documentation, including tutorials, glossary, and concepts and man pages is available in the GitHub repository.

You can read the documentation for the kdb tool, either

Goals

And in terms of quality, we want:

  1. Simplicity (make configuration tasks simple),
  2. Robustness (no undefined behaviour of applications), and
  3. Extensibility (gain control over configuration access)

Read more about the goals of Elektra

Facts and Features

News

Also see News and its RSS feed.

Sources

Packages

The preferred way to install Elektra is by using packages provided for your distribution:

Available, but not up-to-date (Version 0.7):

For OpenSUSE, CentOS, Fedora, RHEL and SLE Kai-Uwe Behrmann kindly provides packages for download. For Debian wheezy and jessie amd64 we provide latest builds. See build server below.

If there are no packages available for your distribution, see the installation document.

Download

Elektra's uses a git repository at GitHub.

You can clone the latest version of Elektra by running:

     git clone https://github.com/ElektraInitiative/libelektra.git

Releases can be downloaded from http and ftp://ftp.libelektra.org/elektra/releases/

Compiling

After downloading or cloning Elektra, cd to the directory and run the following commands to compile it:

Then you can use sudo make install to install it.

You can also use the `./configure` command to generate a cmake command with special options.

For more information, especially how to set CMake Cache, see here. Make sure to read how to add plugins, tools and bindings.

Build Server

The build server builds Elektra on every commit in various ways and also produces LCOV code coverage report.

To use the debian repository of the latest builds from master put following files in /etc/apt/sources.list. For jessie:

    deb     [trusted=yes] http://debian-stable.libelektra.org/elektra-stable/ jessie main
    deb-src [trusted=yes] http://debian-stable.libelektra.org/elektra-stable/ jessie main

For wheezy:

     deb     [trusted=yes] http://build.libelektra.org/debian/ wheezy main
     deb-src [trusted=yes] http://build.libelektra.org/debian/ wheezy main

Contributing

To start development, just clone the repo and start hacking! We prepared beginner friendly tasks for you.