mrpaulblack
38385e48cf
fix: return body on limiter block so there is not just a blank page
2 years ago
Alexandre Flament
ea0cddba0b
Merge pull request #1047 from return42/redis-lib
...
Add a redis library to generalize DB functions we need in SearXNG.
2 years ago
Markus Heiser
2de007138c
[fix] prepare for pylint 2.14.0
...
Remove issue reported by Pylint 2.14.0:
- no-self-use: has been moved to optional extension [1]
- The refactoring checker now also raises 'consider-using-generator' messages
for max(), min() and sum(). [2]
.pylintrc:
- <option name>-hint has been removed since long, Pylint 2.14.0 raises an
error on invalid options
- bad-continuation and bad-whitespace have been removed [3]
[1] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers
[2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/full.html#what-s-new-in-pylint-2-14-0
[2] https://pylint.pycqa.org/en/latest/whatsnew/2/2.6/summary.html#summary-release-highlights
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser
4b185f0e11
[mod] plugins/limiter.py - use searx.redislib.incr_sliding_window
...
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Émilien Devos
66b77c46c7
Fix typo
2 years ago
Alexandre Flament
9b3efa6d8a
theme: remove __common__
2 years ago
Markus Heiser
37493b0a1e
[doc] add some documentation about the limiter plugin (and redis)
...
Requested-by: https://github.com/searxng/searxng/discussions/993#discussioncomment-2396914
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Alexandre Flament
56e34947a6
[mod] infinite_scroll as preference
...
* oscar theme: code from searx/plugins/infinite_scroll.py
* simple theme: new implementation
Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
3 years ago
Alexandre Flament
29182eb1c9
Merge pull request #899 from dalf/limiter_update
...
[limiter] update
3 years ago
Markus Heiser
7352c6bc79
[mod] templates: rename field for <iframe> URL to iframe_src
...
Rename result field data_src to iframe_src
Suggested-by: @dalf https://github.com/searxng/searxng/pull/882#issuecomment-1037997402
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser
795e8af61d
[fix] hostname_replace.py: don't stop replace URL in fields
...
This is a rewrite of the hostname_replace.py that:
- don't stop to replace URL in fields ('data_src', 'audio_src') if there isn't a
'parsed_url',
- adds a comment about keep or remove a result from the result list
- adds a loop over ['data_src', 'audio_src'] instead of doubling code lines
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament
d1b7debac6
[limiter] update
3 years ago
Markus Heiser
98cab4cf75
[mod] result_templates/default.html replace embedded HTML by data_src audio_src
...
Embedded HTML breaks SearXNG architecture. To modularize, HTML is generated in
the templates (oscar & simple) and result parameter 'embedded' is replaced by
'data_src' (and 'audio_src'), an URL for embedded content (<iframe>).
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser
b9a2e8b387
[mod] hostname_replace: replace hostnames in result's data_src param
...
To test you need to redirect embeded videos (e.g.) from youtube to a invidios
instance. Search for videos using engine `!youtube lebowski`. The result URLs
and the embeded videos should link to the invidios instance.
Here is an example of such a `hostname_replace` configuration::
hostname_replace:
# youtube --> Invidious
'(.*\.)?youtube-nocookie\.com': 'invidio.xamh.de'
'(.*\.)?youtube\.com$': 'invidio.xamh.de'
'(.*\.)?invidious\.snopyta\.org$': 'invidio.xamh.de'
'(.*\.)?vid\.puffyan\.us': 'invidio.xamh.de'
'(.*\.)?invidious\.kavin\.rocks$': 'invidio.xamh.de'
'(.*\.)?inv\.riverside\.rocks$': 'invidio.xamh.de'
Closes: https://github.com/searxng/searxng/issues/873
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament
b99ccd7c02
plugin limiter: check only /image_proxy and /search
...
also adjust the number of req/time
3 years ago
Alexandre Flament
f79b0fce06
[enh] limiter plugin
...
can replace filtron:
* rate limite the number of request per IP and per (IP, User-Agent)
* block some bots
use Redis
data stored in Redis never contains the IP addresses, only HMAC using the secret_key
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Martin Fischer
6d43cf7952
[typing] add optional attrs to Plugin
3 years ago
Martin Fischer
bb06758a7b
[refactor] add type hints & remove Setting._post_init
...
Previously the Setting classes used a horrible _post_init
hack that prevented proper type checking.
3 years ago
Markus Heiser
3d96a9839a
[format.python] initial formatting of the python code
...
This patch was generated by black [1]::
make format.python
[1] https://github.com/psf/black
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser
fcdc2c2cd2
[format.python] disable py code formatting for some hunks of code
...
Disable the python code formatting from python-black, where the readability of
code suffers by formatting.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser
5731b6b700
[mod] searx.plugins.prepare_package_resources() - use generators
...
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser
aa5a5147b2
[fix] searx.plugins.initialize() - don't miss module & module-name
...
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament
2b4fef7118
plugins: refactor initialization
...
add a new function "init" call when the app starts.
The function can:
* return False to disable the plugin.
* modify the Flask app.
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
b941763e20
[mod] ahmia_filter: use on_result instead of post_search
...
see commit 6c9ae7911e9639bc46cd53af215734b4bdb61ba9
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
3f3b5d6181
[mod] plugins: minor change
...
required attributes: display a different message
when the attribute has the wrong type
3 years ago
Alexandre Flament
881659ca9d
[mod] oscar theme: /preferences : HTML detail order match visual tabs
...
First details about the general tab, then detail about UI tab, etc...
No functionnal change
3 years ago
Alexandre Flament
f83b64270c
[mod] oscar theme /preferences: reorganize the preferences
...
close #115
3 years ago
Alexandre Flament
4b07df62e5
[mod] move all default settings into searx.settings_defaults
3 years ago
Markus Heiser
247c46c6b0
[drop] plugin HTTPS rewrite - rule base is to old (update is to big)
...
The usefulness of the _HTTPS rewrite_ plugin is questionable:
- the 36 rule files have not been updated since 2015 [1]
- actual there are 23760 rule files in the https-everywhere repo [2]
For the first, we can remove this plugin. For a complete new implementation, it
might be good to know that there is a project "https-everywhere : Privacy for
Pythons" [3]
related: https://github.com/return42/searx-next/issues/8
[1] https://github.com/return42/searx-next/tree/d187a1d/searx/plugins/https_rules
[2] https://github.com/EFForg/https-everywhere/tree/master/src/chrome/content/rules
[3] https://github.com/jayvdb/https-everywhere-py
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
3nprob
2ca0aa4f29
Remove hubsbpot tracking URL params
...
More information here:
https://knowledge.hubspot.com/settings/how-do-i-create-a-tracking-url
https://knowledge.hubspot.com/ads/ad-tracking-in-hubspot
https://knowledge.hubspot.com/ctas/calls-to-action-frequently-asked-questions
https://meta.stackexchange.com/questions/263392/what-are-these-very-long-parameters-in-so-careers-feedback-always-welcome-url
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
Alexandre Flament
b00d108673
[mod] pylint: numerous minor code fixes
4 years ago
Alexandre Flament
3038052c79
[mod] remove unused import
...
use
from searx.engines.duckduckgo import _fetch_supported_languages, supported_languages_url # NOQA
so it is possible to easily remove all unused import using autoflake:
autoflake --in-place --recursive --remove-all-unused-imports searx tests
4 years ago
Alexandre Flament
5e7060053c
[mod] ahmia_filter.py: minor changes
...
- use result['parsed_url']
- load ahmia_blacklist.txt in searx.datae
4 years ago
Marc Abonce Seguin
32957cdf49
add Ahmia filter plugin for onion results
4 years ago
Venca24
2b93e70a26
[fix] code style
4 years ago
Venca24
1cbcf2ccb6
[mod] adapt hash plugin to current version of searx
4 years ago
Venca24
40c552c11e
[fix] hash plugin
4 years ago
Venca24
69e5a58058
[fix] code style
4 years ago
Venca24
1ea9438f5d
[fix] hash plugin
4 years ago
Venca24
c9593c8ffd
[enh] add plugin converting strings into hash digests
4 years ago
Adam Tauber
a05c660e30
[enh] add ability to set enabled plugins from settings - closes #1613 #778
4 years ago
Dalf
c225db45c8
Drop Python 2 (4/n): SearchQuery.query is a str instead of bytes
4 years ago
Dalf
1022228d95
Drop Python 2 (1/n): remove unicode string and url_utils
4 years ago
Noémi Ványi
74013c212a
Revert "[enh] new plugin to open results on new browser tabs"
...
This reverts commit ab6a7601cb
.
Closes #2037
4 years ago
Adam Tauber
93ac4db312
[enh] copy atime_ns and mtime_ns of external plugin resources
4 years ago
Adam Tauber
164e4725f3
[mod] add dedicated directory to external plugins with gitignore file
4 years ago
Adam Tauber
3f60bb470a
[fix] correct imported modules
4 years ago