2018-11-22 18:19:27 +01:00
## Git Repository Logic
* Frequent updates are made to the **testing** branch, which is considered "dirty". Commits appearing here may be quickly written, untested, incomplete, etc. This is where the development happens.
* In unspecified intervals, the piled-up changes in the testing branch are reviewed, ordered and squashed to a smaller set of tidy commits. Those are then pushed to the **master** branch.
* The tidy-up is marked by an empty commit "Realign with master" in the testing branch. This is roughly equivalent to a *merge* , although for an actual merge the commits would remain unaltered.
* Development happens in the testing branch. Thus, *testing* is more up-to-date, but *master* is better to understand.
* The Monitoring web server uses the testing branch.
2017-11-10 12:10:27 +01:00
## Debian Dependencies
```bash
apt-get install mysql-server python3-mysqldb python python3 python3-requests python3-lxml python3-pip python3-flask python3-dateutil python3-numpy python3-scipy python3-mapnik python3-pip uwsgi-plugin-python3 nginx
2018-04-03 17:28:27 +02:00
pip3 install wheel pymongo pillow modestmaps simplejson werkzeug
2017-11-10 12:10:27 +01:00
```
## When updating
```bash
apt-get install mysql-server python3-mysqldb python3-mapnik
apt-get uninstall mongodb python-mapnik uwsgi-plugin-python tilestache
2018-04-03 17:28:27 +02:00
pip3 install wheel pillow modestmaps simplejson werkzeug
2017-11-10 12:10:27 +01:00
pip3 uninstall uuid
```
## Prerequisites
* Datenbank in MySQL anlegen
* Git vorbereiten:
```bash
git clone https://github.com/asdil12/fff-monitoring
git clone https://github.com/TileStache/TileStache
cd fff-monitoring
cp ffmap/mysqlconfig.example.py ffmap/mysqlconfig.py
```
* MySQL Zugangsdaten in mysqlconfig.py eintragen
2015-10-10 17:42:44 +02:00
## Installation
2016-01-25 17:25:45 +01:00
```bash
2015-10-10 17:42:44 +02:00
./install.sh
2016-04-28 17:25:27 +02:00
systemctl daemon-reload
2015-10-10 17:42:44 +02:00
systemctl enable uwsgi-ffmap
2016-04-28 17:38:05 +02:00
systemctl enable uwsgi-tiles
2015-10-10 17:42:44 +02:00
systemctl start uwsgi-ffmap
2016-04-28 17:38:05 +02:00
systemctl start uwsgi-tiles
2016-04-28 17:36:10 +02:00
cd ffmap/db/
./init_db.py
2015-10-10 17:42:44 +02:00
# Then apply NGINX Config
2018-04-03 17:28:27 +02:00
cd ../.. # go back to fff-monitoring root directory
./scripts/setupcron.sh
2015-10-10 17:42:44 +02:00
```
## NGINX Config
2016-01-25 17:25:45 +01:00
```nginx
2017-08-02 20:40:38 +02:00
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
2015-10-10 17:42:44 +02:00
...
2017-08-02 20:40:38 +02:00
2016-01-22 21:10:19 +01:00
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3031;
2016-02-17 02:47:13 +01:00
client_max_body_size 30M;
2016-01-22 21:10:19 +01:00
}
2015-10-10 17:42:44 +02:00
2015-10-16 16:28:52 +02:00
location /tiles {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3032;
}
2017-08-02 20:40:38 +02:00
location /static/ {
root /usr/share/ffmap/;
expires max;
add_header Cache-Control "public";
}
2015-10-10 17:42:44 +02:00
...
2017-08-02 20:40:38 +02:00
}
2015-10-10 17:42:44 +02:00
```
2017-08-02 21:50:19 +02:00
## Admin anlegen
* User über WebUI anlegen
2017-11-10 12:10:27 +01:00
* Dann über z.B. phpmyadmin in der Tabelle users 'admin' auf 1 setzen