summaryrefslogtreecommitdiff
path: root/searx/webapp.py
AgeCommit message (Collapse)Author
2020-12-03[enh] record details exception per engineAlexandre Flament
add an new API /stats/errors
2020-12-01[mod] pylint: numerous minor code fixesAlexandre Flament
2020-11-26Merge pull request #2327 from renyhp/masterAlexandre Flament
Add preference for displaying advanced settings
2020-11-26Remove unused linesrenyhp
2020-11-26Fix syntax errorrenyhp
2020-11-26Another patchrenyhp
2020-11-23Patch advanced search preferencesrenyhp
2020-11-22Add preference for displaying advanced settingsrenyhp
2020-11-20[enh] Add multiple outgoing proxiesAlexandre Flament
credits go to @bauruine see https://github.com/searx/searx/pull/1958
2020-11-17Fix type of unresponsive_enginesNoémi Ványi
Previously __get_translated_errors returned a list. But unresponsive_engines is a set. Closes #2305
2020-11-14[mod] remove unused importAlexandre Flament
use from searx.engines.duckduckgo import _fetch_supported_languages, supported_languages_url # NOQA so it is possible to easily remove all unused import using autoflake: autoflake --in-place --recursive --remove-all-unused-imports searx tests
2020-11-14Merge pull request #2289 from dalf/pylintAlexandre Flament
[mod] pylint: add extension-pkg-whitelist=lxml.etree
2020-11-14Merge pull request #2300 from dalf/fix-webapp-indexAlexandre Flament
[fix] fix of / and /search
2020-11-06[fix] fix of / and /searchAlexandre Flament
* URL / : the index page displayed the selected or the default category. * URL / : when the q parameter is set using the URL, the redirect includes the URL query. * URL /search : an empty query doesn't raise an exception.
2020-11-05[enh] add default http headers - closes #715Adam Tauber
2020-11-03[mod] pylint: minor code change to allow pylint globallyAlexandre Flament
This commit is only a step, it doesn't fix all the issues reported by pylint
2020-11-02[mod] separate index and search routesMarc Abonce Seguin
This makes it easier to separately handle search and index requests from a web server or from a reverse proxy. If a request to index contains a query, a permanent redirect HTTP response is returned. This should give some level of backwards compatibility for users that have set a searx instance in their browser's search bar.
2020-10-25[enh] Add onions category with Ahmia, Not Evil and Torcha01200356
Xpath engine and results template changed to account for the fact that archive.org doesn't cache .onions, though some onion engines migth have their own cache. Disabled by default. Can be enabled by setting the SOCKS proxies to wherever Tor is listening and setting using_tor_proxy as True. Requires Tor and updating packages. To avoid manually adding the timeout on each engine, you can set extra_proxy_timeout to account for Tor's (or whatever proxy used) extra time.
2020-10-25Let admins lock user preferencesNoémi Ványi
2020-10-08[fix] use base_url everywhere if it is defined in settings.ymlAdam Tauber
2020-10-06[fix] opensearch.xml URL contains method and autocomplete parametersAlexandre Flament
When the user add searx as a search engine, the browser loads the /opensearch.xml URL without the cookies. Without the query parameters, the user preferences are ignored (method and autocomplete). In addition, opensearch.xml is modified to support automatic updates, see https://developer.mozilla.org/en-US/docs/Web/OpenSearch
2020-10-05[mod] webapp.py: update engines initialization conditionAlexandre Flament
Always call initialize engines except on the first run of werkzeug with the reload feature. the reload feature is activated when: * searx_debug is True (SEARX_DEBUG environment variable or settings.yml) * FLASK_APP=searx/webapp.py FLASK_ENV=development flask run (see https://flask.palletsprojects.com/en/1.1.x/cli/ ) Fix SEARX_DEBUG=0 make docs docs/admin/engines.rst : engines are initialized See https://github.com/searx/searx/issues/2204#issuecomment-701373438
2020-09-28Merge pull request #2189 from dalf/architecture-clean-upAdam Tauber
Architecture clean up
2020-09-26[mod] upgrade requests to version 2.24.0. use ssl instead of pyopenssl.Alexandre Flament
requests 2.24.0 uses the ssl module except if it doesn't support SNI, in this case searx fallbacks to pyopenssl. searx logs a critical message and exit if the ssl modules doesn't support SNI and pyOpenSSL is not installed. searx logs a critical message and exit if the ssl version is older than 1.0.2. in requirements.txt, pyopenssl is still required to install searx as a fallback.
2020-09-24[mod] more typingAlexandre Flament
2020-09-22[mod] searx/webadapter.py: add get_selected_categories share common code ↵Alexandre Flament
with get_search_query_from_webapp Update searx/webapp.py to use get_selected_categories Close #2142
2020-09-22[mod] check the engine tokens in searx/webadapter.py instead of searx/search.pyAlexandre Flament
2020-09-22[mod] add searx/webadapter.pyAlexandre Flament
* move searx.search.get_search_query_from_webapp to searx.webadapter * move searx.query.SearchQuery to searx.search
2020-09-22[mod] searx.query.RawTextQuery: getSearchQuery and changeSearchQuery rename ↵Alexandre Flament
to getQuery and changeQuery getSearchQuery is confusing, the method returns a str not a SearchQuery object
2020-09-22[mod] add searx/webutils.pyAlexandre Flament
contains utility functions and classes used only by webapp.py
2020-09-22[mod] refactor searx.webapp.get_localeAlexandre Flament
* Log each call to get_locale: display the URL, the locale and the source (browser, preferences, form). * Rename _get_browser_language to _get_browser_or_settings_language to match the actual code.
2020-09-22[fix] /autocompleter: return HTTP 400 when q is empty as intent.Alexandre Flament
Fix commit c225db45c8a4ab466bff049216f7e0189dc1b067
2020-09-12[mod] searx.RawTextQuery: the constructor call parse_queryAlexandre Flament
2020-09-10Drop Python 2 (4/n): SearchQuery.query is a str instead of bytesDalf
2020-09-10Drop Python 2 (3/n): objectsDalf
2020-09-10Drop Python 2 (2/n): templatesDalf
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