0.8.16 Release

In case you do not yet know about it, here is an abstract about Elektra:

Elektra serves as a universal and secure framework to access configuration parameters in a global, hierarchical key database. 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.

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:
  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.

See https://libelektra.org

The same text as follows is also available here as html and here on GitHub

Highlights

Other important features

Plugins

Many new or vastly improved plugins are waiting to be explored.

curlget

The plugin curlget fetches a configuration file from a remote host before the configuration is being accessed:

kdb mount -R noresolver /tmp/curltest.ini system/curltest ini curlget url="https://raw.githubusercontent.com/ElektraInitiative/libelektra/master/src/plugins/ini/ini/plainini"
kdb ls system/curltest  # every get access will redownload the file

Thanks to Thomas Waser!

INI

The INI plugin is still under heavy development and was again nearly rewritten:

Thanks to Thomas Waser!

shell

This plugin allows you to executes shell commandos after kdbGet, kdbSet and kdbError (failing kdbSet):

kdb mount /tmp/test.ini system/shelltest ini array= shell 'execute/set=echo set >> /tmp/log,execute/get=echo get >> /tmp/log'
kdb set system/shelltest
cat /tmp/log

Thanks to Thomas Waser!

validation

The validation plugin is not new, but got many new features. It allows you to match values by a regex and set your own error messages in case a validation did not match.

Up to now, the regex was given as is to regcomp, which means that if the regex is contained anywhere in the value, the value is accepted.

Often this is not what we want, thus Thomas Waser added special support for icase, word and line validation. Additionally, flags allow you now to ignore the case or invert the match. This can be changed for every individual value or for the whole mountpoint.

Additionally, kdb vset validation was updated to use the new metadata and correctly match against the whole value.

Thanks to Thomas Waser!

hosts

Only minor improvements were necessary for the host plugin but it is quite matured already. The contract was changed so that ipv6 addresses for ipv4 addresses will be rejected:

# kdb mount --with-recommends /etc/hosts system/hosts hosts
# kdb set system/hosts/ipv4/localhost ::1
The command set failed...
Reason: localhost value: ::1 message: Address family not supported
# kdb set system/hosts/ipv6/localhost ::1

You can also comfortably and safely edit the hosts file with: kdb editor system/hosts hosts, then you have the functionality visudo for the hosts file.

rename

Again not a new plugin, but the plugin was greatly improved and many test cases were added.

Now you can set upper/lowercase individually for both sides:

  1. What applications see.
  2. What the configuration file contains.

For example, if you always want the keys in the configuration file upper case, but for your application lower case you would use:

kdb mount caseconversion.ini /rename ini rename get/case=tolower,set/case=toupper
kdb set user/rename/section/key valu
cat ~/.config/caseconversion.ini
#> [SECTION]
#> KEY = value

Thanks to Thomas Waser!

Resolver

Resolving by ~ as home directory now also for system and spec namespaces, thanks to Thomas Waser.

Files keep their previous owner, useful when root edits configuration files of others, thanks to Thomas Waser.

The resolver has many improvements to better detect conflicts.

The lock is now extended longer after the commit and already requested in the temporary file.

The warnings were improved when getcwd fails.

Resolver now can correctly handle conflicts with empty files. It can also better cope with frequent commits of the same binary. Elektra already reached some limits filesystems have.

Bindings

Java

Marvin Mall improved the Java binding, fixed the appending of keysets, added lots of documentation, and many unit tests.

C++

Some kind of misusage of vaargs is now detected at compile-time instead of crashing at runtime.

Generated C++

Value now supports convenience activations. Values can be used to activate context, no more layers are needed. Topological sorting makes sure that values are activated in the correct order, loops are not allowed anymore.

The bool operator< is now correctly inline (allows to use it in more than one translation unit)

Documentation

René Schwaiger reworked most of the documentation and fixed countless spelling mistakes and other problems.

Testing

Thanks to René Schwaiger

Maintainer

By default now ALL plugins except EXPERIMENTAL are included. Plugins will be automatically excluded if dependencies are missing.

The PLUGINS syntax was vastly improved. Now many categories can be intermixed freely and also categories can be used for exclusion.

E.g. to include all plugins without deps, that provide storage (except yajl) and are maintained, but not include all plugins that are experimental, you would use:

-DPLUGINS="NODEP;STORAGE;-yajl;MAINTAINED;-EXPERIMENTAL"

Details see /doc/COMPILE.md.

Renamed files:

/usr/include/elektra/merging/kdbmerge.hpp -> /usr/include/elektra/merging/mergingkdb.hpp

/etc/profile.d/kdb -> /etc/profile.d/kdb.sh

(So that it works on arch linux, thanks to Gabriel Rauter)

removed files:

was only necessary because of limitations of the build system and is now removed. It never had actual functionality, but was only a stub without a crypto provider selected.

new files:

more new files with ALL or EXPERIMENTAL:

new tests all in folder /usr/lib/elektra/tool_exec: testcpp_contextual_update testkdb_conflict test_keyname testmod_curlget testmod_dpkg testmod_jni testmod_profile testmod_semlock testmod_shell testtool_mergingkdb

Following Plugins are excluded on specific platforms:

new releases

The first release of the libraries libelektratools-full, libelektratools and libelektragetenv. They now have SOVERSION 0.

Development

You do not need to format the source manually anymore. Make sure that you run scripts/reformat-source before creating a PR.

clang-tidy helps you to add blocks to have better maintainable code.

Felix Berlakovich improved the performance of the augeas plugin and also contributed a script to benchmark different host plugin. His thesis can be downloaded from here. It contains benchmarks and discussions about augeas.

The CMake function add_plugin was completely rewritten. Now you do not have to register your plugin at multiple points but instead information of README.md is parsed to correctly register the plugin to categories as stated by infos/status and infos/provides.

The code generator for errors also yields macros. This avoids usage of the IDs, which can be problematic if multiple pullrequests are prepared at once.

Compatibility

This might be the last release supporting wheezy, because it gets more and more time-intensive to find workarounds for the old compiler. The C++11 regex do not work at all.

Binary Compatibility Test

When you execute the test cases of 0.8.15 against Elektra 0.8.16 following test cases fail. None of them effect the API.

Added API

in libease René Schwaiger added:

extern char const * elektraKeyGetRelativeName(Key const * cur, Key const * parentKey);

in libmeta Thomas Waser added (partly based on ideas/code from Felix Berlakovich):

extern void elektraMetaArrayAdd(Key *, char const *, char const *);
extern KeySet * elektraMetaArrayToKS(Key *, char const *);
extern char * elektraMetaArrayToString(Key *, char const *, char const *);
extern int elektraSortTopology(KeySet *, Key * *);

Tools

Qt-gui

Raffael Pancheri fixed an important issue which broke the synchronization because an key related to Elektra’s internal version information was missing.

Felix Berlakovich updated the qt-gui so that it uses a newly written sync-method added in libtools.

Gabriel Rauter added a desktop file that uses the new svg logo from René Schwaiger.

Portability

macOS

A lot of effort was invested to all test cases also run on macOS:

Thanks to René Schwaiger

Bugs

Get It!

You can download the release from here and now also here on GitHub

This release tarball now is also available signed by me using gpg

already built API documentation can be found here

Stay tuned!

Subscribe to the RSS feed to always get the release notifications.

For any questions and comments, please contact the Mailing List the issue tracker on GitHub or by mail elektra@markus-raab.org.

Permalink to this NEWS entry

For more information, see https://libelektra.org

Best regards, Markus