diff options
author | Thien-Thi Nguyen <ttn@gnuvola.org> | 2020-12-15 03:26:26 -0500 |
---|---|---|
committer | Thien-Thi Nguyen <ttn@gnuvola.org> | 2020-12-15 03:27:06 -0500 |
commit | 52986bf3356f25e65ca03bab0070c16c9bd60d7c (patch) | |
tree | c2414b30af3065da1b280b47e30dc265edd8d8cf /doc/handbook | |
parent | 74d7528e6bd53cf5acc939c63a5be74a001e5ce1 (diff) | |
download | gnunet-52986bf3356f25e65ca03bab0070c16c9bd60d7c.tar.gz gnunet-52986bf3356f25e65ca03bab0070c16c9bd60d7c.zip |
[doc] Add section "Config file format"
This is based on a similar fragment in Taler docs.git.
I am certain it contains inaccuracies; please take a critical look.
Diffstat (limited to 'doc/handbook')
-rw-r--r-- | doc/handbook/chapters/configuration.texi | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/doc/handbook/chapters/configuration.texi b/doc/handbook/chapters/configuration.texi index 286c72e7a..adff956a9 100644 --- a/doc/handbook/chapters/configuration.texi +++ b/doc/handbook/chapters/configuration.texi | |||
@@ -1,5 +1,77 @@ | |||
1 | @node Configuration Handbook | 1 | @node Configuration Handbook |
2 | @chapter Configuration Handbook | 2 | @chapter Configuration Handbook |
3 | 3 | ||
4 | This chapter has yet to be written. It is intended to be about in-depth | 4 | This chapter has yet to be fully written. It is intended to be about in-depth |
5 | configuration of GNUnet. | 5 | configuration of GNUnet. |
6 | |||
7 | |||
8 | @menu | ||
9 | * Config file format:: | ||
10 | @end menu | ||
11 | |||
12 | |||
13 | @node Config file format | ||
14 | @section Config file format | ||
15 | |||
16 | In GNUnet realm, all components obey the same pattern to get configuration | ||
17 | values. According to this pattern, once the component has been installed, the | ||
18 | installation deploys default values in @file{$prefix/share/gnunet/config.d/}, | ||
19 | in @file{.conf} files. In order to override these defaults, the user can | ||
20 | write a custom @file{.conf} file and either pass it to the component at | ||
21 | execution time, or name it @file{gnunet.conf} and place it under | ||
22 | @file{$HOME/.config/}. | ||
23 | |||
24 | A config file is a text file containing sections, and each section | ||
25 | contains its values. The right format follows: | ||
26 | |||
27 | @example | ||
28 | [section1] | ||
29 | value1 = string | ||
30 | value2 = 23 | ||
31 | |||
32 | [section2] | ||
33 | value21 = string | ||
34 | value22 = /path22 | ||
35 | @end example | ||
36 | |||
37 | Throughout any configuration file, it is possible to use @code{$}-prefixed | ||
38 | variables, like @code{$VAR}, especially when they represent filenames in in | ||
39 | the filesystem. It is also possible to provide defaults values for those | ||
40 | variables that are unset, by using the following syntax: | ||
41 | |||
42 | @example | ||
43 | ${VAR:-default} | ||
44 | @end example | ||
45 | |||
46 | @noindent | ||
47 | However, there are two ways a user can set @cide{$}-prefixable variables: | ||
48 | (a) by defining them under a @code{[paths]} section | ||
49 | |||
50 | @example | ||
51 | [paths] | ||
52 | GNUNET_DEPLOYMENT_SHARED = ${HOME}/shared-data | ||
53 | .. | ||
54 | [section-x] | ||
55 | path-x = ${GNUNET_DEPLOYMENT_SHARED}/x | ||
56 | @end example | ||
57 | |||
58 | @noindent | ||
59 | or (b) by setting them in the environment | ||
60 | |||
61 | @example | ||
62 | $ export VAR=/x | ||
63 | @end example | ||
64 | |||
65 | @noindent | ||
66 | The configuration loader will give precedence to variables set under | ||
67 | @code{[path]}, though. | ||
68 | |||
69 | The utility @samp{gnunet-config}, which gets installed along with GNUnet, | ||
70 | serves to get and set configuration values without directly editing the | ||
71 | @file{.conf} file. The option @samp{-f} is particularly useful to resolve | ||
72 | filenames, when they use several levels of @code{$}-expanded variables. | ||
73 | See @samp{gnunet-config --help}. | ||
74 | |||
75 | Note that, in this stage of development, the file | ||
76 | @file{$HOME/.config/gnunet.conf} can contain sections for @strong{all} the | ||
77 | components. | ||