From 8be3704c3fbe08308132d92a6653cb9c3784ef9e Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 13 Nov 2017 10:56:58 +0100 Subject: profpatsch/searx: Rebase searx-secret-key.patch This build error is quite annoying, so I applied the patch on v0.11.0 and rebased it against v0.12.0. The only hunk that's failing is the import of get_secret_app_key in searx/webapp.py, so no big conflicts with the actual logic of the patch. Signed-off-by: aszlig Cc: @Profpatsch --- machines/profpatsch/patches/searx-secret-key.patch | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'machines/profpatsch') diff --git a/machines/profpatsch/patches/searx-secret-key.patch b/machines/profpatsch/patches/searx-secret-key.patch index 13d45291..ac26be7f 100644 --- a/machines/profpatsch/patches/searx-secret-key.patch +++ b/machines/profpatsch/patches/searx-secret-key.patch @@ -13,7 +13,7 @@ index a0bb12f..9e32b53 100644 For all the details, follow this `step by step diff --git a/searx/settings.yml b/searx/settings.yml -index 8515326..e65e5e8 100644 +index 17b0bd5..ce19764 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -10,7 +10,6 @@ search: @@ -25,7 +25,7 @@ index 8515326..e65e5e8 100644 image_proxy : False # Proxying image results through searx http_protocol_version : "1.0" # 1.0 and 1.1 are supported diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml -index dbaf2fd..2c8f7cf 100644 +index 070a0ed..27227f3 100644 --- a/searx/settings_robot.yml +++ b/searx/settings_robot.yml @@ -10,7 +10,6 @@ search: @@ -37,10 +37,10 @@ index dbaf2fd..2c8f7cf 100644 image_proxy : False http_protocol_version : "1.0" diff --git a/searx/utils.py b/searx/utils.py -index 35cb6f8..284087d 100644 +index 498f8d0..6588863 100644 --- a/searx/utils.py +++ b/searx/utils.py -@@ -2,6 +2,8 @@ import cStringIO +@@ -1,6 +1,8 @@ import csv import os import re @@ -49,7 +49,7 @@ index 35cb6f8..284087d 100644 from babel.dates import format_date from codecs import getincrementalencoder -@@ -300,3 +302,61 @@ def load_module(filename, module_dir): +@@ -312,3 +314,61 @@ def load_module(filename, module_dir): module = load_source(modname, filepath) module.name = modname return module @@ -112,27 +112,27 @@ index 35cb6f8..284087d 100644 + except OSError as e: + saError("could not be chmodded to 600", e) diff --git a/searx/webapp.py b/searx/webapp.py -index 929d9e2..31395af 100644 +index fcea5f2..9d7c960 100644 --- a/searx/webapp.py +++ b/searx/webapp.py -@@ -28,6 +28,7 @@ import hmac - import json - import os +@@ -29,6 +29,7 @@ import os + import sys + import requests +import xdg from searx import logger logger = logger.getChild('webapp') -@@ -59,7 +60,7 @@ from searx.engines import ( +@@ -58,7 +59,7 @@ from searx.engines import ( from searx.utils import ( - UnicodeWriter, highlight_content, html_to_text, get_themes, - get_static_files, get_result_templates, gen_useragent, dict_subset, -- prettify_url -+ prettify_url, get_secret_app_key + UnicodeWriter, highlight_content, html_to_text, get_resources_directory, + get_static_files, get_result_templates, get_themes, gen_useragent, +- dict_subset, prettify_url ++ dict_subset, prettify_url, get_secret_app_key ) from searx.version import VERSION_STRING from searx.languages import language_codes -@@ -103,7 +104,11 @@ app = Flask( +@@ -118,7 +119,11 @@ app = Flask( app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True @@ -145,7 +145,7 @@ index 929d9e2..31395af 100644 if not searx_debug or os.environ.get("WERKZEUG_RUN_MAIN") == "true": initialize_engines(settings['engines']) -@@ -265,7 +270,7 @@ def proxify(url): +@@ -273,7 +278,7 @@ def proxify(url): url.encode('utf-8'), hashlib.sha256).hexdigest() @@ -154,7 +154,7 @@ index 929d9e2..31395af 100644 urlencode(url_params)) -@@ -280,7 +285,7 @@ def image_proxify(url): +@@ -288,7 +293,7 @@ def image_proxify(url): if settings.get('result_proxy'): return proxify(url) @@ -163,7 +163,7 @@ index 929d9e2..31395af 100644 return '{0}?{1}'.format(url_for('image_proxy'), urlencode(dict(url=url.encode('utf-8'), h=h))) -@@ -684,7 +689,7 @@ def image_proxy(): +@@ -693,7 +698,7 @@ def image_proxy(): if not url: return '', 400 @@ -173,7 +173,7 @@ index 929d9e2..31395af 100644 if h != request.args.get('h'): return '', 400 diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py -index 0448079..7c88445 100644 +index eb40e62..b53aec2 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,4 +1,8 @@ @@ -183,9 +183,9 @@ index 0448079..7c88445 100644 +import stat + import mock + import sys from searx.testing import SearxTestCase - from searx import utils -@@ -99,3 +103,63 @@ class TestUnicodeWriter(SearxTestCase): +@@ -103,3 +107,63 @@ class TestUnicodeWriter(SearxTestCase): rows = [1, 2, 3] self.unicode_writer.writerows(rows) self.assertEqual(self.unicode_writer.writerow.call_count, len(rows)) -- cgit 1.4.1