summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-06-12[fix] move locale code from webapp.py to locales.py and fix #1303Markus Heiser
To improve modularization this patch: - moves *locale* related implementation from the webapp.py application to the locale.py module. - The initialization of the locales is now done in the application (webapp) and is no longer done while importing searx.locales. In the searx.locales module a new dictionary named `LOCALE_BEST_MATCH` has been added. In this dictionary we can map languages without a translation to languages we have a translation for. To fix #1303 zh-HK has been mapped to zh-Hant-TW (we do not need additional translations of traditional Chinese) Closes: https://github.com/searxng/searxng/issues/1303 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-05-07theme: remove __common__Alexandre Flament
2022-04-30[theme] peel out oscar from SearXNG developmentMarkus Heiser
This is the first step of removing oscar theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-16[fix] dailymotion engine: filter by language & countryMarkus Heiser
- fix the issue of fetching more the 7000 *languages* - improve the request function and filter by language & country - implement time_range_support & safesearch - add more fields to the response from dailymotion (allow_embed, length) - better clean up of HTML tags in the 'content' field. This is more or less a complete rework based on the '/videos' API from [1]. This patch cleans up the language list in SearXNG that has been polluted by the ISO-639-3 2 and 3 letter codes from dailymotion languages which have never been used. [1] https://developers.dailymotion.com/tools/ Closes: https://github.com/searxng/searxng/issues/1065 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-05[fix] add missing territory (country) nameMarkus Heiser
Related-to: https://github.com/searxng/searxng/pull/1029#issuecomment-1086824911 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-01[fix] issue when upgrading from werkzeug v2.0.3 to v2.1.0Markus Heiser
In v2.1.0 werkzeug [1] fixed an issue [2] to keep relative redirect locations by default [3]. Since relative locations are returned, we need to fix out test cases to avoid AssertionErrors like this one:: ====================================================================== FAIL: test_index_html_get (tests.unit.test_webapp.ViewsTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/searxng/searxng/tests/unit/test_webapp.py", line 105, in test_index_html_get self.assertEqual(result.location, 'http://localhost/search?q=test') AssertionError: '/search?q=test' != 'http://localhost/search?q=test' - /search?q=test + http://localhost/search?q=test [1] https://werkzeug.palletsprojects.com/ [2] https://github.com/pallets/werkzeug/issues/2352 fixed in [3] https://github.com/pallets/werkzeug/pull/2354 Related-to: https://github.com/searxng/searxng/pull/1039#issuecomment-1085538288 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-19Merge pull request #894 from dalf/simple-aria-1Alexandre Flament
[enh] simple: basic ARIA fixes
2022-03-12[mod] replace /help by /info pages and include pages in project docsMarkus Heiser
This patch implements a bolierplate to share content from info-pages of the SearXNG instance (URL /info) with the project documentation (path /docs/user). The info pages are using Markdown (CommonMark), to include them in the project documentation (reST) the myst-parser [1] is used in the Sphinx-doc build chain. If base_url is known (defined in settings.yml) links to the instance are also inserted into the project documentation:: searxng_extra/docs_prebuild [1] https://www.sphinx-doc.org/en/master/usage/markdown.html Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-08[enh] simple: basic ARIA fixesAlexandre Flament
2022-03-05[mod] URL for the static file contains the sha1Alexandre Flament
* allow to cache the static file forever * avoid bugs when the static files are updated but not reloaded
2022-02-26[simple theme] replace Image_layout.js with flexbox CS impl.mrpaulblack
* drop image_layout.js from simple theme * move image_layout.js to oscar theme and delete common js dir (since its empty now) * align top position of image detail modal with bottom position of search header * use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less * display span title underneath each image with a max width of 12rem * increase margin and padding around image article on desktop and tablet * make article height smaller on phone layout (height of 6rem) to display more content on current view * remove content from result, if the title and content matches * use a group that cotains the flex image article, if images are mixed with other categories * fix pylint issues in webapp.py * use the default.html result template in unit tests (thanks @return42)
2022-02-20[fix] changeover of the unit tests to the simple themeMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-02-05Merge pull request #848 from not-my-profile/help-routeAlexandre Flament
Introduce `/help` route
2022-02-04Merge pull request #839 from dalf/docs_searx_utilsMarkus Heiser
[mod] add documentation about searx.utils
2022-02-04preferences: Set autocomplete=off for formMartin Fischer
Otherwise you can change the value of a select, refresh the page and the preferences stay changed, leaving the wrong impression that they were saved.
2022-02-01[enh] introduce /help routeMartin Fischer
Translation will be implemented in the future. For now the "en" in /help/en/<pagename> is hardcoded.
2022-02-01[help] remove link from about.md titleMartin Fischer
Now that about.html extends page_with_header.html it already has a link to the start page and removing the link makes it easier to extract the page title from the Markdown for the following commit.
2022-01-29[mod] add documentation about searx.utilsAlexandre Flament
This module is a toolbox for the engines. Is should be documented. In addition, searx/utils.py is checked by pylint.
2022-01-17[typing] add results.TimingMartin Fischer
2022-01-12[fix] external bangs: don't overwrite Bangs in data trieMarkus Heiser
Bangs with a `*` suffix (e.g. `!!d*`) overwrite Bangs with the same prefix (e.g. `!!d`) [1]. This can be avoid when a non printable character is used to tag a LEAF_KEY. [1] https://github.com/searxng/searxng/pull/740#issuecomment-1010411888 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-07Merge pull request #708 from not-my-profile/pref-refactorMartin Fischer
Refactor `preferences`
2022-01-06[refactor] refactor SwitchableSettingMartin Fischer
The previous implementation used two hash sets and a list. ... that's not necessary ... a single hash map suffices. And it's also less error prone ... because the previous data structure allowed a setting to be enabled and disabled at the same time.
2022-01-06[refactor] add type hints & remove Setting._post_initMartin Fischer
Previously the Setting classes used a horrible _post_init hack that prevented proper type checking.
2022-01-06[fix] remove broken ? search operatorMartin Fischer
The ? search operator has been broken for some time and currently only raises the question why it's still there. ## Context ## The query "Paris !images" searches for "Paris" in the "images" category. Once upon a time Searx supported "Paris ?images" to search for "Paris" in the currently enabled categories and the "images" category. The feature makes sense ... the ? syntax does not. We will hopefully introduce a +!images syntax in the future. Fixes #702.
2022-01-06Merge pull request #634 from not-my-profile/powered-byAlexandre Flament
Introduce `categories_as_tabs` & group engines in tabs
2022-01-05Merge pull request #596 from dalf/upgrade-httpxAlexandre Flament
Upgrade httpx
2022-01-05[mod] upgrade httpx 0.21.2Alexandre Flament
httpx 0.21.2 and httpcore 0.14.4 fix multiple issues: * https://github.com/encode/httpx/releases/tag/0.21.2 * https://github.com/encode/httpcore/releases/tag/0.14.4 so most of the workarounds in searx.network have been removed.
2022-01-05[enh] change categories_as_tabs from a list to a dictMartin Fischer
The tab icon names are currently hard coded in the templates. This commit lets us introduce an icon property in the future, e.g: categories_as_tabs: general: icon: search-outline
2022-01-03[enh] introduce categories_as_tabsMartin Fischer
Previously all categories were displayed as search engine tabs. This commit changes that so that only the categories listed under categories_as_tabs in settings.yml are displayed. This lets us introduce more categories without cluttering up the UI. Categories not displayed as tabs can still be searched with !bangs.
2022-01-02reference docs.searxng.orgAlexandre Flament
2021-12-28[mod] webutils.py: remove dead codeAlexandre Flament
secret_key can't be bytes (see settings_default.py)
2021-12-27[fix] issues reported by pylintMarkus Heiser
Fix pylint issues from commit (3d96a983) [format.python] initial formatting of the python code Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] disable py code formatting for some hunks of codeMarkus Heiser
Disable the python code formatting from python-black, where the readability of code suffers by formatting. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-26[fix] oscar theme: use SearXNG logo and wordmarkMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-10-29healthcheck endpointIgor Rzegocki
2021-10-12Merge pull request #380 from dalf/fix-339Alexandre Flament
[fix] interface language zh_CN and zh_TW don't work
2021-10-12[mod] locale: use hyphen everywhere except for BabelAlexandre Flament
2021-10-12[fix] fix match_language issue to make zh-TW match to zh-Hant-TWMarc Abonce Seguin
pybabel separates locales with underscores but we use hyphens everywhere babel doesn't directly touch
2021-10-12[enh] verify that Tor proxy works every time searx startsAlexandre Flament
based on @MarcAbonce commit on searx
2021-10-06plugins: refactor initializationAlexandre Flament
add a new function "init" call when the app starts. The function can: * return False to disable the plugin. * modify the Flask app.
2021-10-03Merge pull request #375 from dalf/searxng_extraAlexandre Flament
SearXNG: searx_extra
2021-10-02SearXNG: searxng_extraAlexandre Flament
2021-10-02SearXNG: SEARXNG_SETTINGS_PATHAlexandre Flament
2021-10-02SearXNG: environment variablesAlexandre Flament
2021-09-30SearXNG: oscar themeAlexandre Flament
2021-09-17[pylint] fix global-variable-not-assigned issuesMarkus Heiser
If there is no write access, there is no need for global. Remove global statement if there is no assignment. global-variable-not-assigned: Using global for names but no assignment is done Used when a variable is defined through the "global" statement but no assignment to this variable is done. In Pylint 2.11 the global-variable-not-assigned checker now catches global variables that are never reassigned in a local scope and catches (reassigned) functions [1][2] [1] https://pylint.pycqa.org/en/latest/whatsnew/2.11.html [2] https://github.com/PyCQA/pylint/issues/1375 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-14Merge pull request #297 from dalf/engine-logger-enhAlexandre Flament
debug mode: more readable logging
2021-09-13[fix] settings - displayed name is SearXNGMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-10[mod] debug mode: use coloredlogs packageAlexandre Flament
in debug mode, add some padding to make the output more readable in procution mode, add the timestamp