2019-12-30 21:56:09 +01:00
|
|
|
.. _settings.yml:
|
|
|
|
|
|
|
|
================
|
|
|
|
``settings.yml``
|
|
|
|
================
|
|
|
|
|
2020-02-04 16:42:13 +01:00
|
|
|
This page describe the options possibilities of the :origin:`searx/settings.yml`
|
|
|
|
file.
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
.. sidebar:: Further reading ..
|
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
- :ref:`use_default_settings.yml`
|
2019-12-30 21:56:09 +01:00
|
|
|
- :ref:`search API`
|
|
|
|
|
2020-02-04 16:42:13 +01:00
|
|
|
.. contents:: Contents
|
|
|
|
:depth: 2
|
|
|
|
:local:
|
|
|
|
:backlinks: entry
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
.. _settings location:
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
settings.yml location
|
|
|
|
=====================
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
The initial ``settings.yml`` we be load from these locations:
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-10-02 17:18:05 +02:00
|
|
|
1. the full path specified in the ``SEARXNG_SETTINGS_PATH`` environment variable.
|
2021-10-08 11:35:47 +02:00
|
|
|
2. ``/etc/searxng/settings.yml``
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-09-12 08:36:56 +02:00
|
|
|
If these files don't exist (or are empty or can't be read), SearXNG uses the
|
2021-06-03 18:56:39 +02:00
|
|
|
:origin:`searx/settings.yml` file. Read :ref:`settings use_default_settings` to
|
|
|
|
see how you can simplify your *user defined* ``settings.yml``.
|
2019-12-30 21:56:09 +01:00
|
|
|
|
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
.. _settings global:
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
Global Settings
|
|
|
|
===============
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. _settings brand:
|
2021-01-02 19:56:26 +01:00
|
|
|
|
2021-06-29 19:46:06 +02:00
|
|
|
``brand:``
|
2022-03-20 17:55:55 +01:00
|
|
|
----------
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
.. code:: yaml
|
2021-04-25 12:03:54 +02:00
|
|
|
|
|
|
|
brand:
|
2021-06-03 18:56:39 +02:00
|
|
|
issue_url: https://github.com/searxng/searxng/issues
|
2022-01-02 20:54:41 +01:00
|
|
|
docs_url: https://docs.searxng.org
|
2021-06-03 18:56:39 +02:00
|
|
|
public_instances: https://searx.space
|
|
|
|
wiki_url: https://github.com/searxng/searxng/wiki
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-07-20 13:16:21 +02:00
|
|
|
``issue_url`` :
|
2021-06-29 19:46:06 +02:00
|
|
|
If you host your own issue tracker change this URL.
|
|
|
|
|
2021-07-20 13:16:21 +02:00
|
|
|
``docs_url`` :
|
2021-06-29 19:46:06 +02:00
|
|
|
If you host your own documentation change this URL.
|
|
|
|
|
2021-07-20 13:16:21 +02:00
|
|
|
``public_instances`` :
|
2021-06-29 19:46:06 +02:00
|
|
|
If you host your own https://searx.space change this URL.
|
|
|
|
|
2021-07-20 13:16:21 +02:00
|
|
|
``wiki_url`` :
|
2021-06-29 19:46:06 +02:00
|
|
|
Link to your wiki (or ``false``)
|
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. _settings general:
|
2021-06-29 19:46:06 +02:00
|
|
|
|
|
|
|
``general:``
|
|
|
|
------------
|
|
|
|
|
|
|
|
.. code:: yaml
|
|
|
|
|
|
|
|
general:
|
2022-07-02 13:50:06 +02:00
|
|
|
debug: false
|
|
|
|
instance_name: "SearXNG"
|
|
|
|
privacypolicy_url: false
|
|
|
|
donation_url: https://docs.searxng.org/donate.html
|
|
|
|
contact_url: false
|
|
|
|
enable_metrics: true
|
2021-06-29 19:46:06 +02:00
|
|
|
|
2021-10-02 12:21:02 +02:00
|
|
|
``debug`` : ``$SEARXNG_DEBUG``
|
2021-09-12 08:36:56 +02:00
|
|
|
Allow a more detailed log if you run SearXNG directly. Display *detailed* error
|
2019-12-30 21:56:09 +01:00
|
|
|
messages in the browser too, so this must be deactivated in production.
|
|
|
|
|
2022-07-02 13:50:06 +02:00
|
|
|
``donation_url`` :
|
|
|
|
At default the donation link points to the `SearXNG project
|
|
|
|
<https://docs.searxng.org/donate.html>`_. Set value to ``true`` to use your
|
|
|
|
own donation page written in the :ref:`searx/info/en/donate.md
|
|
|
|
<searx.infopage>` and use ``false`` to disable the donation link altogether.
|
|
|
|
|
2022-06-15 22:06:52 +02:00
|
|
|
``privacypolicy_url``:
|
|
|
|
Link to privacy policy.
|
|
|
|
|
2020-12-21 00:37:45 +01:00
|
|
|
``contact_url``:
|
2021-01-02 19:56:26 +01:00
|
|
|
Contact ``mailto:`` address or WEB form.
|
2020-12-21 00:37:45 +01:00
|
|
|
|
2021-12-26 22:44:46 +01:00
|
|
|
``enable_metrics``:
|
|
|
|
Enabled by default. Record various anonymous metrics availabled at ``/stats``,
|
|
|
|
``/stats/errors`` and ``/preferences``.
|
2020-12-21 00:37:45 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. _settings search:
|
|
|
|
|
|
|
|
``search:``
|
|
|
|
-----------
|
|
|
|
|
|
|
|
.. code:: yaml
|
|
|
|
|
|
|
|
search:
|
|
|
|
safe_search: 0
|
|
|
|
autocomplete: ""
|
|
|
|
default_lang: ""
|
|
|
|
ban_time_on_fail: 5
|
|
|
|
max_ban_time_on_fail: 120
|
2023-01-29 19:25:07 +01:00
|
|
|
suspended_times:
|
|
|
|
SearxEngineAccessDenied: 86400
|
|
|
|
SearxEngineCaptcha: 86400
|
|
|
|
SearxEngineTooManyRequests: 3600
|
|
|
|
cf_SearxEngineCaptcha: 1296000
|
|
|
|
cf_SearxEngineAccessDenied: 86400
|
|
|
|
recaptcha_SearxEngineCaptcha: 604800
|
2022-03-20 17:55:55 +01:00
|
|
|
formats:
|
|
|
|
- html
|
|
|
|
|
|
|
|
``safe_search``:
|
|
|
|
Filter results.
|
|
|
|
|
|
|
|
- ``0``: None
|
|
|
|
- ``1``: Moderate
|
|
|
|
- ``2``: Strict
|
|
|
|
|
|
|
|
``autocomplete``:
|
|
|
|
Existing autocomplete backends, leave blank to turn it off.
|
|
|
|
|
|
|
|
- ``dbpedia``
|
|
|
|
- ``duckduckgo``
|
|
|
|
- ``google``
|
|
|
|
- ``startpage``
|
|
|
|
- ``swisscows``
|
|
|
|
- ``qwant``
|
|
|
|
- ``wikipedia``
|
|
|
|
|
|
|
|
``default_lang``:
|
|
|
|
Default search language - leave blank to detect from browser information or
|
|
|
|
use codes from :origin:`searx/languages.py`.
|
|
|
|
|
2022-03-21 10:21:33 +01:00
|
|
|
``languages``:
|
|
|
|
List of available languages - leave unset to use all codes from
|
|
|
|
:origin:`searx/languages.py`. Otherwise list codes of available languages.
|
|
|
|
The ``all`` value is shown as the ``Default language`` in the user interface
|
|
|
|
(in most cases, it is meant to send the query without a language parameter ;
|
|
|
|
in some cases, it means the English language) Example:
|
|
|
|
|
|
|
|
.. code:: yaml
|
|
|
|
|
|
|
|
languages:
|
|
|
|
- all
|
|
|
|
- en
|
|
|
|
- en-US
|
|
|
|
- de
|
|
|
|
- it-IT
|
|
|
|
- fr
|
|
|
|
- fr-BE
|
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
``ban_time_on_fail``:
|
|
|
|
Ban time in seconds after engine errors.
|
|
|
|
|
|
|
|
``max_ban_time_on_fail``:
|
|
|
|
Max ban time in seconds after engine errors.
|
|
|
|
|
2023-01-29 19:25:07 +01:00
|
|
|
``suspended_times``:
|
|
|
|
Engine suspension time after error (in seconds; set to 0 to disable)
|
|
|
|
|
|
|
|
``SearxEngineAccessDenied``: 86400
|
|
|
|
For error "Access denied" and "HTTP error [402, 403]"
|
|
|
|
|
|
|
|
``SearxEngineCaptcha``: 86400
|
|
|
|
For error "CAPTCHA"
|
|
|
|
|
|
|
|
``SearxEngineTooManyRequests``: 3600
|
|
|
|
For error "Too many request" and "HTTP error 429"
|
|
|
|
|
|
|
|
Cloudflare CAPTCHA:
|
|
|
|
- ``cf_SearxEngineCaptcha``: 1296000
|
|
|
|
- ``cf_SearxEngineAccessDenied``: 86400
|
|
|
|
|
|
|
|
Google CAPTCHA:
|
|
|
|
- ``recaptcha_SearxEngineCaptcha``: 604800
|
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
``formats``:
|
|
|
|
Result formats available from web, remove format to deny access (use lower
|
|
|
|
case).
|
|
|
|
|
|
|
|
- ``html``
|
|
|
|
- ``csv``
|
|
|
|
- ``json``
|
|
|
|
- ``rss``
|
|
|
|
|
2023-01-29 19:25:07 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. _settings server:
|
2020-12-21 00:37:45 +01:00
|
|
|
|
2021-01-02 19:56:26 +01:00
|
|
|
``server:``
|
|
|
|
-----------
|
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
.. code:: yaml
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
server:
|
2023-02-17 12:08:58 +01:00
|
|
|
base_url: http://example.org/location # change this!
|
2021-06-03 18:56:39 +02:00
|
|
|
port: 8888
|
2023-02-17 12:08:58 +01:00
|
|
|
bind_address: "127.0.0.1"
|
|
|
|
secret_key: "ultrasecretkey" # change this!
|
2022-04-22 12:48:12 +02:00
|
|
|
limiter: false
|
2023-02-17 12:08:58 +01:00
|
|
|
image_proxy: false
|
2020-12-08 20:19:10 +01:00
|
|
|
default_http_headers:
|
2021-06-03 18:56:39 +02:00
|
|
|
X-Content-Type-Options : nosniff
|
|
|
|
X-XSS-Protection : 1; mode=block
|
|
|
|
X-Download-Options : noopen
|
|
|
|
X-Robots-Tag : noindex, nofollow
|
|
|
|
Referrer-Policy : no-referrer
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2023-02-17 12:08:58 +01:00
|
|
|
``base_url`` : ``$SEARXNG_URL`` :ref:`buildenv <make buildenv>`
|
2021-09-12 08:36:56 +02:00
|
|
|
The base URL where SearXNG is deployed. Used to create correct inbound links.
|
2021-06-29 19:46:06 +02:00
|
|
|
If you change the value, don't forget to rebuild instance's environment
|
|
|
|
(:ref:`utils/brand.env <make buildenv>`)
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2023-02-17 12:08:58 +01:00
|
|
|
``port`` & ``bind_address``: ``$SEARXNG_PORT`` & ``$SEARXNG_BIND_ADDRESS`` :ref:`buildenv <make buildenv>`
|
2021-09-12 08:36:56 +02:00
|
|
|
Port number and *bind address* of the SearXNG web application if you run it
|
2023-02-17 12:08:58 +01:00
|
|
|
directly using ``python searx/webapp.py``. Doesn't apply to a SearXNG
|
|
|
|
services running behind a proxy and using socket communications. If you
|
|
|
|
change the value, don't forget to rebuild instance's environment
|
|
|
|
(:ref:`utils/brand.env <make buildenv>`)
|
2021-07-20 13:16:21 +02:00
|
|
|
|
2021-10-02 12:21:02 +02:00
|
|
|
``secret_key`` : ``$SEARXNG_SECRET``
|
2021-07-20 13:16:21 +02:00
|
|
|
Used for cryptography purpose.
|
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. _limiter:
|
|
|
|
|
2022-04-22 12:48:12 +02:00
|
|
|
``limiter`` :
|
|
|
|
Rate limit the number of request on the instance, block some bots. The
|
|
|
|
:ref:`limiter plugin` requires a :ref:`settings redis` database.
|
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. _image_proxy:
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
``image_proxy`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
Allow your instance of SearXNG of being able to proxy images. Uses memory space.
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. _HTTP headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
|
|
|
|
|
2022-04-22 12:48:12 +02:00
|
|
|
``default_http_headers`` :
|
2022-03-20 17:55:55 +01:00
|
|
|
Set additional HTTP headers, see `#755 <https://github.com/searx/searx/issues/715>`__
|
|
|
|
|
|
|
|
|
|
|
|
.. _settings ui:
|
|
|
|
|
|
|
|
``ui:``
|
|
|
|
-------
|
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. _cache busting:
|
|
|
|
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#caching_static_assets_with_cache_busting
|
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
.. code:: yaml
|
|
|
|
|
|
|
|
ui:
|
2022-06-14 10:02:50 +02:00
|
|
|
static_use_hash: false
|
2022-03-20 17:55:55 +01:00
|
|
|
default_locale: ""
|
|
|
|
query_in_title: false
|
2022-07-09 19:33:25 +02:00
|
|
|
infinite_scroll: false
|
2022-07-03 17:58:40 +02:00
|
|
|
center_alignment: false
|
2022-09-04 09:36:01 +02:00
|
|
|
cache_url: https://web.archive.org/web/
|
2022-03-20 17:55:55 +01:00
|
|
|
default_theme: simple
|
|
|
|
theme_args:
|
|
|
|
simple_style: auto
|
|
|
|
|
2022-06-14 10:02:50 +02:00
|
|
|
.. _static_use_hash:
|
|
|
|
|
|
|
|
``static_use_hash`` :
|
|
|
|
Enables `cache busting`_ of static files.
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
``default_locale`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
SearXNG interface language. If blank, the locale is detected by using the
|
2019-12-30 21:56:09 +01:00
|
|
|
browser language. If it doesn't work, or you are deploying a language
|
|
|
|
specific instance of searx, a locale can be defined using an ISO language
|
|
|
|
code, like ``fr``, ``en``, ``de``.
|
|
|
|
|
2022-07-03 17:58:40 +02:00
|
|
|
``query_in_title`` :
|
|
|
|
When true, the result page's titles contains the query it decreases the
|
|
|
|
privacy, since the browser can records the page titles.
|
|
|
|
|
2022-07-09 19:33:25 +02:00
|
|
|
``infinite_scroll``:
|
|
|
|
When true, automatically loads the next page when scrolling to bottom of the current page.
|
|
|
|
|
2022-07-03 17:58:40 +02:00
|
|
|
``center_alignment`` : default ``false``
|
|
|
|
When enabled, the results are centered instead of being in the left (or RTL)
|
|
|
|
side of the screen. This setting only affects the *desktop layout*
|
|
|
|
(:origin:`min-width: @tablet <searx/static/themes/simple/src/less/definitions.less>`)
|
|
|
|
|
2022-09-04 09:36:01 +02:00
|
|
|
.. cache_url:
|
|
|
|
|
|
|
|
``cache_url`` : ``https://web.archive.org/web/``
|
|
|
|
URL prefix of the internet archive or cache, don't forgett trailing slash (if
|
|
|
|
needed). The default is https://web.archive.org/web/ alternatives are:
|
|
|
|
|
|
|
|
- https://webcache.googleusercontent.com/search?q=cache:
|
|
|
|
- https://archive.today/
|
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
``default_theme`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
Name of the theme you want to use by default on your SearXNG instance.
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
``theme_args.simple_style``:
|
|
|
|
Style of simple theme: ``auto``, ``light``, ``dark``
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2022-03-20 17:55:55 +01:00
|
|
|
``results_on_new_tab``:
|
|
|
|
Open result links in a new tab by default.
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2022-01-03 17:43:20 +01:00
|
|
|
|
|
|
|
.. _settings redis:
|
|
|
|
|
|
|
|
``redis:``
|
|
|
|
----------
|
|
|
|
|
|
|
|
.. _Redis.from_url(url): https://redis-py.readthedocs.io/en/stable/connections.html#redis.client.Redis.from_url
|
|
|
|
|
2022-11-11 21:58:32 +01:00
|
|
|
A redis DB can be connected by an URL, in :py:obj:`searx.redisdb` you
|
2022-03-25 10:23:15 +01:00
|
|
|
will find a description to test your redis connection in SerXNG. When using
|
|
|
|
sockets, don't forget to check the access rights on the socket::
|
|
|
|
|
|
|
|
ls -la /usr/local/searxng-redis/run/redis.sock
|
|
|
|
srwxrwx--- 1 searxng-redis searxng-redis ... /usr/local/searxng-redis/run/redis.sock
|
|
|
|
|
|
|
|
In this example read/write access is given to the *searxng-redis* group. To get
|
|
|
|
access rights to redis instance (the socket), your SearXNG (or even your
|
|
|
|
developer) account needs to be added to the *searxng-redis* group.
|
|
|
|
|
2022-01-03 17:43:20 +01:00
|
|
|
``url``
|
|
|
|
URL to connect redis database, see `Redis.from_url(url)`_ & :ref:`redis db`::
|
|
|
|
|
|
|
|
redis://[[username]:[password]]@localhost:6379/0
|
|
|
|
rediss://[[username]:[password]]@localhost:6379/0
|
|
|
|
unix://[[username]:[password]]@/path/to/socket.sock?db=0
|
|
|
|
|
|
|
|
.. admonition:: Tip for developers
|
|
|
|
|
2022-10-14 15:27:07 +02:00
|
|
|
To set up a local redis instance, first set the socket path of the Redis DB
|
|
|
|
in your YAML setting:
|
2022-03-25 10:23:15 +01:00
|
|
|
|
|
|
|
.. code:: yaml
|
|
|
|
|
|
|
|
redis:
|
|
|
|
url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
|
|
|
|
|
2022-10-14 15:27:07 +02:00
|
|
|
Then use the following commands to install the redis instance ::
|
|
|
|
|
|
|
|
$ ./manage redis.build
|
|
|
|
$ sudo -H ./manage redis.install
|
|
|
|
$ sudo -H ./manage redis.addgrp "${USER}"
|
|
|
|
# don't forget to logout & login to get member of group
|
|
|
|
|
2022-03-25 10:23:15 +01:00
|
|
|
|
2022-01-03 17:43:20 +01:00
|
|
|
.. _settings outgoing:
|
|
|
|
|
2021-01-02 19:56:26 +01:00
|
|
|
``outgoing:``
|
|
|
|
-------------
|
2020-12-08 20:19:10 +01:00
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
Communication with search engines.
|
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
.. code:: yaml
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
outgoing:
|
|
|
|
request_timeout: 2.0 # default timeout in seconds, can be override by engine
|
|
|
|
max_request_timeout: 10.0 # the maximum timeout in seconds
|
2022-09-27 17:01:00 +02:00
|
|
|
useragent_suffix: "" # information like an email address to the administrator
|
2021-06-03 18:56:39 +02:00
|
|
|
pool_connections: 100 # Maximum number of allowable connections, or null
|
|
|
|
# for no limits. The default is 100.
|
|
|
|
pool_maxsize: 10 # Number of allowable keep-alive connections, or null
|
|
|
|
# to always allow. The default is 10.
|
|
|
|
enable_http2: true # See https://www.python-httpx.org/http2/
|
2022-07-19 23:40:11 +02:00
|
|
|
# uncomment below section if you want to use a custom server certificate
|
|
|
|
# see https://www.python-httpx.org/advanced/#changing-the-verification-defaults
|
|
|
|
# and https://www.python-httpx.org/compatibility/#ssl-configuration
|
|
|
|
# verify: ~/.mitmproxy/mitmproxy-ca-cert.cer
|
|
|
|
#
|
|
|
|
# uncomment below section if you want to use a proxyq see: SOCKS proxies
|
|
|
|
# https://2.python-requests.org/en/latest/user/advanced/#proxies
|
|
|
|
# are also supported: see
|
|
|
|
# https://2.python-requests.org/en/latest/user/advanced/#socks
|
|
|
|
#
|
|
|
|
# proxies:
|
|
|
|
# all://:
|
|
|
|
# - http://proxy1:8080
|
|
|
|
# - http://proxy2:8080
|
|
|
|
#
|
|
|
|
# using_tor_proxy: true
|
|
|
|
#
|
|
|
|
# Extra seconds to add in order to account for the time taken by the proxy
|
|
|
|
#
|
|
|
|
# extra_proxy_timeout: 10.0
|
|
|
|
#
|
2020-12-08 20:19:10 +01:00
|
|
|
|
|
|
|
``request_timeout`` :
|
|
|
|
Global timeout of the requests made to others engines in seconds. A bigger
|
|
|
|
timeout will allow to wait for answers from slow engines, but in consequence
|
2021-09-12 08:36:56 +02:00
|
|
|
will slow SearXNG reactivity (the result page may take the time specified in the
|
2020-12-08 20:19:10 +01:00
|
|
|
timeout to load). Can be override by :ref:`settings engine`
|
|
|
|
|
|
|
|
``useragent_suffix`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
Suffix to the user-agent SearXNG uses to send requests to others engines. If an
|
2020-12-08 20:19:10 +01:00
|
|
|
engine wish to block you, a contact info here may be useful to avoid that.
|
|
|
|
|
2022-04-22 12:48:12 +02:00
|
|
|
``keepalive_expiry`` :
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
Number of seconds to keep a connection in the pool. By default 5.0 seconds.
|
|
|
|
|
|
|
|
.. _httpx proxies: https://www.python-httpx.org/advanced/#http-proxying
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2020-11-16 12:44:07 +01:00
|
|
|
``proxies`` :
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
Define one or more proxies you wish to use, see `httpx proxies`_.
|
2020-11-16 12:44:07 +01:00
|
|
|
If there are more than one proxy for one protocol (http, https),
|
|
|
|
requests to the engines are distributed in a round-robin fashion.
|
2019-12-30 21:56:09 +01:00
|
|
|
|
|
|
|
``source_ips`` :
|
2020-07-12 12:01:16 +02:00
|
|
|
If you use multiple network interfaces, define from which IP the requests must
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
be made. Example:
|
|
|
|
|
|
|
|
* ``0.0.0.0`` any local IPv4 address.
|
|
|
|
* ``::`` any local IPv6 address.
|
|
|
|
* ``192.168.0.1``
|
|
|
|
* ``[ 192.168.0.1, 192.168.0.2 ]`` these two specific IP addresses
|
|
|
|
* ``fe80::60a2:1691:e5a2:ee1f``
|
|
|
|
* ``fe80::60a2:1691:e5a2:ee1f/126`` all IP addresses in this network.
|
|
|
|
* ``[ 192.168.0.1, fe80::/126 ]``
|
|
|
|
|
|
|
|
``retries`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
Number of retry in case of an HTTP error. On each retry, SearXNG uses an
|
2021-06-03 18:56:39 +02:00
|
|
|
different proxy and source ip.
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
|
|
|
|
``retry_on_http_error`` :
|
|
|
|
Retry request on some HTTP status code.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
* ``true`` : on HTTP status code between 400 and 599.
|
|
|
|
* ``403`` : on HTTP status code 403.
|
|
|
|
* ``[403, 429]``: on HTTP status code 403 and 429.
|
|
|
|
|
|
|
|
``enable_http2`` :
|
2021-06-03 18:56:39 +02:00
|
|
|
Enable by default. Set to ``false`` to disable HTTP/2.
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
|
2022-07-19 23:40:11 +02:00
|
|
|
.. _httpx verification defaults: https://www.python-httpx.org/advanced/#changing-the-verification-defaults
|
|
|
|
.. _httpx ssl configuration: https://www.python-httpx.org/compatibility/#ssl-configuration
|
|
|
|
|
|
|
|
``verify``: : ``$SSL_CERT_FILE``, ``$SSL_CERT_DIR``
|
|
|
|
Allow to specify a path to certificate.
|
|
|
|
see `httpx verification defaults`_.
|
|
|
|
|
|
|
|
In addition to ``verify``, SearXNG supports the ``$SSL_CERT_FILE`` (for a file) and
|
|
|
|
``$SSL_CERT_DIR`` (for a directory) OpenSSL variables.
|
|
|
|
see `httpx ssl configuration`_.
|
|
|
|
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
``max_redirects`` :
|
|
|
|
30 by default. Maximum redirect before it is an error.
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-12-22 15:51:26 +01:00
|
|
|
``categories_as_tabs:``
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
A list of the categories that are displayed as tabs in the user interface.
|
|
|
|
Categories not listed here can still be searched with the :ref:`search-syntax`.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
categories_as_tabs:
|
2022-01-04 18:00:45 +01:00
|
|
|
general:
|
|
|
|
images:
|
|
|
|
videos:
|
|
|
|
news:
|
|
|
|
map:
|
|
|
|
music:
|
|
|
|
it:
|
|
|
|
science:
|
|
|
|
files:
|
|
|
|
social media:
|
2021-12-22 15:51:26 +01:00
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
.. _settings engine:
|
|
|
|
|
|
|
|
Engine settings
|
|
|
|
===============
|
|
|
|
|
|
|
|
.. sidebar:: Further reading ..
|
|
|
|
|
2021-06-04 11:29:58 +02:00
|
|
|
- :ref:`configured engines`
|
2019-12-30 21:56:09 +01:00
|
|
|
- :ref:`engines-dev`
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
In the code example below a *full fledged* example of a YAML setup from a dummy
|
|
|
|
engine is shown. Most of the options have a default value or even are optional.
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
.. code:: yaml
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
- name: example engine
|
|
|
|
engine: example
|
|
|
|
shortcut: demo
|
|
|
|
base_url: 'https://{language}.example.com/'
|
2022-08-01 17:01:59 +02:00
|
|
|
send_accept_language_header: false
|
2021-06-03 18:56:39 +02:00
|
|
|
categories: general
|
|
|
|
timeout: 3.0
|
|
|
|
api_key: 'apikey'
|
|
|
|
disabled: false
|
|
|
|
language: en_US
|
|
|
|
tokens: [ 'my-secret-token' ]
|
|
|
|
weigth: 1
|
|
|
|
display_error_messages: true
|
|
|
|
about:
|
|
|
|
website: https://example.com
|
|
|
|
wikidata_id: Q306656
|
|
|
|
official_api_documentation: https://example.com/api-doc
|
|
|
|
use_official_api: true
|
|
|
|
require_api_key: true
|
|
|
|
results: HTML
|
|
|
|
enable_http: false
|
|
|
|
enable_http2: false
|
|
|
|
retries: 1
|
|
|
|
retry_on_http_error: true # or 403 or [404, 429]
|
|
|
|
max_connections: 100
|
|
|
|
max_keepalive_connections: 10
|
|
|
|
keepalive_expiry: 5.0
|
|
|
|
proxies:
|
|
|
|
http:
|
|
|
|
- http://proxy1:8080
|
|
|
|
- http://proxy2:8080
|
|
|
|
https:
|
|
|
|
- http://proxy1:8080
|
|
|
|
- http://proxy2:8080
|
|
|
|
- socks5://user:password@proxy3:1080
|
|
|
|
- socks5h://user:password@proxy4:1080
|
2019-12-30 21:56:09 +01:00
|
|
|
|
|
|
|
``name`` :
|
2021-09-12 08:36:56 +02:00
|
|
|
Name that will be used across SearXNG to define this engine. In settings, on
|
2019-12-30 21:56:09 +01:00
|
|
|
the result page...
|
|
|
|
|
|
|
|
``engine`` :
|
|
|
|
Name of the python file used to handle requests and responses to and from this
|
|
|
|
search engine.
|
|
|
|
|
|
|
|
``shortcut`` :
|
2022-01-06 13:45:25 +01:00
|
|
|
Code used to execute bang requests (in this case using ``!bi``)
|
2019-12-30 21:56:09 +01:00
|
|
|
|
|
|
|
``base_url`` : optional
|
2020-07-12 12:01:16 +02:00
|
|
|
Part of the URL that should be stable across every request. Can be useful to
|
2019-12-30 21:56:09 +01:00
|
|
|
use multiple sites using only one engine, or updating the site URL without
|
|
|
|
touching at the code.
|
|
|
|
|
2022-08-01 17:01:59 +02:00
|
|
|
``send_accept_language_header`` :
|
|
|
|
Several engines that support languages (or regions) deal with the HTTP header
|
|
|
|
``Accept-Language`` to build a response that fits to the locale. When this
|
|
|
|
option is activated, the language (locale) that is selected by the user is used
|
|
|
|
to build and send a ``Accept-Language`` header in the request to the origin
|
|
|
|
search engine.
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
``categories`` : optional
|
|
|
|
Define in which categories this engine will be active. Most of the time, it is
|
|
|
|
defined in the code of the engine, but in a few cases it is useful, like when
|
|
|
|
describing multiple search engine using the same code.
|
|
|
|
|
|
|
|
``timeout`` : optional
|
|
|
|
Timeout of the search with the current search engine. **Be careful, it will
|
2021-11-18 18:27:26 +01:00
|
|
|
modify the global timeout of SearXNG.**
|
2019-12-30 21:56:09 +01:00
|
|
|
|
|
|
|
``api_key`` : optional
|
|
|
|
In a few cases, using an API needs the use of a secret key. How to obtain them
|
|
|
|
is described in the file.
|
|
|
|
|
|
|
|
``disabled`` : optional
|
2020-07-12 12:01:16 +02:00
|
|
|
To disable by default the engine, but not deleting it. It will allow the user
|
2019-12-30 21:56:09 +01:00
|
|
|
to manually activate it in the settings.
|
|
|
|
|
2022-09-29 20:54:46 +02:00
|
|
|
``inactive``: optional
|
|
|
|
Remove the engine from the settings (*disabled & removed*).
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
``language`` : optional
|
|
|
|
If you want to use another language for a specific engine, you can define it
|
2022-09-29 20:54:46 +02:00
|
|
|
by using the ISO code of language (and region), like ``fr``, ``en-US``,
|
|
|
|
``de-DE``.
|
2019-12-30 21:56:09 +01:00
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
``tokens`` : optional
|
|
|
|
A list of secret tokens to make this engine *private*, more details see
|
|
|
|
:ref:`private engines`.
|
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
``weigth`` : default ``1``
|
|
|
|
Weighting of the results of this engine.
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
``display_error_messages`` : default ``true``
|
2020-03-29 13:14:06 +02:00
|
|
|
When an engine returns an error, the message is displayed on the user interface.
|
|
|
|
|
2022-04-22 12:48:12 +02:00
|
|
|
``network`` : optional
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
Use the network configuration from another engine.
|
|
|
|
In addition, there are two default networks:
|
2022-03-20 17:55:55 +01:00
|
|
|
|
|
|
|
- ``ipv4`` set ``local_addresses`` to ``0.0.0.0`` (use only IPv4 local addresses)
|
|
|
|
- ``ipv6`` set ``local_addresses`` to ``::`` (use only IPv6 local addresses)
|
[httpx] replace searx.poolrequests by searx.network
settings.yml:
* outgoing.networks:
* can contains network definition
* propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections,
keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries
* retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time)
* local_addresses can be "192.168.0.1/24" (it supports IPv6)
* support_ipv4 & support_ipv6: both True by default
see https://github.com/searx/searx/pull/1034
* each engine can define a "network" section:
* either a full network description
* either reference an existing network
* all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-04-05 10:43:33 +02:00
|
|
|
|
2019-12-30 21:56:09 +01:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
A few more options are possible, but they are pretty specific to some
|
|
|
|
engines, and so won't be described here.
|
2020-11-03 15:29:59 +01:00
|
|
|
|
|
|
|
|
2022-01-07 10:27:55 +01:00
|
|
|
Example: Multilingual Search
|
|
|
|
----------------------------
|
|
|
|
|
2022-01-10 13:48:13 +01:00
|
|
|
SearXNG does not support true multilingual search. You have to use the language
|
|
|
|
prefix in your search query when searching in a different language.
|
2022-01-07 10:27:55 +01:00
|
|
|
|
2022-01-10 13:48:13 +01:00
|
|
|
But there is a workaround: By adding a new search engine with a different
|
|
|
|
language, SearXNG will search in your default and other language.
|
2022-01-07 10:27:55 +01:00
|
|
|
|
|
|
|
Example configuration in settings.yml for a German and English speaker:
|
2022-01-10 13:48:13 +01:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
2022-01-07 10:27:55 +01:00
|
|
|
|
|
|
|
search:
|
|
|
|
default_lang : "de"
|
|
|
|
...
|
|
|
|
|
|
|
|
engines:
|
|
|
|
- name : google english
|
|
|
|
engine : google
|
|
|
|
language : en
|
|
|
|
...
|
|
|
|
|
2022-01-10 13:48:13 +01:00
|
|
|
When searching, the default google engine will return German results and
|
|
|
|
"google english" will return English results.
|
|
|
|
|
2022-01-07 10:27:55 +01:00
|
|
|
|
2020-12-08 20:19:10 +01:00
|
|
|
.. _settings use_default_settings:
|
2020-11-03 15:29:59 +01:00
|
|
|
|
|
|
|
use_default_settings
|
|
|
|
====================
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
.. sidebar:: ``use_default_settings: true``
|
2020-11-03 15:29:59 +01:00
|
|
|
|
2021-01-02 19:56:26 +01:00
|
|
|
- :ref:`settings location`
|
|
|
|
- :ref:`use_default_settings.yml`
|
2021-10-11 10:56:50 +02:00
|
|
|
- :origin:`/etc/searxng/settings.yml <utils/templates/etc/searxng/settings.yml>`
|
2021-01-02 19:56:26 +01:00
|
|
|
|
|
|
|
The user defined ``settings.yml`` is loaded from the :ref:`settings location`
|
|
|
|
and can relied on the default configuration :origin:`searx/settings.yml` using:
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
``use_default_settings: true``
|
2021-01-02 19:56:26 +01:00
|
|
|
|
|
|
|
``server:``
|
|
|
|
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``:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
use_default_settings: true
|
2021-01-02 19:56:26 +01:00
|
|
|
server:
|
2021-06-03 18:56:39 +02:00
|
|
|
secret_key: "ultrasecretkey" # change this!
|
2021-01-02 19:56:26 +01:00
|
|
|
bind_address: "0.0.0.0"
|
|
|
|
|
|
|
|
``engines:``
|
2021-06-03 18:56:39 +02:00
|
|
|
With ``use_default_settings: true``, each settings can be override in a
|
2021-01-02 19:56:26 +01:00
|
|
|
similar way, the ``engines`` section is merged according to the engine
|
2023-02-12 18:32:29 +01:00
|
|
|
``name``. In this example, SearXNG will load all the default engines, will
|
|
|
|
enable the ``bing`` engine and define a :ref:`token <private engines>` for
|
|
|
|
the arch linux engine:
|
2021-01-02 19:56:26 +01:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2021-06-03 18:56:39 +02:00
|
|
|
use_default_settings: true
|
2021-01-02 19:56:26 +01:00
|
|
|
server:
|
2021-06-03 18:56:39 +02:00
|
|
|
secret_key: "ultrasecretkey" # change this!
|
2021-01-02 19:56:26 +01:00
|
|
|
engines:
|
|
|
|
- name: arch linux wiki
|
|
|
|
tokens: ['$ecretValue']
|
2023-02-12 18:32:29 +01:00
|
|
|
- name: bing
|
|
|
|
disabled: false
|
|
|
|
|
2021-01-02 19:56:26 +01:00
|
|
|
|
|
|
|
``engines:`` / ``remove:``
|
|
|
|
It is possible to remove some engines from the default settings. The following
|
2021-09-12 08:36:56 +02:00
|
|
|
example is similar to the above one, but SearXNG doesn't load the the google
|
2021-01-02 19:56:26 +01:00
|
|
|
engine:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
use_default_settings:
|
2021-06-03 18:56:39 +02:00
|
|
|
engines:
|
|
|
|
remove:
|
|
|
|
- google
|
2021-01-02 19:56:26 +01:00
|
|
|
server:
|
2021-06-03 18:56:39 +02:00
|
|
|
secret_key: "ultrasecretkey" # change this!
|
2021-01-02 19:56:26 +01:00
|
|
|
engines:
|
|
|
|
- name: arch linux wiki
|
|
|
|
tokens: ['$ecretValue']
|
|
|
|
|
|
|
|
``engines:`` / ``keep_only:``
|
|
|
|
As an alternative, it is possible to specify the engines to keep. In the
|
2021-09-12 08:36:56 +02:00
|
|
|
following example, SearXNG has only two engines:
|
2021-01-02 19:56:26 +01:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
use_default_settings:
|
2021-06-03 18:56:39 +02:00
|
|
|
engines:
|
|
|
|
keep_only:
|
|
|
|
- google
|
|
|
|
- duckduckgo
|
2021-01-02 19:56:26 +01:00
|
|
|
server:
|
2021-06-03 18:56:39 +02:00
|
|
|
secret_key: "ultrasecretkey" # change this!
|
2021-01-02 19:56:26 +01:00
|
|
|
engines:
|
|
|
|
- name: google
|
|
|
|
tokens: ['$ecretValue']
|
|
|
|
- name: duckduckgo
|
|
|
|
tokens: ['$ecretValue']
|