Elektra  0.8.18
0.8.18 Release

Release did not happen yet but is expected for today!

What is Elektra?

Elektra serves as a universal and secure framework to access configuration parameters in a global, hierarchical key database. For a small demo see here:

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

Highlights

Crypto Plugin

Gpg is now used to decrypt a master password, which is used by the individual crypto backends.

Furthermore, a new botan backend was implemented.

See here

Thanks to Peter Nirschl.

Open Interception

When Elektra directly modifies config files which are on the disc, and applications read the config files without Elektra, Elektra has no control over the access, e.g. we cannot dynamically calculate values. To avoid this, we wrote a library that intercepts the open-call.

Together with the mozprefs plugin, we got control over the configuration of Firefox and can dynamically change config values with all possibilities Elektra provides.

For easy setup, we implemented the script configure-firefox.

See here

Thanks to Thomas Waser.

Resolver

Resolvers in Elektra are the code that are responsible to determine where content should be read from and stored to. They are independent of the actual configuration file syntax.

The gitresolver allows you to get/store config data in git.

The blockresolver allows Elektra to take control of parts of the configuration file. This is useful for config files such as vim or zsh, which contain program code. The plugin allows you to split config files with special markers into parts containing code and others controlled by Elektra.

zsh completion

Added zsh completion file, and a script (kdb install-sh-completion) that installs bash+zsh completion when the default installation places do not work (e.g. for Mac OS X).

Thanks to Sebastian Bachmann.

Documentation

Quality

Compatibility

As always, the ABI and API of kdb.h is fully compatible, i.e. programs compiled against an older 0.8 version of Elektra will continue to work (ABI) and you will be able to recompile programs without errors (API).

Libtools

Libtools got a new major version (SOVERSION 0 -> 1):

Plugins

The plugins conditionals and mathcheck are incompatible because of changes in syntax.

Development

Packaging

Other

Get It!

You can download the release from here and also here on github

<<scripts/generate-hashsums>>

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

already built API-Docu 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 email elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

0.8.17 Release

Survey

First off: We created a survey questionnaire to gather more knowledge about the relevance of configuration systems. If you are involved in the development of free and open source software (FLOSS) you are the person we are looking for.

It would be a great help if you take this survey:

survey

It will be available till 18.07.2016 (anywhere on earth).

For every thoroughly and not anonymously finished survey € 40 cent will be donated to one of the following organizations of your choice:

Why should I use Elektra?

The three main points relevant for most people are:

  1. Even though Elektra provides a global keydatabase configuration files stay human read- and writable which allows us to integrate unmodified software.
  2. Flexible adoption on how the configuration is accessed via plugins: you can run arbitrary code, e.g. do a git commit or log/notify when configuration files are changed.
  3. Elektra allows you to specify configuration values:
    • use the value of other configuration values (symbolic links)
    • calculate the values based on other configuration values
    • validation configuration files
    • generate code based on it
    • https://github.com/elektrainitiative/libelektra/tree/master/src/plugins/README.md "and much more"

Read more about https://github.com/elektrainitiative/libelektra/tree/master/doc/WHY.md "Why using Elektra", which also contains since this release unique features, further reasons and limitations.

For a small demo see here

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

Highlights

Beginner friendly tasks

In this release starting developing Elektra gets easier:

For details about ELEKTRA_DEBUG and cmake, see individual points below.

Find-Tools

There is now a fine collection of external scripts which can executed by kdb + <script>. The new script kdb find-tools provides full text search over the meta data as provided by the scripts.

Developers should now https://github.com/elektrainitiative/libelektra/tree/master/scripts/README.md "add MetaData for their scripts.".

Thanks to Kurt Micheli!

Mac OS X Support

Because of its POSIX support one might think it would be trivial to support Mac OS X. Unfortunately there were many small issues, especially in the regular expression handling and the filesystem.

Nevertheless we finally fully support Mac OS X and the newly added travis build server makes sure it will stay this way.

A huge thanks to Manuel Mausz and Mihael Pranjić for fixing the issues and setting up travis:

jenkins

Now (nearly) every build job can be triggered from Pull Requests. For example:

For a full list see https://github.com/elektrainitiative/libelektra/tree/master/doc/GIT.md "here".

Thanks to Mihael Pranjić for the setup!

Fixes

Rework Add Plugin

CMake

for maintainers:

for developers:

and fixes:

See more about changes to plugin adding in cmake in the https://github.com/elektrainitiative/libelektra/tree/master/doc/decisions/cmake_plugins.md "plugin decision".

Experimental GSettings support

As part of the ongoing work of the bachelor thesis Integration of Elektra into the GNOME desktop environment we now have experimental support for Elektra as a GSettings backend on Linux (We will look into getting OS X support on a later date). When installed, applications using GSettings default backend will write to Elektra below the /sw key. The GSettings bindings are intended as a preview version so please do not use them in a production system.

To build the GSettings backend you have to explicitly add the binding even if ALL is given. e.g. -DBINDINGS=gsettings -DBINDINGS="ALL;gsettings"

All needed core functionality of a GSettings backend is already implemented. This includes notification support if you have your /sw mounted with the dbus plugin.

Please report any bugs you encounter.

For further information regarding the status of the implementations please refer to the corresponding README and ticket.

Common Provider Names

Mounting now supports to mount commonly known names even if the name is not a plugin. If more than one plugin is available automatically the best one is selected. The selection process works by annotating different qualities of the plugins, see infos/status in the README.md of individual plugins.

