Skip to content

Installation

jmg1138 edited this page Nov 17, 2017 · 23 revisions

The unblinkingBot can be installed several different ways.

Using Docker

From Docker Hub

The fastest way to install the unblinkingBot is by pulling the Docker image from the Docker Hub registry.

Run the docker pull command:

docker pull nothingworksright/unblinkingbot:0.0.1

Build Docker Container

It is also possible to build the Docker image manually by cloning the source code repository and running the docker build command.

git clone https://github.com/nothingworksright/unblinkingbot.git
cd unblinkingbot
docker build --rm --no-cache -t nothingworksright/unblinkingbot:0.0.1 .

Using systemd

The unblinkingBot runs as a systemd service, even when running from inside of a Docker container. The unblinkingBot service may be installed directly instead of running inside of a container.

First, install dependencies. Most of these are for chromium/puppeteer.

sudo apt-get update && sudo apt install -y \
    curl \
    build-essential \
    gconf-service \
    libasound2 \
    libatk1.0-0 \
    libc6 \
    libcairo2 \
    libcups2 \
    libdbus-1-3 \
    libexpat1 \
    libfontconfig1 \
    libgcc1 \
    libgconf-2-4 \
    libgdk-pixbuf2.0-0 \
    libglib2.0-0 \
    libgtk-3-0 \
    libnspr4 \
    libpango-1.0-0 \
    libpangocairo-1.0-0 \
    libstdc++6 \
    libx11-6 \
    libx11-xcb1 \
    libxcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxext6 \
    libxfixes3 \
    libxi6 \
    libxrandr2 \
    libxrender1 \
    libxss1 \
    libxtst6 \
    ca-certificates \
    fonts-liberation \
    libappindicator1 \
    libnss3 \
    lsb-release \
    xdg-utils \
    wget

Next, install nodejs and yarn.

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt install yarn

Next, create the directories where the unblinkingBot code will live, clone the source code repository, and run yarn to install npm modules.

sudo mkdir -p /usr/local/unblinkingbot
cd /usr/local/unblinkingbot
sudo git init .
sudo git remove add origin https://github.com/nothingworksright/unblinkingbot.git
sudo git pull origin master
sudo yarn

It can be handy to store the unblinkingBot db files and the motionEye settings files on a mounted external drive, so that the applications can be quickly replaced without losing any custom settings. Wherever you choose to store your files, create symlinks so that they are available for the bot under /usr/local/unblinkingbot/db and /usr/local/unblinkingbot/motion/settings.

For example, if the unblinkingBot db files and motionEye conf files are stored on an external USB drive which has been mounted at /mnt/4tb and the files are organized like this...

user@machine:/mnt$ tree -L 4
.
└── 4tb
    ├── motion
    │   └── settings
    │       ├── core
    │       ├── motion.conf
    │       ├── motioneye.conf
    │       ├── prefs.json
    │       ├── thread-1.conf
    │       ├── thread-2.conf
    └── unblinkingbot
        └── db
            ├── 000003.log
            ├── CURRENT
            ├── LOCK
            ├── LOG
            └── MANIFEST-000002

Then these commands would create the proper symlinks.

sudo ln -s /mnt/4tb/unblinkingbot/db /usr/local/unblinkingbot/
sudo ln -s /mnt/4tb/motion /usr/local/unblinkingbot/

Last, copy the systemd service file into place, and enable the service.

sudo cp /usr/local/unblinkingbot/unblinkingbot.service /lib/systemd/system/unblinkingbot.service
sudo systemctl enable unblinkingbot.service
Clone this wiki locally