Configuration Management Tool

The configuration tool allows a user to look at configuration settings and modify parameters.

First, an answer to the question: "Why use this configuration tool instead of directly, manually editing the config file?"

There are a couple of reasons why you should NOT manually edit configuration file and use the tool instead to modify settings:

  1. Configuration is kept in XML file which can be easily broken if not edited carefully. The tool takes care of creating valid XML configuration file for you. So you can focus on your task - setting proper parameters for your server.
  2. Configuration values are kept UUEncoded in the config file. If you edit file manually you have to take care of proper encoding of special characters. The tool presents parameters to you in decoded form which is easy to read and can accept all settings also in decoded form which is easier for you to write. Then when writing your parameters to configuration file settings are automatically encoded to correct form.
  3. Data in configuration file have TYPES. That is some parameters are expected to be Strings other are expected to be Integers, Booleans or arrays keeping data in any of that type. If data type is set incorrectly then Tigase may have problems with reading configuration data. The configuration tool takes care of proper data types in configuration file.

Configuration management tool is a Java class - tigase.conf.Configurator. To make it easier to use this class there is also shell script available - config.sh.

First thing you can do is running the script with -h parameter:

./scripts/config.sh -h

In response you get description of all available parameters:

Parameters:
 -h             this help message
 -c file        configuration file
 -key key       node/key for the value to set
 -value value   value to set in configuration file
 -set           set given value for given key
 -add           add given value to the values list for given key
 -print         print content of all configuration settings or of given node/key
 -f             force creation of the new property - dangerous option...
Samples:
 Setting admin account - overwriting any previous value(s)
 $ ./scripts/config.sh -c tigase-config.xml -print -set -key session_1/admins -value admin1@localhost
 Adding next admin account leaving old value(s)
 $ ./scripts/config.sh -c tigase-config.xml -print -add -key session_1/admins -value admin2@localhost

Note: adding -print option is useful always, even with -set or -add
      option as it prints set value afterwards.

Let’s assume configuration for your server is located in tigase-config.xml file. So the first thing you need to set when calling the tool is location of the configuration file.