blinky/README.md

53 lines
1.3 KiB
Markdown

# blinky
control your blinkstick via http requests
## requirements
- nodejs
- yarn / npm
- [nvm](https://github.com/nvm-sh/nvm)
**the node-hid module is a bit picky about node.js's version - use node.js 8.x or 15.x**
## setup
- clone the project (to '/opt/blinky')
`git clone https://git.velvettear.de/velvettear/blinky.git /opt/blinky`
- enter the cloned directory
`cd /opt/blinky`
- install and switch to a supported node.js version (automatically done via .nvmrc file)
`nvm install`
- install the required modules
`npm install`
- switch back to your system's default node.js version
`nvm deactivate`
- execute blinky
`nvm run 15 blinky.js`
## systemd
**for security reasons it is highly recommended to not run blinky with root permissions!**
- create a new system user
`useradd -r -s /usr/bin/nologin blinky`
- symlink the provided systemd-service file and modify it according to your needs
`ln -s /opt/blinky/blinky.service /etc/systemd/system/blinky.service`
- reload systemd-services
`systemctl daemon-reload`
- enable and start blinky as a systemd-service
`systemctl enable --now blinky`
### scripts
- blinky-feed.sh
- gathers various system information (currently temperature only) then converts it to color values and sends it to blinky
- requirements: bash, bc