SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] add plugin sha sum check to be able to copy updated resources
Adam Tauber7b93d11d841a
diff --git a/searx/plugins/__init__.py b/searx/plugins/__init__.pyindex 66ff93c2a..8742dc2d6 100644--- a/searx/plugins/__init__.py+++ b/searx/plugins/__init__.py@@ -15,6 +15,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.(C) 2015 by Adam Tauber, <[email protected]>'''+from hashlib import sha256from importlib import import_modulefrom os.path import abspath, basename, dirname, exists, joinfrom shutil import copyfile@@ -109,7 +110,7 @@ def check_resource(base_path, resource_path, name, dir_prefix):file_name = basename(dep_path)resource_name = '{0}_{1}'.format('_'.join(name.split()), file_name)resource_path = join(static_path, 'plugins', dir_prefix, resource_name)- if not exists(resource_path):+ if not exists(resource_path) or sha_sum(dep_path) != sha_sum(resource_path):try:copyfile(dep_path, resource_path)except:@@ -133,6 +134,12 @@ def fix_package_resources(pkg, name):])+def sha_sum(filename):+ with open(filename,"rb") as f:+ bytes = f.read() # read entire file as bytes+ return sha256(bytes).hexdigest()++plugins = PluginStore()plugins.register(oa_doi_rewrite)plugins.register(https_rewrite)