Kerberos.io WebHooks extensible module to be notified where you need if anything happens on you Kerberosio
To use this script you need a recent version of NodeJS (the 0.10.X is not supported). I suggest you to use the latest LTS version. To install it on your RPi the easy way is using NVM (Node Version Manager https://github.com/creationix/nvm)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
nvm install --lts
nvm alias default <the lts version installed>
nvm use default
Clone the project on your system:
git clone https://github.com/mmornati/kerberosio-hooks
Install all dependencies using npm:
cd kerberosio-hooks
npm install
To use this module you need to configure into the config/default.json file containing basic parameters and all the module's too.
{
"server_port": 8080,
"activated_plugins": ["pushbullet"],
}
{
"pushbullet_key": "test",
"device_id": "",
"images_base_url": "https://media.home.mornati.net/'",
"images_base_path": "/mnt/kerberosio/machinery/capture/",
"image_method": "PATH"
}
To start the WebHook Listener you can use the following command line:
node index.js
A webserver will be started on the configure port (by default 8080). Into the Kerberos.io configuration you can then configure the URL of the server: http://ip:port/kerberosio The sent message will contain some information about the detection (image url, time, ...).
You can start your service in background and configure to start it up automatically when the system starts up.
First of all you need to install forever
npm install -g forever
Then you can simply use (and configure) the sample init.d script placed in the root source folder (webhook-init-d).
sudo cp webhook-init-d /etc/init.d/webhook
sudo /etc/init.d/webhook start