From f6db12902654112c628e24c8a7d3db1a9380de4a Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 15 Dec 2016 15:37:25 +0100 Subject: $-expansion in config --- configuration-basics.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/configuration-basics.rst b/configuration-basics.rst index 9296a2b4..50c3d532 100644 --- a/configuration-basics.rst +++ b/configuration-basics.rst @@ -39,11 +39,13 @@ its `values`. The right format follows:: value21 = string value22 = /path22 -Throught any configuration file, it is possible to use ``$``-prefixed variables, -especially when a value needs a pathname. Some of them are automatically resolved, -like ``${TALER_DATA_HOME}``, ``${TALER_RUNTIME_DIR}``, or ``${HOME}``. (FIXME: explain -how/where/when those defaults get resolved) Other variables can be defined under the -`paths` section. For example:: +Throughout any configuration file, it is possible to use ``$``-prefixed variables, +like ``$VAR``, especially when they represent filesystem paths. +It is also possible to provide defaults values for those variables that are unset, +by using the following syntax: ``${VAR:-default}``. +However, there are two ways a user can set ``$``-prefixable variables: + +by defining them under a ``[paths]`` section, see example below, :: [paths] TALER_DEPLOYMENT_SHARED = ${HOME}/shared-data @@ -51,8 +53,17 @@ how/where/when those defaults get resolved) Other variables can be defined under [section-x] path-x = ${TALER_DEPLOYMENT_SHARED}/x -The utility ``taler-config``, which gets installed along with the exchange, serves to get and -set configuration values without directly editing the `.conf`. See ``taler-config --help``. +or by setting them in the environment:: + + $ export VAR=/x + +The configuration loader will give precedence to variables set under ``[path]``, +though. + +The utility ``taler-config``, which gets installed along with the exchange, serves +to get and set configuration values without directly editing the `.conf`. +The option ``-f`` is particularly useful to resolve pathnames, when they use +several levels of ``$``-expanded variables. See ``taler-config --help``. Note that, in this stage of development, the file ``$HOME/.config/taler.conf`` can contain sections for *all* the component. For example, both an exchange and -- cgit v1.2.3