Skip to content

Dustcloud Installation

Achilleas Pipinellis edited this page Jan 16, 2020 · 26 revisions

Preparations on the Vacuum Robot

See Preparations on the Vacuum Robots

Requirements

  • MySQL/MariaDB Database server
  • Webserver with PHP
  • php-mysqli
  • Python3
  • python-miio
  • composer (Dependency Manager for PHP)

Installation on Ubuntu 16.04 (Server)

  1. We assume that we want to install dustcloud to /opt and that it should not run as root:

    apt update
    apt install git
    git clone --depth=1 https://github.com/dgiese/dustcloud.git
    mv dustcloud/dustcloud /opt/
    apt install apache2 mysql-server php7.0-zip composer libapache2-mod-php7.0 php7.0-mysql python3-pip virtualenv python3-mysql python3-cryptography python3-pil php7.0-curl python3-pymysql python3-bottle
    cp docker/dustcloud.conf /etc/apache2/conf-enabled/
    cd /opt/dustcloud/www
    composer install
    cp /opt/dustcloud/config.sample.ini /opt/dustcloud/config.ini
    cat /opt/dustcloud/setup.sql | mysql -p
    cat /opt/dustcloud/dustcloud.sql | mysql dustcloud -D dustcloud -p
    chown www-data:www-data /opt/dustcloud/www/cache
    pip3 install python-miio    
  2. Edit /etc/apache2/ports.conf and change Listen 80 to Listen 2080.

  3. Edit /etc/apache2/sites-enables/000-default.conf and change :80 to :2080.

  4. Set up the firewall rules:

    sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 1080  
    su -c "python3 /opt/dustcloud/server.py --enable-live-map --http-proxy localhost:2080 -sport 1080" -s /bin/sh - www-data

Content of setup.sql:

CREATE USER 'dustcloud'@'localhost' IDENTIFIED by 'dustcloud';
GRANT USAGE ON *.* TO 'dustcloud'@'localhost';
CREATE DATABASE IF NOT EXISTS dustcloud`;
GRANT ALL PRIVILEGES ON dustcloud.* TO 'dustcloud'@'localhost';

Content of dustcloud.conf:

Alias /dustcloud /opt/dustcloud/www/public
<Directory /opt/dustcloud/www/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Require all granted
</Directory>