summaryrefslogtreecommitdiff
path: root/frags/configuration-format.rst
blob: 5a74c7754040f5f2776f8174abad348861b85466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Configuration format
--------------------

All GNU Taler components are designed to possibly share the same
configuration files.  When installing a GNU Taler component, the
installation deploys default values in configuration files located
at ${prefix}/share/taler/config.d/ where ${prefix} is the installation
prefix. Different components must be installed to the same prefix.

In order to override these defaults, the user can write a custom configuration
file and either pass it to the component at execution time using the *-c*
option, or name it taler.conf and place it under $HOME/.config/ which is where
components will look by default. Note that the systemd service files pass ``-c
/etc/taler/taler.conf``, thus making ``/etc/taler/taler.conf``
the primary location for the configuration.

A config file is a text file containing sections, and each section
contains maps options to their values.  Configuration files follow
basically the INI syntax:

.. code-block:: ini

   [section1]
   value1 = string
   value2 = 23

   [section2]
   value21 = string
   value22 = /path22

Comments start with a hash (``#``).  Throughout the configuration, it is
possible to use ``$``-substitution for options relating to names of files or
directories. It is also possible to provide defaults values for those
variables that are unset, by using the following syntax:
``${VAR:-default}``. There are two ways a user can set the value
of ``$``-prefixable variables:

(1) by defining them under a ``[paths]`` section:

    .. code-block:: ini

       [paths]
       TALER_DEPLOYMENT_SHARED = ${HOME}/shared-data
       ..
       [section-x]
       path-x = ${TALER_DEPLOYMENT_SHARED}/x

(2) or by setting them in the environment:

    .. code-block:: console

       $ export VAR=/x

The configuration loader will give precedence to variables set under
``[path]`` over environment variables.

The utility ``taler-config``, which gets installed along with the exchange,
can be used get and set configuration values without directly editing the
configuration file. The option ``-f`` is particularly useful to resolve
pathnames, when they use several levels of ``$``-expanded variables. See
``taler-config --help``.

The repository ``git://git.taler.net/deployment`` contains example code
for generating configuration files under ``deployment/netzbon/``.