Commit Graph

4841 Commits (0b27c8698f7b5bbca5083cf234fabbc7d7308349)
 

Author SHA1 Message Date
Alexandre Flament 0b27c8698f [doc] update docs/dev/plugins.rst 3 years ago
Alexandre Flament b941763e20 [mod] ahmia_filter: use on_result instead of post_search
see commit 6c9ae7911e9639bc46cd53af215734b4bdb61ba9
3 years ago
Alexandre Flament 660c180170 [mod] plugin: call on_result after each engine from the ResultContainer
Currently, searx.search.Search calls on_result once the engine results have been merged
(ResultContainer.order_results).

on_result plugins can rewrite the results: once the URL(s) are modified, even they can be merged,
it won't be the case since ResultContainer.order_results has already be called.

This commit call on_result inside for each result of each engines.
In addition the on_result function can return False to remove the result.

Note: the on_result function now run on the engine thread instead of the Flask thread.
3 years ago
Alexandre Flament fc20c561bf [mod] oa_doi_rewrite plugin: get_doi_resolver: remove args parameter
doi_resolvers.get_value('preferences') already contains the value from
request.args.get('doi_resolver')
3 years ago
Alexandre Flament a3789b3bb4
Merge pull request #295 from return42/fix-csp-2
[fix] make HTML templates more CSP compliant
3 years ago
Markus Heiser b0623ac9f6 [build] /static 3 years ago
Markus Heiser 0240ca9567 [fix] oscar template - merge the two class attributes into one
Suggested-by: @dalf https://github.com/searxng/searxng/pull/295#discussion_r703337237
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser bd830f7449 [fix] simple theme - preferences: fix tooltip overflow
Suggested-by: @dalf https://github.com/searxng/searxng/pull/295#discussion_r703370358
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament e41f78b806
Merge pull request #301 from return42/fix-lintrc
[pylint] .pylintrc - disable missing-function-docstring
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 f0059b80ed [pylint] engines: 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 5c86754340 [pylint] .pylintrc - disable 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 9068a72c6a [fix] oscar theme - preferences: rename col-checkbox/col-stat
[1] https://github.com/searxng/searxng/pull/295#discussion_r703318053
[2] https://github.com/searxng/searxng/pull/295#discussion_r703337237

Suggested-by: @dalf [1] [2]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 9ef7f38e4f
Merge pull request #300 from return42/fix-engine-pylint
[fix] drop useless pylint: disable=undefined-variable
3 years ago
Markus Heiser 82847df300 [fix] add 'categories' to PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES
androp no longer needed (see line 591 in 7b235a1)::

    # pylint: disable=undefined-variable

Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914068609
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser cd033b5416 [fix] drop useless pylint: disable=undefined-variable
Since 7b235a1 (see line 591) it is no longer needed to disable
'undefined-variable' for names defined in::

   PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES

Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914068609
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 222031e975 [fix] make oscar theme more CSP compliant - col-checkbox
Add col-checkbox in::

    searx/static/themes/oscar/src/less/preferences.less

Replaced style in file::

    searx/templates/oscar/preferences.html

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 9d106ae972 [fix] make oscar theme more CSP compliant - default-image-style
Add default-image-style in::

    searx/static/themes/oscar/src/less/result_templates.less

Replaced style= in files::

    ./oscar/result_templates/default.html:19:        <img src="{{ image_proxify(result.img_src or result.thumbnail) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
    ./oscar/result_templates/files.html:24:<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser e564cef0fe [fix] make /preferences more CSP compliant - simple & oscar theme
In simple & oscar theme remove ``style=`` properties which violates CSP but seem
not to have a magnification in GUI (UX).

Fixed files::

    ./oscar/preferences.html:25:<td class="{{ label }}" style="padding: 2px">{{- "" -}}
    ./simple/preferences.html:39:<td class="{{ label }}" style="padding: 2px; width: 13rem;">{{- "" -}}
    ./simple/preferences.html:77:    <div class="engine-tooltip" style="right: 12rem;" role="tooltip" id="{{engine_name}}_reliability">
    ./simple/preferences.html:258:     <p class="text-muted" style="margin:20px 0;">

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament f869e73d2f
Merge pull request #299 from dalf/fix-osm-workaround
[fix] fix openstreetmap engine
3 years ago
Alexandre Flament ea60c03827 [fix] fix openstreetmap engine
close #298

