pfsense-blink1
v0.2.4
Published
<br /> <div align="center"> <img src="https://raw.githubusercontent.com/amacado/pfsense-blink1/main/docs/images/blink1-logo.png" alt="blink(1)" height="60" /> <img src="https://raw.githubusercontent.com/amacado/pfsense-blink1/main/docs/images/pfsense-logo
Downloads
9
Readme
pfsense-blink(1)
Introduction
Watch your pfSense® firewall temperature with blink(1) using Node.js® runtime
Quickstart
Docker (recommended: docker-compose.yml)
docker pull ghcr.io/amacado/pfsense-blink1:latest
Requirements
- blink(1)
mk2
ormk3
by THINGMmk1
does not have two LEDs on both top and bottom which are independently addressable. It might work, but not tested.
Preparations & setup
The intended deployment of this script is on another machine (or container) than the pfSense®. It's recommended to keep your firewall server as "clean" as possible.
- Setup jaredhendrickson13/pfsense-api for pfSense®
- Create an API Token for the REST API (see
jaredhendrickson13/pfsense-api
instructions) - Install libusb driver
apt-get install libusb-1.0-0
which is required to access the blink(1) device using the node package sandeepmistry/node-blink1 - Install
nodejs
(see nodejs.org) - Connect the blink(1) via USB
Run the application
- Copy
config/config.sample.json5
, rename it to/path/to/config.json5
(default/config/config.json5
) and paste API credentials and pfSense® URI (see json5.org for more information about the this next level json project) - Adjust settings in
config/config.json5
to your needs. The default values are defined inConfigurationManager
- Install and start
pfsense-blink1
applicationnpm i pfsense-blink1 -g pfsense-blink1 [--config "/path/to/config.json5"]
Development or 'Go build yourself'
- Install
yarn
package manager (see yarnpkg.com) - Clone this repository (
gh repo clone amacado/pfsense-blink1
) - Execute
yarn install
- Execute
yarn serve
for TypeScript watcher - Execute
yarn build
to build the project and create production ready project in /dist/ - Setup
pre-push
hook with following script#!/bin/sh yarn build git add dist/ git diff-index --quiet HEAD || git commit -m ":octocat: build sources via pre-push hook" exit 0
Publishing new (npm package) version
This project follows Semantic Versioning 2.0.0 with the help ofnp
CLI tool
to ensure quality.
yarn global add np
npm install np -g
Create a new version and publish (np
is installed as dev-dependency):
np
Known problems
Error TypeError: cannot open device with path
This error may occurs when the current user is not allowed to access the attached blink(1) device:
TypeError: cannot open device with path /dev/hidraw0
If you're running this script in a docker container you might want to check the bindings and
mount /dev:/dev
which allows the container to access the device.
Error libusb-1.0.so.0: cannot open shared object file
Error: libusb-1.0.so.0: cannot open shared object file: No such file or directory
This error occurs if you haven't installed libusb driver apt-get install libusb-1.0-0
.
ERR! self signed certificate
ERR! self signed certificate
This error occurs when the SSL certificate which should secure your REST API connection
is self signed. There are two solutions for this problem: Either authorize your SSL certificate
or skip the check by setting configuration option api.httpsAgent.rejectUnauthorized = false
(see /config/config.sample.json5
).
Credits
Special thanks to these projects: