summaryrefslogtreecommitdiff
path: root/searx/webapp.py
AgeCommit message (Collapse)Author
2022-04-07fix: %2F in path will be converted to " › "HZH
2022-04-05Unquote path on result page.HZH
2022-03-29Extra null safetyAustin Huang
Co-Authored-By: Alexandre Flament <alex.andre@al-f.net>
2022-03-29[fix] merge fake "plugins" endpoint back to "static"Austin Huang
https: //matrix.to/#/!vxScbLNEAmRvOraXBn:matrix.org/$0zqTtH3s-eVKlMwiAgiEJdetOkRx27EIRs-C0o8FzSg?via=libera.chat&via=matrix.org&via=tchncs.de Co-Authored-By: Alexandre Flament <alex.andre@al-f.net>
2022-03-28[fix] return correct plugin pathAustin Huang
closes #1021
2022-03-20[interim fix] static files can't be delivered by HTTP.Markus Heiser
Since PR 932 [1][2] static files can't be delivered by HTTP server any longer. This patch makes the hash paramter in the URL of static files: /static/themes/simple/css/searxng.min.css?5fde34a74bc438c7b56ec8c6501e131cc9914bd8 optional. By default the hash parameter is disabled. HINT: Instances that do not deliver static files by their HTTP server and have a long expire time [3] should enable this option. ---- This is only a interim solution, on the long run: make static.build.commit creates files including the file name: css/searxng-5fde34a74bc438c7b56ec8c6501e131cc9914bd8.min.css and a mapping.json with this content[4] [1] https://github.com/searxng/searxng/issues/964 [2] https://github.com/searxng/searxng/pull/932#issuecomment-1067039518 [3] https://github.com/searxng/searxng/pull/932/commits/55833364401ed72c30b3e85c16824a75de6b547a [4] https://github.com/searxng/searxng/pull/932#issuecomment-1067216426 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-20Merge pull request #859 from return42/fix-814Markus Heiser
[mod] add i18n infrastructure for SearXNG message files (searxng.msg)
2022-03-16Info: code refactoring & bug fixesAlexandre Flament
2022-03-16[mod] move category and names of constants to searx/searxng.msgMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/814 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-13Various change on PR 930Alexandre Flament
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-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[mod] infinite_scroll as preferenceAlexandre Flament
* oscar theme: code from searx/plugins/infinite_scroll.py * simple theme: new implementation Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
2022-02-19[fix] image_proxy: allow HTTP redirectsMarkus Heiser
Without redirects the load of various images will fail when image_proxy is enabled [1]. [1] https://github.com/searxng/searxng/pull/910#issuecomment-1045966577 Suggested-by: @dalf [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-02-01[enh] generate navigation for help pagesMartin Fischer
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-01-27[pyright] remove no longer needed assertionMartin Fischer
The pyright bug[1] for which the assertion was added has been fixed. [1]: https://github.com/microsoft/pyright/issues/2930
2022-01-27[pyright:basic] searx.webappMartin Fischer
2022-01-23[mod] configuration to overwrite engine descriptionMarkus Heiser
Engine description can be configured, this is needed e.g. by custom search engines. Here is an example of a command engine with a description in the about section:: - name: locate engine: command command: ['locate', '{{QUERY}}'] disabled: true categories: files about: description: local files website: 'https://www.man7.org/linux/man-pages/man1/locate.1.html' delimiter: chars: ' ' keys: ['line'] Closes: https://github.com/searxng/searxng/issues/788 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-23[help] render user documentation once on startupMartin Fischer
Currently we have two kinds of user documentation: * the about page[1] which is written in HTML and part of the web application and can therefore link instance-specific pages (like e.g. the preferences) via Jinja variables * the Sphinx documentation[2] which is written in reStructuredText and cannot link instance-specific pages since it doesn't know which instance the user is using The plan is to integrate the user documentation currently in Sphinx into the application, so that it can also link instance specific pages. We also want to enable the user documentation to be translated. This commit implements the first step in this endeavor (see #722). [1]: searx/templates/__common__/about.html [2]: docs/user/ (currently served at https://docs.searxng.org/user/)
2022-01-17[typing] add type hints to webapp.pyMartin Fischer
2022-01-17[typing] add results.UnresponsiveEngineMartin Fischer
2022-01-17[refactor] remove never used parameterMartin Fischer
2022-01-17[typing] add results.TimingMartin Fischer
2022-01-17[typing] add ExtendedRequestMartin Fischer
webapp.py monkey-patches the Flask request global. This commit adds a type cast so that e.g. Pyright[1] doesn't show "Cannot access member" errors everywhere. [1]: https://github.com/microsoft/pyright
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