searxng/docs/build-templates/searxng.rst
Markus Heiser fe6bac5a08 [fix] pip install -e: legacy editable install (setup.py develop) is deprecated
From [1]: There is now a standardized mechanism [2] for an installer like pip to
request an editable install of a project.  pip is transitioning to using this
standard only instead of invoking the deprecated `setup.py develop` command.

For backward compatibility, we can use switches:

--use-pep517
  https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-use-pep517

--no-build-isolation
  https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-build-isolation

- [1] https://github.com/pypa/pip/issues/11457
- [2] https://peps.python.org/pep-0660/

Closes: https://github.com/searxng/searxng/issues/3701
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-08-21 12:09:14 +02:00

4.2 KiB

Ubuntu / debian

$ sudo -H apt-get install -y \\

${debian}

Arch Linux

$ sudo -H pacman -S --noconfirm \\

${arch}

Fedora / RHEL

$ sudo -H dnf install -y \\

${fedora}

Ubuntu / debian

$ sudo -H apt-get install -y \\

${debian_build}

Arch Linux

$ sudo -H pacman -S --noconfirm \\

${arch_build}

Fedora / RHEL

$ sudo -H dnf install -y \\

${fedora_build}

bash

$ sudo -H useradd --shell /bin/bash --system \\
    --home-dir \"$SERVICE_HOME\" \\
    --comment 'Privacy-respecting metasearch engine' \\
    $SERVICE_USER

$ sudo -H mkdir \"$SERVICE_HOME\"
$ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"

bash

$ sudo -H -u ${SERVICE_USER} -i
(${SERVICE_USER})$ git clone \"$GIT_URL\" \\
                   \"$SEARXNG_SRC\"

bash

(${SERVICE_USER})$ python3 -m venv \"${SEARXNG_PYENV}\"
(${SERVICE_USER})$ echo \". ${SEARXNG_PYENV}/bin/activate\" \\
                   >>  \"$SERVICE_HOME/.profile\"

bash

$ sudo -H -u ${SERVICE_USER} -i

(${SERVICE_USER})$ command -v python && python --version
$SEARXNG_PYENV/bin/python
Python 3.8.1

# update pip's boilerplate ..
pip install -U pip
pip install -U setuptools
pip install -U wheel
pip install -U pyyaml

# jump to SearXNG's working tree and install SearXNG into virtualenv
(${SERVICE_USER})$ cd \"$SEARXNG_SRC\"
(${SERVICE_USER})$ pip install --use-pep517 --no-build-isolation -e .

Use default settings

$ sudo -H mkdir -p \"$(dirname ${SEARXNG_SETTINGS_PATH})\"
$ sudo -H cp \"$SEARXNG_SRC/utils/templates/etc/searxng/settings.yml\" \\
             \"${SEARXNG_SETTINGS_PATH}\"

minimal setup

$ sudo -H sed -i -e \"s/ultrasecretkey/\$(openssl rand -hex 16)/g\" \\
              \"$SEARXNG_SETTINGS_PATH\"

bash

# enable debug ..
$ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARXNG_SETTINGS_PATH\"

# start webapp
$ sudo -H -u ${SERVICE_USER} -i
(${SERVICE_USER})$ cd ${SEARXNG_SRC}
(${SERVICE_USER})$ export SEARXNG_SETTINGS_PATH=\"${SEARXNG_SETTINGS_PATH}\"
(${SERVICE_USER})$ python searx/webapp.py

# disable debug
$ sudo -H sed -i -e \"s/debug : True/debug : False/g\" \"$SEARXNG_SETTINGS_PATH\"

Open WEB browser and visit http://$SEARXNG_INTERNAL_HTTP . If you are inside a container or in a script, test with curl:

WEB browser

$ xdg-open http://$SEARXNG_INTERNAL_HTTP

curl

$ curl --location --verbose --head --insecure $SEARXNG_INTERNAL_HTTP

*   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
...