Reporting Server / API for The PiSwitch and PiSwitch front-end
 
 
Go to file
dennis 36a4075e60 'README.md' updaten 2021-04-13 19:46:39 +02: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 'README.md' updaten 2021-04-13 19:46:39 +02: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