Commit Graph

79 Commits

Author SHA1 Message Date
Adrian Schmutzler c7ffb50d3d fff-hoods: Restart alfred after keyxchange file update
This is a workaround to enable alfred on routers which do not see
a configap during initial boot.

Fixes: #78

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-21 13:50:28 +01:00
Adrian Schmutzler 430049d1b3 fff-hoods: Replace hiddenapflag by check for real conditions
Instead of using the hiddenapflag file, we can just check whether
the hood file copy used by the webserver is present. As a second
condition, we check whether the w2configap is not configured yet.

This fixes the following minor issue:
Previously, if configurehood has run once, the hiddenapflag was
set, but the configap not set up yet. If then a restart happens,
the flag is gone (/tmp), but not recreated until a change in the
hood file appears. Thus, no configap would be set up until that
point.
Since we check for a real condition now, this can't be happening.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 15:16:47 +01:00
Adrian Schmutzler 6ad42be496 fff-network/fff-hoods: Only use MAC address in network lib
Previously, IPv6 addresses were constructed by reading from
the device config file in the function. To have more options,
it is better to use the address itself as parameter.

By this way we can decide what we use for getting the MAC when
calling.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 14:47:58 +01:00
Christian Dresel 9e0952e01e fff-hoods: Make possible to use fixed hoodfile
Add a complete hoodfile to /etc/hoodfile to use only this file

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
- Changed according to Adrian's review
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 13:06:57 +01:00
Adrian Schmutzler 6cc6b4b786 configurehood: Prevent connecting two hoods
To prevent connecting hoods, this patch loads keyxchange files
from the local network (eth0.3/eth0) before it uses the gateway.

Thus, if other files are provided via wXconfigap, they are just
ignored. If a router is connected to two hoods by cable, it will
just disable the interfaces where a second hood file is detected
and wait until the next call of configurehood.

If cable and wXmesh are different, the cable has precedence.

If two hoods are present via cable on the same eth, wXmesh has
precedence.

If two hoods are present via cable on different eth, the first
eth has precedence and all others are disabled.

If cable has precedence, wXmesh is configured with the hood
file from cable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-12-23 14:31:01 +01:00
Adrian Schmutzler 696c983f22 configurehood: Wait for the config AP to build when in sta mode
The configurehood script is started at the same time for all
routers. Thus, if one router sets up its configap, another may
just go into wXsta at the very same moment. This creates a race
condition between configap setup and wXsta download.

To circumvent this, we add a sleep to the wXsta routine, so the
wXsta always comes later, but is still run every 5 minutes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-12-23 13:26:27 +01:00
Adrian Schmutzler 39d147da8d Rearrange fff config values into their own config file
This moves the FFF configuration from
/etc/config/system to a new file /etc/config/fff. Thus,
this file can be copied as a whole during upgrade (with
compatibility provided) and then resulting values in
other files are re-set later.

This also fixes the bandwidth settings not being persistent
during upgrade. Other settings may join ...

I tried to go through all the code and update all occurrences
of the relevant system variables (looking for "system" both
in GitHub and my local src folder).

Note that a downgrade will result in loss of configuration!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- Rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:52 +01:00
Adrian Schmutzler a9b3dfd7e0 fff-web: Show WiFi channels and SSID
This patch introduced more detailed information about the
hood in the WebUI, i.e. channel and SSIDs.

The patch includes a reorganization of the columns.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Tested-By: Fabian Bläse <fabian@blaese.de>
2017-11-12 20:28:49 +01:00
Fabian Bläse f3dd36b8da configurehood: Allow for spaces after identifier
Some JSON beautifiers put spaces between identifier and value.
This is necessary to tolerate that.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 17:28:59 +01:00
Adrian Schmutzler 56c07144f7 fff-hoods: Suppress warning for missing sectorfile
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-04 15:51:49 +01:00
Tim Niemeyer 90e0643b29 fff-hoods: move hiddenapfile variable
Move the variable definition to the implementation file. This is more
intuitive and the variable is not used otherwise.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-04 15:51:35 +01:00
Adrian Schmutzler 72942057bc fff-hoods/fff-wireless: Don't delete WiFi devices
We only want to remove WiFi interfaces, not devices during
reconfiguration. This still allows for complete reconfiguration,
but does not remove device attributes like a disabled 5 GHz or
similar.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-04 14:49:19 +01:00
Tim Niemeyer e22663a673 fff-hoods: only delete hiddenapfile if ap was configured
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-03 22:30:27 +01:00
Adrian Schmutzler 566d762148 fff-network/fff-hoods: Create functions for IPv6 rewriting
This puts the code for creating IPv6 addresses from MAC
address and EUI into functions, so it can be reused.

