Private Overwatch statistics backend application.
What do you need to execute owstats and owapi?
- We support Windows and Linux
- MySQL / MariaDB Database
- Node.JS and NPM Package Manager
- Python > Version 3.5
- Linux / Unix based server
- apt packages
apt install redis-server libxslt-dev python3-dev build-essential zlib1g-dev pkg-config
- OWAPI - Overwatch JSON API
- Node.js
- mysqljs - A pure node.js JavaScript Client implementing the MySql protocol.
We recommend a linux / unix environment for use of owapi and owstats.
Linux Installation steps (Optimized for Debian):
-
Follow the installation steps of OWAPI showed in their Readme
-
To use owapi as systemd service add the following content into the file
/lib/systemd/system/owapi.service
and edit the file for your environment.
[Unit]
Description=OWAPI - Overwatch API
Wants=network-online.target
After=syslog.target time-sync.target network.target network-online.target
[Service]
Type=oneshot
ExecStart=/opt/OWAPI/run.sh
User=owapi
Group=owapi
[Install]
WantedBy=multi-user.target
Alias=owapi.service
- add the following content into
/PATH TO OWAPI/run.sh
and edit the file for your system.
#!/usr/bin/env bash
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
cd /opt/OWAPI
python3.5 -m venv ./venv
source ./venv/bin/activate
PYTHONPATH=. asphalt run -l uvloop config.yml
exit 0
-
start the owapi service and look out for errors. You have to cancel the script after starting using
Strg + C
-
Clone this repository into a folder you like. We recommend
/opt/owstats
or/usr/local/owstats
-
Run
npm install
to setup the required Node.js Packages -
execute the
setup.sql
file in your MySQL or MariaDB database. -
Copy the .example-files in config folder to .js files and edit the default values to your values.
-
Execute
node readdata.js
and watch for possible errors. -
Add the following line to your crontab using the command
crontab -e
and edit the execute frequency. In our example we read the data every hour.
0 * * * * /usr/bin/node /opt/owstats/readdata.js