summaryrefslogtreecommitdiff
path: root/docs/dev
AgeCommit message (Collapse)Author
2025-11-05[feat] sourcehut engine: implement as custom module, fix user agentBnyro
SourceHut uses a foss bot protection tool called `go-away` (which I can recommend BTW). It blocks common crawler user agents, such as the standard Firefox user agent. Hence, we're now using our custom SearXNG user agent to clarify we're not a crawler. Closes: https://github.com/searxng/searxng/issues/5270 Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-20[mod] typification of SearXNG: add new result type FileMarkus Heiser
This PR adds a new result type: File Python class: searx/result_types/file.py Jinja template: searx/templates/simple/result_templates/file.html CSS (less) client/simple/src/less/result_types/file.less Class 'File' (singular) replaces template 'files.html' (plural). The renaming was carried out because there is only one file (singular) in a result. Not to be confused with the category 'files' where in multiple results can exist. As mentioned in issue [1], the class '.category-files' was removed from the CSS and the stylesheet was adopted in result_types/file.less (there based on the templates and no longer based on the category). [1] https://github.com/searxng/searxng/issues/5198 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-13[feat] engines: add Azure resources engine (#5235)Tommaso Colella
Adds a new engine `searx/engines/azure.py` to search cloud resources on Azure. A lot of enterprise users have to deal with Azure Public Cloud. This helps them easily search for cloud resources without logging in to the Portal first How to test this PR locally? You should create an App Registration on Azure Entra Id with Reader access on the resources you want to search for. You should create a Secret for the App Registration. After that, you should set up appropriate values in the `settings.yml` file [1]:: - name: azure engine: azure ... azure_tenant_id: "your_tenant_id" azure_client_id: "your_client_id" azure_client_secret: "your_client_secret" azure_token_expiration_seconds: 5000 [1] https://github.com/searxng/searxng/pull/5235#issuecomment-3397664928 Co-authored-by: Bnyro <bnyro@tutanota.com> Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-01[mod] drop searxng_extra/standalone_searx.py (#5256)Markus Heiser
This is an old and grumpy hack / SearXNG is a Flask application with client/server structure, which can't be turned into a command line tool the way it was done here. Maintaining this hack is becoming increasingly complex the more we try to remodel the core code, which is why we should now remove the hack from SearXNG. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-01[doc] dev - cleanup asdf remnants and add a note about mise-en-place (#5264)Ivan Gabaldon
Notes on the developer environment with MISE have been added to the Quickstart Guide. We migrated `.tool-versions` to replace it with `mise` [1], so we can now remove `asdf` related documentation. [1] https://github.com/searxng/searxng/pull/5253 Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] ADS engine: revision of the engine (Paper result)Markus Heiser
Revision of the Astrophysics Data System (ADS) engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] Springer Nature engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] Semantic Scholar engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] PubMed engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] Open Library engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] OpenAlex engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] Crossref engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] arXiv engine: revision of the engine (Paper result)Markus Heiser
Revision of the engine / use of the result type Paper as well as other typifications. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-20[mod] typification of SearXNG: add new result type PaperMarkus Heiser
This patch adds a new result type: Paper - Python class: searx/result_types/paper.py - Jinja template: searx/templates/simple/result_templates/paper.html - CSS (less) client/simple/src/less/result_types/paper.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-18[mod] addition of various type hints / engine processorsMarkus Heiser
Continuation of #5147 .. typification of the engine processors. BTW: - removed obsolete engine property https_support - fixed & improved currency_convert - engine instances can now implement a engine.setup method [#5147] https://github.com/searxng/searxng/pull/5147 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-09-01[feat] engines: add repology.org engine for linux packages (#5103)Bnyro
Repology_ monitors a huge number of package repositories and other sources comparing packages versions across them and gathering other information. Repology_ shows you in which repositories a given project is packaged, which version is the latest and which needs updating, who maintains the package, and other related information. .. _Repology: https://repology.org/docs/about Co-authored-by: Markus Heiser <markus.heiser@darmarit.de> Format: reST
2025-09-01[mod] typification of SearXNG: add new result type CodeMarkus Heiser
This patch adds a new result type: Code - Python class: searx/result_types/code.py - Jinja template: searx/templates/simple/result_templates/code.html - CSS (less) client/simple/src/less/result_types/code.less Signed-of-by: Markus Heiser <markus.heiser@darmarIT.de>
2025-08-28[feat] plugins: add new time/timezone search pluginBnyro
The plugin uses the ``GeoLocation`` class, which is already implemented in the context of weather forecasts, to determine the time zone. The ``DateTime`` class is used for the localized display of date and time. Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-08-24[feat] engines: add OpenAlex Works engine (#5102)muthukumaran R
- Adds a new engine `searx/engines/openalex.py` that integrates the OpenAlex Works API to return scientific paper results using the `paper.html` template. - Uses the official API (no auth required); supports OpenAlex polite pool via `mailto`. - Adds developer docs at `docs/dev/engines/online/openalex.rst`. OpenAlex API reference: https://docs.openalex.org/how-to-use-the-api/api-overview
2025-08-20[feat] engines: add GitHub Code Search engine (#5074)Filip Mikina
This patch adds GitHub Code Search [1] engine to allow querying the codebases. Template code.html is changed to allow passthrough of strip and highlighting options. Engine Searchcode is adjusted to pass filename and not rely on hardcoded extensions. GitHub search code API does not return the exact code line indices, this implementation assigns the code arbitrary numbers starting from 1 (effectively relabeling the code). The API allows for unauth calls, and the default engine settings default to that, although the calls are heavily rate limited. The 'text' lexer is the default pygments lexer when parsing fails. [1] https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-code Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
2025-08-18[mod] theme/simple: migrate codebase to TypeScriptIvan Gabaldon
TypeScript is a superset of JavaScript, converting the entire theme to TypeScript allows us to receive much more feedback on possible issues made in package updates or our own typos, furthermore, it allows to transpile properly to lower specs. This PR couldn't be done in smaller commits, a lot of work needed to make everything *work properly*: - A browser baseline has been set that requires minimum **Chromium 93, Firefox 92 and Safari 15** (proper visuals/operation on older browser versions is not guaranteed) - LightningCSS now handles minification and prefix creation for CSS. - All hardcoded polyfills and support for previous browser baseline versions have been removed. - Convert codebase to TypeScript. - Convert IIFE to ESM, handling globals with IIFE is cumbersome, ESM is the standard for virtually any use of JS nowadays. - Vite now builds the theme without the need for `vite-plugin-static-copy`. - `searxng.ready` now accepts an array of conditions for the callback to be executed. - Replace `leaflet` with `ol` as there were some issues with proper Vite bundling. - Merged `head` with `main` script, as head was too small now. - Add `assertElement` to properly check the existence of critical DOM elements. - `searxng.on` renamed to `searxng.listen` with some handling improvements.
2025-08-09[doc] Development Quickstart: debug with the Python Debugger pdb (#5100)Markus Heiser
Related: - https://github.com/searxng/searxng/pull/5037#issuecomment-3166851578
2025-08-09[feat] engines: add Marginalia (#5087)Austin-Olacsi
To get an API key follow instructions at [1]. [1] https://about.marginalia-search.com/article/api/ Related (historical ordered): - https://github.com/searxng/searxng/issues/1620 - https://github.com/searxng/searxng/issues/1673 - https://github.com/searxng/searxng/pull/1627 - https://github.com/searxng/searxng/pull/2489 Closes: - https://github.com/searxng/searxng/issues/3034 Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-07-28[enh] CI - add shell script formatterMarkus Heiser
Implement rules and functions to format shell scripts: $ make format.shell or alternatively to format all source code: $ make format The formatter `shfmt` reads the rules from the editorconfig[1] If any EditorConfig files are found, they will be used to apply formatting options. If any parser or printer flags are given to the tool, no EditorConfig files will be used. [1] https://github.com/patrickvane/shfmt?tab=readme-ov-file#description Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-07-28[chore] overdue maintenance of shell scriptsMarkus Heiser
Removes obsolete scripts and fix various leftovers. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-07-09[mod] migrate from Redis to Valkey (#4795)Gaspard d'Hautefeuille
This patch migrates from `redis==5.2.1` [1] to `valkey==6.1.0` [2]. The migration to valkey is necessary because the company behind Redis has decided to abandon the open source license. After experiencing a drop in user numbers, they now want to run it under a dual license again. But this move demonstrates once again how unreliable the company is and how it treats open source developers. To review first, read the docs:: $ make docs.live Follow the instructions to remove redis: - http://0.0.0.0:8000/admin/settings/settings_redis.html Config and install a local valkey DB: - http://0.0.0.0:8000/admin/settings/settings_valkey.html [1] https://pypi.org/project/redis/ [2] https://pypi.org/project/valkey/ Co-authored-by: HLFH <gaspard@dhautefeuille.eu> Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-07-03[mod] theme/simple: improve fmt/lint techIvan Gabaldon
This is one of various PR to refactor the simple theme internally. Replace eslint tool with Biome. I have been using this for quite some time, and it will help us to have more consistent and valid code without extending on other third party plugins. Removes unused dependencies.
2025-06-22[feat] engines: add Tube Archivist engine (#4889)Robert M. Clabough
Tube Archivist [1] is a self-hosted project which archives youtube videos on your own local server. This engine connects with Tube Archivist's search API to allow searching from SearXNG into your own hosted videos. [1] https://www.tubearchivist.com/ Signed-off-by: Robert M. Clabough <robert@claobugh.tech> Co-authored-by: Bnyro <bnyro@tutanota.com> Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-05-13[enh] tidy: clean old morty, filtron, searx referencesIvan Gabaldon
Everyone should have already switched from legacy methods
2025-05-12[doc] add chapter on the purpose of (git) commits (#4729)Markus Heiser
Chapter on the purpose of (git) commits The commits and their messages are elementary for the traceability of changes and are unfortunately still too often given too little attention. It therefore seems necessary to dedicate a chapter to this topic in the context of development. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-05-03[mod] ExpireCache - sqlite based key/value cache with expire timeMarkus Heiser
2025-05-03[fix] ResourceWarning: unclosed database in sqlite3Markus Heiser
Reported: - https://github.com/inetol-infrastructure/searxng-container/issues/5 Related: - https://github.com/searxng/searxng/issues/4405#issuecomment-2692352352 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-05-02[feat] engine ChinaSo: support source filter for ChinaSo-NewsBrandonStudio
* filtering ChinaSo-News results by source, option ``chinaso_news_source`` * add ChinaSo engine to the online docs https://docs.searxng.org/dev/engines/online/chinaso.html * fix SearXNG categories in the settings.yml * deactivate ChinaSo engines ``inactive: true`` until [1] is fixed * configure network of the ChinaSo engines [1] https://github.com/searxng/searxng/issues/4694 Signed-off-by: @BrandonStudio Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-04-23[fix] engine: re-implement mullvad leta integrationGrant Lanham
Re-writes the Mullvad Leta integration to work with the new breaking changes. Mullvad Leta is a search engine proxy. Currently Leta only offers text search results not image, news or any other types of search result. Leta acts as a proxy to Google and Brave search results. - Remove docstring comments regarding requiring the use of Mullvad VPN, which is no longer a hard requirement. - configured two engines: ``mullvadleta`` (uses google) and ``mullvadleta brave`` (uses brave) - since leta may not provide up-to-date search results, both search engines are disabled by default. .. hint:: Leta caches each search for up to 30 days. For example, if you use search terms like ``news``, contrary to your intention you'll get very old results! Co-authored-by: Markus Heiser <markus.heiser@darmarit.de> Signed-off-by: Grant Lanham <contact@grantlanham.com>
2025-04-17[fix] docs: changed "many" to "some" for clarity in contribution guide's ↵Tommaso Colella
privacy by design section
2025-04-17[fix] docs: typos and minor refinements in contribution_guide.rstTommaso Colella
2025-04-17[fix] docs: better phrasing for many sections of contribution_guide.rstTommaso Colella
2025-04-17[fix] docs: typos in dev contrib guide "it's might be becauseTommaso Colella
of the tool" -> "it might be because the tool"
2025-04-17[fix] docs: typo in templates dev doc developerat -> developer atTommaso Colella
2025-04-17[feat] engines: add Hugging Face engineZhijie He
2025-03-30[feat] engines: add reuters news engineBnyro
2025-03-19[fix] engine: core.ac.uk implement API v3 / v2 is no longer supportedTan Yong Sheng
2025-03-15[mod] typification of SearXNG: add new result type KeyValueMarkus Heiser
This patch adds a new result type: KeyValue - Python class: searx/result_types/keyvalue.py - Jinja template: searx/templates/simple/result_templates/keyvalue.html - CSS (less) client/simple/src/less/result_types/keyvalue.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-03-15[refactor] typification of SearXNG (MainResult) / result items (part 2)Markus Heiser
The class ReslutContainer has been revised, it can now handle the typed Result items of classes: - MainResult - LegacyResult (a dict wrapper for backward compatibility) Due to the now complete typing of theses three clases, instead of the *getitem* accesses, the fields can now be accessed directly via attributes (which is also supported by the IDE). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-03-01[refactor] soundcloud engineMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/4226 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-02-28[web-client] integrate the migrated theme in the development workflowsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-02-26[fix] various issues in the documentationMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/4370 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-28[refactor] typification of SearXNG / EngineResultsMarkus Heiser
In [1] and [2] we discussed the need of a Result.results property and how we can avoid unclear code. This patch implements a class for the reslut-lists of engines:: searx.result_types.EngineResults A simple example for the usage in engine development:: from searx.result_types import EngineResults ... def response(resp) -> EngineResults: res = EngineResults() ... res.add( res.types.Answer(answer="lorem ipsum ..", url="https://example.org") ) ... return res [1] https://github.com/searxng/searxng/pull/4183#pullrequestreview-257400034 [2] https://github.com/searxng/searxng/pull/4183#issuecomment-2614301580 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-28[refactor] typification of SearXNG (initial) / result items (part 1)Markus Heiser
Typification of SearXNG ======================= This patch introduces the typing of the results. The why and how is described in the documentation, please generate the documentation .. $ make docs.clean docs.live and read the following articles in the "Developer documentation": - result types --> http://0.0.0.0:8000/dev/result_types/index.html The result types are available from the `searx.result_types` module. The following have been implemented so far: - base result type: `searx.result_type.Result` --> http://0.0.0.0:8000/dev/result_types/base_result.html - answer results --> http://0.0.0.0:8000/dev/result_types/answer.html including the type for translations (inspired by #3925). For all other types (which still need to be set up in subsequent PRs), template documentation has been created for the transition period. Doc of the fields used in Templates =================================== The template documentation is the basis for the typing and is the first complete documentation of the results (needed for engine development). It is the "working paper" (the plan) with which further typifications can be implemented in subsequent PRs. - https://github.com/searxng/searxng/issues/357 Answer Templates ================ With the new (sub) types for `Answer`, the templates for the answers have also been revised, `Translation` are now displayed with collapsible entries (inspired by #3925). !en-de dog Plugins & Answerer ================== The implementation for `Plugin` and `Answer` has been revised, see documentation: - Plugin: http://0.0.0.0:8000/dev/plugins/index.html - Answerer: http://0.0.0.0:8000/dev/answerers/index.html With `AnswerStorage` and `AnswerStorage` to manage those items (in follow up PRs, `ArticleStorage`, `InfoStorage` and .. will be implemented) Autocomplete ============ The autocompletion had a bug where the results from `Answer` had not been shown in the past. To test activate autocompletion and try search terms for which we have answerers - statistics: type `min 1 2 3` .. in the completion list you should find an entry like `[de] min(1, 2, 3) = 1` - random: type `random uuid` .. in the completion list, the first item is a random UUID Extended Types ============== SearXNG extends e.g. the request and response types of flask and httpx, a module has been set up for type extensions: - Extended Types --> http://0.0.0.0:8000/dev/extended_types.html Unit-Tests ========== The unit tests have been completely revised. In the previous implementation, the runtime (the global variables such as `searx.settings`) was not initialized before each test, so the runtime environment with which a test ran was always determined by the tests that ran before it. This was also the reason why we sometimes had to observe non-deterministic errors in the tests in the past: - https://github.com/searxng/searxng/issues/2988 is one example for the Runtime issues, with non-deterministic behavior .. - https://github.com/searxng/searxng/pull/3650 - https://github.com/searxng/searxng/pull/3654 - https://github.com/searxng/searxng/pull/3642#issuecomment-2226884469 - https://github.com/searxng/searxng/pull/3746#issuecomment-2300965005 Why msgspec.Struct ================== We have already discussed typing based on e.g. `TypeDict` or `dataclass` in the past: - https://github.com/searxng/searxng/pull/1562/files - https://gist.github.com/dalf/972eb05e7a9bee161487132a7de244d2 - https://github.com/searxng/searxng/pull/1412/files - https://github.com/searxng/searxng/pull/1356 In my opinion, TypeDict is unsuitable because the objects are still dictionaries and not instances of classes / the `dataclass` are classes but ... The `msgspec.Struct` combine the advantages of typing, runtime behaviour and also offer the option of (fast) serializing (incl. type check) the objects. Currently not possible but conceivable with `msgspec`: Outsourcing the engines into separate processes, what possibilities this opens up in the future is left to the imagination! Internally, we have already defined that it is desirable to decouple the development of the engines from the development of the SearXNG core / The serialization of the `Result` objects is a prerequisite for this. HINT: The threads listed above were the template for this PR, even though the implementation here is based on msgspec. They should also be an inspiration for the following PRs of typification, as the models and implementations can provide a good direction. Why just one commit? ==================== I tried to create several (thematically separated) commits, but gave up at some point ... there are too many things to tackle at once / The comprehensibility of the commits would not be improved by a thematic separation. On the contrary, we would have to make multiple changes at the same places and the goal of a change would be vaguely recognizable in the fog of the commits. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-01-16[fix] build workflows of the themesMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>