settings.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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:: 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 global:
  24. Global Settings
  25. ===============
  26. .. _settings brand:
  27. ``brand:``
  28. ----------
  29. .. code:: yaml
  30. brand:
  31. issue_url: https://github.com/searxng/searxng/issues
  32. docs_url: https://docs.searxng.org
  33. public_instances: https://searx.space
  34. wiki_url: https://github.com/searxng/searxng/wiki
  35. ``issue_url`` :
  36. If you host your own issue tracker change this URL.
  37. ``docs_url`` :
  38. If you host your own documentation change this URL.
  39. ``public_instances`` :
  40. If you host your own https://searx.space change this URL.
  41. ``wiki_url`` :
  42. Link to your wiki (or ``false``)
  43. .. _settings general:
  44. ``general:``
  45. ------------
  46. .. code:: yaml
  47. general:
  48. debug: false
  49. instance_name: "SearXNG"
  50. privacypolicy_url: false
  51. donation_url: false
  52. contact_url: false
  53. enable_metrics: true
  54. ``debug`` : ``$SEARXNG_DEBUG``
  55. Allow a more detailed log if you run SearXNG directly. Display *detailed* error
  56. messages in the browser too, so this must be deactivated in production.
  57. ``donation_url`` :
  58. Set value to ``true`` to use your own donation page written in the
  59. :ref:`searx/info/en/donate.md <searx.infopage>` and use ``false`` to disable
  60. the donation link altogether.
  61. ``privacypolicy_url``:
  62. Link to privacy policy.
  63. ``contact_url``:
  64. Contact ``mailto:`` address or WEB form.
  65. ``enable_metrics``:
  66. Enabled by default. Record various anonymous metrics availabled at ``/stats``,
  67. ``/stats/errors`` and ``/preferences``.
  68. .. _settings search:
  69. ``search:``
  70. -----------
  71. .. code:: yaml
  72. search:
  73. safe_search: 0
  74. autocomplete: ""
  75. default_lang: ""
  76. ban_time_on_fail: 5
  77. max_ban_time_on_fail: 120
  78. suspended_times:
  79. SearxEngineAccessDenied: 86400
  80. SearxEngineCaptcha: 86400
  81. SearxEngineTooManyRequests: 3600
  82. cf_SearxEngineCaptcha: 1296000
  83. cf_SearxEngineAccessDenied: 86400
  84. recaptcha_SearxEngineCaptcha: 604800
  85. formats:
  86. - html
  87. ``safe_search``:
  88. Filter results.
  89. - ``0``: None
  90. - ``1``: Moderate
  91. - ``2``: Strict
  92. ``autocomplete``:
  93. Existing autocomplete backends, leave blank to turn it off.
  94. - ``dbpedia``
  95. - ``duckduckgo``
  96. - ``google``
  97. - ``startpage``
  98. - ``swisscows``
  99. - ``qwant``
  100. - ``wikipedia``
  101. ``default_lang``:
  102. Default search language - leave blank to detect from browser information or
  103. use codes from :origin:`searx/languages.py`.
  104. ``languages``:
  105. List of available languages - leave unset to use all codes from
  106. :origin:`searx/languages.py`. Otherwise list codes of available languages.
  107. The ``all`` value is shown as the ``Default language`` in the user interface
  108. (in most cases, it is meant to send the query without a language parameter ;
  109. in some cases, it means the English language) Example:
  110. .. code:: yaml
  111. languages:
  112. - all
  113. - en
  114. - en-US
  115. - de
  116. - it-IT
  117. - fr
  118. - fr-BE
  119. ``ban_time_on_fail``:
  120. Ban time in seconds after engine errors.
  121. ``max_ban_time_on_fail``:
  122. Max ban time in seconds after engine errors.
  123. ``suspended_times``:
  124. Engine suspension time after error (in seconds; set to 0 to disable)
  125. ``SearxEngineAccessDenied``: 86400
  126. For error "Access denied" and "HTTP error [402, 403]"
  127. ``SearxEngineCaptcha``: 86400
  128. For error "CAPTCHA"
  129. ``SearxEngineTooManyRequests``: 3600
  130. For error "Too many request" and "HTTP error 429"
  131. Cloudflare CAPTCHA:
  132. - ``cf_SearxEngineCaptcha``: 1296000
  133. - ``cf_SearxEngineAccessDenied``: 86400
  134. Google CAPTCHA:
  135. - ``recaptcha_SearxEngineCaptcha``: 604800
  136. ``formats``:
  137. Result formats available from web, remove format to deny access (use lower
  138. case).
  139. - ``html``
  140. - ``csv``
  141. - ``json``
  142. - ``rss``
  143. .. _settings server:
  144. ``server:``
  145. -----------
  146. .. code:: yaml
  147. server:
  148. base_url: http://example.org/location # change this!
  149. port: 8888
  150. bind_address: "127.0.0.1"
  151. secret_key: "ultrasecretkey" # change this!
  152. limiter: false
  153. image_proxy: false
  154. default_http_headers:
  155. X-Content-Type-Options : nosniff
  156. X-XSS-Protection : 1; mode=block
  157. X-Download-Options : noopen
  158. X-Robots-Tag : noindex, nofollow
  159. Referrer-Policy : no-referrer
  160. ``base_url`` : ``$SEARXNG_URL`` :ref:`buildenv <make buildenv>`
  161. The base URL where SearXNG is deployed. Used to create correct inbound links.
  162. If you change the value, don't forget to rebuild instance's environment
  163. (:ref:`utils/brand.env <make buildenv>`)
  164. ``port`` & ``bind_address``: ``$SEARXNG_PORT`` & ``$SEARXNG_BIND_ADDRESS`` :ref:`buildenv <make buildenv>`
  165. Port number and *bind address* of the SearXNG web application if you run it
  166. directly using ``python searx/webapp.py``. Doesn't apply to a SearXNG
  167. services running behind a proxy and using socket communications. If you
  168. change the value, don't forget to rebuild instance's environment
  169. (:ref:`utils/brand.env <make buildenv>`)
  170. ``secret_key`` : ``$SEARXNG_SECRET``
  171. Used for cryptography purpose.
  172. .. _limiter:
  173. ``limiter`` :
  174. Rate limit the number of request on the instance, block some bots. The
  175. :ref:`limiter src` requires a :ref:`settings redis` database.
  176. .. _image_proxy:
  177. ``image_proxy`` :
  178. Allow your instance of SearXNG of being able to proxy images. Uses memory space.
  179. .. _HTTP headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
  180. ``default_http_headers`` :
  181. Set additional HTTP headers, see `#755 <https://github.com/searx/searx/issues/715>`__
  182. .. _settings ui:
  183. ``ui:``
  184. -------
  185. .. _cache busting:
  186. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#caching_static_assets_with_cache_busting
  187. .. code:: yaml
  188. ui:
  189. static_use_hash: false
  190. default_locale: ""
  191. query_in_title: false
  192. infinite_scroll: false
  193. center_alignment: false
  194. cache_url: https://web.archive.org/web/
  195. default_theme: simple
  196. theme_args:
  197. simple_style: auto
  198. .. _static_use_hash:
  199. ``static_use_hash`` :
  200. Enables `cache busting`_ of static files.
  201. ``default_locale`` :
  202. SearXNG interface language. If blank, the locale is detected by using the
  203. browser language. If it doesn't work, or you are deploying a language
  204. specific instance of searx, a locale can be defined using an ISO language
  205. code, like ``fr``, ``en``, ``de``.
  206. ``query_in_title`` :
  207. When true, the result page's titles contains the query it decreases the
  208. privacy, since the browser can records the page titles.
  209. ``infinite_scroll``:
  210. When true, automatically loads the next page when scrolling to bottom of the current page.
  211. ``center_alignment`` : default ``false``
  212. When enabled, the results are centered instead of being in the left (or RTL)
  213. side of the screen. This setting only affects the *desktop layout*
  214. (:origin:`min-width: @tablet <searx/static/themes/simple/src/less/definitions.less>`)
  215. .. cache_url:
  216. ``cache_url`` : ``https://web.archive.org/web/``
  217. URL prefix of the internet archive or cache, don't forgett trailing slash (if
  218. needed). The default is https://web.archive.org/web/ alternatives are:
  219. - https://webcache.googleusercontent.com/search?q=cache:
  220. - https://archive.today/
  221. ``default_theme`` :
  222. Name of the theme you want to use by default on your SearXNG instance.
  223. ``theme_args.simple_style``:
  224. Style of simple theme: ``auto``, ``light``, ``dark``
  225. ``results_on_new_tab``:
  226. Open result links in a new tab by default.
  227. .. _settings redis:
  228. ``redis:``
  229. ----------
  230. .. _Redis.from_url(url): https://redis-py.readthedocs.io/en/stable/connections.html#redis.client.Redis.from_url
  231. A redis DB can be connected by an URL, in :py:obj:`searx.redisdb` you
  232. will find a description to test your redis connection in SerXNG. When using
  233. sockets, don't forget to check the access rights on the socket::
  234. ls -la /usr/local/searxng-redis/run/redis.sock
  235. srwxrwx--- 1 searxng-redis searxng-redis ... /usr/local/searxng-redis/run/redis.sock
  236. In this example read/write access is given to the *searxng-redis* group. To get
  237. access rights to redis instance (the socket), your SearXNG (or even your
  238. developer) account needs to be added to the *searxng-redis* group.
  239. ``url`` : ``$SEARXNG_REDIS_URL``
  240. URL to connect redis database, see `Redis.from_url(url)`_ & :ref:`redis db`::
  241. redis://[[username]:[password]]@localhost:6379/0
  242. rediss://[[username]:[password]]@localhost:6379/0
  243. unix://[[username]:[password]]@/path/to/socket.sock?db=0
  244. .. admonition:: Tip for developers
  245. To set up a local redis instance, first set the socket path of the Redis DB
  246. in your YAML setting:
  247. .. code:: yaml
  248. redis:
  249. url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
  250. Then use the following commands to install the redis instance ::
  251. $ ./manage redis.build
  252. $ sudo -H ./manage redis.install
  253. $ sudo -H ./manage redis.addgrp "${USER}"
  254. # don't forget to logout & login to get member of group
  255. .. _settings outgoing:
  256. ``outgoing:``
  257. -------------
  258. Communication with search engines.
  259. .. code:: yaml
  260. outgoing:
  261. request_timeout: 2.0 # default timeout in seconds, can be override by engine
  262. max_request_timeout: 10.0 # the maximum timeout in seconds
  263. useragent_suffix: "" # information like an email address to the administrator
  264. pool_connections: 100 # Maximum number of allowable connections, or null
  265. # for no limits. The default is 100.
  266. pool_maxsize: 10 # Number of allowable keep-alive connections, or null
  267. # to always allow. The default is 10.
  268. enable_http2: true # See https://www.python-httpx.org/http2/
  269. # uncomment below section if you want to use a custom server certificate
  270. # see https://www.python-httpx.org/advanced/#changing-the-verification-defaults
  271. # and https://www.python-httpx.org/compatibility/#ssl-configuration
  272. # verify: ~/.mitmproxy/mitmproxy-ca-cert.cer
  273. #
  274. # uncomment below section if you want to use a proxyq see: SOCKS proxies
  275. # https://2.python-requests.org/en/latest/user/advanced/#proxies
  276. # are also supported: see
  277. # https://2.python-requests.org/en/latest/user/advanced/#socks
  278. #
  279. # proxies:
  280. # all://:
  281. # - http://proxy1:8080
  282. # - http://proxy2:8080
  283. #
  284. # using_tor_proxy: true
  285. #
  286. # Extra seconds to add in order to account for the time taken by the proxy
  287. #
  288. # extra_proxy_timeout: 10.0
  289. #
  290. ``request_timeout`` :
  291. Global timeout of the requests made to others engines in seconds. A bigger
  292. timeout will allow to wait for answers from slow engines, but in consequence
  293. will slow SearXNG reactivity (the result page may take the time specified in the
  294. timeout to load). Can be override by ``timeout`` in the :ref:`settings engine`.
  295. ``useragent_suffix`` :
  296. Suffix to the user-agent SearXNG uses to send requests to others engines. If an
  297. engine wish to block you, a contact info here may be useful to avoid that.
  298. .. _Pool limit configuration: https://www.python-httpx.org/advanced/#pool-limit-configuration
  299. ``pool_maxsize``:
  300. Number of allowable keep-alive connections, or ``null`` to always allow. The
  301. default is 10. See ``max_keepalive_connections`` `Pool limit configuration`_.
  302. ``pool_connections`` :
  303. Maximum number of allowable connections, or ``null`` # for no limits. The
  304. default is 100. See ``max_connections`` `Pool limit configuration`_.
  305. ``keepalive_expiry`` :
  306. Number of seconds to keep a connection in the pool. By default 5.0 seconds.
  307. See ``keepalive_expiry`` `Pool limit configuration`_.
  308. .. _httpx proxies: https://www.python-httpx.org/advanced/#http-proxying
  309. ``proxies`` :
  310. Define one or more proxies you wish to use, see `httpx proxies`_.
  311. If there are more than one proxy for one protocol (http, https),
  312. requests to the engines are distributed in a round-robin fashion.
  313. ``source_ips`` :
  314. If you use multiple network interfaces, define from which IP the requests must
  315. be made. Example:
  316. * ``0.0.0.0`` any local IPv4 address.
  317. * ``::`` any local IPv6 address.
  318. * ``192.168.0.1``
  319. * ``[ 192.168.0.1, 192.168.0.2 ]`` these two specific IP addresses
  320. * ``fe80::60a2:1691:e5a2:ee1f``
  321. * ``fe80::60a2:1691:e5a2:ee1f/126`` all IP addresses in this network.
  322. * ``[ 192.168.0.1, fe80::/126 ]``
  323. ``retries`` :
  324. Number of retry in case of an HTTP error. On each retry, SearXNG uses an
  325. different proxy and source ip.
  326. ``enable_http2`` :
  327. Enable by default. Set to ``false`` to disable HTTP/2.
  328. .. _httpx verification defaults: https://www.python-httpx.org/advanced/#changing-the-verification-defaults
  329. .. _httpx ssl configuration: https://www.python-httpx.org/compatibility/#ssl-configuration
  330. ``verify``: : ``$SSL_CERT_FILE``, ``$SSL_CERT_DIR``
  331. Allow to specify a path to certificate.
  332. see `httpx verification defaults`_.
  333. In addition to ``verify``, SearXNG supports the ``$SSL_CERT_FILE`` (for a file) and
  334. ``$SSL_CERT_DIR`` (for a directory) OpenSSL variables.
  335. see `httpx ssl configuration`_.
  336. ``max_redirects`` :
  337. 30 by default. Maximum redirect before it is an error.
  338. ``using_tor_proxy`` :
  339. Using tor proxy (``true``) or not (``false``) for all engines. The default is
  340. ``false`` and can be overwritten in the :ref:`settings engine`
  341. .. _settings categories_as_tabs:
  342. ``categories_as_tabs:``
  343. -----------------------
  344. A list of the categories that are displayed as tabs in the user interface.
  345. Categories not listed here can still be searched with the :ref:`search-syntax`.
  346. .. code-block:: yaml
  347. categories_as_tabs:
  348. general:
  349. images:
  350. videos:
  351. news:
  352. map:
  353. music:
  354. it:
  355. science:
  356. files:
  357. social media:
  358. Engines are added to ``categories:`` (compare :ref:`engine categories`), the
  359. categories listed in ``categories_as_tabs`` are shown as tabs in the UI. If
  360. there are no active engines in a category, the tab is not displayed (e.g. if a
  361. user disables all engines in a category).
  362. On the preferences page (``/preferences``) -- under *engines* -- there is an
  363. additional tab, called *other*. In this tab are all engines listed that are not
  364. in one of the UI tabs (not included in ``categories_as_tabs``).
  365. .. _settings engine:
  366. Engine settings
  367. ===============
  368. .. sidebar:: Further reading ..
  369. - :ref:`configured engines`
  370. - :ref:`engines-dev`
  371. In the code example below a *full fledged* example of a YAML setup from a dummy
  372. engine is shown. Most of the options have a default value or even are optional.
  373. .. code:: yaml
  374. - name: example engine
  375. engine: example
  376. shortcut: demo
  377. base_url: 'https://{language}.example.com/'
  378. send_accept_language_header: false
  379. categories: general
  380. timeout: 3.0
  381. api_key: 'apikey'
  382. disabled: false
  383. language: en_US
  384. tokens: [ 'my-secret-token' ]
  385. weight: 1
  386. display_error_messages: true
  387. about:
  388. website: https://example.com
  389. wikidata_id: Q306656
  390. official_api_documentation: https://example.com/api-doc
  391. use_official_api: true
  392. require_api_key: true
  393. results: HTML
  394. # overwrite values from section 'outgoing:'
  395. enable_http2: false
  396. retries: 1
  397. max_connections: 100
  398. max_keepalive_connections: 10
  399. keepalive_expiry: 5.0
  400. using_tor_proxy: false
  401. proxies:
  402. http:
  403. - http://proxy1:8080
  404. - http://proxy2:8080
  405. https:
  406. - http://proxy1:8080
  407. - http://proxy2:8080
  408. - socks5://user:password@proxy3:1080
  409. - socks5h://user:password@proxy4:1080
  410. # other network settings
  411. enable_http: false
  412. retry_on_http_error: true # or 403 or [404, 429]
  413. ``name`` :
  414. Name that will be used across SearXNG to define this engine. In settings, on
  415. the result page...
  416. ``engine`` :
  417. Name of the python file used to handle requests and responses to and from this
  418. search engine.
  419. ``shortcut`` :
  420. Code used to execute bang requests (in this case using ``!bi``)
  421. ``base_url`` : optional
  422. Part of the URL that should be stable across every request. Can be useful to
  423. use multiple sites using only one engine, or updating the site URL without
  424. touching at the code.
  425. ``send_accept_language_header`` :
  426. Several engines that support languages (or regions) deal with the HTTP header
  427. ``Accept-Language`` to build a response that fits to the locale. When this
  428. option is activated, the language (locale) that is selected by the user is used
  429. to build and send a ``Accept-Language`` header in the request to the origin
  430. search engine.
  431. .. _engine categories:
  432. ``categories`` : optional
  433. Specifies to which categories the engine should be added. Engines can be
  434. assigned to multiple categories.
  435. Categories can be shown as tabs (:ref:`settings categories_as_tabs`) in the
  436. UI. A search in a tab (in the UI) will query all engines that are active in
  437. this tab. In the preferences page (``/preferences``) -- under *engines* --
  438. users can select what engine should be active when querying in this tab.
  439. Alternatively, :ref:`\!bang <search-syntax>` can be used to search all engines
  440. in a category, regardless of whether they are active or not, or whether they
  441. are in a tab of the UI or not. For example, ``!dictionaries`` can be used to
  442. query all search engines in that category (group).
  443. ``timeout`` : optional
  444. Timeout of the search with the current search engine. Overwrites
  445. ``request_timeout`` from :ref:`settings outgoing`. **Be careful, it will
  446. modify the global timeout of SearXNG.**
  447. ``api_key`` : optional
  448. In a few cases, using an API needs the use of a secret key. How to obtain them
  449. is described in the file.
  450. ``disabled`` : optional
  451. To disable by default the engine, but not deleting it. It will allow the user
  452. to manually activate it in the settings.
  453. ``inactive``: optional
  454. Remove the engine from the settings (*disabled & removed*).
  455. ``language`` : optional
  456. If you want to use another language for a specific engine, you can define it
  457. by using the ISO code of language (and region), like ``fr``, ``en-US``,
  458. ``de-DE``.
  459. ``tokens`` : optional
  460. A list of secret tokens to make this engine *private*, more details see
  461. :ref:`private engines`.
  462. ``weight`` : default ``1``
  463. Weighting of the results of this engine.
  464. ``display_error_messages`` : default ``true``
  465. When an engine returns an error, the message is displayed on the user interface.
  466. ``network`` : optional
  467. Use the network configuration from another engine.
  468. In addition, there are two default networks:
  469. - ``ipv4`` set ``local_addresses`` to ``0.0.0.0`` (use only IPv4 local addresses)
  470. - ``ipv6`` set ``local_addresses`` to ``::`` (use only IPv6 local addresses)
  471. ``enable_http`` : optional
  472. Enable HTTP for this engine (by default only HTTPS is enabled).
  473. ``retry_on_http_error`` : optional
  474. Retry request on some HTTP status code.
  475. Example:
  476. * ``true`` : on HTTP status code between 400 and 599.
  477. * ``403`` : on HTTP status code 403.
  478. * ``[403, 429]``: on HTTP status code 403 and 429.
  479. ``proxies`` :
  480. Overwrites proxy settings from :ref:`settings outgoing`.
  481. ``using_tor_proxy`` :
  482. Using tor proxy (``true``) or not (``false``) for this engine. The default is
  483. taken from ``using_tor_proxy`` of the :ref:`settings outgoing`.
  484. ``max_keepalive_connection#s`` :
  485. `Pool limit configuration`_, overwrites value ``pool_maxsize`` from
  486. :ref:`settings outgoing` for this engine.
  487. ``max_connections`` :
  488. `Pool limit configuration`_, overwrites value ``pool_connections`` from
  489. :ref:`settings outgoing` for this engine.
  490. ``keepalive_expiry`` :
  491. `Pool limit configuration`_, overwrites value ``keepalive_expiry`` from
  492. :ref:`settings outgoing` for this engine.
  493. .. note::
  494. A few more options are possible, but they are pretty specific to some
  495. engines, and so won't be described here.
  496. Example: Multilingual Search
  497. ----------------------------
  498. SearXNG does not support true multilingual search. You have to use the language
  499. prefix in your search query when searching in a different language.
  500. But there is a workaround: By adding a new search engine with a different
  501. language, SearXNG will search in your default and other language.
  502. Example configuration in settings.yml for a German and English speaker:
  503. .. code-block:: yaml
  504. search:
  505. default_lang : "de"
  506. ...
  507. engines:
  508. - name : google english
  509. engine : google
  510. language : en
  511. ...
  512. When searching, the default google engine will return German results and
  513. "google english" will return English results.
  514. .. _settings use_default_settings:
  515. use_default_settings
  516. ====================
  517. .. sidebar:: ``use_default_settings: true``
  518. - :ref:`settings location`
  519. - :ref:`use_default_settings.yml`
  520. - :origin:`/etc/searxng/settings.yml <utils/templates/etc/searxng/settings.yml>`
  521. The user defined ``settings.yml`` is loaded from the :ref:`settings location`
  522. and can relied on the default configuration :origin:`searx/settings.yml` using:
  523. ``use_default_settings: true``
  524. ``server:``
  525. In the following example, the actual settings are the default settings defined
  526. in :origin:`searx/settings.yml` with the exception of the ``secret_key`` and
  527. the ``bind_address``:
  528. .. code-block:: yaml
  529. use_default_settings: true
  530. server:
  531. secret_key: "ultrasecretkey" # change this!
  532. bind_address: "0.0.0.0"
  533. ``engines:``
  534. With ``use_default_settings: true``, each settings can be override in a
  535. similar way, the ``engines`` section is merged according to the engine
  536. ``name``. In this example, SearXNG will load all the default engines, will
  537. enable the ``bing`` engine and define a :ref:`token <private engines>` for
  538. the arch linux engine:
  539. .. code-block:: yaml
  540. use_default_settings: true
  541. server:
  542. secret_key: "ultrasecretkey" # change this!
  543. engines:
  544. - name: arch linux wiki
  545. tokens: ['$ecretValue']
  546. - name: bing
  547. disabled: false
  548. ``engines:`` / ``remove:``
  549. It is possible to remove some engines from the default settings. The following
  550. example is similar to the above one, but SearXNG doesn't load the the google
  551. engine:
  552. .. code-block:: yaml
  553. use_default_settings:
  554. engines:
  555. remove:
  556. - google
  557. server:
  558. secret_key: "ultrasecretkey" # change this!
  559. engines:
  560. - name: arch linux wiki
  561. tokens: ['$ecretValue']
  562. ``engines:`` / ``keep_only:``
  563. As an alternative, it is possible to specify the engines to keep. In the
  564. following example, SearXNG has only two engines:
  565. .. code-block:: yaml
  566. use_default_settings:
  567. engines:
  568. keep_only:
  569. - google
  570. - duckduckgo
  571. server:
  572. secret_key: "ultrasecretkey" # change this!
  573. engines:
  574. - name: google
  575. tokens: ['$ecretValue']
  576. - name: duckduckgo
  577. tokens: ['$ecretValue']