Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.69 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.69 KB

strobelight-ci-alarm

strobelight-ci-alarm is a Electronic Relay toggler to be used on our Continuous Integration system (while builds are running).

This project is intended to run on an RaspberryPi and it's currently using HapiJS for creating a simple API and uses OnOff library to access the GPIO ports of RPI.

It's currently using a real 220V strobelight, being turned ON via a relay and controlled via RPI, that handles API requests via HapiJS.

API

Authentication

This project uses basic authentication, relying on hapi-auth-basic. Basic passwords are hashed with Bcrypt.

If you need some extra "protection", please refer to hapijs.com/tutorials/auth.

Methods

/toggle

Toggles the relay switching its state

/activate/{on|off}

Changes the relay state switching either to ON or OFF

Folder structure

This hapi.js project has the following structure:

|-config                # any config required - you can change your PIN ports here
|-controllers           # controllers for the application
|-handlers              # handlers for routes
|-models                # models required by the application
|-routes                # the routing system
|-system_configs        # here you can find any system configurations for deploying the solution
|---nginx               #   nginx sites config files
|-----sites-available
|---systemd             #   systemd config filex
|-----system

Logging

Logging is performed via good-console and redirected to /tmp/strobelight.log file.