Small set of python utilities for running a GitHub Issue Printer on a Raspberry Pi + Adafruit Thermal Printer
For Development:
git submodule update --init --recursive
sqlite3 main.db < install.sql
sudo easy_install Flask
On the Pi:
sudo apt-get install python-setuptools python-serial python-imaging python-unidecode sqlite3
git submodule update --init --recursive
sqlite3 main.db < install.sql
sudo easy_install Flask
crontab -e
- Add the following lines, using the full path of the scripts:
@reboot APP_ENV=production APP_SECRET=password1 python /home/pi/issueprinter/server.pi &
@reboot python /home/pi/issueprinter/beacon.py &
sudo shutdown -r now
Webhook:
- Create a new GitHub webhook pointing to
http://hostname:4000/
with content typeapplication/json
and a secret, if desired - Select only the "Issues" event
APP_ENV
can be set toproduction
to turn off stack traces and debug messages, otherwise defaults todevelopment
with full stack traces enabledAPP_SECRET
can be set, requiring a matching secret on the webhook to prevent randos from sending print tasks
python server.py
starts the app listening on port 4000