This should be particularly helpful if code is rewritten later.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-11-03 09:30:14 +01:00
Adrian Schmutzler 85510f25b3 fff-hoods: Fix missing commit for hood name
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-02 21:10:26 +01:00
Robert Langhammer 66cb34c802 fff-hoods: fix sed to substitute timestamp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2017-11-02 20:56:57 +01:00
Adrian Schmutzler 6daffa2485 fff-hoods: Use w5sta for download
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2017-11-02 20:54:43 +01:00
Adrian Schmutzler b88841352c fff-hoods: Use variables for hood file names
Since names may change, this puts the relevant file names for
hood files into variables, so they can be changed at once
without the risk of forgetting some occurrences.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2017-11-02 20:52:51 +01:00
Fabian Bläse 4f3c30eb0e consistently use same webserver port for hoodfile on wifi and lan
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer rlanghammer@web.de
2017-11-02 20:47:13 +01:00
Adrian Schmutzler 3f607e106f fff-hoods: Introduce sector files for custom settings
While the hood file is only set by the keyexchange/hood, this
introduces a local additional configuration in a second file.
This file is retrieved from the first configap we got in w2sta
mode, of which we save the fdff address to identify it later.
Thus, a router always "knows" its specific uplink, as long as
the gateway connection is stable; otherwise: reset.

The implementation is similar to the hoodfiles with a tmp
version and a copy in the /www/public. On the "section head",
the initial configuration is located in /etc/sectorfile and
distributed from there to other nodes. Syntax should be like
the node file, except that it only contains the values to be
overwritten.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2017-11-02 20:39:39 +01:00
Adrian Schmutzler 1b568d96a7 fff-hoods: Use channel provided by gateway
This prevents setup if a channel is missing (json defective)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2017-11-02 20:39:05 +01:00
Adrian Schmutzler e7e27c168c Utilize PKG_NAME in Makefiles
Since there is a PKG_NAME variable, there is no need to repeat
the individual package name five times.

This makes editing and particularly copying Makefiles much
easier, as only the PKG_NAME has to be changed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-10-16 21:20:02 +02:00
Adrian Schmutzler c4ae6bf216 fff-hoods: Fix case of missing keyxchangev2data
This fixes a missing /tmp/keyxchangev2data due to gateway
misconfiguration.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- Added double quote around $jsonfile
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-10-16 21:18:10 +02:00
Adrian Schmutzler 3d057de934 fff-hoods: Fix fe80::1 for multiple configap interfaces
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-10-16 21:16:37 +02:00
Fabian Bläse d788f843b6 Support batman-adv meshing over 802.11s
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-10-16 21:14:11 +02:00
Adrian Schmutzler c8c92466be Configure the Node a routable IPv6 ULA
Signed-off-by: Christian Dresel <fff@chrisi01.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Christian Dresel <fff@chrisi01.de>
2017-10-15 17:30:40 +02:00
Adrian Schmutzler 6463e2d2cf Remove references to community.cfg
This removes all references to community.cfg except in the
buildscript and except the file itself.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-10-15 17:30:34 +02:00
Adrian Schmutzler 235644be8d vpn-select: Use keyxchangev2data instead of fastd_fff_output
This is a first consolidation step which gets rid of
/tmp/fastd_fff_output, but still requires /etc/fastd/fff/peers/*

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-10-15 17:30:28 +02:00
Christian Dresel 4cd8b8eac2 Add fff-hoods
This package connects to keyxchangev2

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Signed-off-by: Jan Kraus <mayosemmel@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-10-15 17:30:24 +02:00