Skip to content

Converts a meshviewer.json generated by yanic into a zonefile to give nodes a hostname

License

Notifications You must be signed in to change notification settings

freifunk-ffm/yanicOutputToZonefile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freifunk: meshviewer.json to zonefile

generateZonefile.py is a script intended to run regularly as cron and generate a zonefile for a subdomain which contains all the Freifunk Router of a Freifunk community so that they are accesible with a name.

It uses a http request to get a meshviewer.json, extracts all the valid hostnames and outputs a zonefile for a "node domain".

Installation

  • clone this repository
  • create a copy of the config.example.py with the name config.py and edit it
  • run it with python3 generateZonefile.py

Limitations

Hostname Limitations:

  • must only contain letters a-z, numbers, german umlauts (äöü)
  • must not start or end with a dash (-)

not valid are:

Example Script

It is probably better to run the following two parts separate:

generate Files

#!/usr/bin/env bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

python3 generateZonefile.py > nodes.ffrn.de.log

reload zone

#!/usr/bin/env bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

cp nodes.ffrn.de.zone /etc/bind/zones/
/usr/sbin/rndc reload nodes.ffrn.de > /dev/null

About

Converts a meshviewer.json generated by yanic into a zonefile to give nodes a hostname

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%