Giter Site home page Giter Site logo

freifunk-saar / ffmap-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freifunk-mwu/ffmap-backend

0.0 6.0 1.0 640 KB

This code is in a really bad state and might not work as expected. Backend for ffmap-d3

License: Other

Python 98.00% Shell 2.00%

ffmap-backend's Introduction

Data for Freifunk Map, Graph and Node List

ffmap-backend gathers information on the batman network by invoking batctl and batadv-vis as root (via sudo) and has this information placed into a target directory as the file "nodes.json" and also updates the directory "nodes" with graphical representations of uptimes and the number of clients connecting.

The target directory is suggested to host all information for interpreting those node descriptions, e.g. as provided by https://github.com/ffnord/ffmap-d3.git . When executed without root privileges, we suggest to grant sudo permissions within wrappers of those binaries, so no further changes are required in other scripts:

$ cat < $HOME/batctl
#!/bin/sh
exec sudo /usr/sbin/batctl $*
EOCAT

and analogously for batadv-vis. The entry for /etc/sudoers could be whateveruser ALL=(ALL:ALL) NOPASSWD: /usr/sbin/batctl,/usr/sbin/batadv-vis,/usr/sbin/alfred-json

The destination directory can be made directly available through apache:

$ cat /etc/apache2/site-enabled/000-default
...
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        
...

$ cat /etc/apache2/conf.d/freifunk
Alias /map /home/ffmap/www/
Alias /firmware /home/freifunk/autoupdates/

To execute, run ./mkmap.sh ../www The script expects above described sudo-wrappers in the $HOME directory of the user executing the script. If those are not available, an error will occurr if not executed as root. Also, the tool realpath optionally allows to execute the script from anywhere in the directory tree.

For the script's regular execution add the following to the crontab:

*/5 * * * * /home/ffmap/ffmap-backend/mkmap.sh /home/ffmap/www

ffmap-backend's People

Contributors

rugosh avatar sargon avatar neocturne avatar jplitza avatar smoe avatar baldo avatar t-x avatar wklaebe avatar

Watchers

Ralf Jung avatar James Cloos avatar Tobias Theobald avatar Kim avatar  avatar  avatar

Forkers

freifunk-lux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.