1. 02 Feb, 2023 1 commit
    • Filip Hron's avatar
      guest: Fix QoS for guest network startup on TOS 6.0+ · ba60113e
      Filip Hron authored and Martin Matějek's avatar Martin Matějek committed
      There was discrepancy in names of network bridges between multiple
      modules of foris-controller.
      
      Which could lead to following error:
      
      SQM: ERROR: br-guest_turris does currently not exist, not even trying to start SQM on nothing.
      
      Use the correct name (from Turris OS 6.0+) for guest network bridge,
      which will in turn allow starting QoS for guest network again.
      
      Rename bridge `br-guest_turris` -> `br-guest-turris`
      
      Closes: #255
      
      
      
      Co-authored-by: Martin Matějek's avatarMartin Matějek <martin.matejek@nic.cz>
      ba60113e
  2. 27 Jan, 2023 1 commit
  3. 20 Jan, 2023 6 commits
    • Martin Matějek's avatar
      Version 5.5.0 · 1b5e58fc
      Martin Matějek authored
      Added
      - Add new backend "ubus" for querying `/bin/ubus`.
      - tests: Allow ubus-cli mock to load json data for tests.
      
      Changed
      - lan+wan: refactor querying ubus from lan & wan backends.
      - networks: Change severity of log message during detection of network bridges
        from "warning" to "debug". It will no longer spam system log during normal operation
        of foris-controller with message
        "WARNING:foris_controller_backends.networks:No anonymous section 'br-<bridge_name>' found among network devices.".
      - lan: Make fetching dhcpv6 leases more resilient to unexpected values.
      1b5e58fc
    • Martin Matějek's avatar
      lan: Minor refactoring · e9e856d3
      Martin Matějek authored
      Make function `get_ipv6_client_list()` internal static method.
      
      Also update docstring and type annotation.
      e9e856d3
    • Martin Matějek's avatar
      lan: Do not crash on dhcpv6 lease with negative expire time · 9605e031
      Martin Matějek authored
      '-1' or other negative numbers points to some kind of error with lease
      time (see odhcpd source code).
      
      Fallback to 0 in case of negative lease time.
      
      Closes: #254
      9605e031
    • Martin Matějek's avatar
      lan: Prevent crash on missing DHCPv6 leases of br-lan · 3cb88d6a
      Martin Matějek authored
      Prevent crash of foris-controller in case when `br-lan` is not managed
      by `odhcpd`, for instance when `br-lan` is missing or IPv6 is
      explicitly disabled for `br-lan`.
      
      Return empty list (no DHCPv6 leases) instead.
      
      Closes: #253
      3cb88d6a
    • Martin Matějek's avatar
      lan: Handle unexpected keys in DHCPv6 leases data · 08a755c9
      Martin Matějek authored
      We rely on `odhcpd` through ubus call to get DHCPv6 leases data.
      
      However depending on network configuration - both topology and IPv6
      setup - there might some unexpected keys in JSON data provided by
      `odhcpd`. Which could in turn cause function `get_ipv6_client_list()` to fail.
      
      Currently for the sake of reForis LAN page, we are interested only in
      devices in network (`ipv6-addr`) and we don't care about assigned IPv6
      prefixes (`ipv6-prefix`) for downstream routers.
      
      For instance:
      
      $ ubus call dhcp ipv6leases
      {
        "device": {
          "br-guest-turris": {
            "leases": [
      
            ]
          },
          "br-lan": {
            "leases": [
              {
                "duid": "<DUID redacted>",
                "iaid": 1,
                "hostname": "downstream-router",
                "accept-reconf": true,
                "assigned": 17,
                "flags": [
                  "bound",
                  "static"
                ],
                "ipv6-addr": [
                  {
                    "address": "2001:xxxx:xxxx::11",
                    "preferred-lifetime": 42,
                    "valid-lifetime": 42
                  },
                  {
                    "address": "fd60:xxxx:xxxx::11",
                    "preferred-lifetime": 42,
                    "valid-lifetime": 42
                  }
                ],
                "valid": 42
              },
              {
                "duid": "<DUID redacted>",
                "iaid": 1,
                "hostname": "downstream-router",
                "accept-reconf": true,
                "assigned": 4,
                "flags": [
                  "bound",
                  "static"
                ],
                "ipv6-prefix": [ <-- ignore this part
                  {
                    "address": "2001:xxxx:xxxx:4::",
                    "preferred-lifetime": 42,
                    "valid-lifetime": 42,
                    "prefix-length": 62
                  },
                  {
                    "address": "fd60:xxxx:xxxx:4::",
                    "preferred-lifetime": 42,
                    "valid-lifetime": 42,
                    "prefix-length": 62
                  }
                ],
                "valid": 42
              }
            ]
          }
        }
      }
      
      Closes: #259
      08a755c9
    • Martin Matějek's avatar
      tests: Allow ubus-cli mock to load json data for tests · cadf8443
      Martin Matějek authored
      Add ability to load mocked data for various ubus objects dynamically.
      This will help with testing different situations that static mock data
      cannot cover.
      
      For instance: different wireless devices setup, various DHCPv6 leases
      replies and so on.
      cadf8443
  4. 12 Jan, 2023 2 commits
    • Martin Matějek's avatar
      networks: Change log message severity 'warning' -> 'debug' · 23329ca2
      Martin Matějek authored
      Change log message severity for detection of network bridges and its
      ports.
      
      This particular log message covers few edge cases in network bridges
      configuration.
      
      It doesn't really signal anything seriously wrong with configuration and
      rather spam system log with confusing message, while the configuration
      is fine and network is working as intended.
      23329ca2
    • Martin Matějek's avatar
      Add new backend "ubus" · 895b7b3e
      Martin Matějek authored
      Refactor current code for calling ubus binary to single place and reuse
      it elsewhere.
      
      Closes: #210
      895b7b3e
  5. 15 Dec, 2022 3 commits
    • Martin Matějek's avatar
      version 5.4.0 · 70964369
      Martin Matějek authored
      Added
      - wifi: Allow disabling Management Frame Protection (IEEE 802.11w) for WPA3
        encryption modes (WPA2/3 and WPA3). It might help when wifi clients are
        having trouble connecting to the wifi Access Point.
      - wan: Allow setting VLAN ID for WAN interface
      - networks: Add optional VLAN ID of interface to the json schema
      
      Changed
      - setup: bump turrishw version to 0.10.0
      - wan: Reuse shared 'vlan_id' definition in the json schema
      70964369
    • Martin Matějek's avatar
    • Martin Matějek's avatar
      networks: Add optional VLAN ID of interface to the json schema · b42d875e
      Martin Matějek authored
      Turrishw could provide additional information about VLAN ID of the
      interface, in case interface has VLAN ID assigned.
      
      Adjust the json schema accordingly.
      
      Closes: #105
      b42d875e
  6. 01 Dec, 2022 1 commit
  7. 30 Nov, 2022 1 commit
  8. 24 Nov, 2022 2 commits
  9. 22 Nov, 2022 1 commit
    • Martin Matějek's avatar
      version 5.3.0 · 13c51ac0
      Martin Matějek authored
      Changed
      - wan: store wan interface L2 options in separate device section
      - lan: use ubus call instead of parsing odhcpd files to get DHCPv6 leases
      13c51ac0
  10. 18 Nov, 2022 1 commit
    • Martin Matějek's avatar
      wan: store wan interface L2 options in device section · 278ecff1
      Martin Matějek authored
      Since OpenWrt 21.02, L2 interface options should be stored in
      interface's `device` section instead of `interface` section.
      
      OpenWrt 19.07
      
      ```
      config interface 'wan'
          option iface 'eth0'
          option macaddr '11:22:33:44:55:66'
      ```
      
      OpenWrt 21.02
      
      ```
      config interface 'wan'
          option device 'eth0'
      
      config device
          option name 'eth0'
          option macaddr '11:22:33:44:55:66'
      ```
      
      Closes: #242
      278ecff1
  11. 26 Aug, 2022 2 commits
  12. 15 Jul, 2022 4 commits
  13. 27 Jun, 2022 4 commits
  14. 23 Jun, 2022 1 commit
  15. 13 Jun, 2022 1 commit
  16. 07 Jun, 2022 2 commits
    • Martin Matějek's avatar
      f34a72c4
    • Martin Matějek's avatar
      networks: Sort interfaces by port names · 2a53a7ab
      Martin Matějek authored
      Interfaces were returned in order defined in uci config, e.g.:
      
      config device
      	option name 'br-lan'
      	list ports 'lan3'
      	list ports 'lan0'
      	list ports 'lan4'
      	list ports 'lan2'
      	list ports 'lan1'
      
      Would return interfaces in order ['lan3', 'lan0', 'lan4', 'lan2', 'lan1']
      instead of expected ['lan0', 'lan1', 'lan2', 'lan3', 'lan4'].
      
      It is possible to get to this state by moving interfaces between
      interfaces groups (wan, lan, guest), because newly added interface will
      be appended to the list in uci config file.
      
      This commit will sort interfaces again by their names, before finalizing
      the json data.
      
      Closes: #238
      2a53a7ab
  17. 18 May, 2022 4 commits
  18. 13 May, 2022 1 commit
  19. 04 Mar, 2022 1 commit
  20. 28 Feb, 2022 1 commit