Commit Graph

58 Commits (c849731eb1df23b8509a947fcc2807adb34dc730)

Author SHA1 Message Date
Alexandre Flament 42c1a938f0
Merge pull request #485 from dalf/pref_query_in_title
[mod] new preference: query_in_title
3 years ago
Alexandre Flament ec5a82fccd [enh] simple theme: add "simple-style" preferences 3 years ago
Alexandre Flament 80fb77476f [mod] new preference: query_in_title
* 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
3 years ago
Alexandre Flament 60db344cc0 [enh] reduce the available language list
close #406

settings['search']['languages'] contains the languages codes and 'all'
3 years ago
Markus Heiser 2a3b9a2e26 [pylint] searx: drop no longer needed 'missing-function-docstring'
Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser b83c14cf6b [pylint] Pylint 2.10 - fix use-list-literal & use-dict-literal
Pylint 2.10 added new default checks [1]:

use-list-literal
  Emitted when list() is called with no arguments instead of using []

use-dict-literal
  Emitted when dict() is called with no arguments instead of using {}

[1] https://pylint.pycqa.org/en/latest/whatsnew/2.10.html

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament f30d01ffab [mod] settings.yml: remove locales
There are detected from the searx/translations directory
3 years ago
Markus Heiser 24f2376c11 [pylint] prepare for pylint v2.9.3 / fix some (new) pylint issues
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>
3 years ago
Markus Heiser 6787e5a36b [fix] decoding of saved preferences in the URL
To compress saved preferences in the URL was introduced in 5f758b2d3 and
slightly fixed in 8f4401462.  But the main fail was not fixed; The decompress
function returns a binary string and this binary should first be decoded to a
string before it is passed to urllib.parse_qs.

BTW: revert the hot-fix from 5973491

Related-to: https://github.com/searxng/searxng/issues/166
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 4b07df62e5 [mod] move all default settings into searx.settings_defaults 3 years ago
Markus Heiser dc29f1d826 [pylint] tag PYLINT_FILES by comment `# lint: pylint`
These py files are linted by `test.pylint`, all other files are linted by
`test.pep8`.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser ebfd0eb2b7 [fix] default_doi_resolver in preferences
Instead of a hard-coded `oadoi.org` default, use the default value from
`settings.yml`.

Fix an issue in the themes: The replacement 'current_doi_resolver' contains the
doi_resolver_url, not the name of the DOI resolver.  Compare return value of::

    searx.plugins.oa_doi_rewrite.get_doi_resolver(...)

Fix a typo in `get_doi_resolver(..)`:  suggested by @kvch:

  *L32 should set doi_resolver not doi_resolvers*

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
renyhp 22489c4b5f Patch advanced search preferences 4 years ago
renyhp b00f77059c Add preference for displaying advanced settings 4 years ago
Noémi Ványi 33e139cae6 Let admins lock user preferences 4 years ago
Alexandre Flament 507896c115 [mod] preferences.py: check language setting with a regex instead of match_language 4 years ago
Dalf 7888377743 Drop Python 2 (3/n): objects 4 years ago
Dalf 1022228d95 Drop Python 2 (1/n): remove unicode string and url_utils 4 years ago
Scott Wallace 8bcba31e31 Add key to settings.yml for opening result links in a new tab
Closes #1552
Closes #444
4 years ago
Adam Tauber 079783e993 [fix] pylint 4 years ago
Mohamad Safadieh 8dff74dd1b
Make default query submission method configurable
Sending queries through POST, while better for privacy, breaks functionality
with certain extensions (e.g. Firefox containers). Since Firefox does
not send cookies when requesting `/opensearch.xml`, users cannot easily
switch to GET on the client side unless they make a custom search
engine. This commit allows admins to modify the default method on their
side so they can set it to GET if needed.
4 years ago
Markus Heiser 1cae4fa88d preferences.py: implement defaults if unset
Implemnts defaults for:

- search.default_lang, search.autocomplete, search.safe_search,
- ui.default_theme, ui.default_locale
- server.image_proxy

This fixes also:

  https://github.com/asciimoo/searx/pull/1860#issuecomment-590082955

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Markus Heiser 179be12732 preferences.py: pylint, SPDX tag & docstrings (no functional change)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Marc Abonce Seguin c0006cadf7 fix default locale and language issues 4 years ago
Adam Tauber 6df4172887 [fix] allow settin custom locale from settins.yml 4 years ago
Markus Heiser 7c79eb9b1b Merge commit 'refs/pull/1621/head' of https://github.com/asciimoo/searx
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
4 years ago
Noémi Ványi 99435381a8 [enh] introduce private engines
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.
4 years ago
rachmadani haryono 8f44014627 [fix] preference query parameter decoding (#1599)
Fix issue #1598
5 years ago
Nicolas Gelot 373a66be30 Fix locale and search language
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.
5 years ago
Noémi Ványi b63d645a52 Revert "remove 'all' option from search languages"
This reverts commit 4d1770398a.
6 years ago
Adam Tauber f7bb45e891 [enh] admin configurable suspend time of errored engines - closes #1266 6 years ago
Adam Tauber 69d1dd3f86 [enh] configurable default oscar style 6 years ago
Marc Abonce Seguin 772c048d01 refactor engine's search language handling
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.
6 years ago
Adam Tauber 2dc02f50c2 [fix] do not save engine/plugin cookies as unknown settings options - fixes #1110 7 years ago
Adam Tauber 49b845051f
Merge pull request #973 from MarcAbonce/languages
Remove 'all' option from search languages
7 years ago
marc 4d1770398a remove 'all' option from search languages 7 years ago
Adam Tauber e060aedc16 [enh] make custom oscar option configurable from url 7 years ago
Adam Tauber 128eb76604 [fix] allow none as category in preferences - #1086 7 years ago
Noémi Ványi 1b10abfc92 minor fixes of doi resolver
Closes #1047
7 years ago
jibe-b 575159b194 [enh] oa_doi_rewrite plugin broadens doai_rewrite 7 years ago
Adam Tauber 8901b7bddb [fix] pep8 7 years ago
Adam Tauber 5f758b2d39 [mod] compress saved preferences in url 7 years ago
Adam Tauber 38d6ba4066 [enh] generate search url of saved preferences 7 years ago
Adam Tauber 52e615dede [enh] py3 compatibility 7 years ago
marc fd65c12921 make search language handling less strict
languages.py can change, so users may query on a language that is not
on the list anymore, even if it is still recognized by a few engines.

also made no and nb the same because they seem to return the same,
though most engines will only support one or the other.
7 years ago
Adam Tauber fa26afafd8 [fix] handle missing mapsettings 8 years ago
marc e0c270bd72 tests for language support in engines 8 years ago
marc 93233c786a Refactor search language preference. 8 years ago
marc 727c287856 [fix] backwards compatibility with old language cookies 8 years ago
Noémi Ványi 299c882304 search: make language configurable from settings.yml 8 years ago