Commit Graph

502 Commits (657dcb973abe7fa65381fcf53d804a8502625392)

Author SHA1 Message Date
Markus Heiser 2039060b64 [mod] revision of the settings_loader
The intention of this PR is to modernize the settings_loader implementations.
The concept is old (remember, this is partly from 2014), back then we only had
one config file, meanwhile we have had a folder with config files for a very
long time.  Callers can now load a YAML configuration from this folder as
follows ::

    settings_loader.get_yaml_cfg('my-config.yml')

- BTW this is a fix of #3557.

- Further the `existing_filename_or_none` construct dates back to times when
  there was not yet a `pathlib.Path` in all Python versions we supported in the
  past.

- Typehints have been added wherever appropriate

At the same time, this patch should also be downward compatible and not
introduce a new environment variable. The localization of the folder with the
configurations is further based on:

    SEARXNG_SETTINGS_PATH (wich defaults to /etc/searxng/settings.yml)

Which means, the default config folder is `/etc/searxng/`.

ATTENTION: intended functional changes!

 If SEARXNG_SETTINGS_PATH was set and pointed to a not existing file, the
 previous implementation silently loaded the default configuration.  This
 behavior has been changed: if the file or folder does not exist, an
 EnvironmentError exception will be thrown in future.

Closes: https://github.com/searxng/searxng/issues/3557
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 months ago
Bnyro e4da22ee51 [feat] engine: implementation of alpine linux packages
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2 months ago
holysoles 7be468d213 [feat] docker: add env vars for common public instance settings 3 months ago
Ember cb945276b6 Change 'his/her' to 'them' 3 months ago
Markus Heiser 845a0b678d [doc] add 'hostnames' plugin to the online documentation
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 months ago
Bnyro 3bec04079c [feat] hostname replace plugin: possibility to prioritize certain websites
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
3 months ago
allendema_searxng_pi ee146dbc07 [enh] Add engine for discourse forums 3 months ago
Daniel Kukula cc8b537e34 [mod] package.html template: additional links (a python dict)
- Closes: https://github.com/searxng/searxng/issues/3456
4 months ago
Bnyro 82b6c0d05f [feat] engine: implementation of gitea 4 months ago
Markus Heiser 742303d030 [mod] improve unit converter plugin
- l10n support: parse and format decimal numbers by babel
- ability to add additional units
- improved unit detection (symbols are not unique)
- support for alias units (0,010C to F --> 32,018 °F)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 months ago
Markus Heiser 542f7d0d7b [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION
In the past, some files were tested with the standard profile, others with a
profile in which most of the messages were switched off ... some files were not
checked at all.

- ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished
- the distinction ``# lint: pylint`` is no longer necessary
- the pylint tasks have been reduced from three to two

  1. ./searx/engines -> lint engines with additional builtins
  2. ./searx ./searxng_extra ./tests -> lint all other python files

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
6 months ago
Markus Heiser 707d6270c8 [doc] engine: mullvad leta
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
6 months ago
Bnyro f3b4bf86a7 [feat] engine: implementation of void linux packages
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
7 months ago
Bnyro e76ab1a4b3 [refactor] images: add resolution, image format and filesize fields
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
7 months ago
Bnyro 60d8414ef1 [docs] engine_overview: add packages result template 7 months ago
Alexandre Flament ed66ed758d [mod] reduce memory footprint by not calling babel.Locale.parse at runtime
babel.Locale.parse loads more than 60MB in RAM.  The only purpose is to get:

    LOCALE_NAMES   - searx.data.LOCALES["LOCALE_NAMES"]
    RTL_LOCALES    - searx.data.LOCALES["RTL_LOCALES"]

This commit calls babel.Locale.parse when the translations are update from
weblate and stored in::

    searx/data/locales.json

This file can be build by::

    ./manage data.locales

By store these variables in searx.data when the translations are updated we save
round about 65MB (usually 4 worker = 260MB of RAM saved.

Suggested-by: https://github.com/searxng/searxng/discussions/2633#discussioncomment-8490494
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
7 months ago
Markus Heiser c197c0e35e [fix] remove twine from requirements-dev
SearXNG is a rolling release / we do not deploy packages on PyPi

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
7 months ago
Markus Heiser ab8e5383fb [mod] remove X-XSS-Protection headers
Deprecated header not used by browsers nowadays[1]:

"""In modern browsers, X-XSS-Protection has been deprecated in favor of the
Content-Security-Policy to disable the use of inline JavaScript. Its use can
introduce XSS vulnerabilities in otherwise safe websites. This should not be
used unless you need to support older web browsers that don’t yet support CSP.
It is thus recommended to set the header as X-XSS-Protection: 0."""[2]

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
[2] https://infosec.mozilla.org/guidelines/web_security#x-xss-protection

Closes: https://github.com/searxng/searxng/issues/3171
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
8 months ago
Markus Heiser e560d7e373 [mod] presearch: add language & region support
In Presearch there are languages for the UI and regions for narrowing down the
search.  With this change the SearXNG engine supports a search by region.  The
details can be found in the documentation of the source code.

To test, you can search terms like::

   !presearch bmw :zh-TW
   !presearch bmw :en-CA

1. You should get results corresponding to the region (Taiwan, Canada)
2. and in the language (Chinese, Englisch).
3. The context in info box content is in the same language.

Exceptions:

1. Region or language is not supported by Presearch or
2. SearXNG user did not selected a region tag, example::

    !presearch bmw :en

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
8 months ago
Markus Heiser f9c5727ddc [mod] get rid of ./utils/brand.env and its workflow
All the environments defined in ./utils/brand.env are generated on the fly, so
there is no longer a need to define the brand environment in this file and all
the workflows to handle this file.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
8 months ago
Bnyro 3dea7e609b [feat] autocompleter: implementation of stract (beta) 9 months ago
Bnyro bf75a8c2a0 [feat] engine: implementation of bpb 10 months ago
Markus Heiser 76b91a3ef6 [dev] manage runtime versions with asdf
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
10 months ago
Alexandre Flament bd3f526859
Docker: add UWSGI_WORKERS and UWSGI_THREAD environment variables (#2992)
* Docker: add UWSGI_WORKERS and UWSGI_THREAD.

UWSGI_WORKERS specifies the number of process.
UWSGI_THREADS specifies the number of threads.

The Docker convention is to specify the whole configuration
through environment variables. While not done in SearXNG, these two
additional variables allows admins to skip uwsgi.ini

In additional, https://github.com/searxng/preview-environments starts Docker
without additional files through searxng-helm-chat.
Each instance consumes 1Go of RAM which is a lot especially when there are a
lot of instances / pull requests.

* [scripts] add environments UWSGI_WORKERS and UWSGI_THREADS

- UWSGI_WORKERS specifies the number of process.
- UWSGI_THREADS specifies the number of threads.

Templates for uwsgi scripts can be tested by::

    UWSGI_WORKERS=8 UWSGI_THREADS=9 \
      ./utils/searxng.sh --cmd\
      eval "echo \"$(cat utils/templates/etc/uwsgi/*/searxng.ini*)\""\
      | grep "workers\|threads"

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

---------

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
10 months ago
Markus Heiser d13a8f6453 [mod] document server:public_instance & remove it out of the botdetection
- the option server:public_instance lacks some documentation
- the processing of this option belongs in the limiter and not
  in botdetection module

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
11 months ago
Markus Heiser fd814aac86 [mod] isolation of botdetection from the limiter
This patch was inspired by the discussion around PR-2882 [2].  The goals of this
patch are:

1. Convert plugin searx.plugin.limiter to normal code [1]
2. isolation of botdetection from the limiter [2]
3. searx/{tools => botdetection}/config.py and drop searx.tools
4. in URL /config, 'limiter.enabled' is true only if the limiter is really
   enabled (Redis is available).

This patch moves all the code that belongs to botdetection into namespace
searx.botdetection and code that belongs to limiter is placed in namespace
searx.limiter.

Tthe limiter used to be a plugin at some point botdetection was added, it was
not a plugin.  The modularization of these two components was long overdue.
With the clear modularization, the documentation could then also be organized
according to the architecture.

[1] https://github.com/searxng/searxng/pull/2882
[2] https://github.com/searxng/searxng/pull/2882#issuecomment-1741716891

To test:

- check the app works without the limiter, check `/config`
- check the app works with the limiter and with the token, check `/config`
- make docs.live .. and read
  - http://0.0.0.0:8000/admin/searx.limiter.html
  - http://0.0.0.0:8000/src/searx.botdetection.html#botdetection

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
11 months ago
Alex Balgavy 5d53aac20f [mod] add hotkeys option to settings.yml
The change in the hotkey mechanism introduced in 317db5b04 does not allow
configuration via `settings.yml`.  This commit adds that functionality.

Closes: #2898
12 months ago
Aine 213cb74378 [fix] matrixrooms add proper MRS integration
Related:

- https://github.com/searxng/searxng/issues/2918
12 months ago
Bnyro 48cb58bd2e [feat] duckduckgo: support for videos and news 12 months ago
Bnyro ce270961e8 [feat] engine: implementation of mastodon 12 months ago
Markus Heiser fd1422a670 [mod] engine - simplify region & lang handling, make filters configurable
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
12 months ago
Bnyro 26fed56d51 [mod] settings.yml: remove plugin settings for plugins that don't exist anymore 12 months ago
Markus Heiser 597c68b4aa [doc] move dosc of botdetection from developer to admin section
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Bnyro c999cfb422 [feat] engine: implementation of wallhaven 1 year ago
Bnyro a55e0ac553 [feat] search on category select without JS
Co-authored-by: Alexandre Flament <alex@al-f.net>
1 year ago
jazzzooo 223b3487c3 [fix] spelling 1 year ago
Markus Heiser d9dbcedeb6 [feat] implementation of qwant lite for web search
Related: https://github.com/searxng/searxng/issues/2719
Replace: https://github.com/searxng/searxng/pull/2748
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Bnyro b4e0d2eedc [feat] engine: implemenation of moviepilot (de) 1 year ago
Bnyro f182abd6f8 [mod] library of congress: fix engine 1 year ago
Hackurei 4da7003ae0 [feat] engine: implementation of odysee 1 year ago
Markus Heiser b0d2cd5ca9 [doc] add documentation of Mwmbl engine & autocompleter
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Bnyro df71c24b20 [mod] autocomplete.py: add support for mwmbl completions 1 year ago
Markus Heiser 1e2d11fb57 [dev-env] upgrade Sphinx-doc 7.2.3 and unpin at v7.1.2 on py3.8
- Sphinx-doc 7.2.0 drops py3.8 support [1][2]
- last version with py3.8 support is 7.1.2

Many LTS distributions still have py3.8 which EOL is in 2024-10 [3].

To continue to support a development environment on py3.8 the rigid dependency
in the development environment is unpinned in py3.8 / environment markers [4].

To get 7.2.3. work, a fix in sphinx-notfound-page is needed [5][6].

[1] https://github.com/searxng/searxng/pull/2658#issuecomment-1684867270
[2] https://github.com/sphinx-doc/sphinx/issues/11621
[3] https://devguide.python.org/versions/#supported-versions
[4] https://peps.python.org/pep-0508/#environment-markers
[5] https://github.com/readthedocs/sphinx-notfound-page/issues/219
[6] https://github.com/readthedocs/sphinx-notfound-page/issues/219#issuecomment-1694691135

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Markus Heiser 9100a48541 [mod] improve seekr engines and add documentation
Tis patch adds some more fields to the result items and changed paging to the
``nextResultSet`` given in seekr's JSON response.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
ToxyFlog1627 f175574f37 [fix] typos in documentation & messages 1 year ago
Markus Heiser 905ce2a6f6 [doc] add tagesschau API to the debveloper documentation
supplement to the commit e25d1c728

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Markus Heiser 01c0ec5d19 [fix] typo in docs/admin/settings/settings_general.rst (doc)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Bnyro 224f2250ae [feat] engine: support for lemmy communities, posts, comments and users 1 year ago
Markus Heiser 460bbe5b81 [mod] implement brave (WEB) engine to replace XPath configuration
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1 year ago
Markus Heiser 64100db904 [doc] improve documentation of make targets and ./manage script
BTW force modularization of the ./mange script into sub modules:

- utils/lib_sxng_data.sh
- utils/lib_sxng_node.sh
- utils/lib_sxng_static.sh
- utils/lib_sxng_test.sh
- utils/lib_sxng_themes.sh

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