E.g. to mount a file using a json plugin (called yajl because of the library's name it build upon)

kdb mount file.json json

New Cachefilter Plugin

stores filtered keys internally so that they do not get accidentally lost and can be written to the storage again without the user having to remember including them in the writeout

The longer term goal is to add such global plugins per default, so that the usage of the API is easier.

For now you can simply add it using:

 kdb global-mount cachefilter

Thanks to Marvin Mall.

Qt GUI 0.0.12

The Qt GUI receives new features and a better gnome integration. Its version number was updated to 0.0.12 (beta). Major features:

Bug fixes:

Other improvements:

Thanks to Gabriel Rauter and Raffael Pancheri for the engagement in improving qt-gui.

Colored kdb tool

A big thanks to Gabriel Rauter for improving the user experience with the kdb tool. On errors and in kdb info it was often quite hard to find the relevant text.

Now important parts are highlighted by bold or colorful text. This helps to spot the important information immediately without sacrificing information that would be important for a detailed analysis.

Every tool now has the option --color and -C which is set to auto per default. By writing to:

kdb set user/sw/elektra/kdb/#0/color off

one can go back to previous behavior.

Documentation

ELEKTRA_DEBUG build

ENABLE_DEBUG now enables a debug build for Elektra. It has nothing to do with debug symbols, but:

ENABLE_DEBUG is recommended for every developer, even if you are not modifying Elektra itself. The assertions will give you hints on API misusage.

For example, keyNew was known to be error-prone. ENABLE_DEBUG now will report wrong parameters by an assertion.

The old options ELEKTRA_DEBUG and ELEKTRA_VERBOSE are not available anymore.

Thanks to:

The constants plugin was updated to provide cmake/ENABLE_LOGGER cmake/ENABLE_DEBUG and will no longer provide cmake/ELEKTRA_DEBUG_BUILD cmake/ELEKTRA_VERBOSE_BUILD

Other

Compatibility

As always, the ABI and API is fully forward- and backward-compatible, i.e. programs compiled against an older 0.8 version of Elektra will continue to work (ABI) and you will be able to recompile every program without errors (API). This time you can even compile programs against 0.8.17 and run with 0.8.16.

For the qt-gui the svg module is added as dependency.

New and missing files in the installation:

Renamed files:

Removed files:

Temporarily removed files:

Get It!

You can download the release from here and also here on github

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

already built API-Docu 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 email elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Best regards, Markus

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

See http://libelektra.org

The same text as follows is also available here as html and https://github.com/ElektraInitiative/libelektra/blob/master/doc/NEWS.md "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 sudoedit 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<sanssecours> 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 https://github.com/ElektraInitiative/libelektra/tree/master/doc/COMPILE.md "/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 symlinks:

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 testcases of 0.8.15 against Elektra 0.8.16 following testcases 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

Mac OS X

A lot of effort was invested to all test cases also run on Mac OS X:

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-Docu 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 elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Best regards, Markus

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

See http://libelektra.org

Overview

This is one of the largest release up to now. It includes many user-visible improvements. Some highlights:

The same text as follows is also available here as html and https://github.com/ElektraInitiative/libelektra/blob/master/doc/NEWS.md "here on github"

Global Mount

Sometimes you simply want some functionality for the whole key database. For example, you want to enable logging or notification of configuration changes. In previous versions, you had to change every mountpoint individually. Even more problematic, every mountpoint created its individual logs and notifications, without any way for someone to know if an application has issued its last log/notification.

These problems are now solved by global plugins. The same plugins are reused for this purpose. Also the mounting works nearly in the same way, you only have to omit the configuration file and the mountpoint:

    kdb global-mount syslog journald dbus

Voilà, from now on every configuration change gets logged to syslog and journald. Additionally, every application gets notified via dbus.

If you want it more verbose for debugging, you can easily do so by:

    kdb global-mount logchange counter

Which gives you detailed information to standard output which keys were changed/edited/deleted. Additionally, Elektra counts how often the counter plugin is invoked.

The underlying work for the global plugins, i.e. hooks in the core libraries and the list plugin that allows us to use many plugins without bloating the core was done by Thomas Waser.

It was already possible in earlier versions of Elektra to specify the configuration of your program. Until now, this specification could be mainly used to to generate code as described here. This release adds two more interesting options:

  1. the spec plugin, and
  2. the spec mount.

Spec Plugin

The most important global plugin that is now newly introduced with this release (thanks to Thomas Waser) is the spec plugin. By default it will be added for every global-mount. So for a new installation make sure you executed at least once:

    kdb global-mount

The spec plugin is a global plugin that copies metadata from the spec-namespace to other namespaces. That means, it reads the specification, and makes sure that the configuration conforms to it. The actual validation is done by the many validation plugins already present.

Lets start by saying a key is a long and must have at least the value 10:

    kdb setmeta spec/example/longkey check/type long

Then we can create a key in a different namespace and see if the spec plugin applies the meta-data correctly:

    kdb set /example/longkey 25
    kdb lsmeta /example/longkey

Should now at least print check/type. By itself, this is useful for documentation of keys. For example, the application developer says:

    kdb setmeta spec/example/longkey description "Do not change"
    kdb setmeta spec/example/longkey example 30

The user can retrieve this documentation by:

    kdb getmeta /example/longkey description

But we want check/type to be not only a documentation, but also enforced.

Spec Mount

Using kdb setmeta extensively and always looking out that all plugins are mounted correctly is error-prone. So instead, one can directly mount the plugins as specified. For the example above one simply needs:

    kdb setmeta spec/example mountpoint example.ecf
    kdb spec-mount /example

Now, when we try to modify /example/longkey it will be validated:

    kdb set /example/longkey a
    > Error (#52) [...] long [not] matched [...] a

Based on the present meta-data, the correct plugins (in this case type because of the metadata check/type) will be loaded.

We can also create a whole specification file, first mount the specification and then the mountpoint according the specification, e.g when we have battery.ini in the folder $(dirname $(kdb file spec)) with following content:

    []
    mountpoint = battery.ini
    infos/plugins = ini

    [level]
    check/enum = 'critical', 'low', 'high', 'full'

Then we can use:

    # mount the file itself:
    kdb mount battery.ini spec/example/battery ni
    # make sure all plugins are present (e.g. enum for check/enum):
    kdb spec-mount /example/battery

Now lets verify if it worked:

    kdb lsmeta /example/battery/level
    # we see it has a check/enum
    kdb getmeta /example/battery/level check/enum
    # now we know allowed values
    kdb set /example/battery/level low
    # success, low is ok!
    kdb set /example/battery/level wrong
    # fails, not one of the allowed values!

The main idea of the spec-mount is: search a plugin for every specification (meta-data) found in the spec-namespace.

General Mount Improvements

In earlier versions kdb mount failed when plugin dependencies were not satisfied. Now dependencies will automatically be fulfilled, e.g.

    kdb mount /etc/modules system/modules line

In earlier versions you would have got an error because of the missing null plugin. Now it simply adds the needed plugins.

The plugins given in the command-line used to be real plugins. Now also so called providers are accepted.

To make providers useful we need to actually know which plugin is the best candidate. To get the information we added a infos/status clause in the contract. In this clause the plugin developer adds many details how well the plugin is tested, reviewed, documented, maintained and so on. Based on this information, the best suited plugin will be chosen. For example, you now can use:

    kdb mount /etc/security/limits.conf system/limits augeas \
            lens=Limits.lns logging

And the best suitable logger will automatically be chosen.

The configuration variable /sw/kdb/current/plugins now allows us to pass plugin configuration with the same syntax as the plugin specification passed on the commandline. A subtle difference is that thus the shell-splitting of arguments is missing, it is not possible to include whitespaces in the plugin configuration that way.

Now it is also possible to include the same plugin multiple times and also give them individual names. This feature is essential for script-based plugins, e.g. you now might add:

    kdb mount file.x /example/mountpoint \
            lua#resolver script=resolver.lua \
            lua#storage script=storage.lua

Furthermore, kdb mount now supports recommendations, which can be enabled with --with-recommends. E.g. supplied to the mount command using augeas above, comments will automatically transformed to meta-data to avoid cluttering of the real configuration.

Library Split

Up to now, Elektra consisted only of a single shared library, libelektra.so. Not all symbols in it were relevant to end users, for example, some were only needed by plugins. Others were only proposed and not yet part of the stable API. And finally, other symbols were not needed in some situations, e.g. the plugins do not need the kdb interface.

Thus, we split libelektra.so, so that only coherent parts are in the same library:

The source code is now better organized by the introduction of a libs folder. The explanation of every library can be found in /src/libs/.

The rationale of the library split is documented https://github.com/ElektraInitiative/libelektra/blob/master/doc/decisions/library_split.md "here". Shortly put, it was needed for further evolution and allowing us to grow and enhance without getting a fat core.

Thanks to Manuel Mausz for fixing many bugs related to the library split and also adapting all the bindings for it.

Benchmark

To show that the split does not make Elektra slower, Mihael Pranjić made a small benchmark. The real time of benchmarks/large and revision 634ad924109d3cf5d9f83c33aacfdd341b8de17a

  1. kdb-static: Median :0.8800
  2. kdb-full: Median :0.8700
  3. kdb: Median :0.8700

So it seems that the split does not influence the time of running elektrified processes.

Times were measured with time(1) and the median is calculated for 21 runs of benchmarks/large. This was done using scripts/benchmark_libsplit.sh

Compatibility

As always, the ABI and API is fully forward-compatible, i.e. programs compiled against an older 0.8 version of Elektra will continue to work (ABI) and you will be able to recompile every program without errors (API).

We added keyGetNamespace which allows us to handle all namespaces in a switch and to iterate all namespaces. This is essential, when a new namespace is added, thus then the compiler can warn you about every part where the new namespace is not yet considered. We currently do not plan to add a new namespace, but better be safe than sorry.

The internal function keyCompare now also detects any meta-data change.

libtools was nearly rewritten. Even though it is mostly API compatible (you should not use the low-level Backend anymore but instead use the BackendBuilder), it is certainly not ABI compatible. If you have an undefined symbol: _ZN3kdb5tools7Backend9addPluginESsNS_6KeySetE you need to recompile your tool. Even the merging part has ABI incompatibility (different size of _ZTVN3kdb5tools7merging14NewKeyStrategyE). Unfortunately, we still cannot guarantee compatibility in libtools, further changes are planned (e.g. implementing mounting of lazy plugins).

The python(2) and lua interfaces changed, an additional argument (the plugin configuration) is passed to open.

The INI plugin was rewritten, so many options changed in incompatible ways.

The default format plugin (e.g. for import/export) is no longer hardcoded to be dump. Instead KDB_DEFAULT_STORAGE will be used. To get KDB_DEFAULT_STORAGE you can use the constants plugin:

    kdb mount-info
    kdb get system/info/constants/cmake/KDB_DEFAULT_STORAGE

Thanks to Manuel Mausz plugins do no longer export any method other than elektraPluginSymbol. It now will fail if you directly linked against plugins and did not correctly use their public interface. Please use the module loading and access functions via the contract.

The CMake and Pkgconfig Files now only link against elektra-core and elektra-kdb. If you used some symbols not present in kdb.h, your application might not work anymore.

libelektra.so is still present for compatibility reasons. It should not be used for new applications. Some unimportant parts, however, moved to the "sugar" libraries. E.g. the symbol elektraKeyCutNamePart is no longer part of libelektra.so.

Bootstrapping

When you use kdbOpen in Elektra as first step it reads mountpoint configuration from /elektra. This step is the only hardcoded one, and all other places of the KDB's tree can be customized as desired via mounting.

The bootstrapping now changed, so that /elektra is not part of the default configuration default.ecf (or as configured with KDB_DB_FILE), but instead we use elektra.ecf (or as configured with KDB_DB_INIT). This behaviour solves the problem that default.ecf was read twice (and even differently, once for /elektra and once for /).

To be fully compatible with previous mountpoints, Elektra will still read mountpoints from default.ecf as long as elektra.ecf is not present.

To migrate the mountpoints to the new method, simply use:

    kdb upgrade-bootstrap

which basically exports system/elektra/mountpoints, then does kdb rm -r system/elektra/mountpoints so that default.ecf will be without an mountpoint and thus the compatibility mode does not apply anymore. As last step it will import again what it exported before.

https://github.com/ElektraInitiative/libelektra/blob/master/doc/decisions/bootstrap.md "Details are here"

Plugins

We already highlighted the new spec plugin, but also other plugins were improved at many places. Small other changes are:

Larger changes were done in the following plugins:

INI

The INI plugin was rewritten and a huge effort was taken so that it fully-roundtrips and additionally preserves all comments and ordering. Currently, it is brand new. It is planned that it will replace dump in the future.

Currently is has some minor problems when used as KDB_DEFAULT_STORAGE. You can avoid most problems by mounting a different file into root:

    kdb mount root.ini /

Read here about the details.

A huge thanks to Thomas Waser.

Rename

Thanks to Thomas Waser rename is now fixed for cascading keys. Additionally, it does not change the sync status of the keys so that notification plugins work properly afterwards.

Crypto

The crypto plugin is a facility for securing sensitive Keys by symmetric encryption of the value. It acts as a filter plugin and it will only operate on Keys, which have the meta-key „crypto/encrypt“ set.

The key derivation is still work-in-progress, so the plugin does not work with kdb yet. A planned method for key derivation is to utilize the gpg-agent.

For now the plugin requires the following Keys within the plugin configuration in order to work properly:

  1. /crypto/key - the cryptographic key (binary 256 bit long)
  2. /crypto/iv - the initialization vector (binary 128 bit long)

Please note that this method of key input is for testing purposes only and should never be used in a productive environment!

Thanks to Peter Nirschl, especially the patience for also supporting different platforms where dependencies need to be handled differently.

KDB

A technical preview of a new tool was added: kdb editor allows you to edit any part of Elektra's configuration with any editor and any syntax. It uses 3-way merging and other stable technology, but it currently does not provides a way to abort editing. So you only should use it with care.

The tool kdb list now searches in the rpath for libraries and thus will also find plugins not present at compile time (using glob). Additionally, it sorts the plugins by infos/status score, which can also be printed with -v. The last plugins printed are the ones ranked highest.

When running as root, kdb will now use the system namespace when writing configuration to cascading key names.

Long paths are cumbersome to enter in the CLI. Thus one can define bookmarks now. Bookmarks are key-names that start with +. They are only recognized by the kdb tool or tools that explicitly have support for it. Applications should not depend on the presence of a bookmark. For example, if you set the bookmark kdb:

    kdb set user/sw/elektra/kdb/#0/current/bookmarks
    kdb set user/sw/elektra/kdb/#0/current/bookmarks/kdb user/sw/elektra/kdb/#0/current

You are able to use:

    kdb ls +kdb/bookmarks
    kdb set +kdb/format ini

The kdb tool got much more robust when the initial configuration is broken, no man page viewer is present or Elektra was installed wrongly.

The --help usage is unified and improved.

The new keyname naming conventions are now used for configuration of the kdb-tool itself: /sw/elektra/kdb/#0/%/ and /sw/elektra/kdb/#0/current/ are additionally read. The option -p/--profile is now supported for every command, it allows to fetch configuration from /sw/elektra/kdb/#0/<profile>/ instead of current. KDB is more robust when it cannot fetch its own configuration due to KDB errors.

Coding Guidelines

Thanks to Kurt Micheli the code guidelines are https://github.com/ElektraInitiative/libelektra/blob/master/doc/CODING.md "now properly documented". Thanks to René Schwaiger we also provide a style file for clang-format.

Furthermore we unified and fixed the source:

C++11 migration

Since we now only use C++11, we applied clang-modernize which simplified many loops and replaced many 0 to nullptr. Additionally, we added override and default at many places.

We removed all places where we had ifdefs to use auto_ptr if no modern smart pointer is available.

Because of these changes there is no easy way to compile Elektra without C++11 support, except by avoiding the C++ parts all together.

The C++ KeySet now also supports a get to retrieve whole containers at once. By specializing KeySetTypeWrapper you can support your own containers. Currently only map<string, T> is supported (T is any type supported by Key::get).

If you haven't removed it from your flags already, there is no use anymore to set ENABLE_CXX11.

Documentation

The documentation was improved vastly. Most thanks to Kurt Micheli who did a lot of editing and fixed many places throughout the documentation Also thanks to Michael Zehender who added two paragraphs in the main README.md.

Keynames of applications should be called /sw/org/app/#0/current, where current is the default profile (non given). org and app is supposed to not contain / and be completely lowercase. Keynames are documented here. See also here. The main reason for long paths is the provided flexibility in the future (e.g. to use profiles and have a compatible path for new major versions of configuration). By using bookmarks, users should not be confronted by it too often.

Thanks to Kurt Micheli, developers are now warned during compilation on broken links in Markdown. The output format is the same as for gcc. Additionally, the markdown documentation of plugins now get a proper title in the pdf and html output of doxygen.

Qt-Gui 0.0.10

Raffael Pancheri again updated qt-gui with many nice improvements:

Packaging and Build System

Elektra 0.8.14 now in Debian with qt-gui, man pages, thanks to Pino Toscano read more here

Thanks to Gustavo Alvarez for updating and splitting the packages on Arch Linux!

Thanks to Harald Geyer, Elektra is now packaged for OpenWRT. We fixed a number of cross-compilation issues and now officially support building against musl libc, with one minor limitation: RPATH works differently on musl so you need to install all plugins directly in /usr/lib/ or set LD_LIBRARY_PATH. Report any bugs in Harald's OpenWRT packaging issue tracker.

Read about other packages here.

Fixes and Improvements

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-Docu 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 elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Best regards, Markus

0.8.14 Release

Again we managed to release with many new features and plugins (lua, enum, list, crypto, csvstorage, conditionals, mathcheck, filecheck, logchange) many fixes, and especially with a vastly improved polished documentation.

Documentation Initiative

The Documentation Initiative is a huge success and now the documentation of Elektra is in a state where someone (preferable a linux guru), never heard of Elektra, still can use Elektra only by reading man pages.

There are now many ways to show a man page:

Help system

Ian Donnelly wrote man pages for all the tools delivered with Elektra. Additionally, nearly all README.md are now also converted to man pages and also to Doxygen.

Doxygen Filter

Kurt Micheli did an amazing work with a new doxygen filter. The filter allows all Elektra markdown pages to be also included in the doxygen documentation. Thus all technical concepts are now explained in Markdown pages, this filter is essential.

But even more, the filter also includes all man pages written for the tools, giving a nice html view for them. (In addition to the markdown rendering on github).

Enjoy the result.

A big thanks to Kurt Micheli!

Further Docu fixes

Simplicity

We shifted our http://git.libelektra.org/blob/master/doc/GOALS.md "goals" a bit: We want to prefer simplicity to flexibility. Not because we do no like flexibility, but because we think we achieved enough of it. Currently (and in future) you can use Elektra:

But we cut flexibility regarding:

Qt-gui 0.0.9

Raffael Pancheri again updated his qt-gui to version 0.0.9 (beta) with important of fixes and improvements:

A bit thanks to Raffael Pancheri!

Compatibility

As always, the API and API is fully forward-compatible, i.e. programs compiled against an older 0.8 versions of Elektra will continue to work.

The behaviour of some plugins, however, changed:

Build System

ENABLE_CXX11 does not exist anymore, it is always on. We do not care about 199711L compilers anymore, which makes development easier, without losing any actually used platform.

Some programs that are only used in-source are not installed anymore. (by Pino Toscano)

Python and Lua plugins are enabled now in -DPLUGINS=ALL.

Python3 plugin was renamed to python.

Lua Plugin

Manuel Mausz add a lightweight alternative to the python plugin: the lua plugin. In a similar way, someone can write scripts, which are executed on every access to the http://libelektra.org/blob/master/doc/help/elektra-glossary.md "key database".

To mount a lua based filter, you can use:

kdb mount file.ini /lua ini lua script=/path/to/lua/lua_filter.lua

Even though it works well, it is classified as technical preview.

Thanks to Manuel Mausz for this plugin!

Cryptography Plugin

In this technical preview, Peter Nirschl demonstrates how a plugin can encrypt Elektra's values. In testcases it is already able to do so, but for the end user an easy way for key derivation is missing.

A big thanks to Peter Nirschl!

INI Plugin

The INI plugin got a near rewrite. Now it handles many situations better, has many more options and features, including:

Thanks to Thomas Waser for this work!

Mathcheck plugin

This plugin allows you to check and even calculate keys from other keys using an polish prefix notation. It supports the typical operations + - / * and <, <=, ==, !=, =>, >, :=. To mount, check and calculate values, one would use:

kdb mount mathcheck.dump /example/mathcheck dump mathcheck
kdb setmeta user/example/mathcheck/k check/math "== + a b"
kdb setmeta user/example/mathcheck/k check/math ":= + a b"

For details see the documentation.

Thanks to Thomas Waser for this important plugin!

List Plugin

Currently, Elektra has some limitations on how many plugins can be added to certain http://libelektra.org/blob/master/doc/help/elektra-plugins-ordering.md "placement". Because of the rapidly growing number of plugins, some combinations are not possible anymore.

This plugin tackles the issue, by delegating the work to an arbitrary number of subplugins. As a bonus, it works lazily and thus might avoid the loading of some plugins all together.

Thanks to Thomas Waser for this plugin!

Conditionals

Brings if inside Elektra. It lets you check if some keys have the values they should have.

    kdb mount conditionals.dump /tmount/conditionals conditionals dump
    kdb set user/tmount/conditionals/fkey 3.0
    kdb set user/tmount/conditionals/hkey hello
    kdb setmeta user/tmount/conditionals/key check/condition "(hkey == 'hello') ? (fkey == '3.0')" # success
    kdb setmeta user/tmount/conditionals/key check/condition "(hkey == 'hello') ? (fkey == '5.0')" # fail

For details see the documentation.

Again, thanks to Thomas Waser for this plugin!

Csvstorage Plugin

You can now mount csv-files. To mount test.csv simply use:

kdb mount test.csv /csv csvstorage

There are many options, e.g. changing the delimiter, use header for the key names or predefine how the columns should be named. For details see the documentation.

Thanks to Thomas Waser!

Filecheck plugin

This plugin lets you validate lineendings, encodings, null, bom and unprintable characters.

The also new plugin lineendings is already superseded by the filecheck plugin.

Thanks to Thomas Waser!

Enum plugin

The Enum plugin checks string values of Keys by comparing it against a list of valid values.

Thanks to Thomas Waser!

Elektrify Machinekit.io

We are proud that Machinekit starts using Elektra.

Alexander Rössler is digging into all details, and already enhanced the DBUS Plugin for their needs. DBus now can emit a message for every changed key.

A big thanks to Alexander Rössler!

Bugfixes

Other Gems

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-Docu 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 elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Btw. the whole release happened with http://libelektra.org/blob/master/src/libs/getenv/README.md "elektrify-getenv" enabled.

Best regards, Markus

0.8.13 Release

Again we managed to release with many new features, many fixes and also other improvements.

Elektrify-getenv

getenv(3) is one of the most popular ways to retrieve configuration, even though it has many known problems:

With elektrify-getenv we wrote a solution which solves most of the problems. We use the LD_PRELOAD technique to additionally retrieve values from Elektra, and not only the environment.

You simply can do:

```bash kdb set user/env/override/HTTP_PROXY "http://my.proxy:8080" ```

This will set the HTTP_PROXY environment variable to http://my.proxy:8080. Configuration can be retrieved with kdb get:

```bash kdb get user/env/override/HTTP_PROXY lynx # or start another www-browser with the newly set HTTP_PROXY ```

Or using the man pages:

kdb elektrify-getenv man man --elektra:MANWIDTH=40

Will use MANWIDTH 40 for this invocation of man man. This feature is handy, if an option is only available by environment, but not by command-line arguments, because sometimes environment variables are not trivial to set (e.g. in Makefiles).

Some more examples:

kdb set user/env/override/MANOPT -- "--regex -LC"
kdb elektrify-getenv getenv MANOPT   # to check if it is set as expected
kdb getenv MANOPT   # if /etc/ld.so.preload is active

So is this the final solution for configuration and manual elektrification of applications is not needed anymore?

The answer is: no and yes.

It is quite satisfactory for configuration that is inherently sharable (not different from one application to another) and needs the environment semantics, i.e. some subprocesses should have different configuration than others, e.g. in a specific terminal.

But it might not be a good solution for your own application, because libgetenv(3) implies many architectural decision, that other elektrified applications would decide differently, e.g.:

For more information see http://git.libelektra.org/blob/master/src/libs/getenv/README.md "src/libgetenv/README.md"

Compatibility

As always, the API and API is fully forward-compatible, i.e. programs compiled against an older 0.8 versions of Elektra will continue to work.

Because keyUnescapedName and keyGetUnescapedNameSize is added in this release, it is not backward-compatible, i.e. programs compiled against 0.8.13, might not work with older 0.8 libraries.

The function keyUnescapedName provides access to an unescaped name, i.e. one where / and \\ are literal symbols and do not have any special meaning. NULL characters are used as path separators. This function makes it trivial and efficient to iterate over all path names, as already exploited in all bindings:

Other small changes/additions in bindings:

Doxygen 1.8.8 is preferred and the configfile was updated to this version.

The symbols of nickel (for the ni plugin) do not longer leak from the Elektra library. As such, old versions of testmod_ni won't work with Elektra 0.8.13. A version-script is now in use to only export following symbols:

In this release, ENABLE_CXX11 was changed to ON by default.

Note that in the next release 0.8.14 there will be two changes:

By not having to care for pre-C++11 compilers, we hope to attract more developers. The core part is still in C99 so that Elektra can be used on systems where libc++ is not available. Many new plugins are still written in C99, also with the purpose of not depending on C++.

Python Plugins

A technical preview of python3 and python2 plugins has been added.

With them its possible to write any plugin with python scripts.

Note, they are a technical preview. They might have severe bugs and the API might change in the future. Nevertheless, it is already possible to, e.g. develop storage plugins with it.

They are not included in ALL plugins. To use it, you have to specify it:

-PLUGINS="ALL;python;python2"

Thanks to Manuel Mausz for to this work on the plugins and the patience in all the last minute fixes!

Qt-gui 0.0.8

The GUI was improved and the most annoying bugs are fixed:

A big thanks to Raffael Pancheri!

KDB Tool

The commandline tool kdb also got some improvements. Most noteworthy is that kdb get -v now gives a complete trace for every key that was tried. This is very handy if you have a complex specification with many fallback and override links.

It also shows default values and warnings in the case of context-oriented features.

Furthermore:

Documentation Initiative

As Michael Haberler from machinekit pointed out it was certainly not easy for someone to get started with Elektra. With the documentation initiative we are going to change that.

Any further help is very welcome! This call is especially addressed to beginners in Elektra because they obviously know best which documentation is lacking and what they would need.

Portability

kdb-full and kdb-static work fine now for Windows 64bit, thanks to Manuel Mausz. The wresolver is now more relaxed with unset environment.

All issues for Mac OS X were resolved. With the exception of elektrify-getenv everything should work now, thanks to Mihael Pranjic:

and thanks to Daniel Bugl:

furthermore:

Thanks to Manuel Mausz for to testing and improving portability!

Packaging and Build System

Further Fixes

Notes

There are some misconceptions about Elektra and semi structured data (like XML, JSON). Elektra is a key/value storage, that internally represents everything with key and values. Even though, Elektra can use XML and JSON files elegantly, there are limitations what XML and JSON can represent. XML, e.g., cannot have holes within its structure, while this is obviously easily possible with key/value. And JSON, e.g., cannot have non-array entries within an array. This is a more general issue of that configuration files in general are constrained in what they are able to express. The solution to this problem is validation, i.e. keys that does not fit in the underlying format are rejected. Note there is no issue the other way round: special characteristics of configuration files can always be captured in Elektra's metadata.

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-Docu 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 elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Best regards, Markus

0.8.12 Release

Again we managed to release with new features, many build system fixes and also other improvements.

dir namespace

This namespace adds per-project or per-directory (hence the name) configurations. E.g. think how git works: not only /etc and ~ are relevant sources for configuration but also the nearest .git directory.

This technique is, however, much more widely useful than just for git repositories! Nearly every application can benefit from such a per-dir configuration. Its almost certain that you have already run into the problem that different projects have different guidelines (e.g. coding conventions, languages, whitespace requirements, line breaks, ..). Obviously, thats not a per-user configuration and its also not a per-file issue (thats how its usually solved today). So in fact you want, e.g., your editor to have an additional per-project layer to choose between such settings.

The technique is useful for nearly every other tool:

It is simple to use, also for the administrative side. First, change to the folder to your folder (e.g. where a project is):

cd ~/projects/abc

Then add some user (or system or spec) configuration to have some default.

kdb set user/sw/editor/textwidth 72

Then verify that we get this value back when we do a cascading lookup:

kdb get /sw/editor/textwidth

The default configuration file for the dir-namespace is pwd/KDB_DB_DIR/filename:

kdb file dir/sw/editor/textwidth

We assume, that the project abc has the policy to use textwidth 120, so we change the dir-configuration:

kdb set dir/sw/editor/textwidth 120

Now we will get the value 120 in the folder ~/projects/abc and its subdirectories (!), but everywhere else we still get 72:

kdb get /sw/editor/textwidth

Obviously, that does not only work with kdb, but with every elektrified tool.

mount files in dir namespaces

For cascading mountpoints, the dir name is also automatically mounted, e.g.:

kdb mount editor.ini /sw/editor ini

But its also possible to only mount for the namespace dir if no cascading mountpoint is present already:

kdb mount app.ini dir/sw/app tcl

In both cases keys below dir/sw/editor would be in the INI file .dir/editor.ini and not in the file .dir/default.ecf.

dir together with spec namespace

In the project P we had the following issue: We needed on a specific computer the configuration in /etc to be used in favour of the dir config.

We could easily solve the problem using the specification:

kdb setmeta spec/sw/P/current/org/base override/#0 /sw/P/override/org/base

Hence, we could create system/sw/P/override/org/base which would be in favour of dir/sw/P/current/org/base. So we get system/sw/P/override/org/base when we do:

kdb get /sw/P/current/org/base

Alternatively, one could also use the specification:

kdb setmeta spec/sw/P/current/org/base namespace/#0 user
kdb setmeta spec/sw/P/current/org/base namespace/#1 system
kdb setmeta spec/sw/P/current/org/base namespace/#2 dir

Which makes dir the namespace with the least priority and system would be preferred. This was less suitable for our purpose, because we needed the override only on one computer. For all other computers we wanted dir to be preferred with only one specification.

Conclusion

The great thing is, that every elektrified application, automatically gets all the mentioned features. Not even a recompilation of the application is necessary.

Especially the specification provides flexibility not present in other configuration systems.

Qt-Gui 0.0.7

Raffael Pancheri again did a lot of stabilizing work:

The GUI can be handy for many purposes, e.g. we use it already as xml and json editor. Note that there are still some bugs.

Other fixes

Compatibility

As always, the API and API is fully compatible. Because nothing was added, its even possible to link against an older version of Elektra (if compiled against 0.8.12).

In plugins some small changes may effect compatibility:

These two points are also the only unit tests that fail when Elektra 0.8.12 is used with 0.8.11 unit tests.

Build Server

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-Docu 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 elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Permalink to this NEWS entry

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

Best regards, Markus

0.8.11 Release

From the beginning of the Elektra Initiative, Elektra aimed at avoiding hard-coded information in the application and to make the application's configuration more transparent. While avoiding any paths to files was reality from the first released Elektra version, now also hard-coding default values, fallback mechanisms and even Elektra's paths to keys can be avoided.

How does that work?

Elektra 0.8.11 introduces a so called specification for the application's configuration. It is located below its own namespace spec (next to user and system).

Once the base path is known, the user can find out all Elektra paths used by an application, using:

kdb ls spec/basepath

Keys in spec allow us to specify which keys are read by the application, which fallback it might have and which is the default value using meta data. The implementation of these features happened in ksLookup. When cascading keys (those starting with /) are used following features are now available (in the meta data of respective spec-keys):

This technique does not only give you the obvious advantages, but also provides complete transparency how a program will fetch a configuration value. In practice that means that:

kdb get "/sw/app/#0/promise"

will give you the exact same value as the application uses when it lookups the key promise. Many ifs and hardcoded values are avoided, we simply fetch and lookup the configuration by following code:

Key *parentKey = keyNew("/sw/app/#0", KEY_CASCADING_NAME, KEY_END);
kdbGet(kdb, ks, parentKey);

ksLookupByName(ks, "/sw/app/#0/promise", 0);

We see in that example that only Elektra paths are hardcoded in the application. But those can be found out easily, completely without looking in the source code. The technique is simple: append a logger plugin and the KDB base path is printed to:

What we do not see in the program above are the default values and fallbacks. They are only present in the so specification (namespace spec). Luckily, the specification are key/value pairs, too. So we do not have to learn something new, e.g. using the ni plugin we can specify:

[promise]
default=20
fallback/#0=/somewhere/else
namespace/#0=user

1.) When this file is mounted to spec/sw/app/#0 we specify, that for the key /sw/app/#0/promise only the namespace user should be used. 2.) If this key was not found, but /somewhere/else is present, we will use this key instead. The fallback technique is very powerful: it allows us to have (recursive) links between applications. In the example above, the application is tricked in receiving e.g. the key user/somewhere/else when promise was not available. 3.) The value 20 will be used as default, even if no configuration file is found.

Note that the fallback, override and cascading works on key level, and not like most other systems have implemented, on configuration file level.

Namespaces

The specification gives the namespaces clearer semantics and purpose. Key names starting with a namespace are connected to a configuration source. E.g. keys starting with:

When a key name starts with an / it means that it is looked up by specification. Such a cascading key is not really present in the keyset (except when a default value was found). They are neither received nor stored by kdbGet and kdbSet.

Applications shall only lookup using cascading keys (starting with /). If no specification is present, cascading of all namespaces is used as before.

Elektra will (always) continue to work for applications that do not have a specification. We strongly encourage you, however, to write such a specification, because:

For a tutorial how to actually elektrify an application and for more background to Elektra, https://github.com/ElektraInitiative/libelektra/blob/master/doc/tutorials/application-integration.md "read this document".

For a full list of proposed and implemented meta-data, https://github.com/ElektraInitiative/libelektra/blob/master/doc/help/elektra-namespaces.md "read this document".

Simplification in the merging framework

As it turned out the concept of very granular merge strategies was hard to understand for users of the three-way merging framework that emerged in the last year's GSoC. While this granularity is desirable for flexibility, we additionally wanted something easy to use. For that reason merge configurations were introduced. These are simply preconfigured configurations for a merger that arrange required strategies for the most common merging scenarios. Especially they make sure that meta merging is handled correctly.

Have a look at the changes in the example /src/libs/tools/examples/merging.cpp for an glimpse of the simplifications.

A big thanks to Felix Berlakovich!

The header files will be installed to /usr/include/elektra/merging, but they are subject to be changed in the future (e.g. as they did in this release).

From the merging improvements some minor incompatibility happened in kdb import. Not all merging strategies that worked in 0.8.10 work anymore. Luckily, now its much simpler to choose the strategies.

API

The main API kdb.h has two added lines. First a new method was added:

ssize_t keyAddName(Key *key, const char *addName);

This method is already used heavily in many parts. Contrary to keySetBaseName and keyAddBaseName it allows us to extend the path with more than one Element at once, i.e. / are not escaped.

The other new line is the new enum value KEY_FLAGS. This feature allows bindings to use any flags in keyNew without actually building up variable argument lists. (Thanks to Manuel Mausz)

As always, API+ABI is stable and compatible.

Proposed

Many new functions are proposed and can be found in the doxygen docu and in kdbproposal.h.

Noteworthy is the method keyGetNamespace which allows us to query all namespaces. Since this release we changed every occurrence of namespaces (except documentation) with switch-statements around keyGetNamespace. This allows us to add new more namespaces more easily. (Although its currently not planned to add further namespaces.)

Finally, a bunch of new lookup options were added, which might not be useful for the public API (they allow us to disable the specification-aware features mentioned in the beginning).

Obsolete and removed concepts

umount

The concept that backends have a name (other than their mountpoint) is now gone. Backends will simply be named with their escaped mountpath below system/elektra/mountpoints without any confusing additional name.

Unmounting still works with the mountpath.

Removing this concept makes Elektra easier to understand and it also removes some bugs. E.g. having mountpoints which do not differ except having a _ instead of a / would have caused problems with the automatic name generation of Elektra 0.8.10.

Old mountpoints need to be removed with their 0.8.10 name (_ instead of /).

directory keys

Additionally, the so called directory keys were also removed. Elektra was and still is completely key/value based. The / separator is only used for mountpoints.

fstab

The plugin fstab is also improved: Slashes in mountpoints are escaped properly with the internal escaping engine of keyAddBaseName() (i.e. without any problematic / replacements).

dirname

getDirName() was removed from C++, gi-lua, gi-python2, gi-python3, swig-lua, swig-python2 and swig-python3. It was never present in C and did not fit well with keyBaseName() (which returns an unescaped name, which is not possible for the dirname). (Thanks to Manuel Mausz)

invalid parent names

While empty (=invalid) names are still accepted as parentName to kdbGet and kdbSet for compatibility reasons, but the parentKey

Key *parentKey = keyNew("/", KEY_END);

should be used instead (if you want to get or store everything). They have identical behaviour, except that invalid names (that cannot be distinguished from empty names) will produce a warning. In the next major version invalid parentNames will produce an error.

KDB Behaviour

It is now enforced that before a kdbSet() on a specific path a kdbGet() on that path needs to be done. This was always documented that way and is the only way to correctly detect conflicts, updates and missing configuration files. Error #107 will be reported on violations.

Additionally, the handling with missing files was improved. Empty keysets for a mountpoint now will remove a file. Such an empty file is always up-to-date. Removing files has the same atomicity guarantees as other operations.

The concurrency behaviour is at a very high level: as expected many processes with many threads can each concurrently write to the key database, without any inconsistent states: This is noted here because Elektra works on standard configuration files without any guarding processes.

Filesystem problems, e.g. permission, now always lead to the same errors (#9, #75, #109, #110), regardless of the storage plugin.

Qt-Gui 0.0.6

Raffael Pancheri was very busy and did a lot of stabilizing work:

The gui is already used and the remaining small bugs (see github) are going to be fixed soon. One of the highlights is undo for nearly every action, so nothing prevents you from trying it out!

A huge thanks to Raffael Pancheri for his contributions. His thesis can be found at here.

Bug fixing

Further gems

Further Notes

With 471 files changed, 27978 insertions(+), 11512 deletions(-) this release is huge. With 773 commits over four month much more changes happened which did not find their place in these release notes, even though the notes are much less detailed than usual.

Thanks for all contributions that are not enlisted here!

For any questions and comments, please contact the Mailing List or elekt.nosp@m.ra@m.nosp@m.arkus.nosp@m.-raa.nosp@m.b.org.

Get It!

You can download the release from here

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

already built API-Docu can be found here

Stay tuned!

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

Permalink to this NEWS entry

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.10 Release

Hello,

we are delighted to announce our latest feature release providing major updates in:

XDG Compatibility

Elektra now is fully XDG 0.8 compliant. Following changes were necessary:

For example, we could use resolver_fm_xhp_x:

kdb mount --resolver=resolver_fm_xhp_x file.dump /example dump
kdb file user/example
kdb file system/example

Will show you that for both user+system the resolver respects XDG environment variables, e.g. above lines will print:

/home/m/.config/file.dump
/etc/xdg/file.dump

Of course, any attempts to get and set keys below user/example and system/example will also be in these files.

The letters after _ describe the variant of the resolver:

A lot of such resolver variants are added when -DPLUGINS=ALL is used. Of course you can create new variants with different behaviour by adding them to PLUGINS.

To make your application (that uses Elektra) XDG aware, you have nothing to do: you get it to free. Make sure to always use cascading lookup. Additionally, an XDG conforming application should not write system/ keys.

OpenICC Compatibility

Based on that, Elektra now also implements the draft for the OpenICC specification.

The mount command looks like quite complicated, but it consists of simple parts:

kdb mount --resolver=resolver_fm_xhp_x \
  color/settings/openicc-devices.json /org/freedesktop/openicc \
  yajl rename cut=org/freedesktop/openicc

We already know the first two lines: we use the XDG resolver already introduced above. Only the file name and the path where it should be mounted differs.

The plugin yajl is a storage plugin that reads/writes json. The plugin rename was the missing link to support OpenICC (thanks to Felix Berlakovich for closing this gap). It is needed, because every OpenICC file starts like this:

{ "org": { "freedesktop": { "openicc": {

Because the backend is mounted at /org/freedesktop/openicc, it would lead to keys below /org/freedesktop/openicc/org/freedesktop/openicc which we obviously do not want. So we simply get rid of the common prefix by cutting it out using the rename plugin.

Of course this renaming functionality can be used in every situation and is not limited to OpenICC.

Tools

A large number of old and new tools were added, mostly for convenience e.g.:

kdb mount-openicc

saves you from writing the long mount command we had in the previous section.

To get a list of all tools that are installed, now the command (which is also an external tool and as such currently not displayed in kdb –help):

kdb list-tools

is available. Do not be surprised: on typical installations this will be a large list. You can run each of these tools by using kdb <command>. Most of the tools, however, are part of the test suite, which you can run using:

kdb run_all

Other tools are "old friends", e.g. convert-fstab written in 2006 by Avi Alkalay still works:

kdb convert-fstab | kdb import system/filesystems xmltool

It will parse your /etc/fstab and generate a XML. This XML then can be imported. Other convert tools directly produce kdb commands, though.

kdb now uses KDB itself for many commands:

By default the plugin "sync" is added automatically (it makes sure that fsync is executed on config files, the directory is already done by the resolver), you should not remove it from /sw/kdb/current/plugins otherwise the next mount command will not add it. To preserve it use a space separated list, e.g.:

kdb set user/sw/kdb/current/plugins "sync syslog"

Last, but not least, kdb get now supports cascading get:

kdb get /sw/kdb/current/plugins

This feature allows you to see the configuration exactly as seen by the application.

Other options:

Compatibility

The core API (kdb.h), as always, stayed API/ABI compatible. The only changes in kdb.h is the addition of KEY_CASCADING_NAME and KEY_META_NAME. So applications compiled against 0.8.10 and using these constants, will not work with Elektra 0.8.9.

The constants allow us to create following kinds of keys:

Usage in C is:

Key *c = keyNew("/org/freedesktop", KEY_CASCADING_NAME, KEY_END);
Key *m = keyNew("comment/#0", KEY_META_NAME, KEY_END);

The same functionality exists, of course, in available in all bindings, too.

Changes in non-core API are:

CMake

It is now possible to remove a plugin/binding/tools by prefixing a name with "-". The new "-element" syntax is accepted by TOOLS, BINDINGS and PLUGINS. It is very handy in combination with ALL, e.g.:

-DPLUGINS="ALL;-xmltool"

will include all plugins except xmltool.

Improved comments

Comment preserving was improved a lot. Especially, the hosts plugin was rewritten completely. Now multiple different comment styles can be intermixed without losing information. E.g. some INI formats support both ; and # for comments. With the new comments it is possible to preserve that information and even better: applications can iterate over that information (meta data).

To mount the new hosts plugin use (if you already have mounted it, you have nothing to do):

kdb mount /etc/hosts system/hosts hosts

The hosts plugin now seperates from ipv4 and ipv6 which makes the host names canonical again, e.g.:

kdb get system/hosts/ipv4/localhost
kdb get system/hosts/ipv6/localhost

To access the inline-comment, use:

kdb getmeta system/hosts/ipv4/localhost "comment/#0"

For other meta information, see:

kdb lsmeta system/hosts/ipv4/localhost

Additionally, a small API for specific meta-data operations emerges. These operations will be moved to a separate library and will not stay in Elektra's core library.

Proposal

Java binding

Elektra now fully supports applications written in Java and also Plugins written in the same language.

The new binding was developed using jna. For the plugin interface JNI was used. We developed already some plugins.

Qt-Gui

Raffael Pancheri released the version 0.0.2 of the Qt-Gui:

Further stuff and small fixes

Get It!

You can download the release from here

already built API-Docu can be found here

Stay tuned!

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

Permalink to this NEWS entry

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.9 Release

Again we managed to do an amazing feature release in just two month. In 416 commits we modified 393 files with 23462 insertions(+) and 9046 deletions(-).

Most awaited

The most awaited feature in this release is certainly the qt-gui developed by Raffael Pancheri. It includes a rich feature set including searching, unmounting, importing and exporting. A lot of functionality is quite stable now, even though its version is 0.0.1 alpha. If you find any bugs or want to give general feedback, feel free to use the issue tracker of the Elektra project. A screenshot can be found here To compile it (together with Elektra), see the README here

Manuel Mausz also has been very active and developed glib+gi bindings. These bindings make Elektra more friendly to the glib/gtk/gnome world. Using the gobject introspection python3 and lua bindings were developed. Additionally he got rid of all clang warnings.

Felix Berlakovich also made progress: the ini plugin now supports multiline and which can be dynamically turned on and off, i.e. during mounting (thanks to Felix)

Last, but not least, Kai-Uwe ported Elektra to Windows7. MinGW is now one more supported compiler (tested on build-server, see later). Astonishingly, it was only little effort necessary: Basically we only needed a new implementation of the resolver, which is now called wresolver. Different from the resolver it lacks the sophisticated multi-process and multi-thread atomicity properties. On the plus side we now have a resolver that is very easy to study and understand and still works as file resolver (noresolver does not).

Interfaces

ABI/API of the C-API is still completely stable even though under the hood a lot was changed. All testcases compiled against the previous version still run against Elektra 0.8.9.

This is, however, not the case for libtools. For MinGW porting it was necessary to rename an enum related to merging because it conflicted with an already defined MACRO.

For maintainers also some changes are necessary. For MinGW and to actually use the flexibility of the new resolver variants two new CMake Variables are introduced: KDB_DEFAULT_RESOLVER and KDB_DEFAULT_STORAGE.

More importantly for maintainers the CMake variables regarding SWIG bindings are now abandoned in favour to the new variable BINDINGS that works like PLUGINS and TOOLS. Just start with

    -DBINDINGS=ALL

and CMake should remove the bindings that have missing dependencies on your system. Remember that glib and gi (i.e. gi_python3 and gi_lua) bindings were introduced, too. Additionally, the cpp binding can now be deactivated if not added to BINDINGS.

Finally, the gen tool added a Python package called support.

Other Bits

A proof of concept storage plugin regexstore was added. It allows one to capture individual configuration options within an otherwise not understood configuration file (e.g. for vimrc or emacs where the configuration file may contain programming constructs).

Most tests now also work with the BUILD_SHARED variant (from our knowledge all would work now, but some are still excluded if BUILD_FULL and BUILD_STATIC is disabled. Please report issues if you want to use uncommon CMake combinations).

A small but very important step towards specifying configuration files is the new proposed API method ksLookupBySpec (and ksLookup implementing cascading search). It introduces a logical view of configuration that in difference to the physical view of configuration does not have namespaces, but everything is below the root "/". Additionally, contextual values now allow one to be compile-time configured using C++-Policies. These are small puzzle pieces that will fit into a greater picture at a later time.

A (data) race detection tool was implemented. Using it a configurable number of processes and threads it tries to kdbSet() a different configuration at (nearly) the same time.

With this tool the resolver could be greatly be improved (again). It now uses stat with nanosecond precision that will be updated for every successful kdbSet(). Even if the configuration file was modified manually (not using Elektra) the next kdbSet() then is much more likely to fail. Additionally a recursive mutex now protects the file locking mechanism.

The build server now additionally has following build jobs:

Many more examples were written and are used within doxygen. Most snippets now can also be found in compilable files:

Most plugins now internally use the same CMake function add_plugin which makes plugin handling more consistent.

Felix converted the METADATA spec to ini files and added a proposal how comments can be improved.

Refactoring:

Optimization:

Fixes:

Get It!

You can download the release from here

already built API-Docu can be found here

For more information, see http://www.libelektra.org

Best regards, Markus

0.8.8 Release

In this release we changed 578 files in 473 commits (68596 insertions(+), 59260 deletions(-) compared to Elektra 0.8.7). We assume thats the largest change set for any of Elektra's releases up to now. It happened only within a bit more than a month up (0.8.7 was released 28.07.2014).

New features

GSoC finished successfully (thanks Ian and Felix) See http://community.libelektra.org/wp for the latest results. So Elektra now has a 3-way merging framework that is superior to text-based merging in many scenarios (e.g. moving configuration options within a file or with in-line comments) iff a storage plugin creates key names that are not only line numbers. We love to get Feedback!

Writing plugins is now even more comfortable. A plugin writer tutorial was written (thanks Ian): https://github.com/ElektraInitiative/libelektra/blob/master/doc/tutorials/plugins.md The documentation was completely reworked: http://doc.libelektra.org/api/0.8.7/html/group__plugin.html And two new macros allow printf formating for warnings and errors (ELEKTRA_ADD_WARNINGF and ELEKTRA_SET_ERRORF).

The ini plugin was greatly improved (tested with samba configurations and added to ALL plugins) and the hosts plugin was rewritten to support ipv6 properly (thanks to Felix).

The constants plugin was added and allows introspection of Elektra's cmake variables. Because such non-file based plugins (e.g. also uname) do not need resolving, the plugin noresolver was added. It supersedes the success plugin.

Elektra now allows one to correctly fsync its configuration files (sync plugin) and the folders where files are stored (resolver plugin). Just make sure to add the "sync" plugin using kdb mount. The resolver plugin now reads from passwd and no longer needs environment variables. Additionally, the resolver plugin was prepared to support other variants by so called compilation variants.

The error plugin now allows, next to list all possible errors, to provoke errors when opening plugins. We fixed some issues related to plugins having errors when they initialize themselves.

So following plugins were added: sync noresolver line ini constants Nearly all plugins now have a README.md for further information (thanks to Ian). An overview of all plugin is on with links to them: https://github.com/ElektraInitiative/libelektra/blob/master/src/plugins/

The kdb tools were greatly improved (thanks to Felix):

New/improved scripts/make targets (note that scripts can be executed by kdb scriptname):

Compatibility

This time we had to break compatibility. We did not change the ABI (your application still will be able to use Elektra 0.8.8) and we did not change the API (your application still will compile against Elektra). We changed the third part of our interface: the semantic interface.

The problems were following: keyAddBaseName/keySetBaseName did something obvious when no special characters were in the baseName. But once there were, there are two different interpretations what it should do: 1.) add/set a basename, so escape characters that are not canonical in the basename 2.) add all parts of the name given (with slashes)

The methods were used in both ways, so it was obvious that something is very wrong. We decided that it should do what the name says, that is add/set a basename (variant 1).

The variant 2, to add any name was added and is called keyAddName() and added as proposal.

(Thank Felix for implementations and Manuel for investigations)

When keys are renamed after adding to a keyset is a bad thing because it destroys the order of the keyset. This is now avoided by keyLock. Use keyDup() to get rid of such locks.

Another, even larger, change is also about ordering of keys in keysets. Elektra now internally has an null-terminated unescaped keyname. Ordering of keysets will always happen on this name. The keyCmp() tool can be used to check this order. It works very efficiently with memcmp() and never gets confused by ASCII ordering of / (because / is 0 in the unescaped keyname).

The syntax, semantics and conventions of key names is now documented in detail: http://doc.libelektra.org/api/0.8.8/html/group__keyname.html

ksNew() does now return a keyset with a properly set cursor (ksRewind).

Because its always possible that software relies on bugs the better way to deal with such a situation (as the keySetBaseName() situation described above) is to provide the same function twice. Manuel said he will create a prototype to introduce symbol versioning in Elektra. With that, old customers would still receive the old behaviour, but people compiling against a new version would get the new behaviour. So in one of the next releases we will also avoid semantic interface changes when there is a valid use case for it (there is none if the program e.g. crashes).

Symbol versioning also allows one to compile against old versions on purpose if you do not want the new behaviour.

We have prepared an ABI-test suite, that also checks behaviour, for that purpose, but we also improved testing in other parts:

If you try to execute test_ks from 0.8.7 with libelektra 0.8.8 it will crash, but not because of any incompatibility, but because of strcmp in the test itself gets a null pointer. The pointer is now null, because ksNew correctly rewinds its internal cursor (see above). Amusingly, it says on that line 94 in test_ks.c: // TODO: why is the cursor here?

API Proposals

see above for more information:

some new ideas:

elektraArrayIncName() now works correctly with empty arrays embedded in other arrays (yajl+line plugin)

elektraArrayValidateName() was also added, thanks to Felix.

These methods are declared in the file kdbproposal.h but do not guarantee any forms of compatibility (they might even be removed).

Issues

Many issues were resolved as you can see in github: https://github.com/ElektraInitiative/libelektra/issues Alone for the milestone 0.8.8 we closed 17 issues, including those mentioned in "Compatibility". Other issues (not all were tracked on github):

Other Stuff

Thanks to Pino Toscano Elektra 0.8.7-4 is now available in Debian Testing: https://packages.debian.org/search?keywords=elektra So it is only a matter of time that other (debian-based) distributions will follow and replace the dusty Elektra 0.7.

Debian Continuous Integration http://ci.debian.net/packages/e/elektra (thanks Pino) greatly complement our tests running on http://build.libelektra.org:8080/

Elektra's buildserver also was improved:

Raffael Pancheri now made a merge request for qt-gui https://github.com/ElektraInitiative/libelektra/pull/103/files in which copy, paste and delete of keys already works. It is, however, still work in progress.

Manuel Mausz made great progress in script-based Elektra plugins. He is also working on glib+gobject-introspection based bindings. He investigated some issues, e.g. a crash of the python binding which was only triggered if python3 is build with a specific flag/module combination, see: https://github.com/ElektraInitiative/libelektra/issues/25

Get It!

You can download the release from:

http://www.markus-raab.org/ftp/elektra/releases/elektra-0.8.8.tar.gz

already built API-Docu can be found here:

http://doc.libelektra.org/api/0.8.8/html/

Best regards, Markus