settings.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .. _settings.yml:
  2. ================
  3. ``settings.yml``
  4. ================
  5. This page describe the options possibilities of the :origin:`searx/settings.yml`
  6. file.
  7. .. sidebar:: Further reading ..
  8. - :ref:`use_default_settings.yml`
  9. - :ref:`search API`
  10. .. contents::
  11. :depth: 2
  12. :local:
  13. :backlinks: entry
  14. .. _settings location:
  15. settings.yml location
  16. =====================
  17. The initial ``settings.yml`` we be load from these locations:
  18. 1. the full path specified in the ``SEARXNG_SETTINGS_PATH`` environment variable.
  19. 2. ``/etc/searxng/settings.yml``
  20. If these files don't exist (or are empty or can't be read), SearXNG uses the
  21. :origin:`searx/settings.yml` file. Read :ref:`settings use_default_settings` to
  22. see how you can simplify your *user defined* ``settings.yml``.
  23. .. _settings use_default_settings:
  24. use_default_settings
  25. ====================
  26. .. sidebar:: ``use_default_settings: true``
  27. - :ref:`settings location`
  28. - :ref:`use_default_settings.yml`
  29. - :origin:`/etc/searxng/settings.yml <utils/templates/etc/searxng/settings.yml>`
  30. The user defined ``settings.yml`` is loaded from the :ref:`settings location`
  31. and can relied on the default configuration :origin:`searx/settings.yml` using:
  32. ``use_default_settings: true``
  33. ``server:``
  34. In the following example, the actual settings are the default settings defined
  35. in :origin:`searx/settings.yml` with the exception of the ``secret_key`` and
  36. the ``bind_address``:
  37. .. code:: yaml
  38. use_default_settings: true
  39. server:
  40. secret_key: "ultrasecretkey" # change this!
  41. bind_address: "0.0.0.0"
  42. ``engines:``
  43. With ``use_default_settings: true``, each settings can be override in a
  44. similar way, the ``engines`` section is merged according to the engine
  45. ``name``. In this example, SearXNG will load all the default engines, will
  46. enable the ``bing`` engine and define a :ref:`token <private engines>` for
  47. the arch linux engine:
  48. .. code:: yaml
  49. use_default_settings: true
  50. server:
  51. secret_key: "ultrasecretkey" # change this!
  52. engines:
  53. - name: arch linux wiki
  54. tokens: ['$ecretValue']
  55. - name: bing
  56. disabled: false
  57. ``engines:`` / ``remove:``
  58. It is possible to remove some engines from the default settings. The following
  59. example is similar to the above one, but SearXNG doesn't load the the google
  60. engine:
  61. .. code:: yaml
  62. use_default_settings:
  63. engines:
  64. remove:
  65. - google
  66. server:
  67. secret_key: "ultrasecretkey" # change this!
  68. engines:
  69. - name: arch linux wiki
  70. tokens: ['$ecretValue']
  71. ``engines:`` / ``keep_only:``
  72. As an alternative, it is possible to specify the engines to keep. In the
  73. following example, SearXNG has only two engines:
  74. .. code:: yaml
  75. use_default_settings:
  76. engines:
  77. keep_only:
  78. - google
  79. - duckduckgo
  80. server:
  81. secret_key: "ultrasecretkey" # change this!
  82. engines:
  83. - name: google
  84. tokens: ['$ecretValue']
  85. - name: duckduckgo
  86. tokens: ['$ecretValue']