summaryrefslogtreecommitdiff
path: root/searx
AgeCommit message (Collapse)Author
2021-05-21[pylint] searx/search/__init__.py & replace lic-text by SPDX tagMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-21[mod] remove gc.collect() after each user requestAlexandre Flament
2021-05-18[fix] unit test: don't load /etc/searx/settings.ymlAlexandre Flament
Add a new environment variable SEARX_DISABLE_ETC_SETTINGS to disable loading of /etc/searx/settings.yml unit tests: * set SEARX_DISABLE_ETC_SETTINGS to 1 * remove SEARX_SETTINGS_PATH if it exists
2021-05-18Merge pull request #81 from return42/csp-bar-graphAlexandre Flament
[fix] make /stats more CSP compliant
2021-05-17[static] make /stats more CSP compliant- make themes.allMarkus Heiser
Based on commits - 0507e185 [fix] bar graph and rename CSS class engine-scores -> engine-score - 3e9ad7ae [fix] make /stats more CSP compliant - github issue form - 34859d0e [fix] make /stats more CSP compliant - oscar theme - 0a6c4884 [fix] make /stats more CSP compliant - simple theme - cdfb4b7f [fix] make /stats more CSP compliant - bar graph - 965817f2 [fix] simple theme - generate missing sourceMap file this patch is generated by:: make themes.all Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] bar graph and rename CSS class engine-scores -> engine-scoreMarkus Heiser
- drop #main_stats selector in stats.less - 'engine-score' exists before this PR. - untabify searx/static/themes/__common__/less/stats.less for details see comment at: https://github.com/searxng/searxng/pull/81/files/d93bec7638908cae64530727d4e1539ae10bd144..1204e4f07e932029d66b4674a3474918228459a6#r633571496 Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] make /stats more CSP compliant - github issue formMarkus Heiser
Hide textarea from github issue form:: ./__common__/new_issue.html:6: <textarea name="body" style="display: none;">{{- '' -}} BTW: fix indentation. Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] make /stats more CSP compliant - oscar themeMarkus Heiser
Replace oscar theme's *styles* (see below) by CSP compliant implementation in ``searx/static/themes/__common__/less/stats.less`` :: ./oscar/stats.html:29: <th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th> ./oscar/stats.html:30: <th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th> ./oscar/stats.html:33: <th scope="col" style="text-align: right;">{{ th_sort('reliability', _('Reliability')) }}</th> ./oscar/stats.html:38: <td style="text-align: right;"> ./oscar/stats.html:91: <td style="text-align: right;"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td> ./oscar/stats.html:109: <tbody style="padding-top: 1rem;"> ./oscar/stats.html:112: <th scope="row" style="width: 10rem">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td> ./oscar/stats.html:114: <th scope="row" style="width: 10rem">{{ _('Message') }}</th><td>{{ error.log_message }}</td> ./oscar/stats.html:116: <th scope="row" style="width: 10rem">{{ _('Percentage') }}</th><td style="width: 10rem">{{ error.percentage }}</td> ./oscar/stats.html:121: <span style="border-right: 1px solid gray; padding: 0 1rem 0 0; margin: 0 0 0 0.5rem;">{{ param }}</span> ./oscar/stats.html:138: <th scope="col" style="width: 10rem">{{ _('Failed test') }}</th> Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] make /stats more CSP compliant - simple themeMarkus Heiser
Replace simple theme's *styles* (see below) by CSP compliant implementation in ``searx/static/themes/simple/less/stats.less`` :: ./simple/stats.html:26: <table style="max-width: 1280px; margin: 0 auto 0 0;"> ./simple/stats.html:28: <th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th> ./simple/stats.html:29: <th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th> ./simple/stats.html:32: <th scope="col" style="text-align: right;">{{ th_sort('reliability', _('Reliability')) }}</th> ./simple/stats.html:37: <td style="text-align: right;"> ./simple/stats.html:90: <td style="text-align: right;"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td> ./simple/stats.html:106: <table style="max-width: 1280px; margin: 1rem; border: 1px solid gray;"> ./simple/stats.html:107: <tbody style="padding-top: 1rem;"> ./simple/stats.html:110: <th scope="row" style="width: 10rem">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td> ./simple/stats.html:112: <th scope="row" style="width: 10rem">{{ _('Message') }}</th><td>{{ error.log_message }}</td> ./simple/stats.html:114: <th scope="row" style="width: 10rem">{{ _('Percentage') }}</th><td style="width: 10rem">{{ error.percentage }}</td> ./simple/stats.html:119: <span style="border-right: 1px solid gray; padding: 0 1rem 0 0; margin: 0 0 0 0.5rem;">{{ param }}</span> ./simple/stats.html:136: <th scope="col" style="width: 10rem">{{ _('Failed test') }}</th> Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] make /stats more CSP compliant - bar graphMarkus Heiser
Replace bar graph's *styles* (see below) by CSP compliant implementation in ``searx/static/themes/__common__/less/stats.less`` :: ./simple/stats.html:49: <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}} ./simple/stats.html:57: <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}} ./simple/stats.html:58: <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}} ./oscar/stats.html:50: <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}} ./oscar/stats.html:58: <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}} ./oscar/stats.html:59: <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}} Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] simple theme - generate missing sourceMap fileMarkus Heiser
C&P from searx/static/themes/oscar/gruntfile.js Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[less] update grunt-contrib-less v3.3.0Markus Heiser
Upgraded [v3.3.0] otherwise:: ` width: calc(100% - 5rem);` becomes `width: 95%` once compiled by less version 1.4.1. [v3.3.0] https://github.com/gruntjs/grunt-contrib-less/releases/tag/v3.0.0 Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[fix] engine archive is - search_url has been changedMarkus Heiser
BTW: set soft_max_redirects from *archive is* by 1, to prevent logging:: DEBUG:httpx._client:HTTP Request: GET https://archive.is/search/?q=www.python.org "HTTP/2 302 Found" DEBUG:httpx._client:HTTP Request: GET https://archive.is/www.python.org "HTTP/2 200 OK" DEBUG:searx:archive is: ErrorContext('searx/search/processors/online.py', 110, 'count_error(self.engine_name,', None, '1 redirects, maximum: 0', ('200', 'OK', 'archive.is')) True Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-17[enh] xpath engine - add request parameter 'soft_max_redirects'Markus Heiser
Make 'soft_max_redirects' configurable per Xpath engine:: - name : <engine-name> engine : xpath soft_max_redirects: 1 ... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-14[fix] webapp.py: pylint: disable=assigning-non-slot for request.*Alexandre Flament
Note: actually, the code should use flask.g.* instead of request.*
2021-05-06[mod] Server-Timing header: add render fieldAlexandre Flament
Add a "render" field to the Server-Timing header This field is the time spent in the searx.webapp.render function (Jinja2 rendering) See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing
2021-05-05[mod] searx.network.client: the same configuration reuses the same ↵Alexandre Flament
ssl.SSLContext before there was one ssl.SSLContext per client. see https://github.com/encode/httpx/issues/978
2021-05-05[pylint] checker/__main__.py & checker/background.pyMarkus Heiser
Lint files that has been touched by [PR #58] [PR #58] https://github.com/searxng/searxng/pull/58 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-05[mod] multithreading only in searx.search.* packagesAlexandre Flament
it prepares the new architecture change, everything about multithreading in moved in the searx.search.* packages previously the call to the "init" function of the engines was done in searx.engines: * the network was not set (request not sent using the defined proxy) * it requires to monkey patch the code to avoid HTTP requests during the tests
2021-05-04Merge pull request #55 from searxng/upd-relialibility-columnMarkus Heiser
[themes] /preferences, reliablity: warning icons & error logs link
2021-05-04[mod] option to enable or disable "proxy" button next to each result (#54)Markus Heiser
* [mod] option to enable or disable "proxy" button next to each result Closes: https://github.com/searxng/searxng/issues/51 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de> Co-authored-by: Alexandre Flament <alex@al-f.net>
2021-05-04[themes] /preferences, reliablity: warning icons & error logs linkAlexandre Flament
When there is at least one errors or one failed checker test: * the warning icon is displayed in the reliability column * the link "View error logs and submit a bug report" is displayed on engine name tooltip. Before: * the warning icon was displayed only when one or more checker test(s) failed. * the link "View error logs and submit a bug report" was not shown when a checker test failed but there were no error.
2021-05-03Merge pull request #44 from searxng/dependabot/pip/master/pylint-2.8.2Markus Heiser
Bump pylint from 2.7.4 to 2.8.2
2021-05-03Bump pylint from 2.7.4 to 2.8.2dependabot[bot]
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.7.4 to 2.8.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.7.4...v2.8.2) Signed-off-by: dependabot[bot] <support@github.com>
2021-05-02fix Qwant's fetch_languages functionMarc Abonce Seguin
2021-05-01Merge pull request #49 from searxng/update_data_update_ahmia_blacklist.pyAlexandre Flament
Update searx.data - update_ahmia_blacklist.py
2021-05-01Merge pull request #50 from searxng/update_data_update_currencies.pyAlexandre Flament
Update searx.data - update_currencies.py
2021-05-01Merge pull request #48 from searxng/update_data_update_wikidata_units.pyAlexandre Flament
Update searx.data - update_wikidata_units.py
2021-05-01Update searx.data - update_currencies.pydalf
2021-05-01Update searx.data - update_ahmia_blacklist.pydalf
2021-05-01Update searx.data - update_wikidata_units.pydalf
2021-05-01Update searx.data - update_firefox_version.pydalf
2021-04-29Merge pull request #40 from searxng/link-to-statsAlexandre Flament
[mod] engine errors: link to the stats to create an github issue
2021-04-29[mod] UI: engine pref-page, about toolbox: add link to statsMarkus Heiser
In the preference page, in the 'about' toolbox of an engine, add a link to the stats page of the engine, if the engine had one or more errors. Condition is:: reliabilities[<engine.name>].errors Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-29[mod] engine errors: link to the stats to create an github issueAlexandre Flament
2021-04-29[fix] URL to solidtorrent result pageMichael Ilsaas
Reported-by: https://github.com/searx/searx/pull/2786
2021-04-28[static] make themes.all - from commit 9e8171e38Markus Heiser
Based on commit 9e8171e38 this patch is generated by:: make themes.all Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-28[fix] new_issue.html: drop inline style attributes (CSP conformance)Markus Heiser
Inline styles are blocked by default with Content Security Policy (CSP). Move the inline styles from 'new_issue.html' to:: searx/static/themes/__common__/less/new_issue.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-28[fix] simple theme - remove no longer used stats.less fileMarkus Heiser
File searx/static/themes/simple/less/stats.less is not used (imported) in any other less file. I can't say when it's usage was dropped or if it has ever been used. ATM this file is without any usage. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-28[fix] grunt/less/development: oscar light & dark logicodev mixes CSSMarkus Heiser
closes: https://github.com/searxng/searxng/issues/39 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-27[fix] searx.network: fix rare cases where LOOP is NoneAlexandre Flament
* searx.network.client.LOOP is initialized in a thread * searx.network.__init__ imports LOOP which may happen before the thread has initialized LOOP This commit adds a new function "searx.network.client.get_loop()" to fix this issue
2021-04-27Merge pull request #28 from searxng/mod-processors-error-messageAlexandre Flament
[mod] processors: show identical error messages on /search and /stats
2021-04-27[lint] pylint searx/search/processors files / BTW add some doc-stringsMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-27[mod] processors: show identical error messages on /search and /statsAlexandre Flament
2021-04-27[mod] searx.metrics.error_recorder: store relative file name instead of the ↵Alexandre Flament
full absolute file name.
2021-04-26[pylint] tag PYLINT_FILES by comment `# lint: pylint`Markus Heiser
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>
2021-04-26[upd] ./manage pyenv.cmd searx_extra/update/update_pygments.pyMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-26[fix] debug log: UnicodeEncodeError: 'ascii' codec can't encodeMarkus Heiser
The issue exists only in the debug log:: --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1086, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'ascii' codec can't encode characters in position 79-89: ordinal not in range(128) Call stack: File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask/app.py", line 2464, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/searx/searx-src/searx/webapp.py", line 1316, in __call__ return self.app(environ, start_response) File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/werkzeug/middleware/proxy_fix.py", line 169, in __call__ return self.app(environ, start_response) File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/searx/searx-src/searx/webapp.py", line 766, in search number_of_results=format_decimal(number_of_results), File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask_babel/__init__.py", line 458, in format_decimal locale = get_locale() File "/usr/local/searx/searx-pyenv/lib/python3.9/site-packages/flask_babel/__init__.py", line 226, in get_locale rv = babel.locale_selector_func() File "/usr/local/searx/searx-src/searx/webapp.py", line 249, in get_locale logger.debug("%s uses locale `%s` from %s", request.url, locale, locale_source) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-25Merge pull request #23 from searxng/metrics-stats-enginesAlexandre Flament
Metrics stats engines
2021-04-25[mod] /stats : detail per engineAlexandre Flament
allow to submit a github issue including the technical details (exceptions, errors, warning, checker result)