This is a workaround: inside engine code, any call to function in another engine can crash
since the logger won't be initialized except if it is done explicitly.
3 years ago
Alexandre Flament b57d776edb
Merge pull request #293 from dalf/fix-290
[fix] translation: lock weblate only when there is an actual change of messages.pot
3 years ago
Alexandre Flament 17e739a859
Merge pull request #296 from return42/engine-logger
one logger per engine
3 years ago
Markus Heiser aecfb2300d [mod] one logger per engine - drop obsolete logger.getChild
Remove the no longer needed `logger = logger.getChild(...)` from engines.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 7b235a1c36 [mod] one logger per engine
Suggested-by: @dalf in https://github.com/searxng/searxng/issues/98#issuecomment-849013518
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 2a5f690a71 [fix] translation: lock weblate only when there is an actual change of messages.pot
Close #290
3 years ago
Alexandre Flament a26e4eff10
Merge pull request #292 from return42/fix-csp
[fix] make HTML templates more CSP compliant
3 years ago
Markus Heiser 0d070fde92 [build] /static 3 years ago
Markus Heiser ad528c706e [fix] make result template map more CSP compliant - simple & oscar
Add osm-map-box in::

    searx/static/themes/__common__/less/result_templates.less

Replaced sty= in files::

    ./oscar/result_templates/map.html:64:        <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
    ./simple/result_templates/map.html:65:    <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div>

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 48c806954e [fix] make /preferences more CSP compliant - simple & oscar theme
in simple & oscar theme replace bar-graph's *styles* by CSP compliant
implementation in::

    searx/static/themes/__common__/less/stats.less

Fixed files::

    ./oscar/preferences.html:29:        <span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
    ./oscar/preferences.html:30:        <span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
    ./oscar/preferences.html:31:        <span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
    ./simple/preferences.html:43:        <span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
    ./simple/preferences.html:44:        <span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
    ./simple/preferences.html:45:        <span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 33ea1d5909
Merge pull request #289 from return42/fix-xpath
[fix] remove minimum length of content for XPath engine
3 years ago
Alexandre Flament 39bbd15b39
Merge pull request #287 from return42/azlyrics
[enh] add engine AZLyrics.com (XPath)
3 years ago
Alexandre Flament 3b1acdd5c5
Merge pull request #288 from return42/enh-brave
[enh] add suggestions to brave engine
3 years ago
Markus Heiser 9ff881f937 [fix] remove minimum length of content for XPath engine
Instead of raising an exception and therefore hiding all results of the engine.

It make sense to remove that requirement in order to allow the implementation of
search engines that do not always have a description.  In fact some search
engines that in 99% of the case have a description like Brave Search or Mojeek
crash completely if they for some reason included a result with no description.

To test this patch try Mojeek:

    !mjk xyz

before and after the patch.

Suggested-by: 0xhtml in https://github.com/searx/searx/discussions/2933
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 730073b850 [enh] add suggestions to brave engine
Suggestions should be added too.

    suggestion_xpath: //div[@class="text-gray h6"]/a

You can try it with:

    !brave recurzuoin

Suggested-by: @allendema in https://github.com/searx/searx/issues/2857#issuecomment-904837023
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Allen 0648757e7f [enh] add engine AZLyrics.com (XPath)
Upstream example query:
  https://search.azlyrics.com/search.php?q=The+verbal+acupunture&w=lyrics&p=1

Cherry picked from [1] and slightly modified to pass yamllint test.

[1] https://github.com/allendema/searx/commit/8b6d5a0e5

Reviewed-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 018537080c
Merge pull request #286 from return42/patches-from-allendema
Cherry pick some fixes from @allendema
3 years ago
Allen 08ac175236 [fix] Wording for Morty & Filtron error message 3 years ago
Allen a5a0a4e106 [fix] Correct engine name in for Rumble 3 years ago
Allen 49bbd250d9 [fix] Update about section of Invidious
Another website and new documentation
3 years ago
Markus Heiser ab4456b0d0
Merge pull request #281 from dalf/cleanup
Cleanup
3 years ago
Markus Heiser 16c19389a5
Merge pull request #285 from return42/fix-typo
[fix] typo in searx.webadapter.parse_lang
3 years ago
Markus Heiser df351937f4 [fix] typo in searx.webadapter.parse_lang
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 2f348216b0
Merge pull request #283 from searxng/update-readme
README.rst: differences with searx
3 years ago
Alexandre Flament 94458b4881 README.rst: differences with searx 3 years ago
Markus Heiser e94181337f
Merge pull request #282 from searxng/translations_update
Update translations
3 years ago
searxng-bot 3120c9ca79 [translations] update
4fd5bb5a - 2021-08-27 - Allan Nordhøy <epost@anotheragency.no>
3 years ago
Alexandre Flament a14ea6396e [mod] remove searx.raise_for_httperror
Not used anymore
3 years ago
Alexandre Flament a7d781c49d [mod] remove remaining references to locales in settings.yml
see #247
3 years ago
Alexandre Flament 3c377c0aa8 [mod] searx.webapp: code clean up 3 years ago