diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2023-12-04 15:19:50 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2023-12-04 16:26:54 -0500 |
commit | 1ce028e55e9fdb2fc259a53be04cebcce6410ffd (patch) | |
tree | 3045e7a4624deca94701073f0759e3c05b75cd6d | |
parent | 5d1808d2813fc47ff6425aa43e79782d41f740c0 (diff) |
[searx]: upgrade to v1.1.0
-rw-r--r-- | pcr/searx/0003-Fix-deprecated-werkzeug-import.patch | 43 | ||||
-rw-r--r-- | pcr/searx/PKGBUILD | 50 | ||||
-rw-r--r-- | pcr/searx/flask-babel-3.patch | 33 | ||||
-rw-r--r-- | pcr/searx/searx.ini | 3 |
4 files changed, 64 insertions, 65 deletions
diff --git a/pcr/searx/0003-Fix-deprecated-werkzeug-import.patch b/pcr/searx/0003-Fix-deprecated-werkzeug-import.patch deleted file mode 100644 index ca6e27cec..000000000 --- a/pcr/searx/0003-Fix-deprecated-werkzeug-import.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b8b13372c8fd3bfe978a1c724ab98b05348df054 Mon Sep 17 00:00:00 2001 -Message-Id: <b8b13372c8fd3bfe978a1c724ab98b05348df054.1581582658.git.git@rationality.eu> -In-Reply-To: <a818d3241df2cf010086f837a504b11983c3d55f.1581582658.git.git@rationality.eu> -References: <a818d3241df2cf010086f837a504b11983c3d55f.1581582658.git.git@rationality.eu> -From: Nicolas Gelot <nicolas.gelot@e.email> -Date: Thu, 6 Feb 2020 22:40:58 +0100 -Subject: [PATCH 3/6] Fix deprecated werkzeug import - -Close: #1830 -Signed-off-by: Nicolas Gelot <nicolas.gelot@e.email> ---- - requirements.txt | 2 +- - searx/webapp.py | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/requirements.txt b/requirements.txt -index 6e4df37a..ea4a5a7a 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1,6 +1,6 @@ - certifi==2019.3.9 - babel==2.7.0 --flask-babel==0.12.2 -+flask-babel==1.0.0 - flask==1.0.2 - idna==2.8 - jinja2==2.10.1 -diff --git a/searx/webapp.py b/searx/webapp.py -index aadefe6b..5ed9f127 100644 ---- a/searx/webapp.py -+++ b/searx/webapp.py -@@ -47,7 +47,7 @@ except: - from html import escape - from datetime import datetime, timedelta - from time import time --from werkzeug.contrib.fixers import ProxyFix -+from werkzeug.middleware.proxy_fix import ProxyFix - from flask import ( - Flask, request, render_template, url_for, Response, make_response, - redirect, send_from_directory --- -2.25.0 - diff --git a/pcr/searx/PKGBUILD b/pcr/searx/PKGBUILD index 08dab5e59..e3593d399 100644 --- a/pcr/searx/PKGBUILD +++ b/pcr/searx/PKGBUILD @@ -1,19 +1,22 @@ # Maintainer (aur): Jake <aur@ja-ke.tech> +# Maintainer: Parabola Hackers <dev@lists.parabola.nu> + + # parabola changes and rationale: -# - Fixed license -# - Moved random secret key generation in the .install: having that in -# prepare() is not obtimal even for AUR, but it still works fine in many -# cases because users run the package on the machine that compiles it, so -# even if it ends up in the package, it's not a big issue, unless users share -# the package as they are not aware of this issue in the first place. +# libre: +# - Fixed license name in 'license' array +# privacy: +# - Moved random secret key generation into an .install hook +# technical: +# - Renamed upstream source-ball + pkgname=searx -pkgver=0.16.0 +pkgver=1.1.0 pkgrel=2 -pkgrel+=par1 pkgdesc="A privacy-respecting, hackable metasearch engine (python(3) based)" arch=('any') -url="https://asciimoo.github.io/searx/" +url="https://searx.github.io/searx/" license=('AGPL3') makedepends=('openssl') install="${pkgname}.install" @@ -21,34 +24,37 @@ depends=( 'uwsgi' 'uwsgi-plugin-python' 'python-certifi' - 'python-flask' - 'python-flask-babel' + 'python-flask-babel' # sub dep: flask, babel, jinja 'python-lxml' 'python-idna' 'python-pygments' - 'python-pyopenssl' - 'python-dateutil' + 'python-dateutil' 'python-yaml' 'python-requests' - 'python-pysocks') + 'python-pysocks' + 'python-langdetect') conflicts=('searx-git' ) replaces=('searx-py3') backup=('etc/searx/settings.yml' 'etc/uwsgi/searx.ini') -source=("https://github.com/asciimoo/searx/archive/v$pkgver.zip" +source=(${pkgname}-${pkgver}.zip::https://github.com/searx/searx/archive/refs/tags/v1.1.0.zip + 'flask-babel-3.patch' 'searx.ini' - 'searx.sysusers' - '0003-Fix-deprecated-werkzeug-import.patch') -sha512sums=('3ae4e4c295830e65eefbd39ed9885b60a42a4d4db4d87c179ace76cf43f8c75d49f1363f019bedd135c0597191612e16592cacd159ae97a42a25dcc2fee9d00b' - '6e1e7771e747e2bcb9cbc3e5ec9735461b6d791c0c0412e06e7dd802c18625edd0916de32164bf780c18ef7b6a87f55ed1e917377b3adb2bf53c0344f34b49e8' - '6856e26451fe053d37c2ce4b9d5f3b35891dd8ec702c5256c02d04415124c57705abc497f12943948a85621bb0238d26c2c1f3a7bf42404a6ff1487c7655909e' - '064738f57b8bfbd937d56c592f7321140aab5f894e8ea457ae0d2d9407523f58471f4ba7424968f1d6db7fe51e4f8d360d1e997284eeb7b8528dbcf10f5f12dd') + 'searx.sysusers') +sha512sums=('ed92199913353ed246ff30c516402326e9eac0f439b4519d6500b516f9ef73e73d0b25d894c078fb9b65870f2b10a09777d1ae068d13c8e10c91ec14de450b1e' + '1db543553aa4989e1cb9fb449a1c4badfd5a1c8e39afc99b5f894557ba74b9293b64d02882919ce9f2e4c108a6cd3b7acb51043e98bc3bab40e69078fbe8813f' + '476a4297c51681a9a92c6db3933359cc5a8ec292e45b229d98608ef2906b80c173868a30df06c329204c6f9371736a5bb322239860199526fd559780b37a2d0a' + '6856e26451fe053d37c2ce4b9d5f3b35891dd8ec702c5256c02d04415124c57705abc497f12943948a85621bb0238d26c2c1f3a7bf42404a6ff1487c7655909e') prepare() { cd "$srcdir/$pkgname-$pkgver" - patch --forward --strip=1 --input="${srcdir}/0003-Fix-deprecated-werkzeug-import.patch" + + patch -Np1 < ../flask-babel-3.patch # Allow newer versions of the dependencies sed -i "s|==|>=|g" requirements.txt + + # Generate a random secret key + # parabola does this in the .install hook (privacy concern) } package() { diff --git a/pcr/searx/flask-babel-3.patch b/pcr/searx/flask-babel-3.patch new file mode 100644 index 000000000..a575a0e04 --- /dev/null +++ b/pcr/searx/flask-babel-3.patch @@ -0,0 +1,33 @@ +diff --git a/searx/webapp.py b/searx/webapp.py +index e37eaf73..96bac1c0 100755 +--- a/searx/webapp.py ++++ b/searx/webapp.py +@@ -141,7 +141,6 @@ if not werkzeug_reloader\ + or (werkzeug_reloader and os.environ.get("WERKZEUG_RUN_MAIN") == "true"): + search_initialize(enable_checker=True) + +-babel = Babel(app) + + rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'fa_IR', 'glk', 'he', + 'ku', 'mzn', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi'] +@@ -188,7 +187,6 @@ def _get_browser_or_settings_language(request, lang_list): + return settings['search']['default_lang'] or 'en' + + +-@babel.localeselector + def get_locale(): + if 'locale' in request.form\ + and request.form['locale'] in settings['locales']: +@@ -217,6 +215,12 @@ def get_locale(): + + return locale + ++babel = Babel() ++if hasattr(babel, "localeselector"): ++ babel.init_app(app) ++ babel.localeselector(get_locale) ++else: ++ babel.init_app(app, locale_selector=get_locale) + + # code-highlighter + @app.template_filter('code_highlighter') diff --git a/pcr/searx/searx.ini b/pcr/searx/searx.ini index 7681436a1..ee7d3c142 100644 --- a/pcr/searx/searx.ini +++ b/pcr/searx/searx.ini @@ -31,3 +31,6 @@ module = searx.webapp #virtualenv = /usr/local/searx/searx-ve/
#pythonpath = /usr/local/searx/
#chdir = /usr/local/searx/searx/
+
+# Cache: https://uwsgi-docs.readthedocs.io/en/latest/Caching.html
+cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
|