Commit Graph

4916 Commits (385dce213b3541feadcb820fdb49a8c7d6a39fc2)
 

Author SHA1 Message Date
Alexandre Flament f8793fbda0 [fix] logger per engine: make .logger is always initialized
the openstreetmap engine imports code from the wikidata engine.
before this commit, specific code make sure to copy the logger variable to the wikidata engine.

with this commit searx.engines.load_engine makes sure the .logger is initialized.
The implementation scans sys.modules for module name starting with searx.engines.
3 years ago
Markus Heiser 3f2c10ef9c [fix] manage help(): commands babel.* has been renamed to weblate.*
In commit 97355672c the functions named babel.* has been renamed to weblate.*
but it was forgotten to change it also in the help().

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser c3473480f4
Merge pull request #314 from MrPaulBlack/engine-stats-link
Engine stats link
3 years ago
MrPaulBlack 644ccf16be [theme] make engine stats clickable 3 years ago
MrPaulBlack 48d4296caa [theme] link to engine stats in footer 3 years ago
Markus Heiser ecd6ca86d0
Merge pull request #308 from dalf/plugin_hostname_replace
[enh] add hostname_replace plugin
3 years ago
Alexandre Flament 0f43b39eac [enh] add hostname_replace plugin
* backport of https://github.com/searx/searx/pull/2724
* allow to remove result if the replacement is the boolean value false
3 years ago
Alexandre Flament 2de95af923
Merge pull request #313 from dalf/fix-pr-257
[fix] PR #257: use the image_proxy network instead of the default network
3 years ago
Alexandre Flament 2b53d718e4 [fix] PR #257: use the image_proxy network instead of the default network 3 years ago
Alexandre Flament 6abc37efc7 [mod] production mode: make sure to set the log level to WARNING
set:
* the root logger level to WARNING
* the werkzeug logger level to WARNING (useful when there is no uwsgi)
3 years ago
Alexandre Flament 0e42db9da1 [mod] xpath engine: remove logging of the requested URL 3 years ago
Alexandre Flament 91a6d80e82 [mod] debug mode: log HTTP requests with network name
For example wikipedia requests use the logger name "searx.network.wikipedia"

Log is disable when searx_debug is False
3 years ago
Alexandre Flament 577998106a [mod] debug mode: use coloredlogs package
in debug mode, add some padding to make the output more readable
in procution mode, add the timestamp
3 years ago
Alexandre Flament b513917ef9 [mod] searx.metrics & searx.search: use the engine loggers
metrics & processors use the engine logger
3 years ago
Markus Heiser 76e0f6807c
Merge pull request #311 from dalf/fix-pr-302
[fix] searx/results.py: strip result['content'] only if it exists
3 years ago
Alexandre Flament d9658a7f91 [fix] searx/results.py: strip result['content'] only if it exists
fix PR #302
3 years ago
Markus Heiser 13a4d20e8d
Merge pull request #306 from dalf/docs-brand
[doc] searxng brand
3 years ago
Alexandre Flament 75daef8986
Merge pull request #309 from searxng/ci-python-3.10.0-rc.2
[ci] add Python 3.10.0-rc.2
3 years ago
Alexandre Flament ca73a37679
[ci] add Python 3.10.0-rc.2 3 years ago
Alexandre Flament 4833d85e2e [doc] update copyright notice and HTML title 3 years ago
Markus Heiser b671e0364f
Merge pull request #302 from dalf/mod_plugin_on_result
[mod] plugin: call on_result for each result of each engines.
3 years ago
Alexandre Flament 0b27c8698f [doc] update docs/dev/plugins.rst 3 years ago
Markus Heiser 449ff70898
Merge pull request #307 from dalf/remove-transifex-ref
[fix] remove references to transifex
3 years ago
Alexandre Flament 70c9bb6f2c [fix] remove references to transifex 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 1973e4ecf6
Merge pull request #303 from return42/fix-README
[fix] README - fix minor typo
3 years ago
Markus Heiser dad82cac1a [fix] README - fix minor typo
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
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