Main Page
From config-model
Config::Model home page
Introduction
Config::Model enables a project developer (or an advanced user) to create a
graphical configuration editor (with data validation and integrated help) to his users.
For this, the project developer must:
- create a dedicated model that will describe the structure and constraint of his project's configuration
- if the configuration data is not stored in INI file or in Perl data file, he must provide some code to read and write data to and from configuration files.
Then the project developer will be able to provide his users a graphical configuration editor. The graphical editor (Curses or Perl/Tk) are generated from the dedicated model.
Linux distributions can also benefit with this project. With a configuration model for your package, you will be able to smoothly merge customized configuration data and new configuration data of new package version. Smooth means that no user input is required to merge user data with new configuration data. Config::Model can also handle configuration data migration even if the configuration file syntax has changed. Hopefully this should help avoid cluttering /etc/ with rpmsave or dpkgnew files.
Help wanted
Config::Model could use some help on the following topics:
- a WEB interface with functionalities similar to the graphical interface
- a nice logo (maybe a penguin with a wrench or a screwdriver ?)
- New models
Please contact the author (ddumont at cpan.org) or the devel maling list if you want to help
Mailing lists
Users and devel mailing list are available on sourceforge
Latest news
- Config::Model::OpenSsh v1.206 released (2009/06/10): Some model improvements to improve Ssh configuration with TkUI's wizard
- Config::Model version 0.640 released (2009/09/09): Bug fix on Wizard and Searcher and Warped Node.
- Graphical interface Config::Model::TkUi 1.301 released (2009/09/08): Provide new widgets. A Node editor to facilitate edition of simple config. And (at last) a configuration wizard !
- Xorg model version 1.104 (2009/06/25): Updated for Config::Model 0.637
- Config::Model::OpenSsh v1.206 released (2009/06/24): Updated for Config::Model 0.637
- Curses interface 1.103 (Config::Model::CursesUI) released (2009/06/24): Updated for Config::Model 0.637.
- Config::Model::Itself 1.211 released (2009/06/24): This release adds a -save option to the config-model-edit command. This version can upgrade an existing model to changes brought about in Config::Model 0.637.
- Graphical interface Config::Model::TkUi 1.210 released (2009/06/23): TkUI.pm (Populate) has a -title option so that the application can set the title of the TkUI window. Updated for Config::Model 0.637.
- Config::Model version 0.637 released (2009/06/23):The leaf 'built_in' parameter has been replaced with 'upstream_default'. This new name should be easier to understand for users. This change will trigger warnings but no errors... with the existing model. To get rid of the warnings, the easiest solution is to update the model by running "config-model-edit -model Foo -save" (config-model-edit is provided by Config::Model::Itself). Likewise for CheckList, The 'built_in_list' parameter has been replaced with 'upstream_default_list'
- Presented Config::Model to French Perl Workshop. You can view the video of the presentation (in French)
- GNU/Linux Magazine France 117 publishes and article describing the creation of a OpenSsh configuration interface with Config::Model
- Config::Model::Backend::Augeas v0.107 released (2009/06/01): ignore Augeas #comment nodes
- Config::Model::Itself 1.210 released (2009/04/20): Added auto_create and file parameter to read/write spec (Req by Config::Model 0.635). Parameter allow_empty is deprecated and will be replaced by auto_create when you run config-edit-model. Added new -dot_diagram option to config-model-edit to get a dot file to represent the structure of the configuration model. Added summary model parameter (Config::Model 0.635)
Available editor modules
These modules (and their dependencies) provide configuration editors
| module name | description | Status |
| config-model-xorg | configuration model for Xorg. | alpha. Lot of of items are still missing |
| config-model-openssh | Configuration model and editor for sshd_config (edition of ssh_config will come) | released |
| Config::Model::Krb5 | Kerberos model (by Peter Knowles) | Orphaned - Looking for maintainer |
| Config::Model::Approx | configuration model for approx. This model is used as a proof of concept to integrate Config::Model into Debian package upgrade | Under development |
| Config::Model::Nagios | Nagios model (by Sébastien Aperghis Tramoni) | Under development |
The following one is a special case: it provides an editor to edit configuration model (not configuration data). This editor was used to create sshd_config model.
| module name | description | Status |
| config-model-itself | configuration model graphical editor for config-model | beta |
Available framework modules
| module name | description | Status |
| config-model | core framework that interprets configuration models | released |
| config-model-cursesui | Curses interface | beta |
| config-model-tkui | Perl/Tk graphical interface wih wizard | beta |
Available backend
| Backend | Module |
| Perl data structure | Built in Config::Model |
| Ini file | Built in Config::Model |
| Augeas | Config::Model::Backend::Augeas |
Packages
- Debian packages are available (Thanks to Debian Perl group for their help)
- Madriva packages are provided by Guillaume Rousse
- RedHat packages are being prepared by Jérôme Seyman
Installation instructions
The easiest way to install these program it to use CPAN. If you have a recent Perl version (>= 5.8.8), you can install these modules with the cpan command.
For instance:
$ cpan Config::Model::OpenSsh
This command will download and install Config::Model::OpenSsh and all its dependencies (Config::Model, Config::Model::TkUI, Tk ...). You will have to answer some easy configuration questions the first time you use cpan command.
Note that tar files are no longer uploaded to Sourceforge. Please use CPAN to install this software.
Description
Using this project, a typical configuration validation tool will be made of 3 parts :
- The user interface (config-edit program)
- The validation engine which is in charge of validating all the configuration information provided by the user.
- The storage facility that store the configuration information
A configuration model is expressed in a declarative form (currently a Perl data structure) which is always easier to maintain than a lot of code .
The declaration specifies:
- the structure of the configuration data (which can be queried by generic user interfaces)
- the properties of each element (boundary check, integer or string, enum like type ...)
- the default values of parameters (if any)
- mandatory parameters
- the targeted audience (intermediate, advanced, master)
- on-line help (for each parameter or value of parameter)
- the level of expertise of each parameter (to hide expert parameters from newbie eyes)
So, in the end:
- maintenance and evolution of the configuration content is easier
- user will see a common interface for all programs using this project.
- user will not see advanced parameters which miht confuse them
- upgrade of configuration data is easier and sanity check is performed
- audit of configuration is possible to check what was modified by the user compared to default values
Configuration file reader and writer
There are a lot of different syntax for configuration files. Some are rather common like INI syntax, or XML. This project provides a reader/writer for some of these common formats. If your project does not use one of these format, you will have to provide a dedicated parser/writer.
Other reader/writer for rather common syntax can be integrated in this project. This point is open for discussion.
It is entirely possible for a single configuration model to use several parsers and writers so one model will ensure the consistency of several configuration files together.
Use cases
There's 2 main ways of using Config::Model:
- Edit configuration data before running the application (using the architecture described above)
- validate configuration data when starting an application (this is limited to Perl applications, unless you can interface your application with Perl libraries).
Issues and TODO
A Curses interface is not sexy enough. Agreed (though it may be handy if Xorg is down). Anyway, we need a WEB interface or a graphical interface. A Perl/Tk interface is now provided. I need help for a web interface (or may be I'll glue Config::Model into Webmin..).
Documentation TODO
- Add screenshot from the Tk interface
- How to create a model with Config::Model::Itself and Tk interface
Source code access
You can browse sourceforge SVN repository for config-model
Currently, only the main development branch (trunk) is active.
You can download the code from SVN with the following instructions:
svn co https://config-model.svn.sourceforge.net/svnroot/config-model/trunk/ config-model
Download releases
You can download from CPAN :
- Config::Model
- Config::Model::Xorg
- Config::Model::OpenSsh
- Config::Model::CursesUI
- Config::Model::Itself
- Config::Model::TkUi
Author
- Dominique Dumont (ddumont at users dot sourceforge dot net)

