summaryrefslogtreecommitdiff
path: root/docs/build-templates
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2020-06-19 04:51:29 +0000
committerGitHub <noreply@github.com>2020-06-19 04:51:29 +0000
commit1db37a0cc3622ce791851ebeb3db814c0a1f0c61 (patch)
tree3ca2436c9cae27ee3232cb362462d26e1e6effa9 /docs/build-templates
parent59739a44dbdcb59d8b45e25b907aa5761ca88e49 (diff)
parentc83007a6bcd2a7f765e7655b91cc6714fbc4ab01 (diff)
Merge branch 'master' into about-opensearch
Diffstat (limited to 'docs/build-templates')
-rw-r--r--docs/build-templates/filtron.rst52
-rw-r--r--docs/build-templates/morty.rst52
-rw-r--r--docs/build-templates/searx.rst192
3 files changed, 296 insertions, 0 deletions
diff --git a/docs/build-templates/filtron.rst b/docs/build-templates/filtron.rst
new file mode 100644
index 000000000..83a451820
--- /dev/null
+++ b/docs/build-templates/filtron.rst
@@ -0,0 +1,52 @@
+.. START create user
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ $ 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"
+
+.. END create user
+
+.. START install go
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: bash
+
+ $ cat > "$GO_ENV" <<EOF
+ export GOPATH=${SERVICE_HOME}/go-apps
+ export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
+ EOF
+ $ sudo -i -u "${SERVICE_USER}"
+ (${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
+ (${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
+ (${SERVICE_USER}) $ wget --progress=bar -O "${GO_TAR}" \\
+ "${GO_PKG_URL}"
+ (${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local/go -xzf "${GO_TAR}"
+ (${SERVICE_USER}) $ which go
+ ${SERVICE_HOME}/local/go/bin/go
+
+.. END install go
+
+.. START install filtron
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: bash
+
+ $ sudo -i -u "${SERVICE_USER}"
+ (${SERVICE_USER}) $ go get -v -u github.com/asciimoo/filtron
+
+.. END install filtron
diff --git a/docs/build-templates/morty.rst b/docs/build-templates/morty.rst
new file mode 100644
index 000000000..4a5d1f27f
--- /dev/null
+++ b/docs/build-templates/morty.rst
@@ -0,0 +1,52 @@
+.. START create user
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ $ 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"
+
+.. END create user
+
+.. START install go
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: bash
+
+ $ cat > "$GO_ENV" <<EOF
+ export GOPATH=${SERVICE_HOME}/go-apps
+ export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
+ EOF
+ $ sudo -i -u "${SERVICE_USER}"
+ (${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
+ (${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
+ (${SERVICE_USER}) $ wget --progress=bar -O "${GO_TAR}" \\
+ "${GO_PKG_URL}"
+ (${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local/go -xzf "${GO_TAR}"
+ (${SERVICE_USER}) $ which go
+ ${SERVICE_HOME}/local/go/bin/go
+
+.. END install go
+
+.. START install morty
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: bash
+
+ $ sudo -i -u "${SERVICE_USER}"
+ (${SERVICE_USER}) $ go get -v -u github.com/asciimoo/morty
+
+.. END install morty
diff --git a/docs/build-templates/searx.rst b/docs/build-templates/searx.rst
new file mode 100644
index 000000000..5cb70e95f
--- /dev/null
+++ b/docs/build-templates/searx.rst
@@ -0,0 +1,192 @@
+.. template evaluated by: ./utils/searx.sh docs
+.. 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
+
+.. 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
+
+.. START create user
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ $ 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"
+
+.. END create user
+
+.. START clone searx
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ $ sudo -H -u ${SERVICE_USER} -i
+ (${SERVICE_USER})$ git clone "https://github.com/asciimoo/searx.git" "$SEARX_SRC"
+
+.. END clone searx
+
+.. START create virtualenv
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ (${SERVICE_USER})$ python3 -m venv "${SEARX_PYENV}"
+ (${SERVICE_USER})$ echo ". ${SEARX_PYENV}/bin/activate" >> "$SERVICE_HOME/.profile"
+
+.. 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
+ $SEARX_PYENV/bin/python
+ Python 3.8.1
+
+ # update pip's boilerplate ..
+ pip install -U pip
+ pip install -U setuptools
+ pip install -U wheel
+
+ # jump to searx's working tree and install searx into virtualenv
+ (${SERVICE_USER})$ cd "$SEARX_SRC"
+ (${SERVICE_USER})$ pip install -e .
+
+
+.. END manage.sh update_packages
+
+.. START searx config
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ $ sudo -H cp "$SEARX_SRC/searx/settings.yml" "${SEARX_SETTINGS_PATH}"
+ $ sudo -H sed -i -e "s/ultrasecretkey/\\$(openssl rand -hex 16)/g" "$SEARX_SETTINGS_PATH"
+ $ sudo -H sed -i -e "s/{instance_name}/searx@\\$(uname -n)/g" "$SEARX_SETTINGS_PATH"
+
+.. END searx config
+
+.. START check searx installation
+
+.. tabs::
+
+ .. group-tab:: bash
+
+ .. code-block:: sh
+
+ # enable debug ..
+ $ sudo -H sed -i -e "s/debug : False/debug : True/g" "$SEARX_SETTINGS_PATH"
+
+ # start webapp
+ $ sudo -H -u ${SERVICE_USER} -i
+ (${SERVICE_USER})$ cd ${SEARX_SRC}
+ (${SERVICE_USER})$ export SEARX_SETTINGS_PATH="${SEARX_SETTINGS_PATH}"
+ (${SERVICE_USER})$ python searx/webapp.py
+
+ # disable debug
+ $ sudo -H sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS_PATH"
+
+Open WEB browser and visit http://$SEARX_INTERNAL_URL . If you are inside a
+container or in a script, test with curl:
+
+.. tabs::
+
+ .. group-tab:: WEB browser
+
+ .. code-block:: sh
+
+ $ xgd-open http://$SEARX_INTERNAL_URL
+
+ .. group-tab:: curl
+
+ .. code-block:: none
+
+ $ curl --location --verbose --head --insecure $SEARX_INTERNAL_URL
+
+ * 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
+ ...
+
+.. END check searx installation