Home Control

Home Control is a simple application created to monitor Linux servers on a local network. The idea is to have a small, power efficient machine (such as a Raspberry Pi) act as a hub so you can leave your more powerful and power-hungry machines powered off until you need them.

Features

  • Monitoring: Home Control allows you to easily see the server status, its MAC address, and IP address.

  • Power On: Home Control allows you to power your machine on by sending a magic packet via wakeonlan. This must be configured on your machine, both in the BIOS and in the OS. See this how-to from Ubuntu to get an idea of how to enable it within Linux. The process should be similar for most distros.

  • Restart/Shut Down: Home Control allows for remote restarting and powering off of your machines. You must install add-on Home Control Monitor on the machine for which you would like to enable this functionality. See the Home Control Monitor page for more information.

Installation

For now, Home Control Monitor must be installed manually. This will hopefully be updated to be available as a Linux Snap in the near future.

Before you get started, you will need sqlite3 installed, if you don't already have it. If you're on a Debian/Ubuntu system, simply run $ sudo apt install sqlite3.

Once you have that taken care of, follow these steps:

  1. Download the Home Control Monitor source files via git clone. You can place the directory anywhere you wish, the installation process will place the necessary files in the correct location (by default, the requisite directory will be placed in /usr/local/bin/home-control). For ease though, you'll probably want to put it somewhere in your home folder. For example:
    $ sudo git clone https://github.com/jessereitz/home-control.git ~/
  1. From here, cd into the directory and run the install script at home-control/bin/install like so:
    $ cd ~/home-control && ./bin/install

This will install all the requisite dependencies (except sqlite3, see above), walk you through creating a user database, a user account (see below), and a configuration file to keep track of which servers to monitor. It will then copy the service unit file to /etc/systemd/system, copy the home-control/dist directory to /usr/local/bin/home-control and enable/start the home-control service.

  1. You should be all set to go! You can browse to http://localhost:9070 to see Home Control in action.

Once the initialization process has been completed there will be a server-config.json file in the home-control directory (/usr/local/bin/home-control, if you ran the install script). It will look something like this:

{
  "_meta": {
    "info": "This file was autogenerated by Home Control. You can add or delete servers in the 'servers' array below.",
    "created": "18/11/2018, 21:14:24"
  },
  "servers": [
    {
      "name": "Example Server",
      "ip": "192.168.51.156",
      "mac": "32:9b:20:ad:4b:63"
    }
  ]
}

Adding Accounts and Servers

If you would like to add another user or if you forget your username/password, run the create-user script:

$ npm run create-user

If you would like to add another server to monitor, you can add it directly in the server-config.json file located in the home-control directory or run the add-server script from the directory:

$ npm run add-server

Setting a Custom Port

Home Control defaults to port 9070. This is should be a pretty safe option. If, however, you have a service using this port or if you would like to set it to use port 80 (strongly discouraged, see below) or port 443, you are free to do so. Just add a port key with your desired port number (either as a number or a string) to your server-config.json file and restart the service.

For example, using the generated server-config.json from above but serving on port 443 would look something like this:

{
  "_meta": {
    "info": "This file was autogenerated by Home Control. You can add or delete servers in the 'servers' array below.",
    "created": "18/11/2018, 21:14:24"
  },
  "servers": [
    {
      "name": "Example Server",
      "ip": "192.168.51.156",
      "mac": "32:9b:20:ad:4b:63"
    }
  ],
  "port": 443
}

A Note on Security

Home Control should not be exposed to the internet unless you are serving it over HTTPS. Otherwise, your passwords will be sent unencrypted and could be stolen and used to gain access to your network.