Reporting Server / API for The PiSwitch and PiSwitch front-end
 
 
Go to file
git 4e95570fbc Set new Base version 2021-03-22 21:23:14 +01:00
src Set new Base version 2021-03-22 21:23:14 +01:00
.gitignore Set new Base version 2021-03-22 21:23:14 +01:00
Dockerfile Set new Base version 2021-03-22 21:23:14 +01:00
README.md Set new Base version 2021-03-22 21:23:14 +01:00
requirements.txt Set new Base version 2021-03-22 21:23:14 +01:00

README.md

PiSwitch_Reporting

reporting server/API for the PiSwitch

Installation Process

Clone the repository

git clone https://git.dennisvandermeulen.nl/dennis/PiSwitch_reporting.git
cd PiSwitch_reporting/

Setup virtual environment & install requirements (skip if you use Docker)

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Setup config.ini

nano src/config.ini

setup database config

[database]
host = 
user = 
password = 
db = 

setup apikey for this server

[setup]
apikey = string

##Docker use the included Dockerfile

docker run . -t piswitch/reporting -d -p 5000:5000

or build the dockerfile for use with PiSwitch_frontend

docker build . -t piswitch/reporting

Systemd

Use the following script to automatically start the scripts at boot

[Unit]
Description=PiSwitch Reporting server
After=multi-user.target

[Service]
Type=simple
User=
Group=
WorkingDirectory=/path/to/PiSwitch_reporting/src
ExecStart=/path/to/venv/bin/python3 path/to/PiSwitch_reporting/src/server.py

[Install]
WantedBy=multi-user.target

save as PiSwitch_reporting.service