This commit is contained in:
Michael Wyraz 2021-11-13 23:33:57 +01:00
parent 1c88ead09a
commit ec76708754
6 changed files with 106 additions and 3 deletions

View File

@ -1 +1,2 @@
/envfile
/data

View File

@ -16,3 +16,14 @@ Umgebungsvariablen:
* FASTD_PEER`n`_NAME (optional): weitere Peers (fortlaufend numeriert)
* FASTD_LOG_LEVEL (default: info)
* IPV6_PREFIX (optional): Prefix für radvd, nötig um hosts im Netz über ihre nicht-link-lokale IPv6 anzupingen. z.B. `fdef:ffc0:7030::/64`
### yanic
Yanic ist ein Client für respondd und verantwortlich, Knoten-Broadcasts einzusammeln und daraus die Knoten-Daten für die Karte zu generieren. Der Container verwendet das Netzwerk von "fastd", um Zugang zum Feifunk-Netz zu bekommen.
Die generierten Daten werden auf ein Volume geschrieben, welches vom Meshviewer-Kartenserver aus zugäglich ist.
Umgebungsvariablen:
* keine

View File

@ -8,4 +8,11 @@ services:
privileged: true # required to create the tap device
sysctls:
net.ipv6.conf.all.disable_ipv6: 0 # enable ipv6 withn container
stop_grace_period: 0s
net.ipv6.conf.all.forwarding: 1
stop_grace_period: 0s
yanic:
build: ./yanic
network_mode: "service:fastd"
stop_grace_period: 0s
volumes:
- ./data/yanic:/data

View File

@ -47,7 +47,7 @@ while true; do
: ${remote:? ${r} must be set}
: ${key:? ${k} must be set}
cat << EOF > "config/fastd/peers/${name}"
cat << EOF > "/config/fastd/peers/${name}"
key "${key}";
remote ${remote};
EOF
@ -56,7 +56,7 @@ EOF
done
if [ ! -z "${IPV6_PREFIX}" ]; then
cat << EOF > "config/radvd.conf"
cat << EOF > "/config/radvd.conf"
interface bat0
{
AdvSendAdvert on;

View File

@ -0,0 +1,15 @@
FROM golang:1.16-alpine as builder
RUN go get -v -u github.com/FreifunkBremen/yanic
FROM alpine:3.14
COPY --from=builder /go/bin/yanic /bin/yanic
RUN apk add --update --no-cache bash
ADD entrypoint.sh /entrypoint.sh
VOLUME /data
CMD /entrypoint.sh

69
mapserver/yanic/entrypoint.sh Executable file
View File

@ -0,0 +1,69 @@
#!/bin/bash
set -e
mkdir -p /config /data /data/meshviewer
cat << EOF > "/config/yanic.toml"
# Send respondd request to update information
[respondd]
enable = true
# Delay startup until a multiple of the period since zero time
synchronize = "1m"
# how often request per multicast
collect_interval = "1m"
[respondd.sites.l]
domains = []
[respondd.sites.m]
domains = ["meshkit"]
[[respondd.interfaces]]
ifname = "bat0"
[webserver]
enable = false
[nodes]
state_path = "/data/state.json"
prune_after = "120d"
save_interval = "5s"
offline_after = "1h"
# definition for the new more compressed meshviewer.json
[[nodes.output.meshviewer-ffrgb]]
enable = true
path = "/data/meshviewer/meshviewer.json"
[nodes.output.meshviewer-ffrgb.filter]
# WARNING: if it is not set to true, it will publish contact information of other persons
no_owner = false
[[nodes.output.meshviewer]]
enable = false
[[nodes.output.nodelist]]
enable = false
[database]
delete_after = "60d"
delete_interval = "1h"
[[database.connection.influxdb]]
enable = false
[[database.connection.graphite]]
enable = false
[[database.connection.respondd]]
enable = false
[[database.connection.logging]]
enable = false
EOF
exec /bin/yanic serve --config /config/yanic.toml