configuration.texi 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. @node Configuration Handbook
  2. @chapter Configuration Handbook
  3. This chapter has yet to be fully written. It is intended to be about in-depth
  4. configuration of GNUnet.
  5. @menu
  6. * Config file format::
  7. @end menu
  8. @node Config file format
  9. @section Config file format
  10. In GNUnet realm, all components obey the same pattern to get configuration
  11. values. According to this pattern, once the component has been installed, the
  12. installation deploys default values in @file{$prefix/share/gnunet/config.d/},
  13. in @file{.conf} files. In order to override these defaults, the user can
  14. write a custom @file{.conf} file and either pass it to the component at
  15. execution time, or name it @file{gnunet.conf} and place it under
  16. @file{$HOME/.config/}.
  17. A config file is a text file containing sections, and each section
  18. contains its values. The right format follows:
  19. @example
  20. [section1]
  21. value1 = string
  22. value2 = 23
  23. [section2]
  24. value21 = string
  25. value22 = /path22
  26. @end example
  27. Throughout any configuration file, it is possible to use @code{$}-prefixed
  28. variables, like @code{$VAR}, especially when they represent filenames in in
  29. the filesystem. It is also possible to provide defaults values for those
  30. variables that are unset, by using the following syntax:
  31. @example
  32. $@{VAR:-default@}
  33. @end example
  34. @noindent
  35. However, there are two ways a user can set @code{$}-prefixable variables:
  36. (a) by defining them under a @code{[paths]} section
  37. @example
  38. [paths]
  39. GNUNET_DEPLOYMENT_SHARED = $@{HOME@}/shared-data
  40. ..
  41. [section-x]
  42. path-x = $@{GNUNET_DEPLOYMENT_SHARED@}/x
  43. @end example
  44. @noindent
  45. or (b) by setting them in the environment
  46. @example
  47. $ export VAR=/x
  48. @end example
  49. @noindent
  50. The configuration loader will give precedence to variables set under
  51. @code{[path]}, though.
  52. The utility @samp{gnunet-config}, which gets installed along with GNUnet,
  53. serves to get and set configuration values without directly editing the
  54. @file{.conf} file. The option @samp{-f} is particularly useful to resolve
  55. filenames, when they use several levels of @code{$}-expanded variables.
  56. See @samp{gnunet-config --help}.
  57. Note that, in this stage of development, the file
  58. @file{$HOME/.config/gnunet.conf} can contain sections for @strong{all} the
  59. components.