Commit Graph

526 Commits

Author SHA1 Message Date
Adrian Schmutzler 4f76367b5a fff-web-hood: create directory /www/hood via Makefile
Creating a directory via a .keep subfile is not really nice.

Use the OpenWrt mechanism for this instead.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Christian Dresel <freifunk@dresel.systems>
2020-12-22 14:11:10 +01:00
Adrian Schmutzler def42fadde fff-web: rename to fff-web-ui
The former fff-web package is essentially for serving a user
interface (UI). Therefore, include the UI in the name to distinguish
it from other web packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Christian Dresel <freifunk@dresel.systems>
2020-12-22 14:10:16 +01:00
Adrian Schmutzler 341d5cc57d fff-web-hood: separate package for hood file via HTTP
There might be scenarios where a user only needs the hood file,
but no WebUI (e.g. for 4M devices and node firmware), or only
the WebUI, but no hood file (e.g. layer3 firmware).

This separates the HTTP server (section) for the hood file into a
separate package fff-web-hood. The new package is then only added
to the node firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Christian Dresel <freifunk@dresel.systems>
2020-12-22 14:05:19 +01:00
Adrian Schmutzler b69469a0b9 packages/fff: remove unneeded Build/Prepare and Build/Configure
Build/Prepare and Build/Configure are not required for packages
which only contain local files and do not need any compilation.

Remove them.

Note that Build/Compile needs to be present and empty to overwrite
the defaults, though.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-12-22 13:47:45 +01:00
Adrian Schmutzler 3214388680 treewide: rename br-mesh to br-client
The name br-mesh is actually quite misleading, since the bridge
actually includes the "client" interfaces. In order to make this
obvious, and to prevent confusion with the properly named wXmesh
interfaces, rename them to br-client.

Note that br-mesh is also particularly disturbing for the layer 3
firmware without batman-adv.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Christian Dresel <freifunk@dresel.systems>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-12-22 13:41:44 +01:00
Adrian Schmutzler 7e552761f6 packages/fff: rename fff-gateway to fff-layer3
The term "gateway" is ambiguous, and we are using "layer 3" for this
flavor now. Reflect that in the package name as well.

This is cosmetic otherwise.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
2020-12-17 15:38:28 +01:00
Adrian Schmutzler f9a68be465 packages/fff: move config scripts to fff-layer3-config
configuregateway and it's gateway.d files represent a specific
functionality that other packages depend on. Thus, it is put into
a package of its own so dependencies can be expressed more properly.

While at, use the chance to get rid of the ambiguous term "gateway"
and rename the script to configure-layer3 and the folders to layer3.d.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
2020-12-17 15:38:20 +01:00
Christian Dresel e5da228cb1 fff-babeld: Add rule to lookup in fff table for everything except wireguard
With this patch the router answers in traceroute over the fff table with
Freifunk IPs and not with the WAN IP. All other connections use the fff
table too.

We already have the rules with 5000 and 5001 so that wireguard does not use
the fff table anyway and connect the VPN only via the main table.

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
Acked-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-12-16 17:53:56 +01:00
Adrian Schmutzler 31df0a3779 packages/fff: remove whitespace from package TITLE
Some packages contain a whitespace at the start of TITLE, some
don't. This is completely irrelevant since Make strips leading
and trailing spaces anyway. Nevertheless, make it consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-12-13 14:40:53 +01:00
Christian Dresel da50954db7 fff-web: Make ssl menu modular
To add new menu items in other packages we need a modular construction:
- Simpel Babelweb
- Layer 3 configuration
and so on

Every menu item needs a file in /www/menu/ssl/ with the content

  link,name

  - link is the name of the html file without extension (.html)
  - name is the text of the link in the webui

While at it, rename "Password" menu item to German "Passwort".

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
[bump PKG_RELEASE, use /www/menu, use script_file for link,
improve use of class_active, commit message adjustments,
improve variable names, keep HTML umlaut, keep Logout]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-12-12 21:14:42 +01:00
Adrian Schmutzler d4e6482b60 fff-web: remove included files from HTTP-accessible folder
Certain files are only included, but are not meant to be accessed
via HTTP directly. Move those to a dedicated directory that is not
served via HTTP.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
2020-12-12 21:12:35 +01:00
Adrian Schmutzler 8fe7512ae5 ramips/mt76x8: Add support for TP-Link Archer C50 v4
Add support for the TP-Link Archer C50 v4, a low-cost mt7628-based
dual-band router.

Label MAC address is on ethernet and 2.4 GHz WiFi.

The v4 uses the same hardware as the v3 variant, but v4 includes
the newer split uboot.

ATTENTION:

Initial flashing of this device requires additional steps:

As all installation methods require an U-Boot to be integrated into the
image (and we do not ship one with the image) we are not able to create
an image in our build-process.

Download a TP-Link image from their Website and a FFF/OpenWRT sysupgrade
image for the device and build yourself a factory image like following:

TP-Link image:             tpl.bin
OpenWRT sysupgrade image:  owrt.bin

 > dd if=tpl.bin of=boot.bin bs=131584 count=1
 > cat owrt.bin >> boot.bin

This image can be used for Web-UI and recovery, but not TFTP.

Additional instruction can be found in the OpenWrt commit
01dcd574a248 ("ramips: add support for Archer C50 v4")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-12-09 13:10:09 +01:00
Fabian Bläse 52e15e072c fff-firewall: Remove ssh firewall on WAN interface
This firewall was introduced as a countermeasure for very slow routers
directly connected to the internet without any firewall.

Our routers have got quite a bit faster since then. Also, a setup like
this is highly uncommon, especially for slower routers.

Therefore this firewall rule is removed.

Fixes: #138
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-15 13:05:49 +02:00
Fabian Bläse c91e2d03ec fff-gateway: Send ICMP errors using inbound ifaddr
When using NATs and tunnels at the same time, the correct
source address has to be used so the ICMP errors is sent
through the NAT. This is necessary so the NAT can modify
the ICMP payload so it is correctly identified by the
destination host, which is required for PMTUD

Fixes: #142
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-15 13:05:49 +02:00
Adrian Schmutzler 24be8ecdda fff-network: fix unintended wan=eth1 for two-port devices
For historic reasons, the wan interface is set to eth1 as default
value. When updating the config for one-port devices in
configurenetwork, the same value is put there again if the mode
is switched to something != WAN, instead of just removing the
value.

While ifname actually is a mandatory value, this has been handled
inconsistently in the past, where ethmesh ifname was deleted, and
wan ifname was just changed back to eth1, when assigning the
actually relevant eth0 to a different task.

This concept was set up with a one-port device in mind, i.e. a
device where there is no eth1. However, this very setup routine
got applied to the Nanostation M as well (which is treated as
as one-port), where we suddenly have two interfaces and the eth1
exists.
So, while the user assumes it's unconfigured, the second port
actually becomes set up as WAN if the first one is != WAN.
If connected to a second device with CLIENT (=default) to provide
PoE there, this will create a loop.

