2020-04-03 20:24:40 +02:00
|
|
|
.. START create user
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
$ sudo -H useradd --shell /bin/bash --system \\
|
2020-10-27 17:06:37 +01:00
|
|
|
--home-dir \"$SERVICE_HOME\" \\
|
|
|
|
--comment \"Privacy-respecting metasearch engine\" $SERVICE_USER
|
2020-04-03 20:24:40 +02:00
|
|
|
|
2020-10-27 17:06:37 +01:00
|
|
|
$ sudo -H mkdir \"$SERVICE_HOME\"
|
|
|
|
$ sudo -H chown -R \"$SERVICE_GROUP:$SERVICE_GROUP\" \"$SERVICE_HOME\"
|
2020-04-03 20:24:40 +02:00
|
|
|
|
|
|
|
.. END create user
|
|
|
|
|
|
|
|
.. START install go
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
2021-11-16 18:03:34 +01:00
|
|
|
.. group-tab:: os: linux / arch: amd64
|
|
|
|
|
2020-04-03 20:24:40 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-10-27 17:06:37 +01:00
|
|
|
$ cat > \"$GO_ENV\" <<EOF
|
2020-04-03 20:24:40 +02:00
|
|
|
export GOPATH=${SERVICE_HOME}/go-apps
|
|
|
|
export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
|
|
|
|
EOF
|
2020-10-27 17:06:37 +01:00
|
|
|
$ sudo -i -u \"${SERVICE_USER}\"
|
2020-04-03 20:24:40 +02:00
|
|
|
(${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
|
|
|
|
(${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
|
2021-11-16 18:03:34 +01:00
|
|
|
(${SERVICE_USER}) $ wget --progress=bar -O \"${GO_VERSION}.linux-amd64.tar.gz\" \\
|
|
|
|
\"${GO_DL_URL}/${GO_VERSION}.linux-amd64.tar.gz\"
|
|
|
|
(${SERVICE_USER}) $ tar -C ${SERVICE_HOME}/local -xzf \"${GO_VERSION}.linux-amd64.tar.gz\"
|
2020-04-03 20:24:40 +02:00
|
|
|
(${SERVICE_USER}) $ which go
|
|
|
|
${SERVICE_HOME}/local/go/bin/go
|
|
|
|
|
|
|
|
.. END install go
|
|
|
|
|
|
|
|
.. START install filtron
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-10-27 17:06:37 +01:00
|
|
|
$ sudo -i -u \"${SERVICE_USER}\"
|
2020-04-03 20:24:40 +02:00
|
|
|
(${SERVICE_USER}) $ go get -v -u github.com/asciimoo/filtron
|
|
|
|
|
|
|
|
.. END install filtron
|