Commit Graph

90 Commits

Author SHA1 Message Date
Jan-Niklas Burfeind
38fd6bc96e gluon-mesh-vpn-fastd: migrate to spdx license header 2023-01-09 22:35:50 +01:00
Matthias Schiffer
20eea9b9ca
gluon-mesh-vpn-fastd: fix respondd segfault under load (#2594)
When running "fastd -v" fails, line may be NULL, causing a segfault in
strncmp.
2022-08-09 20:09:31 +02:00
lemoer
7c81897b4c gluon-mesh-vpn-*: make vpn MTU provider specific
If a community uses different vpn providers, they typically
assume the same MTU for the wan device underneath the VPN. As
different VPN providers however have different overhead, the MTU
of the VPN device differs for each provider. Therefore this
commit makes the MTU of the VPN device provider specific.

This has two advantages:
1. The same site.conf can used to bake firmwares for different
   VPN providers (only by selecting a diferent vpn feature in the
   site.mk).
2. We are coming closer to the option of integrating multiple VPN
   providers into one firmware.
2022-05-21 18:12:49 +02:00
Matthias Schiffer
7c6befc7c3
gluon-mesh-vpn-fastd: add L2TP offload support 2022-02-08 21:09:15 +01:00
Matthias Schiffer
15eeb86f42
gluon-{,web-}mesh-vpn-fastd: add support for null@l2tp method
THe "null" and "null@l2tp" methods are considered equivalent and always
added and removed together when the method list is "configurable".
"null@l2tp" is added before "null", so it is preferred when the peer
supports both.
2022-02-08 21:01:42 +01:00
Matthias Schiffer
487d312d25
fastd: update and add L2TP variant
This also drops the GMAC-based methods from gluon-mesh-vpn-fastd's
check_site.lua, as they are not supported anymore.
2022-02-08 21:01:42 +01:00
Matthias Schiffer
b68a07e930
gluon-mesh-vpn-fastd: merge secret generation setup into main upgrade script
There wasn't really a reason to have a separate script to set a single
value.

In addition, the old script was using the identifier 'c' instead of
'uci' for the UCI cursor. Following the convention of the other scripts
is helpful so it is easy to grep for all uses of a certain config file/
option.
2022-01-23 14:44:06 +01:00
Maciej Krüger
78ca654c5c
gluon-mesh-vpn-fastd: fix empty string key
Co-Authored-By: Matthias Schiffer <mschiffer@universe-factory.net>
2022-01-14 04:53:28 +01:00
Matthias Schiffer
eaac48e20d
gluon-mesh-vpn-fastd: remove obsolete migration 2022-01-01 01:46:19 +01:00
Matthias Schiffer
f419db58a2 Set PKG_VERSION in gluon.mk
This removes PKG_VERSION and PKG_RELEASE from most Makefiles, as the
value was never useful for Gluon packages; instead, PKG_VERSION is set
to 1 in gluon.mk.

It also removes two other weird definitions:

- gluon-iptables-clamp-mss-to-pmtu replicating the old PKG_VERSION logic
  from gluon-core, but without the fixed PKG_BUILD_DIR to prevent
  unnessary rebuilds
- gluon-hoodselector set GLUON_VERSION=3
2021-10-07 23:42:38 +02:00
Matthias Schiffer
c23bc293ef treewide: remove GLUON_SPECIALIZE_KERNEL
With the removal of ramips-rt305x, the last user of
GLUON_SPECIALIZE_KERNEL is gone.
2021-07-13 21:37:39 +02:00
David Bauer
98a1c196ed mesh-vpn: fully abstract VPN methods
This fully abstracts VPN methods, making gluon-mesh-vpn-fastd and
gluon-mesh-vpn-tunneldigger completely self-contained.

Provide a LUA interface for generic interacting with VPN methods in
gluon-mesh-vpn-core and web packages.

This also adds the ability to install tunneldigger and fastd to the same
image, selecting the VPN method based on the selected domain.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-05-22 06:54:23 +02:00
Jan-Tarek Butt
22847e4986
gluon-reload: add missing service restarts on domain switching
[Matthias Schiffer: fix up start/stop order and file permissions]
2020-05-28 23:30:25 +02:00
Matthias Schiffer
3ccf7fdd96
gluon-mesh-vpn-fastd: clean up peers and groups on update
The 'preserve' flag can be used to mark a peer so it is not removed or
modified on upgrades. In addition, groups containing preserved peers are
not removed.

Fixes: #557
2020-05-10 14:30:25 +02:00
Matthias Schiffer
b019c703c9
gluon-mesh-vpn-fastd: reduce complexity of upgrade script 2020-05-10 13:06:00 +02:00
bobcanthelpyou
4249d65af7 treewide: fix luacheck warnings 2019-06-16 22:51:53 +02:00
Tata
e81d1a390f Add mechanism to reload domain related services (#1710) 2019-04-23 17:34:49 +02:00
Matthias Schiffer
994c94918a
treewide: automatically set SECTION and CATEGORY for Gluon packages 2018-04-14 00:01:04 +02:00
Matthias Schiffer
74f4119c1b
treewide: add support for building kernel modules used by Gluon into the kernel 2018-04-13 17:32:20 +02:00
Matthias Schiffer
60522ee253
treewide: move package Makefile boilerplate to gluon.mk 2018-03-08 19:49:41 +01:00
Matthias Schiffer
934221b86f
treewide: remove redundant definitions from package Makefiles 2018-03-07 21:23:41 +01:00
Martin Weinelt
42763d21dc
gluon-mesh-vpn-core: add public key to nodeinfo response
This is currently only implemented in the gluon-mesh-vpn-fastd
package.

Advertising the public key may be deemed problematic when
your threat-model involves protecting the nodes privacy
from tunnel traffic correlation by onlink observers.

It can be enabled by setting site.mesh_vpn.fastd.pubkey_privacy
to `false`.
2018-02-04 20:47:53 +01:00
Matthias Schiffer
7ccdacd294
treewide: rework check_site_lib.lua
In addition to significant internal differences in check_site_lib.lua (in
particular unifying error handling to a single place for the upcoming
multi-domain support), this changes the way fields are addressed in site
check scripts: rather than providing a string like 'next_node.ip6', the
path is passed as an array {'next_node', 'ip6'}.

Other changes in site check scripts:
* need_array and need_table now pass the full path to the sub fields to the
subcheck instead of the key and value
* Any check referring to a field inside a table implies that all higher
levels must be tables if they exist: a check for {'next_node', 'ip6'} adds
an implicit (optional) check for {'next_node'}, which allows to remove many
explicit checks for such tables
2018-01-19 10:12:43 +01:00
lemoer
50812b162c
treewide: forbid use of selected site variables in domain specific or site configs
[Matthias schiffer: rebase, add a few more restrictions]
2018-01-19 04:05:27 +01:00
Christof Schulze
86e89a86d1 gluon-mesh-vpn-fastd: make respondd module compile again (#1228)
by moving the declaration of ret to the top of get_fastd()
2017-09-24 23:49:00 +02:00
lemoer
4899dda4af treewide: check for NULL after uci_alloc_context() (#1224) 2017-09-21 20:56:40 +02:00
Matthias Schiffer
ee6afaced9
treewide: use new gluon.site Lua library
Some files have received some additional refactoring.
2017-08-11 22:07:34 +02:00
Matthias Schiffer
952439885e
gluon-mesh-vpn: fix fastd <-> tunneldigger migration
The generic upgrade script is moved to run after the more specific scripts.
In addition, the script will now remove the configuration sections of
uninstalled VPN packages, so both positive and negative changes of the
default enable state can be migrated correctly.

Based-on-patch-by: Cyrus Fox <cyrus@lambdacore.de>
Fixes: #1187
2017-08-08 01:39:29 +02:00
Matthias Schiffer
9dae2ebbfd
gluon-mesh-vpn-fastd: respondd: adjust for new site.conf mesh VPN structure
Fixes #1130
2017-06-01 16:23:51 +02:00
Matthias Schiffer
be88eba07f
Refactor common parts of gluon-mesh-vpn-fastd into a gluon-mesh-vpn-core package
The fastd_mesh_vpn site.conf section is renamed to mesh_vpn.fastd.
2017-03-10 19:45:34 +01:00
kb-light
558e98ae42 gluon-mesh-vpn-fastd: improve check_site 2017-02-21 11:19:44 +01:00
Christof Schulze
6a5a7a7131 gluon-mesh-vpn-fastd: do not depend on gluon-mesh-batman-adv (#1041)
In preparation for Babel support.
2017-02-13 21:00:54 +01:00
Matthias Schiffer
c83b5b3cab
treewide: get rid of luci.util outside of config mode/advanced settings 2017-02-10 02:10:01 +01:00
Matthias Schiffer
6cf03bab37
treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies
We also make use of the boolean support of simple-uci to make scripts
clearer.
2017-02-10 02:10:01 +01:00
Matthias Schiffer
2dd8a700ca
package: avoid use of GLUONDIR variable 2017-01-17 21:22:58 +01:00
viisauksena
539081d315 gluon-mesh-vpn-fastd: make fastd syslog level configurable (#915) 2016-11-06 00:01:49 +01:00
Matthias Schiffer
6cddaedfc7
Reorganize MAC addresses, always explicitly set address for private WLAN
Fixes #842
2016-09-07 02:14:42 +02:00
Matthias Schiffer
d1e6dfb7e3
gluon-mesh-batman-adv-*, gluon-mesh-vpn-fastd: configure batman-adv through gluon_mesh proto 2016-09-07 02:14:42 +02:00
Matthias Schiffer
2331cb194e
gluon-mesh-batman-adv-core, gluon-mesh-vpn-fastd: switch MAC address assignment
Switch to:

1. WAN
2. LAN
3. Mesh VPN

As WAN and LAN are setup in gluon-mesh-batman-adv-core (and will be moved
to gluon-core), while the mesh VPN has its own package, giving WAN and LAN
the first indices is preferable.
2016-08-30 21:25:40 +02:00
Matthias Schiffer
2afe34efec
Use MAC addresses provided by WLAN drivers by default
Some drivers (mt76) don't support arbitrary MAC addresses. Use the
addresses provided by the driver (avoiding the primary address) by default,
but fall back to our has-based scheme when the driver doesn't provide
(enough) addresses.
2016-07-20 18:42:56 +02:00
Jan-Tarek Butt
1c1f490527
Minify all Lua code 2016-07-10 20:14:25 +02:00
Jan-Philipp Litza
f7eda9381f respondd modules: Use proper formatting of doubles
Most doubles that are delivered via respondd have limited input
precision, but are converted with up to 17 digits of precision. That can
cause ugly blowups like 0.2800000000000001 in the output, which is
avoided by specifying better format strings (like "%.2f" in most cases).
2016-05-26 17:38:36 +02:00
Matthias Schiffer
4a60e5a02a
gluon-mesh-vpn-fastd: add missing iptables dependency confusing Kconfig
This was causing "recursive dependency" errors and potentially broken
configurations.
2016-05-18 01:24:11 +02:00
lemoer
c73a12e0ea Change MAC schema generation (#715)
While ath9k/ath10k devices can supprt VIFs with any combination of MAC addresses, there are also adapters which have a hardware MAC filter which only allows a few bits to differ. This commit changes the addresses of all VIFs to ony differ in the last 3 bits, which is required to support many Ralink/Mediatek based WLAN adapters.

Technically, the new addresses are generated by calculating an MD5 hash of the primary MAC address and using a part of this hash as a prefix for the MAC addresses.

The addresses (BSSIDs) of the AP VIFs are also reused for the LAN and WAN interfaces in mesh-on-LAN/WAN mode to reduce the number of needed addresses, and thus reduce the chance of collisions. This is not a problem as the MAC addresses of the AP VIFs are never used except as BSSID, and thus not seen by routing protocols like batman-adv.

Fixes #648

[Matthias Schiffer: rewrote commit message]
2016-04-27 12:16:39 +02:00
Matthias Schiffer
4658afb2c6 gluon-core: commit all UCI configs at the end
Avoid commiting configs inbetween to decrease number of flash writes.

Fixes #714.
2016-04-02 18:56:45 +02:00
Matthias Schiffer
9004028cb4 Convert gluon-announce Lua code to C modules, rename to gluon-respondd
gluon-announced and gluon-announce are merged to gluon-respondd.
2016-02-02 09:18:12 +01:00
Matthias Schiffer
5ecb8a7366 gluon-mesh-vpn-fastd: gluon-annouced: fix fastd status always being reported as enabled 2015-12-08 22:47:32 +01:00
Matthias Schiffer
26682b24b3 Replace gluon-simple-tc by non-Gluon-specific simple-tc
The Gluon-specific functions of the gluon-simple-tc package are moved to
gluon-mesh-vpn-fastd.
2015-10-15 02:38:47 +02:00
Matthias Schiffer
05f146f817 Validate section names from site.conf in various packages 2015-10-11 19:34:14 +02:00
Matthias Schiffer
faba9efb88 Merge branch 'jsonc-sink' of https://github.com/FreifunkBremen/gluon 2015-09-04 17:15:58 +02:00