diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-06-15 15:35:02 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-06-15 15:35:02 +0200 |
commit | bccdc9c369893631bce0d150b09997b5dccbb232 (patch) | |
tree | 4e4708ae6b6060b3101715cacbf45839b6d606a7 /searx | |
parent | 00bd4baf7323e97c7c62d4f2f83121bbbdedf596 (diff) | |
download | abslibre-bccdc9c369893631bce0d150b09997b5dccbb232.tar.gz abslibre-bccdc9c369893631bce0d150b09997b5dccbb232.tar.bz2 abslibre-bccdc9c369893631bce0d150b09997b5dccbb232.zip |
pcr: Add searx
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/0003-Fix-deprecated-werkzeug-import.patch | 43 | ||||
-rw-r--r-- | searx/PKGBUILD | 68 | ||||
-rw-r--r-- | searx/searx.ini | 33 | ||||
-rw-r--r-- | searx/searx.install | 13 | ||||
-rw-r--r-- | searx/searx.sysusers | 1 |
5 files changed, 158 insertions, 0 deletions
diff --git a/searx/0003-Fix-deprecated-werkzeug-import.patch b/searx/0003-Fix-deprecated-werkzeug-import.patch new file mode 100644 index 000000000..ca6e27cec --- /dev/null +++ b/searx/0003-Fix-deprecated-werkzeug-import.patch @@ -0,0 +1,43 @@ +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/searx/PKGBUILD b/searx/PKGBUILD new file mode 100644 index 000000000..f9b6fc859 --- /dev/null +++ b/searx/PKGBUILD @@ -0,0 +1,68 @@ +# Maintainer (AUR): Jake <aur@ja-ke.tech> +# 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. + +pkgname=searx +pkgver=0.16.0 +pkgrel=2 +pkgrel+=par1 +pkgdesc="A privacy-respecting, hackable metasearch engine (python(3) based)" +arch=('any') +url="https://asciimoo.github.io/searx/" +license=('AGPL3') +makedepends=('openssl') +install="${pkgname}.install" +depends=( + 'uwsgi' + 'uwsgi-plugin-python' + 'python-certifi' + 'python-flask' + 'python-flask-babel' + 'python-lxml' + 'python-idna' + 'python-pygments' + 'python-pyopenssl' + 'python-dateutil' + 'python-yaml' + 'python-requests' + 'python-pysocks') +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" + 'searx.ini' + 'searx.sysusers' + '0003-Fix-deprecated-werkzeug-import.patch') +sha512sums=('3ae4e4c295830e65eefbd39ed9885b60a42a4d4db4d87c179ace76cf43f8c75d49f1363f019bedd135c0597191612e16592cacd159ae97a42a25dcc2fee9d00b' + '6e1e7771e747e2bcb9cbc3e5ec9735461b6d791c0c0412e06e7dd802c18625edd0916de32164bf780c18ef7b6a87f55ed1e917377b3adb2bf53c0344f34b49e8' + '6856e26451fe053d37c2ce4b9d5f3b35891dd8ec702c5256c02d04415124c57705abc497f12943948a85621bb0238d26c2c1f3a7bf42404a6ff1487c7655909e' + '064738f57b8bfbd937d56c592f7321140aab5f894e8ea457ae0d2d9407523f58471f4ba7424968f1d6db7fe51e4f8d360d1e997284eeb7b8528dbcf10f5f12dd') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + patch --forward --strip=1 --input="${srcdir}/0003-Fix-deprecated-werkzeug-import.patch" + + # Allow newer versions of the dependencies + sed -i "s|==|>=|g" requirements.txt +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + local _site_packages="$(python -c 'import site; print(site.getsitepackages()[0])')" + + python setup.py install --root="$pkgdir" --optimize=1 + + mv "${pkgdir}${_site_packages}"/{README.rst,requirements*,searx} + + mkdir -p "$pkgdir/etc/$pkgname" + mv "${pkgdir}${_site_packages}/$pkgname/settings.yml" $pkgdir/etc/$pkgname/ + ln -s /etc/$pkgname/settings.yml "${pkgdir}${_site_packages}/$pkgname/settings.yml" + + install -Dm644 "${srcdir}/searx.sysusers" "${pkgdir}/usr/lib/sysusers.d/searx.conf" + install -Dm644 "${srcdir}/searx.ini" "${pkgdir}/etc/uwsgi/searx.ini" +} diff --git a/searx/searx.ini b/searx/searx.ini new file mode 100644 index 000000000..7681436a1 --- /dev/null +++ b/searx/searx.ini @@ -0,0 +1,33 @@ +[uwsgi]
+http-socket = :8888
+
+# Who will run the code
+uid = searx
+gid = searx
+
+# disable logging for privacy
+disable-logging = false
+
+# Number of workers (usually CPU count)
+workers = 4
+
+# The right granted on the created socket
+chmod-socket = 666
+
+# Plugin to use and interpretor config
+single-interpreter = true
+master = true
+plugin = python
+lazy-apps = true
+enable-threads = true
+
+# Settings path for AUR package
+env = SEARX_SETTINGS_PATH=/etc/searx/settings.yml
+
+# Module to import
+module = searx.webapp
+
+# Virtualenv and python path
+#virtualenv = /usr/local/searx/searx-ve/
+#pythonpath = /usr/local/searx/
+#chdir = /usr/local/searx/searx/
diff --git a/searx/searx.install b/searx/searx.install new file mode 100644 index 000000000..7c0469198 --- /dev/null +++ b/searx/searx.install @@ -0,0 +1,13 @@ +generate_random_secret_key() { + # Generate a random secret key + sed -i -e "s/ultrasecretkey\" # change this!/`openssl rand -hex 32`\"/g" /etc/searx/settings.yml +} + +post_install() { + generate_random_secret_key +} + +post_upgrade() { + generate_random_secret_key +} + diff --git a/searx/searx.sysusers b/searx/searx.sysusers new file mode 100644 index 000000000..6cf038a44 --- /dev/null +++ b/searx/searx.sysusers @@ -0,0 +1 @@ +u searx - "Searx server user" |