1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-05 04:40:11 +01:00
Commit Graph

2928 Commits

Author SHA1 Message Date
Markus Heiser
2ac3e5b20b [fix] log messages from: google- images, news, scholar, videos
- HTTP header Accept-Language --> lang_info['headers']['Accept-Language']
- remove obsolete query_url log messages which is already logged by
  httpx._client:HTTP request

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-11 16:31:50 +02:00
Markus Heiser
1ac3961336 [mod] google - get_lang_info add documentataion & comments
BTW: remove obsolete log messages from google engine

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-11 16:06:36 +02:00
Alexandre Flament
1c67b6aece [enh] google engine: supports "default language"
Same behaviour behaviour than Whoogle [1].  Only the google engine with the
"Default language" choice "(all)"" is changed by this patch.

When searching for a locate place, the result are in the expect language,
without missing results [2]:

  > When a language is not specified, the language interpretation is left up to
  > Google to decide how the search results should be delivered.

The query parameters are copied from Whoogle.  With the ``all`` language:

- add parameter ``source=lnt``
- don't use parameter ``lr``
- don't add a ``Accept-Language`` HTTP header.

The new signature of function ``get_lang_info()`` is:

    lang_info = get_lang_info(params, lang_list, custom_aliases, supported_any_language)

Argument ``supported_any_language`` is True for google.py and False for the other
google engines.  With this patch the function now returns:

- query parameters: ``lang_info['params']``
- HTTP headers: ``lang_info['headers']``
- and as before this patch:
  - ``lang_info['subdomain']``
  - ``lang_info['country']``
  - ``lang_info['language']``

[1] https://github.com/benbusby/whoogle-search
[2] https://github.com/benbusby/whoogle-search/releases/tag/v0.5.4
2021-06-10 10:22:01 +02:00
Alexandre Flament
73dbee45a6
Merge pull request #90 from searxng/enh-osm-engine
[enh] improve openstreetmap engine
2021-06-10 09:30:41 +02:00
Markus Heiser
15178e5b96 [static] make themes.all - based on commit 12af3b39
Based on commit 12af3b39 this patch is generated by::

    make themes.all

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-10 09:20:51 +02:00
Markus Heiser
12af3b39db [fix] make simple/result_templates/map.html more CSP compliant [1]
[1] https://github.com/searxng/searxng/issues/57

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-09 18:08:23 +02:00
Markus Heiser
bf10b4a857 [fix] openstreetmap - fix some minor whitespace & indentation issues
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-09 18:08:23 +02:00
Markus Heiser
5cf1ae2672 [pylint] searx/data/__init__.py
BTW: add doc strings and moved __all__ to the top [1]

[1] https://www.python.org/dev/peps/pep-0008/#module-level-dunder-names

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-09 18:08:23 +02:00
Alexandre Flament
2e5d823162 [fix] searx/data/__init__.py: rename __init__ as __all__ 2021-06-09 18:08:23 +02:00
Alexandre Flament
c75425655f [enh] openstreetmap / map template: improve results
implements ideas described in #69

* update the engine
* use wikidata
* update map.html template
2021-06-09 18:08:23 +02:00
Alexandre Flament
92c8a8829f [fix] strip spaces from searx user agent
h11 (used by httpx) rejects HTTP request with a trailing space in HTTP headers
2021-06-09 18:08:23 +02:00
Alexandre Flament
2a109d0a5f [mod] refactor searx.webapp.render
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 15:54:11 +02:00
Alexandre Flament
70bbd14b1a [mod] move hook to set Unix thread name into searx.unixthreadname
requires setproctitle (but optional)
2021-06-08 15:54:11 +02:00
Alexandre Flament
0e23113f70 [mod] remove unused filter searx.webapp.extract_domain
it was used in the pix-art theme
2021-06-08 15:54:11 +02:00
Alexandre Flament
cfa07b0a9a [mod] refactor searx.webapp.render
no functional change, reorder declarations
2021-06-08 15:54:11 +02:00
Alexandre Flament
91856e8f6a [mod] refactor searx.webapp.render: remove unused parameters 2021-06-08 15:54:11 +02:00
Alexandre Flament
15567955b4 [mod] remove check of Python 2. 2021-06-08 15:54:11 +02:00
Alexandre Flament
aedf0aa5fe [mod] remove searx.webapp.get_base_url function
see the result of:
git grep "base_url" searx/templates
"base_url" is not used any more.
2021-06-08 15:54:11 +02:00
Alexandre Flament
eeb0998787 [mod] refactor: move Flask proxy fix to searx.flaskfix module 2021-06-08 15:54:11 +02:00
Markus Heiser
5c5db719d2
Merge pull request #97 from return42/drop-searx-admin
[docs] reorder blog articles
2021-06-08 10:56:18 +00:00
Markus Heiser
5a7b12ee6f [yamllint] searx/settings.yml
Fixed messages reported by::

    make test.yamllint

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05 17:41:24 +02:00
Markus Heiser
4e845966ba [yamllint] searx/settings_robot.yml
Fixed messages reported by::

    make test.yamllint

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05 17:41:24 +02:00
Alexandre Flament
cf2b549967 Update engines_languages.json 2021-06-04 16:17:22 +02:00
Alexandre Flament
8194db4e21 [fix] peertube fetch supported languages
close #127
2021-06-04 16:17:20 +02:00
Markus Heiser
f122cb0e27 [fix] typo: online_dictionnary --> online_dictionary
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-04 15:05:58 +02:00
Markus Heiser
79cc82a4db [docs] add engine "Demo Online Engine"
This engine just exists for documentation purpose.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-04 15:05:58 +02:00
Markus Heiser
1c8cf1d3a8 [docs] add engine "Demo Offline Engine"
This engine just exists for documentation purpose.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-04 15:04:38 +02:00
Markus Heiser
d910519ba1
Merge pull request #128 from searxng/debug-settings-reload-on-change
[enh] flask debug mode: reload the app when searx/settings.yml changes
2021-06-04 05:34:11 +00:00
Alexandre Flament
a7d575c099 [enh] flask debug mode: reload the app when searx/settings.yml changes 2021-06-03 12:03:38 +02:00
Alexandre Flament
7457f3fe40
Merge pull request #124 from return42/searx-merge
merge redis offline engine from searx
2021-06-02 12:35:33 +02:00
Markus Heiser
39c18274c6 [fix] enigine redis - avoid error when the engine is loaded
Should be _redis_client to avoid an error when the engine is loaded.

