ffmap-backend
tags: [“ffmap-backend”, “freifunk api”] themen: [“karte”]
Die Bereitstellung der Karte besteht aus mehreren Tasks:
Inhaltsverzeichnis
ffmap-backend
Quellcode: https://github.com/ffnord/ffmap-backend.git
Anpassungen:
freifunk api
Quelle: https://github.com/spookey/changeffapi.git
cronjob: [code] cd ~/bin/changeffapi/ ./mapnodes.py [/code]
Ausgabe-Datei: /var/www/map/freifunk-api/herford.json
cronjob
minütlich wird mit unpriv. user gestartet: [code] #mh d m dow user comand * * * * * map /home/map/bin/cron-map.sh [/code]
/home/map/bin/cron-map.sh [code] # cronjob zum Erzeugen der Map.data aus ALFRED
# Backend aufruden
cd bin/ffmap-backend/
# sondern erst anonymisiewren
jq '.nodes = (.nodes | with_entries(del(.value.nodeinfo.owner)))' < /home/map/ffmap-backend-data/nodes.json > /var/www/map/data/nodes.json
# den Rest direkt kopieren
cp -a /home/map/ffmap-backend-data/graph.json /var/www/map/data/
cp -a /home/map/ffmap-backend-data/nodelist.json /var/www/map/data/
# und die API-file aktialisieren
cd ~/bin/changeffapi/
./mapnodes.py
[/code]
meshviewer
Für die Karte benutzen wir meshviewer
Quellcode: https://github.com/FreiFunkMuenster/meshviewer/tree/plumpudding
Installation: [code] git clone https://github.com/FreiFunkMuenster/meshviewer.git cd meshviewer/ npm install npm install grunt-cli node_modules/.bin/grunt [/code]
This will generate build/ containing all required files.
Config anpassen: [code] cp config.json.example build/config.json [/code] [code] “dataPath”: [ “http://map.herford.freifunk.net/data/” ], [/code]
einmalig den html-Code veröffentlichen: [code] cp -a /home/map/muenster/meshviewer/build/* /var/www/map/ [/code]