taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

configuration-format.rst (2343B)


      1 Configuration format
      2 --------------------
      3 
      4 All GNU Taler components are designed to possibly share the same
      5 configuration files.  When installing a GNU Taler component, the
      6 installation deploys default values in configuration files located
      7 at ${prefix}/share/taler/config.d/ where ${prefix} is the installation
      8 prefix. Different components must be installed to the same prefix.
      9 
     10 In order to override these defaults, the user can write a custom configuration
     11 file and either pass it to the component at execution time using the *-c*
     12 option, or name it taler.conf and place it under $HOME/.config/ which is where
     13 components will look by default. Note that the systemd service files pass ``-c
     14 /etc/taler/taler.conf``, thus making ``/etc/taler/taler.conf``
     15 the primary location for the configuration.
     16 
     17 A config file is a text file containing sections, and each section
     18 contains maps options to their values.  Configuration files follow
     19 basically the INI syntax:
     20 
     21 .. code-block:: ini
     22 
     23    [section1]
     24    value1 = string
     25    value2 = 23
     26 
     27    [section2]
     28    value21 = string
     29    value22 = /path22
     30 
     31 Comments start with a hash (``#``).  Throughout the configuration, it is
     32 possible to use ``$``-substitution for options relating to names of files or
     33 directories. It is also possible to provide defaults values for those
     34 variables that are unset, by using the following syntax:
     35 ``${VAR:-default}``. There are two ways a user can set the value
     36 of ``$``-prefixable variables:
     37 
     38 (1) by defining them under a ``[paths]`` section:
     39 
     40     .. code-block:: ini
     41 
     42        [paths]
     43        TALER_DEPLOYMENT_SHARED = ${HOME}/shared-data
     44        ..
     45        [section-x]
     46        path-x = ${TALER_DEPLOYMENT_SHARED}/x
     47 
     48 (2) or by setting them in the environment:
     49 
     50     .. code-block:: console
     51 
     52        $ export VAR=/x
     53 
     54 The configuration loader will give precedence to variables set under
     55 ``[path]`` over environment variables.
     56 
     57 The utility ``taler-config``, which gets installed along with the exchange,
     58 can be used get and set configuration values without directly editing the
     59 configuration file. The option ``-f`` is particularly useful to resolve
     60 pathnames, when they use several levels of ``$``-expanded variables. See
     61 ``taler-config --help``.
     62 
     63 The repository ``git://git.taler.net/deployment`` contains example code
     64 for generating configuration files under ``deployment/netzbon/``.