2020-04-03 18:26:20 +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\" \\
|
|
|
|
--comment \"Privacy-respecting metasearch engine\" $SERVICE_USER
|
2020-04-03 18:26:20 +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-04-03 18:26:20 +00:00
|
|
|
|
|
|
|
.. END create user
|
|
|
|
|
|
|
|
.. START install go
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
2021-11-16 17:03:34 +00:00
|
|
|
.. group-tab:: os: linux / arch: amd64
|
|
|
|
|
2020-04-03 18:26:20 +00:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-10-27 16:06:37 +00:00
|
|
|
$ cat > \"$GO_ENV\" <<EOF
|
2020-04-03 18:26:20 +00:00
|
|
|
export GOPATH=${SERVICE_HOME}/go-apps
|
|
|
|
export PATH=\$PATH:${SERVICE_HOME}/local/go/bin:\$GOPATH/bin
|
|
|
|
EOF
|
2020-10-27 16:06:37 +00:00
|
|
|
$ sudo -i -u \"${SERVICE_USER}\"
|
2020-04-03 18:26:20 +00:00
|
|
|
(${SERVICE_USER}) $ echo 'source $GO_ENV' >> ~/.profile
|
|
|
|
(${SERVICE_USER}) $ mkdir ${SERVICE_HOME}/local
|
2021-11-16 17:03:34 +00: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 18:26:20 +00:00
|
|
|
(${SERVICE_USER}) $ which go
|
|
|
|
${SERVICE_HOME}/local/go/bin/go
|
|
|
|
|
|
|
|
.. END install go
|
|
|
|
|
|
|
|
.. START install morty
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: bash
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-10-27 16:06:37 +00:00
|
|
|
$ sudo -i -u \"${SERVICE_USER}\"
|
2020-04-03 18:26:20 +00:00
|
|
|
(${SERVICE_USER}) $ go get -v -u github.com/asciimoo/morty
|
|
|
|
|
|
|
|
.. END install morty
|