Suggested-by: @dalf https://github.com/searxng/searxng/pull/124#pullrequestreview-673885664
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-02 09:54:58 +02:00
Markus Heiser
60dc91f234 [static] make /stats more CSP compliant- make themes.all
Based on commit:

- a89b823f [mod] remove overpass API call

this patch is generated by::

     make themes.all

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01 17:54:31 +02:00
Alexandre Flament
a89b823f8d [mod] remove overpass API call
prepare the code the PR #90
2021-06-01 17:52:49 +02:00
Alexandre Flament
8375974dff [fix] sys.exit(1) when there is duplicate engine name 2021-06-01 16:37:20 +02:00
Markus Heiser
8908937046 [mod] searx.engines.load_engine return None instead of sys.exit(1)
Loading an engine should not exit the application (*). Instead
of exit, return None.

(*) RuntimeError still exit the application: syntax error, etc...

BTW: add documentation and normalize indentation (no functional change)

Suggested-by: @dalf https://github.com/searxng/searxng/pull/116#issuecomment-851865627
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01 16:35:17 +02:00
Alexandre Flament
70a9208972 [mod] searx.engines.__init__: refactoring 2021-06-01 16:32:40 +02:00
Alexandre Flament
e3f4a77311
Merge pull request #110 from searxng/mod-default-settings
[mod] move all default settings into searx.settings_defaults
2021-06-01 16:13:04 +02:00
Markus Heiser
495d86b520 [pylint] searx/__init__.py & searx/settings_defaults.py
BTW: normalize some indentations in searx/settings_defaults.py

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01 16:03:19 +02:00
Adam Tauber
e4b6558339 [enh] add redis offline engine / https://redis.io/
Slightly modified merge of commit [97269be6], [01a8a5814a] and [c8d2b5eb] from
searx.

[97269be6] https://github.com/searx/searx/commit/97269be6
[01a8a581] https://github.com/searx/searx/commit/01a8a581
[c8d2b5eb] https://github.com/searx/searx/commit/c8d2b5eb

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01 11:51:25 +02:00
Adam Tauber
e33858d6ef [fix] correct kv template formatting and remove internal data
Slightly modified merge of commit [ea7ccf24] from searx.

[ea7ccf24] https://github.com/searx/searx/commit/ea7ccf24

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01 10:53:37 +02:00
Alexandre Flament
925c21ce42
Merge pull request #122 from searxng/update_data_update_ahmia_blacklist.py
Update searx.data - update_ahmia_blacklist.py
2021-06-01 10:03:50 +02:00
Alexandre Flament
3266738e7a
Merge pull request #121 from searxng/update_data_update_currencies.py
Update searx.data - update_currencies.py
2021-06-01 10:03:35 +02:00
Alexandre Flament
54ae95b95b
Merge pull request #120 from searxng/update_data_update_wikidata_units.py
Update searx.data - update_wikidata_units.py
2021-06-01 10:03:22 +02:00
dalf
43d06e8224 Update searx.data - update_ahmia_blacklist.py 2021-06-01 08:01:50 +00:00
dalf
e53ed4742c Update searx.data - update_currencies.py 2021-06-01 08:01:48 +00:00
dalf
666a25314a Update searx.data - update_wikidata_units.py 2021-06-01 08:01:45 +00:00
dalf
9f3a455777 Update searx.data - update_firefox_version.py 2021-06-01 08:01:33 +00:00
Alexandre Flament
6fa114c9ba [mod] settings_default: remove searx.search.max_request_timeout global variable 2021-06-01 08:10:15 +02:00
Alexandre Flament
4b07df62e5 [mod] move all default settings into searx.settings_defaults 2021-06-01 08:10:15 +02:00
Alexandre Flament
6ca74386d6
[fix] mankier: fix paging
See https://github.com/searxng/searxng/pull/111#issuecomment-851641967
2021-05-31 22:33:40 +02:00