on master help sign in
[mod] improve settings documentation

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit4853a2980322ccd84597a6502dce3ca7f5c76af0 authorMarkus Heiser <markus.heiser@darmarit.de> dateSat 2 Jan 2021, 19:56 (6 years ago) parentd0338cb
2 files changed+97−62
docs/admin/installation-searx.rst+10−3 docs/admin/settings.rst+87−59
docs/admin/installation-searx.rst+10−3
@@ -70,13 +70,20 @@ from the login (*~/.profile*):
7070Configuration
7171=============
7272
73+.. sidebar:: ``use_default_settings: True``
74+
75+ - :ref:`settings global`
76+ - :ref:`settings location`
77+ - :ref:`settings use_default_settings`
78+ - :origin:`/etc/searx/settings.yml <utils/templates/etc/searx/use_default_settings.yml>`
79+
7380To create a initial ``/etc/searx/settings.yml`` you can start with a copy of the
7481file :origin:`utils/templates/etc/searx/use_default_settings.yml`. This setup
75−:option:ref:`use default settings <settings use_default_settings>` from
82+:ref:`use default settings <settings use_default_settings>` from
7683:origin:`searx/settings.yml` and is recommended since :pull:`2291` is merged.
7784
78−For minimal Setup, configure like shown below – replace ``searx@\$(uname -n)``
79−with a name of your choice, set ``ultrasecretkey`` -- *and/or* edit
85+For a *minimal setup*, configure like shown below – replace ``searx@$(uname
86+-n)`` with a name of your choice, set ``ultrasecretkey`` -- *and/or* edit
8087``/etc/searx/settings.yml`` to your needs.
8188
8289.. kernel-include:: $DOCS_BUILD/includes/searx.rst
docs/admin/settings.rst+87−59
@@ -27,7 +27,8 @@ First, searx will try to load settings.yml from these locations:
27271. the full path specified in the ``SEARX_SETTINGS_PATH`` environment variable.
28282. ``/etc/searx/settings.yml``
2929
30−If these files don't exist (or are empty or can't be read), searx uses the :origin:`searx/settings.yml` file.
30+If these files don't exist (or are empty or can't be read), searx uses the
31+:origin:`searx/settings.yml` file.
3132
3233
3334.. _settings global:
@@ -35,6 +36,9 @@ If these files don't exist (or are empty or can't be read), searx uses the :orig
3536Global Settings
3637===============
3738
39+``general:``
40+------------
41+
3842.. code:: yaml
3943
4044 general:
@@ -54,7 +58,7 @@ Global Settings
5458 messages in the browser too, so this must be deactivated in production.
5559
5660``contact_url``:
57− Contact mail address or WEB form.
61+ Contact ``mailto:`` address or WEB form.
5862
5963``git_url`` and ``git_branch``:
6064 Changes this, to point to your searx fork (branch).
@@ -69,6 +73,9 @@ Global Settings
6973 Link to your tweets (or ``False``)
7074
7175
76+``server:``
77+-----------
78+
7279.. code:: yaml
7380
7481 server:
@@ -114,6 +121,8 @@ Global Settings
114121``default_http_headers``:
115122 Set additional HTTP headers, see `#755 <https://github.com/searx/searx/issues/715>`__
116123
124+``outgoing:``
125+-------------
117126
118127.. code:: yaml
119128
@@ -163,6 +172,10 @@ Global Settings
163172 If you use multiple network interfaces, define from which IP the requests must
164173 be made. This parameter is ignored when ``proxies`` is set.
165174
175+
176+``locales:``
177+------------
178+
166179.. code:: yaml
167180
168181 locales:
@@ -268,61 +281,76 @@ Engine settings
268281use_default_settings
269282====================
270283
271−.. note::
272−
273− If searx is cloned from a git repository, most probably there is no need to have an user settings.
274−
275−The user defined settings.yml can relied on the default configuration :origin:`searx/settings.yml` using ``use_default_settings: True``.
276−
277−In the following example, the actual settings are the default settings defined in :origin:`searx/settings.yml` with the exception of the ``secret_key`` and the ``bind_address``:
278−
279−.. code-block:: yaml
280−
281− use_default_settings: True
282− server:
283− secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
284− bind_address: "0.0.0.0"
284+.. sidebar:: ``use_default_settings: True``
285285
286−With ``use_default_settings: True``, each settings can be override in a similar way, the ``engines`` section is merged according to the engine ``name``.
287−
288−In this example, searx will load all the engine and the arch linux wiki engine has a :ref:`token<private engines>`:
289−
290−.. code-block:: yaml
291−
292− use_default_settings: True
293− server:
294− secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
295− engines:
296− - name: arch linux wiki
297− tokens: ['$ecretValue']
298−
299−It is possible to remove some engines from the default settings. The following example is similar to the above one, but searx doesn't load the the google engine:
300−
301−.. code-block:: yaml
302−
303− use_default_settings:
304− engines:
305− remove:
306− - google
307− server:
308− secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
309− engines:
310− - name: arch linux wiki
311− tokens: ['$ecretValue']
312−
313−As an alternative, it is possible to specify the engines to keep. In the following example, searx has only two engines:
314−
315−.. code-block:: yaml
316−
317− use_default_settings:
318− engines:
319− keep_only:
320− - google
321− - duckduckgo
322− server:
323− secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
324− engines:
325− - name: google
326− tokens: ['$ecretValue']
327− - name: duckduckgo
328− tokens: ['$ecretValue']
286+ - :ref:`settings location`
287+ - :ref:`use_default_settings.yml`
288+ - :origin:`/etc/searx/settings.yml <utils/templates/etc/searx/use_default_settings.yml>`
289+
290+The user defined ``settings.yml`` is loaded from the :ref:`settings location`
291+and can relied on the default configuration :origin:`searx/settings.yml` using:
292+
293+ ``use_default_settings: True``
294+
295+``server:``
296+ In the following example, the actual settings are the default settings defined
297+ in :origin:`searx/settings.yml` with the exception of the ``secret_key`` and
298+ the ``bind_address``:
299+
300+ .. code-block:: yaml
301+
302+ use_default_settings: True
303+ server:
304+ secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
305+ bind_address: "0.0.0.0"
306+
307+``engines:``
308+ With ``use_default_settings: True``, each settings can be override in a
309+ similar way, the ``engines`` section is merged according to the engine
310+ ``name``. In this example, searx will load all the engine and the arch linux
311+ wiki engine has a :ref:`token<private engines>`:
312+
313+ .. code-block:: yaml
314+
315+ use_default_settings: True
316+ server:
317+ secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
318+ engines:
319+ - name: arch linux wiki
320+ tokens: ['$ecretValue']
321+
322+``engines:`` / ``remove:``
323+ It is possible to remove some engines from the default settings. The following
324+ example is similar to the above one, but searx doesn't load the the google
325+ engine:
326+
327+ .. code-block:: yaml
328+
329+ use_default_settings:
330+ engines:
331+ remove:
332+ - google
333+ server:
334+ secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
335+ engines:
336+ - name: arch linux wiki
337+ tokens: ['$ecretValue']
338+
339+``engines:`` / ``keep_only:``
340+ As an alternative, it is possible to specify the engines to keep. In the
341+ following example, searx has only two engines:
342+
343+ .. code-block:: yaml
344+
345+ use_default_settings:
346+ engines:
347+ keep_only:
348+ - google
349+ - duckduckgo
350+ server:
351+ secret_key: "uvys6bRhKHUdFF5CqbJonSDSRN8H0sCBziNSrDGNVdpz7IeZhveVart3yvghoKHA"
352+ engines:
353+ - name: google
354+ tokens: ['$ecretValue']
355+ - name: duckduckgo
356+ tokens: ['$ecretValue']