2022-06-14 08:02:50 +00:00
|
|
|
.. template evaluated by: ./utils/searxng.sh searxng.doc.rst
|
2020-03-03 15:26:02 +00:00
|
|
|
.. hint: all dollar-names are variables, dollar sign itself is quoted by: \\$
|
|
|
|
|
|
|
|
.. START distro-packages
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Ubuntu / debian
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H apt-get install -y \\
|
|
|
|
${debian}
|
|
|
|
|
|
|
|
.. group-tab:: Arch Linux
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H pacman -S --noconfirm \\
|
|
|
|
${arch}
|
|
|
|
|
|
|
|
.. group-tab:: Fedora / RHEL
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H dnf install -y \\
|
|
|
|
${fedora}
|
|
|
|
|
|
|
|
.. END distro-packages
|
|
|
|
|
2020-03-31 16:25:40 +00:00
|
|
|
.. START build-packages
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Ubuntu / debian
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H apt-get install -y \\
|
|
|
|
${debian_build}
|
|
|
|
|
|
|
|
.. group-tab:: Arch Linux
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H pacman -S --noconfirm \\
|
|
|
|
${arch_build}
|
|
|
|
|
|
|
|
.. group-tab:: Fedora / RHEL
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H dnf install -y \\
|
|
|
|
${fedora_build}
|
|
|
|
|
|
|
|
.. END build-packages
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. START create user
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H useradd --shell /bin/bash --system \\
|
2020-10-27 16:06:37 +00:00
|
|
|
--home-dir \"$SERVICE_HOME\" \\
|
2022-06-14 08:02:50 +00:00
|
|
|
--comment 'Privacy-respecting metasearch engine' \\
|
|
|
|
$SERVICE_USER
|
2020-03-03 15:26:02 +00:00
|
|
|
|
2020-10-27 16:06:37 +00:00
|
|
|
$ sudo -H mkdir \"$SERVICE_HOME\"
|
|
|
|
$ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. END create user
|
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. START clone searxng
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H -u ${SERVICE_USER} -i
|
2022-06-14 08:02:50 +00:00
|
|
|
(${SERVICE_USER})$ git clone \"$GIT_URL\" \\
|
|
|
|
\"$SEARXNG_SRC\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. END clone searxng
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. START create virtualenv
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
2022-05-27 16:41:08 +00:00
|
|
|
(${SERVICE_USER})$ python3 -m venv \"${SEARXNG_PYENV}\"
|
2022-06-14 08:02:50 +00:00
|
|
|
(${SERVICE_USER})$ echo \". ${SEARXNG_PYENV}/bin/activate\" \\
|
|
|
|
>> \"$SERVICE_HOME/.profile\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. END create virtualenv
|
|
|
|
|
|
|
|
.. START manage.sh update_packages
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H -u ${SERVICE_USER} -i
|
|
|
|
|
|
|
|
(${SERVICE_USER})$ command -v python && python --version
|
2022-05-27 16:41:08 +00:00
|
|
|
$SEARXNG_PYENV/bin/python
|
2020-03-03 15:26:02 +00:00
|
|
|
Python 3.8.1
|
|
|
|
|
2020-05-21 13:46:43 +00:00
|
|
|
# update pip's boilerplate ..
|
|
|
|
pip install -U pip
|
|
|
|
pip install -U setuptools
|
|
|
|
pip install -U wheel
|
[fix] setup.py requires pyyaml installed
pip install -e .
...
Obtaining file:///usr/local/searx/searx-src
ERROR: Command errored out with exit status 1:
command: /usr/local/searx/searx-pyenv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/usr/local/searx/searx-src/setup.py'"'"'; __file__='"'"'/usr/local/searx/searx-src/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-vzer91m2
cwd: /usr/local/searx/searx-src/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/searx/searx-src/setup.py", line 10, in <module>
from searx.version import VERSION_STRING
File "/usr/local/searx/searx-src/searx/__init__.py", line 19, in <module>
import searx.settings_loader
File "/usr/local/searx/searx-src/searx/settings_loader.py", line 8, in <module>
import yaml
ModuleNotFoundError: No module named 'yaml'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-01-16 07:58:13 +00:00
|
|
|
pip install -U pyyaml
|
2020-05-21 13:46:43 +00:00
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
# jump to SearXNG's working tree and install SearXNG into virtualenv
|
2022-05-27 16:41:08 +00:00
|
|
|
(${SERVICE_USER})$ cd \"$SEARXNG_SRC\"
|
2020-05-21 13:46:43 +00:00
|
|
|
(${SERVICE_USER})$ pip install -e .
|
|
|
|
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. END manage.sh update_packages
|
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. START searxng config
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
2020-12-08 19:19:10 +00:00
|
|
|
.. group-tab:: Use default settings
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
2021-10-02 15:18:05 +00:00
|
|
|
$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
|
2022-05-27 16:41:08 +00:00
|
|
|
$ sudo -H cp \"$SEARXNG_SRC/utils/templates/etc/searxng/settings.yml\" \\
|
2021-10-02 15:18:05 +00:00
|
|
|
\"${SEARXNG_SETTINGS_PATH}\"
|
2020-12-08 19:19:10 +00:00
|
|
|
|
|
|
|
.. group-tab:: minimal setup
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
2022-06-14 08:02:50 +00:00
|
|
|
$ sudo -H sed -i -e \"s/ultrasecretkey/\$(openssl rand -hex 16)/g\" \\
|
|
|
|
\"$SEARXNG_SETTINGS_PATH\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. END searxng config
|
2020-03-03 15:26:02 +00:00
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. START check searxng installation
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
# enable debug ..
|
2021-10-02 15:18:05 +00:00
|
|
|
$ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARXNG_SETTINGS_PATH\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
# start webapp
|
|
|
|
$ sudo -H -u ${SERVICE_USER} -i
|
2022-05-27 16:41:08 +00:00
|
|
|
(${SERVICE_USER})$ cd ${SEARXNG_SRC}
|
2021-10-02 15:18:05 +00:00
|
|
|
(${SERVICE_USER})$ export SEARXNG_SETTINGS_PATH=\"${SEARXNG_SETTINGS_PATH}\"
|
2020-03-03 15:26:02 +00:00
|
|
|
(${SERVICE_USER})$ python searx/webapp.py
|
|
|
|
|
|
|
|
# disable debug
|
2021-10-02 15:18:05 +00:00
|
|
|
$ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARXNG_SETTINGS_PATH\"
|
2020-03-03 15:26:02 +00:00
|
|
|
|
2022-05-27 16:41:08 +00:00
|
|
|
Open WEB browser and visit http://$SEARXNG_INTERNAL_HTTP . If you are inside a
|
2020-03-03 15:26:02 +00:00
|
|
|
container or in a script, test with curl:
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: WEB browser
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
2022-05-27 16:41:08 +00:00
|
|
|
$ xdg-open http://$SEARXNG_INTERNAL_HTTP
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
.. group-tab:: curl
|
|
|
|
|
|
|
|
.. code-block:: none
|
|
|
|
|
2022-05-27 16:41:08 +00:00
|
|
|
$ curl --location --verbose --head --insecure $SEARXNG_INTERNAL_HTTP
|
2020-03-03 15:26:02 +00:00
|
|
|
|
|
|
|
* Trying 127.0.0.1:8888...
|
|
|
|
* TCP_NODELAY set
|
|
|
|
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
|
|
|
|
> HEAD / HTTP/1.1
|
|
|
|
> Host: 127.0.0.1:8888
|
|
|
|
> User-Agent: curl/7.68.0
|
|
|
|
> Accept: */*
|
|
|
|
>
|
|
|
|
* Mark bundle as not supporting multiuse
|
|
|
|
* HTTP 1.0, assume close after body
|
|
|
|
< HTTP/1.0 200 OK
|
|
|
|
HTTP/1.0 200 OK
|
|
|
|
...
|
|
|
|
|
2021-11-18 17:27:26 +00:00
|
|
|
.. END check searxng installation
|