summaryrefslogtreecommitdiff
path: root/searx/webapp.py
AgeCommit message (Collapse)Author
2020-09-10Drop Python 2 (1/n): remove unicode string and url_utilsDalf
2020-08-31Revert "[enh] test: load each engine to check for syntax errors"Alexandre Flament
This reverts commit 4fb3ed2c6335b68f6b28ebc68d5d22f2fd621648.
2020-08-28[enh] test: load each engine to check for syntax errorsDalf
2020-08-18[fix] opensearch on chromium for android (#2132)Émilien Devos
2020-08-09Use query params for browser autocompleteMohamad Safadieh
Sending query params over GET seems to be the only way to be able to enable autocomplete in the browser. This commit adds the necessary URL formatting to opensearch.xml. In order to identify queries coming from the URL bar (rather than an AJAX request), which requires a different JSON format and MIME type, the request headers are checked for "X-Requested-With: XMLHttpRequest" which is added by jQuery request.
2020-07-28[enh] add external plugin supportAdam Tauber
2020-07-09[mod] drop py2 supportAdam Tauber
2020-07-03Created new plugin type custom_results. Added new plugin bang_redirect (#2027)Lukas van den Berk
* Made first attempt at the bangs redirects plugin. * It redirects. But in a messy way via javascript. * First version with custom plugin * Added a help page and a operator to see all the bangs available. * Changed to .format because of support * Changed to .format because of support * Removed : in params * Fixed path to json file and changed bang operator * Changed bang operator back to & * Made first attempt at the bangs redirects plugin. * It redirects. But in a messy way via javascript. * First version with custom plugin * Added a help page and a operator to see all the bangs available. * Changed to .format because of support * Changed to .format because of support * Removed : in params * Fixed path to json file and changed bang operator * Changed bang operator back to & * Refactored getting search query. Also changed bang operator to ! and is now working. * Removed prints * Removed temporary bangs_redirect.js file. Updated plugin documentation * Added unit test for the bangs plugin * Fixed a unit test and added 2 more for bangs plugin * Changed back to default settings.yml * Added myself to AUTHORS.rst * Refacored working of custom plugin. * Refactored _get_bangs_data from list to dict to improve search speed. * Decoupled bangs plugin from webserver with redirect_url * Refactored bangs unit tests * Fixed unit test bangs. Removed dubbel parsing in bangs.py * Removed a dumb print statement * Refactored bangs plugin to core engine. * Removed bangs plugin. * Refactored external bangs unit tests from plugin to core. * Removed custom_results/bangs documentation from plugins.rst * Added newline in settings.yml so the PR stays clean. * Changed searx/plugins/__init__.py back to the old file * Removed newline search.py * Refactored get_external_bang_operator from utils to external_bang.py * Removed unnecessary import form test_plugins.py * Removed _parseExternalBang and _isExternalBang from query.py * Removed get_external_bang_operator since it was not necessary * Simplified external_bang.py * Simplified external_bang.py * Moved external_bangs unit tests to test_webapp.py. Fixed return in search with external_bang * Refactored query parsing to unicode to support python2 * Refactored query parsing to unicode to support python2 * Refactored bangs plugin to core engine. * Refactored search parameter to search_query in external_bang.py
2020-06-22[mod] don't try to proxify data URL.Dalf
Previously only image/jpeg was not proxied. This commit don't proxify all MIME types starting with "image/". This is a quick fix for the PR #1985 : the google_image engine can returns some data URL.
2020-06-18[enh] update opensearch.xml to match major search engines opensearch.xmlAdam Tauber
2020-06-15[enh] add translatable strings to javascript - closes #461Adam Tauber
2020-06-04[enh] add unique class for each endpoint - closes #1133Adam Tauber
2020-06-03make category order configurable using ui.categories_orderNoémi Ványi
2020-05-31Fix Farsi language in Oscar && adjust tables with RTLNoémi Ványi
2020-04-17[fix] translate engine errors to Occitan when configuredNoémi Ványi
2020-04-17[fix] remove usage of request context where not availableNoémi Ványi
2020-03-25webapp.py: expose the brand variable in the /config URL.Markus Heiser
E.g. helpful for searx-stats2 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-25webapp.py: partial code review (no functional change)Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-25[fix] brands: add variables from build env to jinja templatingMarkus Heiser
We have some variables in the build environment which are also needed in the templating process. Theses variables are relavant if one creates a fork with its own branding. We treat these variables under the term 'brands'. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-03-16[fix] remove debug printAdam Tauber
2020-03-16[fix] handle weights in accept language parsing - fixes w3ms en;q=1.0Adam Tauber
2020-03-13[fix] convert query to string to produce valid filename for csv outputAdam Tauber
2020-03-13[fix] add answers, suggestions, corrections to csv outputAdam Tauber
fixes #1888
2020-03-13[fix] add answers, suggestions, corrections to rss outputAdam Tauber
fixes #1888
2020-02-23monkey patch babel get_translations to support OccitanMarc Abonce Seguin
2020-02-23fix default locale and language issuesMarc Abonce Seguin
2020-02-08Merge commit 'refs/pull/1621/head' of https://github.com/asciimoo/searxMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-08[enh] introduce private enginesNoémi Ványi
This PR adds a new setting to engines named `tokens`. It expects a list of tokens which lets searx validate if the request should be accepted or not.
2020-02-06Fix deprecated werkzeug importNicolas Gelot
Close: #1830 Signed-off-by: Nicolas Gelot <nicolas.gelot@e.email>
2020-01-28[mod] add py2 deprecation warning to webappAdam Tauber
2019-12-21hide suggestions box if emptyMarc Abonce Seguin
This bug happens only in python3 because map returns an iterator.
2019-12-02Merge pull request #1744 from dalf/optimizationsAdam Tauber
[mod] speed optimization
2019-11-16webapp.py: use html.escape if cgi.escape is not availablelorddavidiii
- cgi.escape was removed in python 3.8 - also use html.escape in framalibre.py
2019-11-15[mod] speed optimizationDalf
compile XPath only once avoid redundant call to urlparse get_locale(webapp.py): avoid useless call to request.accept_languages.best_match
2019-10-22[fix] preserve bangs in correctionsMarc Abonce Seguin
2019-10-16add initial support for offline engines && command engineNoémi Ványi
2019-08-02[enh] Add timeout limit per request (#1640)Alexandre Flament
The new url parameter "timeout_limit" set timeout limit defined in second. Example "timeout_limit=1.5" means the timeout limit is 1.5 seconds. In addition, the query can start with <[number] to set the timeout limit. For number between 0 and 99, the unit is the second : Example: "<30 searx" means the timeout limit is 3 seconds For number above 100, the unit is the millisecond: Example: "<850 searx" means the timeout is 850 milliseconds. In addition, there is a new optional setting: outgoing.max_request_timeout. If not set, the user timeout can't go above searx configuration (as before: the max timeout of selected engine for a query). If the value is set, the user can set a timeout between 0 and max_request_timeout using <[number] or timeout_limit query parameter. Related to #1077 Updated version of PR #1413 from @isj-privacore
2019-07-27[fix] small fixes in preferences view's textMarc Abonce Seguin
2019-07-27[fix] fix the debug message "starting webserver on ip:port"Dalf
was "port:ip"
2019-07-17[enh] Add Server-Timing header (#1637)Alexandre Flament
Server Timing specification: https://www.w3.org/TR/server-timing/ In the browser Dev Tools, focus on the main request, there are the responses per engine in the Timing tab.
2019-07-17Suggestions: use RawTextQuery to make the suggestions URLs. Update all ↵Dalf
themes accordingly.
2019-07-01[fix] preserve bangs in suggestions and correctionsMarc Abonce Seguin
2019-07-01[fix] never pass bangs to autocomplete suggestionsMarc Abonce Seguin
2019-06-17Fix locale and search languageNicolas Gelot
Locale and search language was always defined with english value. This patch inits the locale on `pre_request` in order to define the default value of locale and language preferences. Plus the `best_match` function provided by flask babel library did not work as expected. So the function `match_language` provided by searx is used to detect that the language from Accepted-Language header can be used in searx project.
2019-06-17Remove get local from request.argsNicolas Gelot
args parameters are merged in form in pre_request, so this patch removes that useless operation.
2019-05-18fix: dev: python3 dict keys jsonifyrachmadaniHaryono
2019-01-18[FIX] image_proxifyVenca24
2019-01-07Revert "remove 'all' option from search languages"Noémi Ványi
This reverts commit 4d1770398a6af8902e75c0bd885781584d39e796.
2018-03-27refactor engine's search language handlingMarc Abonce Seguin
Add match_language function in utils to match any user given language code with a list of engine's supported languages. Also add language_aliases dict on each engine to translate standard language codes into the custom codes used by the engine.
2018-03-17[fix] get doi_rewriters from settings - fixes #1245Adam Tauber