BRANCH | DESCRIPTION |
---|---|
database | Postgresql scripts |
flask | REST API |
deploy | apache configuration generator |
android | android apk source |
analysis | graph generation and machine learning |
master | website, report, and backup script |
First, the same environment can be used for both flask and the apache conf generator.
virtualenv -p python3 local
. local/bin/activate
pip install Flask
pip install psycopg2
deactivate
cd deploy
cp secret.dist secret
# fill in the values
./genconf -m ssl
sudo cp <name>.conf /etc/apache2/sites-available/<name>.conf
sudo adduser <user>
sudo su -l postgres
psql
create user <user> with superuser password '<pass>';
create database <db> owner <user>;
alter role <user> in database <db> set search_path to public,dbo,dbv,new,map,fnd;
alter database <db> set extra.secretkey to '<secretkey>';
su -l <user>
psql -d <db> < <script.sql>
cd master
./download
cd database
psql -d <db> < rebuild.sql
psql -d <db> < methods.sql
psql -d <db> < extra.sql
cd flask
mv <backup>.csv data/locations.csv
mv <backup>.csv data/users.csv
mv <backup>.csv data/waps.csv
mv <backup>.csv data/scans.csv
./inflate.py
select setval('dbo.actor_id_seq', (select max(id) from dbo.actor));
select setval('dbo.wap_id_seq', (select max(id) from dbo.wap));
select last_value from dbo.actor_id_seq;
select last_value from dbo.wap_id_seq;