summaryrefslogtreecommitdiff
path: root/searx/webapp.py
AgeCommit message (Collapse)Author
2022-01-09[fix] filtered_engines were not correctly evaluating validate_token()Martin Minka
2022-01-06Merge pull request #634 from not-my-profile/powered-byAlexandre Flament
Introduce `categories_as_tabs` & group engines in tabs
2022-01-05[enh] settings.yml: implement general.enable_metricsAlexandre Flament
* allow not to record metrics (response time, etc...) * this commit doesn't change the UI. If the metrics are disabled /stats and /stats/errors will return empty response. in /preferences, the columns response time and reliability will be empty.
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-05[mod] move group_engines_in_tab to searx.webutilsMartin Fischer
2022-01-05[enh] show categories not in any tab category in "Other" preferences tabMartin Fischer
Previously we didn't have a good place to put search engines that don't fit into any of the tab categories. This commit automatically puts search engines that don't belong to any tab category in an "other" category, that is only displayed in the user preferences (and not above search results).
2022-01-05[enh] group engines in preference tabsMartin Fischer
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.
2021-12-28[mod] implement is_hmac_of() in webutils / close to new_hmac()Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>, Alexandre Flament
2021-12-28[fix] use hmac.compare_digest instead of ==Alexandre Flament
see https://docs.python.org/3/library/hmac.html#hmac.HMAC.hexdigest
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-29[fix] route /autocompleter: escape `<` and `>` in the simple themeMarkus Heiser
This is a follow up of 9a3253fc escaping `<` and `>` in all themes. This patch fix issue in oscar theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-27[fix] route /autocompleter: escape '<' and '>' in the responseMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-24Merge pull request #485 from dalf/pref_query_in_titleAlexandre Flament
[mod] new preference: query_in_title
2021-11-21[simple theme] rework select; add safesearch to search and replace / with ↵mrpaulblack
› in article url * rework selection UI in pref (fix based on: https://github.com/twelsby/searx/commit/78643e9f43a103c523f112e9f3ce26a5c7bb3a0f) * moved search filters underneath categories * cut params from url and replace / with › * make h3 and url in article bigger * add safe search select to search filter (this will not override settings and only be valid while on result page in a session) * make search form button not overlap each other when js is disabled * 1rem padding around preview image and thumbnail in default article template
2021-11-19[enh] simple theme: add "simple-style" preferencesAlexandre Flament
2021-11-08[mod] new preference: query_in_titleAlexandre Flament
* disable by default * settings.yml: ui.query_in_title * in /preferences: privacy tab when enabled, the result page's title contains the user query. previously: * oscar theme: the query was always included * simple theme: the query was included with the GET method
2021-10-29healthcheck endpointIgor Rzegocki
2021-10-26[enh] reduce the available language listAlexandre Flament
close #406 settings['search']['languages'] contains the languages codes and 'all'
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] templates: lang attribute of html uses hyphenAlexandre Flament
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-lang https://www.w3.org/TR/REC-xml/#sec-lang-tag
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-09-28[mod] searx.network.stream returns a tuple (response, stream)Alexandre Flament
2021-09-24[enh] themes: display the engine descriptionsAlexandre Flament
2021-09-24[mod] add /engine_descriptions.json endpointAlexandre Flament
returns engine descriptions (JSON): * key: engine name * value: description in the user locale, use English description as a fallback
2021-09-07[mod] oa_doi_rewrite plugin: get_doi_resolver: remove args parameterAlexandre Flament
doi_resolvers.get_value('preferences') already contains the value from request.args.get('doi_resolver')
2021-09-07[pylint] searx: drop no longer needed 'missing-function-docstring'Markus Heiser
Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-02[mod] searx.webapp: code clean upAlexandre Flament
2021-08-31[enh] new issue: include information from searx.versionAlexandre Flament
2021-08-24[mod] /image_proxy: use HTTP/1 instead of HTTP/2Alexandre Flament
httpx: HTTP/2 is slow when a lot data is downloaded. https://github.com/dalf/pyhttp-benchmark also, the usage of HTTP/1 decreases the load average
2021-08-24[fix] image_proxy: always close the httpx responeAlexandre Flament
previously, when the content type was not an image and some other error, the httpx response was not closed
2021-08-22Merge pull request #260 from dalf/mod_localeMarkus Heiser
[mod] searx.webapp.get_locale: read locale from the preferences
2021-08-18[fix] /config add missing GIT_BRANCH valueMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-17[mod] searx.webapp.get_locale: read locale from the preferencesAlexandre Flament
pre_request already set the locale.
2021-08-03[mod] settings.yml: remove localesAlexandre Flament
There are detected from the searx/translations directory
2021-07-30version based on the git repositoryAlexandre Flament
This commit remove the need to update the brand for GIT_URL and GIT_BRANCH: there are read from the git repository. It is possible to call python -m searx.version freeze to freeze the current version. Useful when the code is installed outside git (distro package, docker, etc...)
2021-07-21[mod] drop usage of the searx.brand namespace (templates & /config)Markus Heiser
In the templates and the /config (JSON) the usage of the 'brand.*' name space is replaced by 'searx.get_setting' function. - new_issue_url --> get_setting('brand.new_issue_url') - brand.GIT_URL --> get_setting('brand.git_url') - brand.PUBLIC_INSTANCES --> get_setting('brand.public_instances') - brand.DOCS_URL --> get_setting('brand.docs_url') - brand.ISSUE_URL --> get_setting('brand.issue_url') - brand.CONTACT_URL --> get_setting('general.contact_url', '') The macro 'new_issue' from searx/templates/*/messages/no_results.html is now imported with context:: {% from '__common__/new_issue.html' import new_issue with context %} To get *public instances URL* from context's 'get_setting()' function:: get_setting('brand.public_instances','') Macro's prototype does no longer need the 'new_issue_url' argument and has been changed to:: macro new_issue(engine_name, engine_reliability) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-03[pylint] prepare for pylint v2.9.3 / fix some (new) pylint issuesMarkus Heiser
Upgrade from pylint v2.8.3 to 2.9.3 raise some new issues:: searx/search/checker/__main__.py:37:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) searx/search/checker/__main__.py:38:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) searx/search/processors/__init__.py:20:0: R0402: Use 'from searx import engines' instead (consider-using-from-import) searx/preferences.py:182:19: C0207: Use data.split('-', maxsplit=1)[0] instead (use-maxsplit-arg) searx/preferences.py:506:15: R1733: Unnecessary dictionary index lookup, use 'user_setting' instead (unnecessary-dict-index-lookup) searx/webapp.py:436:0: C0206: Consider iterating with .items() (consider-using-dict-items) searx/webapp.py:950:4: C0206: Consider iterating with .items() (consider-using-dict-items) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-10[coding-style] searx/webapp.py - normalize indentationsMarkus Heiser
No functional change! Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-08[mod] refactor searx.webapp.renderAlexandre Flament
render automatically adds these variables to the template context: * advanced_search * all_categories * categories before render was checking if the variable was already set but it is actually never set by the callers
2021-06-08[mod] move hook to set Unix thread name into searx.unixthreadnameAlexandre Flament
requires setproctitle (but optional)
2021-06-08[mod] remove unused filter searx.webapp.extract_domainAlexandre Flament
it was used in the pix-art theme
2021-06-08[mod] refactor searx.webapp.renderAlexandre Flament
no functional change, reorder declarations
2021-06-08[mod] refactor searx.webapp.render: remove unused parametersAlexandre Flament
2021-06-08[mod] remove check of Python 2.Alexandre Flament
2021-06-08[mod] remove searx.webapp.get_base_url functionAlexandre Flament
see the result of: git grep "base_url" searx/templates "base_url" is not used any more.
2021-06-08[mod] refactor: move Flask proxy fix to searx.flaskfix moduleAlexandre Flament