[fix] doc - add missing quotation marks in docs/build-templates

Escape the all the quotation marks (" --> \") in docs/build-templates.

The scripts are *bash evaluated* (e.g)::

  eval "echo \"$(< "${REPO_ROOT}/docs/build-templates/searx.rst")\""

Backslash, quotation marks and other need to be escaped.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-10-27 17:06:37 +01:00 committed by Alexandre Flament
parent d553de4909
commit dd23ad8ba2
3 changed files with 33 additions and 33 deletions

View File

@ -7,11 +7,11 @@
.. code-block:: sh .. code-block:: sh
$ sudo -H useradd --shell /bin/bash --system \\ $ sudo -H useradd --shell /bin/bash --system \\
--home-dir "$SERVICE_HOME" \\ --home-dir \"$SERVICE_HOME\" \\
--comment "Privacy-respecting metasearch engine" $SERVICE_USER --comment \"Privacy-respecting metasearch engine\" $SERVICE_USER
$ sudo -H mkdir "$SERVICE_HOME" $ sudo -H mkdir \"$SERVICE_HOME\"
$ sudo -H chown -R "$SERVICE_GROUP:$SERVICE_GROUP" "$SERVICE_HOME" $ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
.. END create user .. END create user
@ -23,16 +23,16 @@
.. code-block:: bash .. code-block:: bash
$ cat > "$GO_ENV" <<EOF $ cat > \"$GO_ENV\" <<EOF
export GOPATH=${SERVICE_HOME}/go-apps export GOPATH=${SERVICE_HOME}/go-apps
export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
EOF EOF
$ sudo -i -u "${SERVICE_USER}" $ sudo -i -u \"${SERVICE_USER}\"
(${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile (${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
(${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local (${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
(${SERVICE_USER}) $ wget --progress=bar -O "${GO_TAR}" \\ (${SERVICE_USER}) $ wget --progress=bar -O \"${GO_TAR}\" \\
"${GO_PKG_URL}" \"${GO_PKG_URL}\"
(${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local -xzf "${GO_TAR}" (${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local -xzf \"${GO_TAR}\"
(${SERVICE_USER}) $ which go (${SERVICE_USER}) $ which go
${SERVICE_HOME}/local/go/bin/go ${SERVICE_HOME}/local/go/bin/go
@ -46,7 +46,7 @@
.. code-block:: bash .. code-block:: bash
$ sudo -i -u "${SERVICE_USER}" $ sudo -i -u \"${SERVICE_USER}\"
(${SERVICE_USER}) $ go get -v -u github.com/asciimoo/filtron (${SERVICE_USER}) $ go get -v -u github.com/asciimoo/filtron
.. END install filtron .. END install filtron

View File

@ -7,11 +7,11 @@
.. code-block:: sh .. code-block:: sh
$ sudo -H useradd --shell /bin/bash --system \\ $ sudo -H useradd --shell /bin/bash --system \\
--home-dir "$SERVICE_HOME" \\ --home-dir \"$SERVICE_HOME\" \\
--comment "Privacy-respecting metasearch engine" $SERVICE_USER --comment \"Privacy-respecting metasearch engine\" $SERVICE_USER
$ sudo -H mkdir "$SERVICE_HOME" $ sudo -H mkdir \"$SERVICE_HOME\"
$ sudo -H chown -R "$SERVICE_GROUP:$SERVICE_GROUP" "$SERVICE_HOME" $ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
.. END create user .. END create user
@ -23,16 +23,16 @@
.. code-block:: bash .. code-block:: bash
$ cat > "$GO_ENV" <<EOF $ cat > \"$GO_ENV\" <<EOF
export GOPATH=${SERVICE_HOME}/go-apps export GOPATH=${SERVICE_HOME}/go-apps
export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
EOF EOF
$ sudo -i -u "${SERVICE_USER}" $ sudo -i -u \"${SERVICE_USER}\"
(${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile (${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
(${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local (${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
(${SERVICE_USER}) $ wget --progress=bar -O "${GO_TAR}" \\ (${SERVICE_USER}) $ wget --progress=bar -O \"${GO_TAR}\" \\
"${GO_PKG_URL}" \"${GO_PKG_URL}\"
(${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local/go -xzf "${GO_TAR}" (${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local/go -xzf \"${GO_TAR}\"
(${SERVICE_USER}) $ which go (${SERVICE_USER}) $ which go
${SERVICE_HOME}/local/go/bin/go ${SERVICE_HOME}/local/go/bin/go
@ -46,7 +46,7 @@
.. code-block:: bash .. code-block:: bash
$ sudo -i -u "${SERVICE_USER}" $ sudo -i -u \"${SERVICE_USER}\"
(${SERVICE_USER}) $ go get -v -u github.com/asciimoo/morty (${SERVICE_USER}) $ go get -v -u github.com/asciimoo/morty
.. END install morty .. END install morty

View File

@ -64,11 +64,11 @@ ${fedora_build}
.. code-block:: sh .. code-block:: sh
$ sudo -H useradd --shell /bin/bash --system \\ $ sudo -H useradd --shell /bin/bash --system \\
--home-dir "$SERVICE_HOME" \\ --home-dir \"$SERVICE_HOME\" \\
--comment 'Privacy-respecting metasearch engine' $SERVICE_USER --comment 'Privacy-respecting metasearch engine' $SERVICE_USER
$ sudo -H mkdir "$SERVICE_HOME" $ sudo -H mkdir \"$SERVICE_HOME\"
$ sudo -H chown -R "$SERVICE_GROUP:$SERVICE_GROUP" "$SERVICE_HOME" $ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
.. END create user .. END create user
@ -81,7 +81,7 @@ ${fedora_build}
.. code-block:: sh .. code-block:: sh
$ sudo -H -u ${SERVICE_USER} -i $ sudo -H -u ${SERVICE_USER} -i
(${SERVICE_USER})$ git clone "https://github.com/searx/searx.git" "$SEARX_SRC" (${SERVICE_USER})$ git clone \"https://github.com/searx/searx.git\" \"$SEARX_SRC\"
.. END clone searx .. END clone searx
@ -93,8 +93,8 @@ ${fedora_build}
.. code-block:: sh .. code-block:: sh
(${SERVICE_USER})$ python3 -m venv "${SEARX_PYENV}" (${SERVICE_USER})$ python3 -m venv \"${SEARX_PYENV}\"
(${SERVICE_USER})$ echo ". ${SEARX_PYENV}/bin/activate" >> "$SERVICE_HOME/.profile" (${SERVICE_USER})$ echo \". ${SEARX_PYENV}/bin/activate\" >> \"$SERVICE_HOME/.profile\"
.. END create virtualenv .. END create virtualenv
@ -118,7 +118,7 @@ ${fedora_build}
pip install -U wheel pip install -U wheel
# jump to searx's working tree and install searx into virtualenv # jump to searx's working tree and install searx into virtualenv
(${SERVICE_USER})$ cd "$SEARX_SRC" (${SERVICE_USER})$ cd \"$SEARX_SRC\"
(${SERVICE_USER})$ pip install -e . (${SERVICE_USER})$ pip install -e .
@ -132,9 +132,9 @@ ${fedora_build}
.. code-block:: sh .. code-block:: sh
$ sudo -H cp "$SEARX_SRC/searx/settings.yml" "${SEARX_SETTINGS_PATH}" $ 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/ultrasecretkey/\\$(openssl rand -hex 16)/g\" \"$SEARX_SETTINGS_PATH\"
$ sudo -H sed -i -e "s/{instance_name}/searx@\\$(uname -n)/g" "$SEARX_SETTINGS_PATH" $ sudo -H sed -i -e \"s/{instance_name}/searx@\\$(uname -n)/g\" \"$SEARX_SETTINGS_PATH\"
.. END searx config .. END searx config
@ -147,16 +147,16 @@ ${fedora_build}
.. code-block:: sh .. code-block:: sh
# enable debug .. # enable debug ..
$ sudo -H sed -i -e "s/debug : False/debug : True/g" "$SEARX_SETTINGS_PATH" $ sudo -H sed -i -e \"s/debug : False/debug : True/g\" \"$SEARX_SETTINGS_PATH\"
# start webapp # start webapp
$ sudo -H -u ${SERVICE_USER} -i $ sudo -H -u ${SERVICE_USER} -i
(${SERVICE_USER})$ cd ${SEARX_SRC} (${SERVICE_USER})$ cd ${SEARX_SRC}
(${SERVICE_USER})$ export SEARX_SETTINGS_PATH="${SEARX_SETTINGS_PATH}" (${SERVICE_USER})$ export SEARX_SETTINGS_PATH=\"${SEARX_SETTINGS_PATH}\"
(${SERVICE_USER})$ python searx/webapp.py (${SERVICE_USER})$ python searx/webapp.py
# disable debug # disable debug
$ sudo -H sed -i -e "s/debug : True/debug : False/g" "$SEARX_SETTINGS_PATH" $ 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 Open WEB browser and visit http://$SEARX_INTERNAL_URL . If you are inside a
container or in a script, test with curl: container or in a script, test with curl: