Map: Unterschied zwischen den Versionen

Aus Freifunk Köln, Bonn und Umgebung
Zur Navigation springen Zur Suche springen
(code style fix)
(Änderung 42605 von JeffBurge6 (Diskussion) rückgängig gemacht.)
Markierung: Rückgängigmachung
 
(5 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
[[Kategorie:Archiv]]
{{:Archiv-Hinweis}}
{{TOCright}}
{{TOCright}}
[[Kategorie:Infrastruktur]]
[[Kategorie:Infrastruktur]]

Aktuelle Version vom 12. September 2020, 22:03 Uhr

Hinweis: Diese Seite wurde in das Archiv verschoben. Die Informationen sind größtenteils veraltet und nur für Spezialfälle relevant.

Voraussetzungen

  • eine private IPv4/IPv6 Adresse

Diese kannst du unter dem Artikel IP Netze selbst zuteilen, oder nachlesen, welches deine sind, wenn es jemand anderes dir schon zuteilte.

Server ins Freifunk Netz einbinden

Grundlage: Debian 7 (Wheezy) oder Debian 8 (Jessy)

Edit /etc/apt/sources.list

nano  /etc/apt/sources.list 

and add this:

deb http://repo.universe-factory.net/debian/ sid main

Add Keys:

gpg --keyserver pgpkeys.mit.edu --recv-key  16EF3F64CB201D9C
gpg -a --export 16EF3F64CB201D9C | apt-key add -

Install required Software:

apt-get update
apt-get install apt-transport-https git make gcc build-essential linux-headers-$(uname -r) pkg-config libgps-dev libnl-3-dev libjansson-dev fastd nodejs

Install Batman, batctl and alfred

mkdir /opt/freifunk
cd $_

git clone https://git.open-mesh.org/batman-adv.git
cd batman-adv
git checkout v2015.1
make
make install

cd ../

git clone https://git.open-mesh.org/batctl.git
cd batctl
git checkout v2015.1
make
make install

cd ../

git clone https://git.open-mesh.org/alfred.git
cd alfred
git checkout v2014.4.0
make 
make install

Configuration

Fastd

Only on Virtual Servers:

rm /dev/random
ln -s /dev/urandom /dev/random

Generate fastd Keys

fastd --generate-key

Save your fastd Keys anywhere

Add Directories

mkdir /etc/fastd/meshvpn
mkdir /etc/fastd/meshvpn/peers

Add your Secret to /etc/fastd/meshvpn/secret.conf:

# /etc/fastd/meshvpn/secret.conf
secret "$SECRETKEY";

fastd Config /etc/fastd/meshvpn/fastd.conf:

First, random mac address has to be calculated on the linux console via:

echo $RANDOM|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'

The 02 for the first octet just sets the "locally assigned" bit, which makes it obvious that it's not a vendor-provided MAC address, and guarantees that you won't collide with a real NIC's MAC address.

# /etc/fastd/meshvpn/fastd.conf
bind 0.0.0.0:53842;
# bind [*IPv6IP*]:53842; #Only if available
include "secret.conf";
include peers from "/etc/fastd/meshvpn/peers";
interface "fastd-meshvpn";
log level info;
method "aes128-gcm";
method "salsa2012+umac";
method "salsa2012+gmac";
method "xsalsa20-poly1305";
mtu 1312;
on up "
modprobe batman-adv
ip link set address aa:bc:cc:dd:ee dev fastd-meshvpn #Change MAC to Random MAC Address
ip link set up dev fastd-meshvpn
batctl -m bat0 if add fastd-meshvpn
batctl -m bat0 it 5000
batctl -m bat0 bl enable
batctl -m bat0 gw client
ip link set up dev bat0
ip addr add 10.158.191.254 broadcast 10.158.191.255 dev bat0 #Change IP to a available Address in the mesh network
ip -6 addr add 2a03:2260:11e:301::107/64 dev bat0 #Change IP to a available Address in the mesh network
";

Add the fastd servers:

cd /etc/fastd/meshvpn/peers
git clone https://gitlab.kbu.freifunk.net/ffkbu/fastd-peers.git ./ -b $BRANCH

Branches (Hoods)

hoodk - Hood Köln
hoodb - Hood Bonn
hoodu - Hood Umgebung

HopGlass-Server (Backend) aufsetzen

wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh

Change config.json as you like. If you leave it as config.json.sample it will load default config

node /opt/hopglass/server/hopglass-server.js

HopGlass-Server (Backend) aufsetzen Kaputt

ArchLinux or Debian-based systems using systemd (preferred)

i.e. Debian Jessie or newer, Ubuntu 15.04 or newer


1) Run # wget https://raw.githubusercontent.com/plumpudding/hopglass-server/v0.1/scripts/bootstrap.sh; bash bootstrap.sh; rm bootstrap.sh
2) Review and edit the default configuration located at /etc/hopglass-server/default/config.json.
3) Start the HopGlass Server: # systemctl start hopglass-server@default
4) (Optional) Automatically start the HopGlass Server at boot: # systemctl enable hopglass-server@default


HopGlass Viewer (Frontend)

Dependencies npm

  1. bower
  2. grunt-cli
  3. Sass (>= 3.2)

Installing dependencies

Install npm package-manager. On Debian-like systems run:

sudo apt-get install npm

On Mac you have to install only npm via brew and sass

1) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2) brew install node
3) sudo gem install sass


Execute these commands on your server as a normal user to prepare the dependencies:

1) git clone https://github.com/plumpudding/hopglass
2) cd hopglass
3) npm install
4) npm install grunt-cli

Building

Just run the following command from the hopglass directory:

node_modules/.bin/grunt

This will generate build/ containing all required files.

Configure

Copy config.json.example to build/config.json and change it to match your community.

Install Webserver

apt-get install apache2

Delete default web files from html folder

rm -r /var/www/html/*

Move compiled map files to the Apache html folder

cp -r build/ /var/www/html/