So, finally, in order to somehow fix this mess, this patch just
changes the hardcoded "eth1" to "eth2". While this is no proper
fix, it perpetuates the original idea of keeping wan set to
something, but nothing which actually exists. However, there are
no sideeffects and we keep this minimal-invasive.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-09-15 13:05:49 +02:00
Adrian Schmutzler 30c3b46127 fff-network: fix broken statement in configurenetwork
This seems to be a copy/paste error, what we want here is to
delete the entry from ethmesh, as we use WAN.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-09-15 13:05:49 +02:00
Fabian Bläse cbf22d8eca fff-gateway: Add tc and bmon
Users might want to manually set up proper scheduling or qos using tc.
bmon can be used to monitor current throughput and packet rates.

Both are now included in layer3 variant.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-09-15 13:05:49 +02:00
Fabian Eppig 1cae99d5d5 ath79/generic: add support for TP-Link WR710N v1
Flashing instructions:

The factory image needs to be uploaded via the OEM firmware GUI.

Notes:

The device is implemented as two-port in OpenWrt, i.e. it has
eth0/eth1 interfaces without switch setup. As our firmware currently
does not support that, this uses a switch setup with one port for
LAN.

Signed-off-by: Fabian Eppig <fabian@eppig.de>
[add commit message, apply alphetic sorting in bsp, remove config
changes apart from adding CONFIG_TARGET_DEVICE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-18 17:27:20 +02:00
Adrian Schmutzler f5872dd84b fff-hoods: fix/simplify condition in configurehood
What was intended as grouping of logic operators actually invoked
a subshell. Remove the subshell by using a better choice of operators.

Found by shellcheck.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-08-01 12:10:18 +02:00
Adrian Schmutzler a157f413d4 fff-hoods: let sha256sum read file directly
This removes two useless cat as found by shellcheck:

  sumnew=$(cat "$hoodfiletmp" 2>/dev/null | sha256sum | cut -f1 -d " ")
               ^-- SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

While not functionally relevant in our case, note that

  cat <non-existant-file> | sha256sum

actually returns a hash code, while

  sha256sum <non-existant-file>

does not return anything on stdout.

Since we check the existance of $hoodfiletmp before calling sha256sum,
though, we always have a hash value for at least one file, so two empty
checksum won't happen at that point.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-08-01 12:09:44 +02:00
Fabian Bläse b5563caa23 fff-network: Improve IPv6 WAN connectivity
Until now, IPv6 connectivity was only ensured by some custom sysctls.
OpenWrt has a proper way of enabling IPv6 client (SLAAC, as well as DHCPv6)
for an interface. Switching to OpenWrt's way of configuring client addresses
for an interface might also make configuration more reliable, as the appropriate
sysctls are now set by netifd. Especially OnePort and TwoPort devices will
benefit from this change, as IPv6 auto configuration does not have to be manually
enabled and disabled for a physical interface, but rather is set as an option for
our logical wan interface.

At the same time this change enables DHCPv6 client support for WAN.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-01 01:09:10 +02:00
Fabian Bläse c23c98b2cb fff-hoods: create hoodfile AP earlier
The hidden AP creation is moved to the end of
configurehood, so it is executed right after hoodfile
changes are processed.

When keeping the long sleep before trying to gather hoodfiles
via wireless or ethernet, this should decrease the delay after
hood changes to a minimum, as mesh nodes don't have to wait
until configurehood on VPN nodes is executed a second time.

Because hoodfiles gathered via wireless or ethernet are not
copied to hoodfilewww (which is used to deliver the active
hoodfile via ethernet or wireless), only authoritative hoodfiles
(keyxchange and gateway) trigger the creation of a hidden AP.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-01 01:07:57 +02:00
Fabian Bläse 0264cc48b3 fff-hoods: Improve hoodfile gathering logic
Instead of seperately checking for various conditions,
which don't actually guarantee that the hoodfile can be
fetched in a certain way (e.g. internet is available but
keyxchange is down), the already built in return value of
the hoodfile gathering functions is utilized.

This change slightly changes the behaviour of nodes in
certian edge cases:
- If no hoodfile could be fetched from keyxchange, the
  next delivery method (getGatewayHoodfile) is used
- If the gateway is unable to deliver a hoodfile, nodes
  now behave like the gateway is unreachable, instead of
  continuing to use old hoodfiles

These behaviour changes should be an improvement over the
previous behaviour:
- VPN nodes don't disconnect and break the whole network
  if the keyxchange is unreachable, but instead try to
  fetch the hoodfile from the gateway
- Instead of checking for batman gateway announcements,
  which are completely unrelated to hoodfile delivery using
  fe80::1, the actual status of the hoodfile download is
  utilized. This has two effects:
  - hoodfile delivery using fe80::1 works even if batmans
    gateway selection isn't used at all
  - if the batman gateway selection is active, but fe80::1
    hoodfile delivery is broken in the hood, the nodes disconnect
    from the hood and try to gather their hoodfile from nerby
    nodes. Previously they continued to use the old hoodfile.
    This should make misconfigured gateways more apparent.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-01 00:59:41 +02:00
Fabian Bläse ce4146cf4a mt7621: Add support for Netgear R6220
The factory image can either be flashed via the vendor WebUI or
the bootloader using nmrpflash.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-20 14:30:39 +02:00
Fabian Bläse b886c938dc fff-gateway: Add mtr package
mtr can be a very helpful tool when debugging unstable
networks. The tool is able to list packet loss to all
routers to a destination in a nice console-based interface.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-07-14 13:54:46 +02:00
Adrian Schmutzler de8f99005c fff-hoods/fff-web: create link to hood file in fff-hoods
For the layer-3 firmware, we currently do not support a hood file
for automatically creating a mesh. However, the link for the
hood file is still created in fff-web.

Move this setup to fff-hoods, which is specific to the node firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-06-18 13:05:49 +02:00
Fabian Bläse 1faaec432a fff-network: Group network files by arch, not by target
OpenWrt only builds and installs a packet for each architecture.
If a package is already fully built and installed for a architecture,
it is not rebuilt.

Because we have two different BSPs building two different targets (BOARDs)
using the same architecture (ath79 and ar71xx, mips), the fff-network package
is not reinstalled when switching between those.

However, we have defined an install step, which copies the necessary network
files seperated by board. But because the package is not rebuilt when switching
targets, the wrong network files might be present in the package.

To resolve this issue, the network files are now seperated by ARCH instead of
the target (i.e. the BOARD variable).

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Robert Langhammer <rlanghammer@web.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-18 12:47:05 +02:00
Adrian Schmutzler 1cf4d762ff treewide: move devices from ar71xx to ath79
This patch moves device support for ar71xx devices that are supported
in ath79. Building them with ath79 will be the new default.

The only devices remaining in ar71xx will be the following, as backporting
them to openwrt-19.07 is too complicated:
- cpe210-v1
- cpe510-v1

Accordingly, no tiny devices are left in ar71xx and we can drop the relevant
patches, and build ar71xx as generic again.

For the tl-wr741nd-v2, in ath79 the tplink_tl-wr741-v1 image is used.

The move from ar71xx to ath79 requires some adjustments on the way:
- The board names and image names on ath79 contain the vendor name,
  where the former have it separated by a comma (tplink,cpe210-v2)
  and the latter use an underscore (tplink_cpe210-v2). It is
  safe to assume that this is the only difference between board and
  image names.
  Consequently, the ath79 devices will use their full board name also
  in our firmware. A lot of renames in fff-boardname can be dropped.
  The rename for fff-sysupgrade is already present in fff-upgrade.sh
  While at it, fix that for the WDR4900 v1 as well.
- Due to a different switch driver, the startup of ethernet devices
  is altered, which leads to eth0 and eth1 being swapped for some ath79
  devices compared to ar71xx. This has been adjusted for SWITCHDEV/WANDEV
  and MAC address setup.
- Since we have direct support for the AC Mesh now, use the proper
  name instead of the AC Lite image. For Ubiquiti, different device
  variants are now available as separate images.
- Remove left-over power-m-xw entry in cpuport file

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2020-06-18 12:41:03 +02:00
Fabian Bläse 328beebe32 fff-wireguard: Use babel type wired for wireguard babel peers
The babel interface type 'tunnel' has some disadvantageous properties for
our network.

First, babel tries to evaluate the tunnel performance using the rtt. However,
this makes the network quite unstable, as rtt might fluctuate a lot, especially
on less reliable connections (e.g. LTE). Instead of fully falling back to an alternate
route, this rtt evaluation leads to a lot of flapping routes. Additionally, rtt
evaluation changes the metric of routes quite often, which leads to many unnessessary
babel messages in our network.

Also, babeld disables split-horizon processing on 'tunnel' interfaces per default.
However, split-horizon processing can be done in our point-to-point tunnel setup without
any issues and has the advantage of significantly reduced babel messages on a link with
many uplink routes.

Therefore, wireguard babel peers now use the interface type 'wired'.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[bump PKG_RELEASE, adjust commit title prefix]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-18 12:24:40 +02:00
Fabian Bläse 9d000c96e0 alfred-proxy: Make curl silent
As we now log output of cron scripts to syslog, the debug
output of curl spams the rather short-lived syslog. As this
debug output is unessesary most of the time, it now is disabled.

Instead, curl's silent option is used, together with '-S', which
reenables error output.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-18 12:22:22 +02:00
Fabian Bläse 5cd46fb17b fff-hoods: Remove hardcoded IPv4 address and foreign domain
IPv4 is not a requirement for VPN nodes. However, a working DNS
is a requirement for nodes connecting via VPN. Therefore the
hardcoded IPv4 address is removed from the internet test.

To improve readability, a loop is used instead of having a seperate
ping command for each host. The ping utility built into our firmware
supports both IPv4 and IPv6.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-18 12:04:07 +02:00
Fabian Bläse 65f2af1ced fff-hoods: Add missing dependencies
The configurehood script unconditionally sources various
libraries from other packages, which previously have not
been included in the fff-hoods package dependencies.

Add the missing dependencies to fff-network, fff-wireless,
fff-timeserver and jshn.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-05-05 13:45:04 +02:00
Adrian Schmutzler d237fe5598 fff-timeserver: remove -q from uci and drop unused library source
Do not suppress errors from uci command without a reason.

While at it, remove unused sourcing of library. This is a left-over
from the transition to KeyXchangeV2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:44:30 +02:00
Adrian Schmutzler 5e4339e954 fff-alfred-proxy: remove uci -q and execute bit for uci-defaults
Do not suppress errors from uci command without a reason.

Despite, remove executable bit for sourced file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:43:45 +02:00
Adrian Schmutzler 7a54c56531 fff-gateway: Use return for errors in config version check
The concept of configuregateway is to respond on the return codes
of the gateway.d files, and exit if anyone returns something different
than zero.

Thus, let's not exit in gateway.d files directly, but stick to that
logic and return 1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:42:42 +02:00
Adrian Schmutzler 6d91d805a7 fff-gateway: improve order of commands for config version check
Move retrieval of config version, as it makes sense to check for
existance of containing file beforehand.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:42:19 +02:00
Adrian Schmutzler 4791c24608 fff-gateway: explicitly return status code 0 for version check
We check the return code in configuregateway, so let's give success
explicitly. This might not be strictly necessary now, but providing
it will make our lifes easier if the file is changed later.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:41:53 +02:00
Adrian Schmutzler 2f9e5f4af1 fff-gateway: provide specific error if config version is not set
This explicitly checks whether the config version is set at all,
instead of just comparing it, and provides a specific error message
for that case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:41:10 +02:00
Adrian Schmutzler f8ced0cc04 fff-gateway: suppress unwanted error for config existance check
We provide our own error message, so suppress the built-in one.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-05 13:40:18 +02:00
Fabian Bläse eac8292dba fff-macnock: update to latest revision
This updates the macnocker to a newer revision,
which moves 'interface not running' log messages to
log_trace, so it only appears when the highest debugging
level is activated.

Fixes: #139
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-05-01 17:47:25 +02:00
Adrian Schmutzler d649151399 fff-network: set correct CPUPORT for new mt76x8 devices
When adding support for the TP-Link Archer C50 v3 and TL-WR841N v13,
their CPU port provided for layer-3 setup has not been set correctly.

Do it now.

Fixes: d165915178 ("ramips/mt76x8: Add support for TP-Link Archer C50 v3")
Fixes: 9343153547 ("ramips/mt76x8: Add support for TP-Link TL-WR841N v13")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-01 17:47:18 +02:00
Fabian Bläse b9fe20c8e7 fff-macnock: Update to latest revision
This updates the macnocker to a newer revision, which
fixes log spamming if the batman interface is not running.

Fixes: #104
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 12:00:17 +02:00
Adrian Schmutzler 173ce577ae fff-macnock: clean up package variables
This removes unnecessary package variables and rearranges the
remaining ones based on the common style in OpenWrt trunk.

In particular, this drops PKG_VERSION in favor of PKG_SOURCE_DATE,
since it does not seem reasonable to tag a version every time we
want to pull it. Despite, while we effectively pull via the
variable PKG_SOURCE_VERSION anyway, the PKG_VERSION might even
have hidden changes if not properly adjusted.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-23 12:00:17 +02:00
Adrian Schmutzler 776cfe9f86 treewide: add "exit 0" for uci-defaults files
uci-defaults scripts are supposed to be run once after firstboot
and then removed. However, the removal only takes place if the
subshell created for the sourced scripts returns exit code 0.

For some of the files, the last command returned a different exit
code, though, leading to the script remaining in its location and
being executed for every boot.

To prevent cases like the latter, this adds an "exit 0" to all
uci-defaults files in our package store. While at it, remove the
shebang for all these files since they are sourced (and not
executed).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-23 12:00:17 +02:00
Adrian Schmutzler da6013ec97 fff-simple-tc: provide status via nodewatcher
Add traffic control status and rates to alfred data, which is also
available for the Monitoring then.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-23 12:00:17 +02:00
Fabian Bläse c7e9f514a5 nodewatcher: Only report batman_adv version if installed
The version of batman_adv is read in a script inside fff-nodewatcher,
so it is possible that batman_adv is not installed.

Therefore, a new test is added to check if batman_adv is installed,
before reading and reporting its version.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 12:00:17 +02:00
Fabian Bläse f26463628b nodewatcher: Exit nodewatcher if subscript fails
If a subscript exits with an exit status != 0, its output should not
be used. Because sending incomplete data sets might result in weird
edge cases, the nodewatcher is terminated and the output of other
subscripts is discarded.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 12:00:11 +02:00
Fabian Bläse 25c5edcf3c nodewatcher: Add prefix to debug messages
Because nodewatcher is executed using a cron, but
our cron has no way to report the origin of a specific
log entry, a 'nodewatcher:' prefix is added to all debug
output.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 11:56:28 +02:00
Fabian Bläse 2eb675790e nodewatcher.d: Remove $(date) from debug output
Debug output is written to stderr now.
Therefore the output is happening in real time and
the current date and time are not necessary anymore.

Typically the date and time are added by the syslog
daemon.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 11:56:19 +02:00
Fabian Bläse c1f694c319 nodewatcher: Output to stderr instead of log file
Maintaining a logfile manually is complicated and
has no major improvements over just logging to stderr,
because nodewatcher is no deamon and can be run manually
for debugging purposes.

Also, the debug output from subscripts currently is not
written to the log file anyway and the debug level is not
used eiher.

Therefore, the file logging and debug level is removed
from nodewatcher, which simplifies the code a bit.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-23 11:56:01 +02:00
Adrian Schmutzler 6c947f8c91 fff-hoods: Replace wifi command with reload_config
If wireless config has changed, reload_config will automatically
adjust wireless interfaces.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler a8f7dce6fc vpn-select: indent contents of make_config function
This is a purely cosmetic change to enhance the readability
of the function.

Also add some empty lines and comments for overview.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 91808ad710 nodewatcher: Use Makefile version for nodewatcher data
So far, nodewatcher version has to be specified twice, once in the
Makefile and again in the nodewatcher script.

With this patch, a version file is created during build than can
be read in nodewatcher script, so version only has to be specified
once anymore. The file name mimics the version files already present
for OpenWrt and our firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 498c6ad963 fff-nodewatcher: Consolidate code in nodewatcher.d/10-systemdata.sh
This consolidates the code in nodewatcher.d/10-systemdata.sh by:

- Slightly reordering data retrieval
- Moving XML node assembly to corresponding data retrieval, making
  the whole file easier to read
- Changing some if statements to shorter binary condition shortcuts
- Reduce the number of variables by merging some code into the XML
  node assembly

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 18e00a4e70 nodewatcher.d: Tiny cosmetic improvements
This applies some tiny improvements to just-moved nodewatcher.d code:

- Remove comments about obvious things
- Introduce newlines to make code easier to read
- Use shorter conditional syntax for easy cases

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 1c3243dd18 fff-nodewatcher: Tidy up uci-defaults script
This solves the following issues with the uci-defaults script in
fff-nodewatcher:

- Remove /bin/sh in non-executable file
- Only commit to changed config
- Use "-1" for uci node indexing, as this will be the node just
  created

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Tim Niemeyer b6c7acd704 nodewatcher: split into nodewatcher.d scripts for individual task
This splits up the data extraction/assembly of the nodewatcher
script into several parts and distributes them across packages, so
that each nodewatcher.d subscript is located in the package providing
the relevant functionality. This allows to extend the nodewatcher data
by enabling/disabling packages.
This scheme is not perfectly fulfilled for fff-network vs. fff-wireless,
as data cannot uniquely assigned there and the XML syntax does not allow
separation anyway.

In general, this moves code without applying code improvements, yielding
at an easy comparison of moved fragments. However, the following changes
were done to improve experience:

- The function writing debug output has been renamed from "err" to "debug"
- Since we catch the stdout of the nodewatcher.d functions anyway,
  those scripts were adjusted to echo output directly instead of first
  writing it into a variable and then outputting it at the end.
- The uci config has been kept, but initialization for the network part
  has been moved to the fff-network package.
- Space indent has been changed to tab, which is more common in the
  firmware and requires less space.
- Remove support for nodewatcher run without uci config. Script-based
  nodewatcher on other platforms will have altered code anyway, and
  splitting it up will prevent effective use as a blueprint for those
  cases. After this change, nodewatcher in firmware is supposed to be
  used only for this firmware.

Note that since the nodewatcher.d scripts are evaluated by using their
echo output, having a function created uncaught output to stdout there
will corrupt the XML.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
[rebase and adjustments for current master, use simpler mechanism to
call nodewatcher.d scripts, use tab indent, remove debug() definition
where not needed, do not remove uci config, add commit message, use
echo -n]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[remove 'local' modifier for variable not inside a function, fix typo]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Fabian Bläse 9957cd4318 fff-gateway: make uci query for vlan ports quiet
The user might create a vlan without any ports.
This setup lead to "uci: Entry not found" error messages,
while still working as intended.

The '-q' flag is added to the corresponding uci query to
hide this error. While this isn't strictly necessary, the
uci subcommand is quoted to bring it in line with the other
subcommands.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-17 17:08:16 +02:00
Johannes Kimmel a16800c683 fff-gateway: add vxlan package
This adds vxlan support to facilitate testing future uses for vxlan.

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-15 16:21:29 +02:00
Dominik Heidler 9343153547 ramips/mt76x8: Add support for TP-Link TL-WR841N v13
Flashing instructions:

The image can only be flashed via TFTP, not via WebUI.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "...-tftp-recovery.bin" to "tp_recovery.bin" and place
   it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.

ref: 24043a0d2e

Signed-off-by: Dominik Heidler <dominik@heidler.eu>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[add commit message, rebase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-15 16:08:44 +02:00
Fabian Bläse d165915178 ramips/mt76x8: Add support for TP-Link Archer C50 v3
This adds support for the TP-Link Archer C50 v3 and adds the
necessary mt76x8 (sub-)target to our firmare.

Flashing instructions:

The image can only be flashed via TFTP, not via WebUI.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "...-tftp-recovery.bin" to "tp_recovery.bin" and place it
   in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.

ref: 14951e8f8e

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[extend commit title and add commit message, rebase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-15 16:08:28 +02:00
Adrian Schmutzler eb784bd0db fff-sysupgrade: replace comma by underscore in image file names
On modern targets in OpenWrt, the board name follows the
"vendor,model" syntax. Since commas in file names are uncommon
and ugly, file names use the same pattern with an underscore,
"vendor_model".

Since this also applies to image file names, this patch
adjusts fff-upgrade.sh to replace the comma from board name
by an underscore for all devices. This should be possible
without harm as OpenWrt images can safely be expected to
either contain a comma in the right place or no comma at all.

It has been discussed whether the same should be applied to
the network.* files as well. However, expecting those to
be removed in the foreseeable future does make this undesirable,
as a lot of code would be inserted now and be removed again a few
months later, only to fix the name for one device.

For the same reason, we won't touch the board name replace
for the TL-WDR4900 v1 for now.

Suggested-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-02 13:07:26 +02:00
Adrian Schmutzler be80e17c57 ar71xx: remove non-existant ubnt-power-m-xw
The ubnt-power-m-xw identifier was introduced in 0447d0c709
("fff-boardname: introduce new ubnt boards") assuming that the
Ubiquiti Powerbeam M2 XW had a separate model identifier in
/var/sysinfo/model (otherwise, it was derived from loco-m-xw image).

However, OpenWrt has never known about a PowerBeam device. Consequently,
on devices nothing changed, and all PowerBeam devices were still
recognized as Nanostation Loco M XW.

Thus, this patch removes all references to a ubnt-power-m-xw, as it's
never been working anyway.

Note that this also implies that any user of a PowerBeam would have
used the wrong antenna_gain values of the Loco M XW by default (and
will continue to do so).

However, actually the Loco M XW has never been tested or supported
officially for this firmware. The image was only used for the
support of the Powerbeam M2 XW in 68314ea943 ("Add support for
Powerbeam M2 XW"). However, since the firmware is expected to work
and seems to be installed on several devices already, we won't remove
the image for now.

For further reference:
The board and model names set in ar71xx are found in the OpenWrt file
target/linux/ar71xx/base-files/lib/ar71xx.sh

Fixes: 0447d0c709 ("fff-boardname: introduce new ubnt boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-31 23:35:40 +02:00
Christian Dresel e3df4720f8 fff-webui: show fastd public key in webui
User can see the fastd public key in the webui

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-30 11:57:15 +02:00
Fabian Bläse 3a845b541b Add support for Archer C2600
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-30 11:56:17 +02:00
Adrian Schmutzler 4bb31a75f2 show_info: Treat case of missing simple-tc package
Suppress error in show_info when simple-tc is not built into the
firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-22 20:01:12 +01:00
Adrian Schmutzler 93cebbf3f7 packages/fff: Add fff-simple-tc
This new packages is meant to serve as meta-package to store
setup for simple-tc.

This achieves two objectives:
- Increase general maintainability by having relevant code in one
  location.
- Provide the option to include/exclude simple-tc functionality
  just by selecting/deselecting the fff-simple-tc package.

This will allow for easier testing of image size impact of this
functionality, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-22 20:00:55 +01:00
Adrian Schmutzler aa0d237fa9 fff-network: apply upstream swap of MAC addresses for Archer C60
The ethernet MAC addresses of the Archer C60 v1/v2 were swapped
compared to the vendor assignment. This has been fixed in OpenWrt
after 19.07.2.

Apply this to our firmware already, so we cannot forget it later
and prevent having messed-up br-mesh MAC addresses.

The OpenWrt patches can be removed again when bumping to 19.07.3.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:56 +01:00
Adrian Schmutzler aa42a39ce2 fff-network: use static MAC address location for TL-WR1043ND v4
At the moment, the ETHMESHMAC for the TL-WR1043ND v4 is loaded from
the config partition. The data there is written by the stock firmware,
and thus is dependent on the version installed before and may even
vary in position.

Instead, this patch uses the product-info partition, which is not
modified by stock firmware.

While at it, update the sourced library files and the comment for
both v4 and v5.

ref: 53839da46e

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:55 +01:00
Adrian Schmutzler 73e227cdc8 fff-network: account for MAC address change of TL-WDR3600/43x0
In OpenWrt commit 27eea249213b ("ar71xx: fix MAC address setup for
TL-WDR4300 board") the LAN/WAN MAC addresses for the TL-WDR3600,
TL-WDR4300 and TL-WDR4310 were changed.

This creates an overlap of the LAN und 5 GHz MAC addresses, where
the first will also affect the BATMAN interface eth0.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC to eth0 +1, corresponding to the virtual WAN device
(VLAN 2) OpenWrt sets up (which we aren't using anyway).

ref: https://github.com/openwrt/openwrt/commit/27eea249213b04a372491009850926f9282d13

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:54 +01:00
Adrian Schmutzler 7614dc5584 fff-network: account for MAC address change of Archer C7 v2
In OpenWrt commit 8a21bc36229d ("ar71xx: fix MAC addresses for
Archer C5 v1, C7 v1/v2, WDR4900 v2") the WiFi MAC addresses for
the Archer C7 v2 were changed.

This creates an overlap of the LAN und 2.4 GHz MAC addresses, where
the first will also affect the BATMAN interface eth1.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC from eth0, corresponding to the separate WAN
device we are not using in our firmware anyway.

ref: https://github.com/openwrt/openwrt/commit/8a21bc36229d3eabad213ae47fddb4d86d76ac

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:53 +01:00
Fabian Bläse 0c3429f3fb fff-web: Use iw instead of iwinfo for wifiscan
This prepares the fff-web package for removal of the iwinfo binary.

Instead of using the 'iwinfo' wrapper, the nl80211 utility 'iw' is used
from now on, which is possible, because we only support devices with
nl80211 drivers anyway.

Because iw reports the frequency instead of the channel, and does not allow
easily parsing the mode and encryption parameters, the table is adjusted accordingly.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-03-15 22:04:48 +01:00
Fabian Bläse fe6ae924aa fff-hoods: manually create wifi station interface
The mac80211 interface script in OpenWrt depends on wpa_supplicant
for the creation of station interfaces. While this is conveniant, it
isn't strictly necessary for connecting to unencrypted networks.

To be able to create station interfaces if wpa_supplicant is removed,
the station interface for obtaining the initial configuration is now
created using iw commands only.

This makes it possible to replace wpad-mini with hostapd-mini, which
does not include wpa_supplicant and therefore shrinks the uncompressed
binary by around 200KiB.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-15 22:04:45 +01:00
Adrian Schmutzler 5ebb60f0ef fff-batman-adv/-server: Remove KMOD for symbols
This follows the changes introduced in
6a25fd5ce5

This is a result of the switch to openwrt-19.07.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: Rebase onto fff firmware master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:44 +01:00
Adrian Schmutzler 9f25f5dc35 batman-adv: Split batadv proto in meshif and hardif part
This migrates to the new configuration architecture introduced
and required in
54af5a209e

This is a side-effect of the switch to openwrt-19.07.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: Rebase onto fff firmware master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:43 +01:00
Adrian Schmutzler 47de26817b fff-wireless: always disable rssileds if package is installed
This always disables rssileds if the package is installed, and thus
saves us from specifying particular devices.

Since rssileds do not work with our concept of resetting WiFi
interfaces, we cannot use it anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-01-18 19:50:54 +01:00
Christian Dresel 38d2a5a704 fastd: make secret key update-safe
To use a whitelist easily, it is necessary to make the fastd key
update-safe.
This patch saves the key to uci fff config and recovers it for
use after a firmware upgrade.

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: lemmi <lemmi@nerd2nerd.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE, rephrase commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-01-10 14:31:58 +01:00
Adrian Schmutzler 1c014d04f4 fff-boardname: start uci-defaults script early
The WiFi configuration scripts have been moved to an earlier point
in initialization sequence in c39de8f7d5 ("fff-wireless: initialize
WiFi config before setting up wXsta"), which has them run before
the script setting board name in uci config files. Since the script
setting manual antenna gain and fixing rssileds depends on having a
board name, though, the move broke this functionality.

Since the board name set up script itself does not depend on anything
else in the uci-defaults scripts, let's move this one to a relatively
early point in initialization (and save us from touching anything
else).

Fixes: c39de8f7d5 ("fff-wireless: initialize WiFi config before setting up wXsta")
Fixes: #135

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-01-04 13:46:23 +01:00
Christian Dresel 08c210a309 gateway.d: use correct function name for apply hook
The configuregateway script calls only "apply" and not "commit".

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[commit title and message facelift, bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-12-30 15:18:14 +01:00
Fabian Bläse 99bce95f80 fff-wireless: Use previous HT/VHT mode instead of detecting capabilities
Previously the HT/VHT mode was detected using the output of iw phy. This
command erroneously used the $radio variable, which doesn't contain the
phy name. Therefore it doesn't work like it is supposed to.

As we don't completely configure the wifi-device sections, but only adjust
some of OpenWRTs default values, the HT/VHT detection can easily be done by
just checking if the previous mode did contain "VHT".

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-24 12:52:05 +01:00
Adrian Schmutzler 6a43b7dfdb fff-sysupgrade: move /etc/sysupgrade.sh to /sbin/fff-upgrade.sh
The old name "sysupgrade.sh" is easy to be confused with OpenWrt's
/sbin/sysupgrade. Rename our script to clearly indicate its
purpose.

While at it, move from /etc to /sbin, as the former is an odd location
for an executable script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-12-14 12:08:03 +01:00
Fabian Bläse 30c7541e6f fff-network: Add portorder to Archer C7v2
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:02:26 +01:00
Fabian Bläse 8d66bdf35c fff-network: Only use one Switch Port on Archer C7v2
Previously the TP-Link Archer C7v2 was configured to use
two Switch CPU Interfaces. One for Trunk (Client + Batman), one
for WAN.

As this setup is very uncommon in our firmware at the moment and does interfere
with the automatic CPU Port setup in layer3 variant, it is converted to a single
trunk port setup just like all of the other routers with integrated managed switches.

As eth0 is now used as the switchport, this change would require to setup
a different ETHMESHMAC if mac addresses would be shared between interfaces.

The device does seems to have 4 discrete mac addresses however, so the
explicit ETHMESHMAC setting is completely removed instead.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:02:06 +01:00
Fabian Bläse d718d0faa9 fff-wireless: Set htmode to VHT for 802.11ac capable radios
To make use of MCS 8 and 9 which have been introduced with
802.11ac, htmode has to be set to VHTxx.

By checking if the radio supports it, the htmode is configured
to the appropriate HT/VHT setting.

Fixes: #130
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:01:39 +01:00
Adrian Schmutzler c39de8f7d5 fff-wireless: initialize WiFi config before setting up wXsta
The script for setting up wXsta (/etc/uci-defaults/24c-fff-wXsta) runs
before the main WiFi config script (/etc/uci-defaults/60-fff-wireless),
so the wXsta config is deleted again by

config_foreach removeWifiIface wifi-iface

This moves the latter script (and another script for WiFi config)
before the wXsta setup, so the WiFi config will be set up correctly.

Fixes: #128
Fixes: 3d9eb1db2e ("fff-hoods/fff-wireless: Reconfigure instead of
delete and create")
Reported-by: Christian Dresel <fff@chrisi01.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-30 20:07:23 +01:00
Fabian Bläse 141f48389d fff-wireless: Hide errors if device doesn't have radios
Some output and exit status are hidden, as they are a valid behaviour
if the device doesn't have any radios.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 21:59:39 +01:00
Fabian Bläse d968665704 fff-hoodutils: Add fallback for upgrade path
If no hoodfile is present or hoodfile support is not compiled
into the firmware, no upgrade path is available. This currently
is the case for layer3 variant.

A fallback to our default firmware host is added. At the moment
both variants don't have a trust anchor for TLS and the wget, that
is currently used, doesn't support TLS. Therefore it is currently
necessary to use a unencrypted http URL.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 14:29:15 +01:00
Fabian Bläse be04d36784 fff-hoodutils: Adjust upgrade path function for changed folder structure
As we now have multiple variants, the binaries on the update server
should be seperated into different directories.

To allow the firmware to decide which variant it wants to download,
the "$VARIANT/current" part is removed from the hoodfiles. Instead
it is added inside the upgrade path function in fff-hoodutils.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-23 14:29:06 +01:00
Fabian Bläse 3e1f6e167d Remove target and subtarget from filename
This simplifies and shortens filenames quite significantly.

A rewrite script will be installed on the update servers
to allow updating routers with older firmwares.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-20 20:05:03 +01:00
Fabian Bläse 87f6f9969f fff-web: Do not remove uploaded binary on sysupgrade failure
For some reason sysupgrade seems to return exit status != 0
even on successful calls. As the binary is removed if
sysupgrade exists with a failure status, it is possible that
it got deleted while a sysupgrade has been in progress.

This removal was added to ensure that only one binary occupies
space in tmpfs (which is stored in memory) when upgrading.
If sysupgrade fails and the user starts another try, the old
binary is overwritten by moving the new one to the same location.

Therefore the removal of binaries on sysupgrade failure can be
removed completely.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-11-20 20:01:33 +01:00
Adrian Schmutzler 1a835f664c fff-wireless: improve treatment of dysfunctional rssileds
The rssileds set up by OpenWrt cannot be used in our firmware.
Despite that those are bound to "wlan0" initially, we also cannot
change them to one of our interfaces, as the interface recreation
due to configurehood seems to break something in rssileds, causing
high load.

This patch now disables the rssileds entirely, which has been found
to be the only solution reliably solving the problem of high load
under all circumstances.

While at it, add all remaining devices with rssileds enabled in
openwrt-18.06. (When updating to openwrt-19.07, most of the ubnt
will have to be added.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-19 22:27:56 +01:00
Adrian Schmutzler 329ed31cde fff-wireless: merge WiFi adjustments into one simple script
This merges the wifi.* files into a single script, which improves
overview/manageability and makes merging of cases possible.

While at it, remove suppression of errors with "-q".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-19 22:27:21 +01:00
Adrian Schmutzler 1e963f5f39 Add support for Archer C60 v2
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-19 22:21:42 +01:00
Adrian Schmutzler 2b77353685 packages/fff: Merge meta packages for variants into config packages
So far, we have meta packages and config packages for the variants
in parallel, e.g. fff-node and fff-variant-node.

Since the sole purpose of the meta packages is to define
dependencies, one can just merge them into the corresponding config
packages to reduce overhead.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-17 15:48:50 +01:00
Adrian Schmutzler 6f132f858e firewall.d: Check for unset IF_WAN
In some cases (mostly for one-port devices) IF_WAN was used
although not set, resulting in not obviously iptables error
messages like

- Bad argument `conntrack'

- Bad argument `REJECT'

Thus, check whether IF_WAN is set to something before using it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-17 15:46:34 +01:00
Adrian Schmutzler 40cad0a9b9 treewide: Force use of busybox wget
In OpenWrt commit 055cdab2bb22 ("uclient: add ALTERNATIVES for wget")
uclient is registered as ALTERNATIVES provider for wget. Since
the priority for busybox as provider is lowest, this overwrites
the link set for /usr/bin/wget, now pointing to uclient wget.

However, uclient wget does not support IPv6 link-local addresses,
as it's not aware of the "%" to separate address from link identifier.

To prevent wget from failing when those addresses are used, this
patch explicitly uses busybox wget.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-11-17 15:45:24 +01:00
Fabian Bläse 6724aaedee Move node-specific firewall rules to fff-node
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-11-10 14:27:46 +01:00
Fabian Bläse ccfde6c655 fff-network: Remove dependency to uradvd
As odhcpd is used as router advertisement server in layer3 variant,
but configurenetwork is still necessary, the dependency to fff-uradvd has
to be removed.

This is done by first checking, if the fff-uradvd service exists, before it
is restarted.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-10 14:22:56 +01:00
Fabian Bläse 3f86bfc70a fff-wireless: Add gateway configuration scripts
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-10 14:22:29 +01:00
Fabian Bläse 03d94d92fd nodewatcher: Add support for babel neighbours
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-10-21 13:53:32 +02:00
Robert Langhammer d989f435e6 fff-network: Have WAN sysctl commands executing after global ones
On layer3 variant ("gateway firmware"), 60-fff-gateway.conf
changes "forwarding" for all interfaces, overwriting the
changes from 51-fff-network-$iface.conf.

By putting the WAN-specific commands after 60-fff-gateway.conf
this patch should provide the correct device-specific value
for WAN interface now.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Rephrased commit title and added message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-10-07 16:20:35 +02:00
Fabian Bläse cac9b55aa2 nodewatcher: Send babeld version
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-10-07 14:44:10 +02:00
Fabian Bläse 199058d110 babeld: Automatically add redistribute filters
babeld filters routes before announcing them with the
redistribute filters.

Users might add unknown public subnets to the client interface,
so redistribute filters have to be generated for these addresses.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2019-09-30 10:38:16 +02:00
Fabian Bläse c3f8b808ec fff-gateway: Add sanity checks
This adds two checks:
- Does gateway config exist?
- Does gateway config version match?

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:29:25 +02:00
Fabian Bläse 40e1577a50 configuregateway: Print newlines for improved readabilty
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:27:07 +02:00
Fabian Bläse 6fdc930301 Add support for Ubiquiti EdgeRouter X (SFP)
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-09-29 21:18:11 +02:00
Fabian Bläse d8ea5c652f fff-gateway: Add firewall rules to ensure nothing is forwarded onto WAN
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:14:17 +02:00
Fabian Bläse 6c706432a6 Create fff-node package
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:13:54 +02:00
Fabian Bläse d7737beb8c Rename variant meta-packages to avoid confilcts
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-09-29 21:13:20 +02:00
Adrian Schmutzler 004b386d55 nodewatcher: Remove leftover use of batman-adv sysfs
In d9ec8edb15 ("batman-adv: Move from DEBUGFS to batctl") we
switched from deprecated DEBUGFS to batctl.

Despite debugfs, batctl seems to also have deprecated sysfs
(https://www.open-mesh.org/news/90).

This patch thus replaces a reference to iface_status by the
corresponding batctl command.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-21 18:16:09 +02:00
Alexander Gutzeit ca40d2d766 fff-wireguard: rename keys to remote_public_key/local_private_key
This renames two options for wireguard interfaces in
/etc/config/gateway:
public_key -> remote_public_key
private_key -> local_private_key

Signed-off-by: Alexander Gutzeit <alexander.gutzeit@web.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
[adjusted commit message/title, added version bump, remove
rename for network config]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-08-21 18:14:30 +02:00
Robert Langhammer 854ba40568 package/fff: add ip-full to variant layer3
"ip" is one of the most essential tools on a gateway. At the moment
there is only one dependency to the metapackage ip from the nodewatcher,
which pulls ip-tiny. Dropping the nodewatcher causes a fallback to the
busybox built-in ip-command.

Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[fabian@blaese.de: rebase onto master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2019-08-14 00:38:29 +02:00
Fabian Bläse 2978cbeb4e Add fff-wireguard package
This package adds gateway.d scripts which create
peering interfaces using wireguard.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:33:07 +02:00
Fabian Bläse 104a260843 fff-babeld: Add prefix to configuration name
When the user removes a peer from /etc/config/gateway,
the script has to be able to find any leftover configurations
that have been created for it.

This can be made very easy by prepending a prefix to every
automatically generated configuration.

This also allows to remove the nasty check for the babeld default interface.
Therefore the naming check for cfg* also can be removed.

As a side effect all manually created configuration blocks that do not match a
prefix will not be touched by configuregateway.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:32:44 +02:00
Fabian Bläse 53ff6f631b fff-babeld: Move common babeld procedures into functions
Various things have to be done for every interface on
which babeld shall run.

Those procedures are moved into functions to reduce duplicate code.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-14 00:32:18 +02:00
Adrian Schmutzler fbc7dab6de fff-support: Add device name and firmware version to MOTD
This adds a line containing the device name and the current
firmware version to the MOTD shown after logging in via SSH, e.g.

> TP-Link TL-WR1043N/ND v2 @ jubtl9_20190320

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:47:51 +02:00
Adrian Schmutzler 4d5731341b configurehood: Do not suppress uci errors where not necessary
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:36:38 +02:00
Adrian Schmutzler 3d9eb1db2e fff-hoods/fff-wireless: Reconfigure instead of delete and create
Previously, when configurehood switched status, all WiFi devices
were completely rewritten and all interfaces were deleted and
recreated. This is both unnecessary and ugly.

This patch redesigns WiFi setup to create all interfaces (in
parallel) initially, and then only to enable/disable them as
necessary. Where reconfiguration is necessary, only the variable
parts are changed.

Since most of the wifi-device config is already created by
OpenWrt, this builds based on the existing wifi-devices and
only removes the default wifi-ifaces.

This patch will not change the logic (codeflow) of configurehood,
but only affects how action on the WiFi devices/interfaces is
taken.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:34:56 +02:00
Adrian Schmutzler 8a1eb6d4c8 fff-wireless: Also use wXmesh label for wXibss
The two different names "wXmesh" and "wXibss" have no functional
purpose and are just for indication. Remove this distinction, so
mesh is just mesh.

This will make further adjustment easier and clearer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-22 22:33:33 +02:00
Adrian Schmutzler 99d7a95d04 fff-tunneldigger/tunneldigger: Remove packages
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:59:58 +02:00
Adrian Schmutzler b38578aded show_info: Remove L2TP diagnostics
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:59:12 +02:00
Robert Langhammer 5a119dcda8 fff-nodewatcher: remove l2tp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Bump PKG_RELEASE and SCRIPT_VERSION]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:57 +02:00
Robert Langhammer cc59852570 fff-web: remove l2tp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:48 +02:00
Robert Langhammer 4941d6eff5 fff-vpn-select: remove tunneldigger
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Rebased, updated PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:13 +02:00
Adrian Schmutzler 0889cf35d8 packages/fff: Tidy up wget dependencies
The symbols BUSYBOX_CONFIG_WGET and
BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT are set in different
packages and do not correlate with where Busybox wget is
actually used.

This updates packages dependencies based on the current
situation.

Note that with current firmware, both two versions of wget
are installed:
/bin/wget
/usr/bin/wget

The latter is from busybox and is used as the default version.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-01 23:04:21 +02:00
Adrian Schmutzler e9268539d1 packages/fff: Only use PKG_RELEASE for our own packages
PKG_VERSION is meant to refer to the version of external packages,
as we do e.g. in the tunneldigger package.

For our own packages, we just need the PKG_RELEASE variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[Rebased onto current state of master]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-07-01 21:54:09 +02:00
Adrian Schmutzler 26b3a13b7c alfred-json: Set PKG_VERSION to latest official version
Although this tag is very old, this is how PKG_VERSION is meant
to be used.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-01 21:37:23 +02:00
Fabian Bläse 3b746e022e Add support for TP-Link Archer C7 v5
Signed-off-by: Fabian Bläse <fabian@blaese.de>
[freifunk@adrianschmutzler.de: Added Portorder]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-06-22 21:55:17 +02:00
Fabian Bläse 2f359a3e00 fff-babel: add configuration scripts
This adds a configuration script to allow configuration
of babel with configuregateway.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
2019-06-22 21:25:18 +02:00
Adrian Schmutzler 06bf24f639 fff-batman-adv-legacy: Remove unused package
This hasn't been used since it was replaced. Remove it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:46:50 +02:00
Fabian Bläse 275c4b255c fff-dhcp: Add configuration scripts for dns
Because DNS Forwarding is done by dnsmasq which we configure
inside the fff-dhcp package, the configuration scripts for dns
are placed in this package.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:45:28 +02:00
Adrian Schmutzler 02fae91477 fff-macnock: Add dependency from tc
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-06-15 12:32:22 +02:00
Fabian Bläse 29d5a10153 gateway.d: Remove output from meta script
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:17:18 +02:00
Fabian Bläse 656102999a packages/fff: Only use fff-batman-adv for node-variant
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:47 +02:00
Fabian Bläse 07b6a6eb3a packages/fff: layer3-variant: Add useful debugging tools
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:37 +02:00
Fabian Bläse 4fb9c4c652 fff-sysupgrade: Add gateway config to sysupgrade.conf
User configuration for layer3 firmware is stored in
/etc/config/gateway. To preserve this file across updates it
is added to sysupgrade.conf

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:23 +02:00
Fabian Bläse b652825b7a packages/fff: Use fff-gateway package when compiling layer3 firmware
fff-gateway is mandatory when compiling layer3 firmware.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 18:16:18 +02:00
Adrian Schmutzler 1fef2e4117 fff-wireless: Raise MTU for 802.11s mesh to 1560
This will prevent batman-adv packet fragmentation on 802.11s mesh.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:23:32 +02:00
Adrian Schmutzler fe9c5919e6 fff-network: Remove MTU 1528 from ethmesh device
This interface was using 1500 anyway and setting ethernet to
MTU > 1500 might not be a good idea.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langammer <rlanghammer@web.de>
2019-05-31 17:22:52 +02:00
Adrian Schmutzler 9c5b65a770 configuregateway: Only match "function" in subshell
When running OpenWrt master, "type <functionname>" only returns
"<functionname> is a function". Thus, to make the implementation
future-proof and since it is also working with the current state,
change the grep in execute_subshell to match "function".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:21:10 +02:00
Adrian Schmutzler dbd8607b53 upgrade.html: Rename uploaded firmware before sysupgrade
At the moment sysupgrade via WebUI is broken on many devices.
This is reproducible: While the (few) status messages seem
normal, the device boots again with the old firmware.
Sysupgrade via SSH always works.

The sysupgrade call in upgrade.html directly uses the path of
the uploaded firmware file as argument. From several tests and
based on caught stdout/stderr from this line, it looks like haserl
deletes the uploaded firmware file due to a hidden trigger before
or even while it is processed by sysupgrade.

The easiest way to work around that is to just rename the file
before using it as argument to sysupgrade. This will preserve the
file DURING sysupgrade. If sysupgrade fails explicitly (status
code != 0), remove the file to provide sufficient memory for
another upload.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-31 17:18:18 +02:00
Fabian Bläse 590dbca7a9 gateway.d: Add scripts for network configuration
This adds scripts to configure vlan and client network.
This also adds sysctl settings to enable forwarding.

Note:
Devices specific properties are sourced from fff-network package.
This creates a dependency on fff-boardname and fff-network.
These properties should be located elsewhere in the future.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-05-25 19:26:00 +02:00
Adrian Schmutzler 555e91628b fff-network: Provide script with CPUPORT
This provides the CPUPORT which is needed for the gateway firmware.
The script is supposed to be sourced.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-05-25 19:22:49 +02:00
Fabian Bläse d687823a27 gateway.d: Add configuration script for meta information
This adds a configuration script for applying hostname,
coordinates, hoodname and contact address.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-05-09 11:03:32 +02:00
Fabian Bläse b40c45b69c fff-gateway: add package
This introduces a new script for simple gateway configuration.

The main configuregateway script is able to execute functions
for various steps like 'configure' or 'apply' from scripts in /etc/gateway.d.

This makes it easy to distribute configuration to the appropriate packages.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-05-09 11:03:13 +02:00
Adrian Schmutzler d9371a7a22 configurehood: Leverage -H option for batctl
Since batctl can suppress headers, we do not have to count lines.

Cosmetical change.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-04-15 15:54:41 +02:00
Adrian Schmutzler 518c0d6fef fff-sysupgrade/fff-web: Free cache before upgrade
This might reduce the chance to break devices with 32 MB RAM
during sysupgrade.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-04-15 15:54:18 +02:00
Adrian Schmutzler d9ec8edb15 batman-adv: Move from DEBUGFS to batctl
The debug filesystem will be deprecated and disabled by default
in newer versions of B.A.T.M.A.N.

This patch switches our code to the batctl, as recommended.

Since batctl can suppress headers, this actually makes our life
easier ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-03-27 18:24:29 +01:00
Adrian Schmutzler 95a22327fe fff-base: Fix another indent
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-02-10 22:45:46 +01:00
Adrian Schmutzler d0d8fc57af configurenetwork: Tidy-up auto configuration functions
This fixes a typo in description and introduces a single variable
for the sysctlfile.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-02-10 22:44:26 +01:00