Commit Graph

1343 Commits

Author SHA1 Message Date
Matthias Schiffer
3c2593b684
gluon-core: fix handling of 'disabled' site.conf attributes for mesh interfaces
Because is_disabled() was always returning true or false, the
first_non_nil() would never actually check the default setting from
site.conf. This was broken since v2017.1.

Fixes: 6cf03bab37 ("treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies")
2020-06-11 23:52:22 +02:00
David Bauer
5d51b7dc2a
Merge pull request #2049 from freifunk-gluon/outdoor-mode-commit
Fix /etc/config/network commit for outdoor mode change, and related fixes
2020-06-07 03:09:00 +02:00
Matthias Schiffer
e8c65ef75f
gluon-web-model: fix conflicting table fields "reset"
With 11a3b56617 ("gluon-web-model: add dependency support for
sections"), a "reset" function was added to all model nodes. This
conflicts with the "reset" field of the Form object, making reset
buttons show labels like "function: 0xbb8d50" and possibly breaking form
processing when packages override the reset field.
2020-06-06 17:23:21 +02:00
Matthias Schiffer
b15b008e69
gluon-core: create disabled mesh interface sections in outdoor mode
The interfaces should always exist and just be disabled when outdoor
mode is enabled. Not creating them at all leads to an issue in the
advanced wifi settings where an additional reload of the page is
necessary after enabling or disabling the ourdoor mode to make the mesh
VIF options appear or disappear.
2020-06-06 17:12:13 +02:00
Matthias Schiffer
d012d7d32f
gluon-web-wifi-config: make mesh VIF options depend on outdoor=false
Instead of relying on the existence of interface sections only (which is
still used for the case of interface types that are not configured at
all in the site config), add a proper dependency.

This fixes section visiblity with enabled outdoor mode after the following
fix, and gives the user immediate feedback (allowing to disable outdoor
mode and enable meshing in a single step).
2020-06-06 17:12:13 +02:00
Matthias Schiffer
53c33acaf9
gluon-web-wifi-config: rename and simplify filter_active_interfaces()
- Return early
- Rename to has_active_interfaces(), as it returns a boolean
2020-06-06 17:12:12 +02:00
Matthias Schiffer
600ab99f80
gluon-config-mode-outdoor, gluon-web-wifi-config: commit network config
200-wireless will add or remove the mesh network sections of
/etc/config/network. Commit this file, so the modified setting doesn't
get lost on reboot.

Fixes: #2048
2020-06-06 16:47:35 +02:00
Matthias Schiffer
45b518df11 gluon-web-model: remove unused field error message code
Validation errors are mostly handled in the frontend (by displaying
invalid fields with a red background). There was some code left in the
backend for handling different kinds of errors, and returning custom
error messages from validate(), but the resulting value was not used
anywhere.
2020-06-05 21:46:30 +02:00
Matthias Schiffer
5adbaf2907 gluon-web-model: remove dead code for section errors 2020-06-05 21:46:30 +02:00
Matthias Schiffer
e6859ca031 gluon-web-model: remove unused tag_invalid and tag_missing fields 2020-06-05 21:46:30 +02:00
Matthias Schiffer
11a3b56617 gluon-web-model: add dependency support for sections
- Add a dependency array to section template
- Lift dependency handling from AbstractValue to Node
- Split resolve_depends() into a function handling dependencies of a
  node itself (resolve_node_depends()), which now is used for all nodes,
  and the existing recursive descent through the node tree
- When any node's dependencies are not satisfied, all descendents are
  reset recursively, meaning that an option in a section that is hidden
  will always be ignored, as if the option's own dependencies were
  unsatisfied

Fixes: #1349
2020-06-04 22:54:28 +02:00
Matthias Schiffer
35950b44b7 gluon-web-model: fix passing additional variables from form template to sections
This is currently unused in our packages.
2020-06-04 22:54:28 +02:00
Matthias Schiffer
3951607e53 gluon-web-model: fix deplist() argument list
Fixes dependency tracking for individual <option> elements (currently
unused).
2020-06-04 22:54:28 +02:00
Matthias Schiffer
50adb097fa
build: make GluonSrcDiet simpler and more robust (#2033)
- If luasrcdiet fails for a Lua script, this is a bug that should be
  noticed rather than including the unminified script
- Use .tmp suffix for temporary file rather than .o
- Replace chmod + stat + mv with simpler cp + rm to overwrite file while
  preserving file mode
2020-06-04 22:53:14 +02:00
Jan-Jonas Sämann
ed094bc68c
gluon-core: firewall: Allow custom gluon_wired interfaces (#2041)
This allows for multiple mesh legs out of one box. Useful for offloaders
and networks using vlan for separate mesh transport.
Custom mesh interfaces in a VXLAN domain are otherwise firewalled.

This fixes #1479
2020-05-31 10:57:58 +02:00
David Bauer
e951ff6e21 gluon-core: add support for configuring the beacon interval
This adds support for the beacon interval to be set on a per-band base.
This has the potential to reduce the amount of airtime used up for
sending beacon frames.
2020-05-30 00:47:33 +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
20c7fd9881
Merge pull request #2011 from freifunk-gluon/board-json-addresses
Look up primary MAC address through board.json for LAN/WAN
2020-05-28 22:30:14 +02:00
David Bauer
b1de28bab1 gluon-core: move wireless-related utils to wireless module
Separate wireless-related helper methods from the util module to a
new wireless module. This keeps them separated, as the amount of
wireless helpers increased in the past, justifying a separate module.
2020-05-28 21:46:23 +02:00
Matthias Schiffer
fcc6877c8b gluon-core: build in xt_CT with GLUON_SPECIALIZE_KERNEL
xt_CT was added to kmod-ipt-conntrack a while back. Update our
GLUON_SPECIALIZE_KERNEL rules accordingly.

When building xt_CT into the kernel, one of the symbols IP_NF_RAW and
IP6_NF_RAW must be enabled as well, even though there is no runtime
dependency when building as modules. The kernel grows by less than 1KB
even when both IP_NF_RAW and NETFILTER_XT_TARGET_CT are enabled, making
this change a (very slight) net win in both flash and RAM usage.
2020-05-28 19:40:29 +02:00
Ruben Barkow-Kuder
891bfc77ac
gluon-client-bridge: simplify boolean expressions (#2031) 2020-05-25 01:13:30 +02:00
lemoer
14481851f6
gluon-status-page: show primary_domain 2020-05-21 18:09:08 +02:00
lemoer
b9c1a026b1
gluon-respondd: emit "primary_domain_code" in nodeinfo
Closes #1974

Situation:
==========

$ ls -l /lib/gluon/domains/lindennord.json
lrwxrwxrwx    1 root     root            10 Jan  6 03:42 /lib/gluon/domains/lindennord.json -> dom17.json

Before:
=======

$ gluon-neighbour-info -d ::1 -p 1001 -r nodeinfo -c 1
{
   "node_id": "525400123456",
   "system": {
     "domain_code": "lindennord",
     "site_code": "ffh"
   },
...
}

After:
======

$ gluon-neighbour-info -d ::1 -p 1001 -r nodeinfo -c 1
{
   "node_id": "525400123456",
   "system": {
     "primary_domain_code": "dom17",
     "domain_code": "lindennord",
     "site_code": "ffh"
   },
...
}
2020-05-21 18:09:05 +02:00
lemoer
bcf57467dd libgluonutil: implement gluonutil_get_primary_domain()
Implemented using readlink() and basename() to the selected domain in
/lib/gluon/domains/${DOMAIN}.json.
2020-05-21 18:08:36 +02:00
lemoer
0c2a52c19f
libgluonutil: fix double free of domain_code when domain is not existing 2020-05-21 18:03:58 +02:00
lemoer
57516fe4e7
Add GLUON_MINIFY flag to allow skipping the minification process (#1916) 2020-05-13 00:45:06 +02:00
Matthias Schiffer
3daacfb92e
Merge pull request #2013 from freifunk-gluon/outdoor-setup-ifname
Reuse outdoor device logic for setup mode interface selection, plus some cleanup
2020-05-12 20:39:30 +02:00
Matthias Schiffer
b842ec43ff gluon-mesh-batman-adv: do not override WAN MAC address with VXLAN
As a partial fix to #496, do not touch the MAC address of the WAN
interface when using VXLANs (as only the MAC address of the VXLAN
interface matters to batman-adv).
2020-05-12 17:02:37 +02:00
Matthias Schiffer
8807c76a34
gluon-setup-mode: remove obsolete sysconfig.config_ifname migration
config_ifname was renamed to setup_ifname in Gluon v2015.1.
2020-05-10 16:38:42 +02:00
Matthias Schiffer
e9687d7ef1
gluon-setup-mode: use is_outdoor_device() for setup_ifname selection
On PoE-powered devices, we usually want to use WAN for the setup mode.
As all outdoor devices are PoE-powered, we can reuse this function. This
switches the setup mode interface for new installations / after config
reset on a few devices that were missing in this list before.
2020-05-10 16:38:42 +02:00
Matthias Schiffer
0dd9a3e07c
gluon-core: platform: add 2.4GHz-only outdoor devices 2020-05-10 16:38:41 +02:00
Matthias Schiffer
f4fe58cfd7
gluon-core: ignore is_outdoor_device() value on devices without 5GHz radio 2020-05-10 16:38:41 +02:00
Matthias Schiffer
5ec08d841d
gluon-core: platform: clean up device_supports_mfp()
- Use util.find_phy()
- Stop foreach() as soon as the result is known
2020-05-10 16:38:41 +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
Matthias Schiffer
e93dca7cb3
gluon-core: primary-mac: replace all eth0/eth1 lookups with lan/wan
The netdev() lookup is confusing to use: whenever a interface does not
exist during boot (for example VLAN) or when the address is overridden
from board.json (which is not obvious at all), it will yield either no
address, or a different address than expected.

To avoid this confusion, using board.json-based interface() is
preferable. This converts all uses of netdev() to the corresponding
lan/wan lookups, except for the final fallback for eth0.
2020-05-08 19:56:36 +02:00
Matthias Schiffer
02e4a13069
gluon-core: primary-mac: add fallback to netdev address to interface()
In most cases, board.json does not contain any MAC addresses; in this
case, the default MAC address of the underlying interface is to be used.
2020-05-08 19:55:41 +02:00
Matthias Schiffer
2250665d18
gluon-core: primary-mac: cleanup
- Replace misnamed, closure-returning sysfs() to a reusable read() function
- Rename eth() to netdev(), pass full interface name
- Rename board() to interface()
- Split reuable get_netdev_addr() out of netdev()
2020-05-08 19:55:40 +02:00
Matthias Schiffer
0c5b5373bb
gluon-core: primary-mac: load board.json only once 2020-05-08 19:55:40 +02:00
Matthias Schiffer
c90b400ce5
Merge pull request #2008 from ctr49/master
add hardware: Linksys EA6350 v3
2020-05-08 19:15:39 +02:00
ctr49
02a908ee2f get primary_mac from board(wan) 2020-05-06 01:12:26 +02:00
Matthias Schiffer
0e681d5c37
gluon-core: util: avoid unintended second return value from gsub()
gsub() returns the number of matches as its second return value. This
was unintendedly passed through by the util functions trim() and
node_id(). It can be presumed that this had no effect in practice, but
it can lead to surprising output when passing values to print() for
debugging.
2020-05-04 23:38:22 +02:00
ctr49
e8767bc747 define primary mac 2020-05-04 21:44:47 +02:00
Martin Weinelt
9b19883d97 add gluon-logging package
Allows reconfigurtion of remote syslog from within site.conf.

Conflicts with the gluon-web-logging package as user made changes
will be overwritten, because this package will reconfigure the syslog
destination on every upgrade.

Resolves #1845
2020-04-30 01:54:35 +02:00
Jan Luebbe
6a371d88f0 gluon-setup-mode: start urngd instead of haveged
OpenWRT 19.07 enables urngd by default, so haveged is redundant.
2020-04-30 01:51:42 +02:00
Jan Luebbe
35b4a97cce gluon-autoupdater: start/stop urngd instead of haveged
OpenWRT 19.07 enables urngd by default, so haveged is redundant.
2020-04-30 01:51:42 +02:00
Matthias Schiffer
696b4316da gluon-web-autoupdater: use human-readable names as branch labels, sort by label
Use the value of the `name` site.conf field as label (it was
accidentally unused before).

Our site.conf currently doesn't define a specific order for the branch
entries. To avoid changing branch orders, sort entries by this label.

Fixes: #1961
2020-04-26 15:31:59 +02:00
Matthias Schiffer
778bf90561
gluon-mesh-batman-adv: add UCI setting for hop penalty
Add a UCI setting gluon.mesh_batman_adv.hop_penalty

Example UCI commands:

    uci set gluon.mesh_batman_adv=mesh_batman_adv
    uci set gluon.mesh_batman_adv.hop_penalty=20
    uci commit

`/etc/config/gluon` config section:

    config mesh_batman_adv 'mesh_batman_adv'
    	option hop_penalty '20'

Fixes: #1942
2020-04-20 23:35:07 +02:00
David Bauer
c5f43add3d gluon-core: add OWE MAC-assignment
Fixes commit 6692095f9d
2020-04-11 15:14:05 +02:00
Matthias Schiffer
7b7cde7256
Merge pull request #1970 from Kasalehlia/fix-form-reset
gluon-web-model: update inputs on form reset
2020-04-09 23:17:39 +02:00