mmornati / kerberosio-hooks

Kerberos.io WebHooks module extensible using plugins
GNU General Public License v3.0
3 stars 0 forks source link

Greenkeeper badgeBuild Status Code Climate Test Coverage Issue Count

kerberosio-hooks

Kerberos.io WebHooks extensible module to be notified where you need if anything happens on you Kerberosio

Requirements

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

Installation

Clone the project on your system:

git clone https://github.com/mmornati/kerberosio-hooks

Install all dependencies using npm:

cd kerberosio-hooks
npm install

Configuration

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 Configuration

{
  "pushbullet_key": "test",
  "device_id": "",
  "images_base_url": "https://media.home.mornati.net/'",
  "images_base_path": "/mnt/kerberosio/machinery/capture/",
  "image_method": "PATH"
}

WebHook Usage

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, ...).

Init.d Service

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