Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3a72e26
chore: version bump
Tbaile Nov 2, 2026
f114356
build: debian update
Tbaile Nov 2, 2026
43ba233
bumped binaries
Tbaile Nov 2, 2026
585d7f8
fixed patches
Tbaile Nov 3, 2026
cddc68e
fix: updating telegraf configuration for banip
Tbaile Nov 3, 2026
f351d1b
feat: added storage monitoring
Tbaile Nov 3, 2026
a88d119
refactor: making victoria-logs save persistent data
Tbaile Nov 5, 2026
0342739
feat(setup): add root password action
filippocarletti Nov 3, 2026
cfb3ad1
feat(setup): toggle WAN UI access
gsanchietti Nov 4, 2026
fb25b46
feat(firewall): disable WAN UI access by default
gsanchietti Nov 4, 2026
610cafd
fix(setup): report root password change result
gsanchietti Nov 4, 2026
d99349e
fix(setup): use Success and Error dialog titles
gsanchietti Nov 4, 2026
8f7bbd2
feat: added proxying of victoria-logs
Tbaile Nov 4, 2026
a389743
build: added ulogd
Tbaile Nov 4, 2026
4175338
ui bump
Tbaile Nov 4, 2026
b2b1918
build: enabled DCO for openvpn
Tbaile Nov 4, 2026
a2c1577
fix: adjusted some log levels
Tbaile Nov 4, 2026
d36232f
fix(ns-binding): limit log rate for DROP messages in binding tables (…
m-dilorenzi Nov 5, 2026
ba2a5ab
fix(adblock): hide feed credentials in logs
gsanchietti Nov 5, 2026
6268935
fix(dpi): making scripts behave using syslog
Tbaile Nov 6, 2026
ece00fc
feat(logs): per-package pre log processor (#2004)
Tbaile Nov 6, 2026
0629da1
feat(threat_shield): fail2ban brute force bans (#1977)
gsanchietti Nov 6, 2026
bac939f
ui bump
Tbaile Nov 6, 2026
551187c
ci: fixed issue with deduping sarif checks
Tbaile Nov 6, 2026
a7eb859
build: removed image builder
Tbaile Nov 9, 2026
c958549
fix(api-server): avoid panic on invalid logout (#1999)
gsanchietti Nov 9, 2026
89ca2bb
fix(restore-extra-packages): stop respawn loop (#1997)
gsanchietti Nov 9, 2026
d7819a6
fix(vmalert): start after VictoriaMetrics (#1998)
gsanchietti Nov 9, 2026
582c64f
fix(ns-plug): show ns-plug as controller in alerts (#1993)
gsanchietti Nov 9, 2026
11d412b
fix(ovpnrw): list disabled accounts of deleted remote users (#1981)
m-dilorenzi Nov 9, 2026
fbe780d
fix(wireguard): enable mtu_fix on new tunnel zones (#1994)
m-dilorenzi Nov 10, 2026
e1e94a0
fix(openvpn): refuse connection of users removed from remote database…
m-dilorenzi Nov 10, 2026
535e177
fix(nat): list real devices with bound interfaces in NAT rules device…
m-dilorenzi Nov 10, 2026
1109f53
feat: added monitoring for user-facing or demanding processes
Tbaile Nov 10, 2026
c9f44ed
build: adding ice firmware support (#2012)
Tbaile Nov 11, 2026
6a455e9
refactor(logs): now all logs pass through our transformation layer (#…
Tbaile Nov 12, 2026
a2f3b29
feat: moving nft logs out of the kernel log (#2010)
Tbaile Nov 12, 2026
8d2f59c
feat(python3-nethsec): report custom IP lists
gsanchietti Nov 11, 2026
3e3b535
feat(ns-api): custom allow and block lists
gsanchietti Nov 11, 2026
ddd9a58
feat(threat_shield): build banIP lists from UCI
gsanchietti Nov 11, 2026
6945071
fix(banip): refresh custom feeds on upgrade
gsanchietti Nov 11, 2026
a424378
feat(ns-api): list blocklist bans
gsanchietti Nov 12, 2026
ee47b15
chore(ns-ui): build UI from release-8.9.0
gsanchietti Nov 12, 2026
b318402
feat(netifyd): added monitoring for statistics
Tbaile Nov 12, 2026
dec3443
fix(ns-api-server): using syslog correctly, with locking and connecting
Tbaile Nov 12, 2026
1182e0d
fix: removing from log even more sensible informations (#2015)
Tbaile Nov 13, 2026
8e1826c
fix: addressing service issues on close role switches (#1930)
Tbaile Nov 13, 2026
310b80e
refactor: making subscription caching if success (#2013)
Tbaile Nov 16, 2026
affd356
fix(ovpn): DCO status hang and disable toggle (#2018)
Tbaile Nov 17, 2026
bca55e1
fix: adjusted file limits for victoria, added new proxy to logs
Tbaile Nov 17, 2026
ecd8564
feat(dpi): add support for source objects in DPI rules and address gr…
m-dilorenzi Nov 19, 2026
fd809bc
feat(firewall): disable HTTPS access from WAN by default (#2020)
m-dilorenzi Nov 19, 2026
a9e5252
chore: ui bump
Tbaile Nov 20, 2026
75af8bc
fix(dpi): refuse IPv6 zones in rule sources (#2036)
gsanchietti Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .agents/skills/netifyd/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ until the next reload and then vanishes. Change the generator or its UCI input i
| `table inet netifyd` (nftables) | `/usr/sbin/ns-netifyd-configure` (on start and reload) | `/etc/config/netifyd` → `ns_config` |
| `netify-application-catalog.json` and the other catalog/category files | `dpi-data-update` (nightly cron) | Netify's data service |
| `/usr/share/nftables.d/table-pre/` DPI chains | `/usr/sbin/dpi-nft` | `/etc/config/dpi` |
| `address-groups.d/30-*.conf` | `nethsec.dpi.write_address_groups` (on commit, by `ns.ovpnrw`, by `/usr/sbin/dpi`) | `/etc/config/objects`, `dhcp`, `users` |

`/usr/sbin/dpi` is the whole DPI apply path: `dpi-config` → `dpi-nft` → `/etc/init.d/netifyd reload`.
`/usr/sbin/dpi` is the whole DPI apply path: `dpi-migrate` → `write-address-groups` → `dpi-config` → `dpi-nft` →
`/etc/init.d/netifyd reload`.
Run it after changing `/etc/config/dpi`; don't reproduce its steps by hand.

---
Expand Down Expand Up @@ -204,6 +206,25 @@ Two operational facts:

MAC members only match via `mac ==`, so don't put them in a group a `local_ip` rule references.

The `30-` prefix belongs to `nethsec.dpi.write_address_groups`: one `30-<database>_<id>.conf` group
per firewall object resolving to addresses, used by a DPI rule or not, with a `# <object name>` and a
`# <id>, generated from the firewall objects: do not edit` header, and every other `30-*.conf` file is
removed. It runs from the `update-address-groups.py` post-commit hook (`objects`, `dhcp`, `users`), from
`ns.ovpnrw` (reserved IP of a VPN user) and from `/usr/sbin/dpi`, before `dpi-config`: at boot the `dpi`
service (`START=40`) runs it before netifyd (`START=99`); `dpi-config` only references the groups. The `30-*.conf` files are in
`/lib/upgrade/keep.d/ns-dpi`, so backups and the HA sync carry them. The agent keeps the groups it loaded
in memory, a reload doesn't drop the ones whose file was removed (it drops their single addresses, not
their networks), and on stop it saves all of them back, without comments: that's why ownership goes by
prefix. The group of a deleted object therefore comes back as a file on the next agent restart
(unreferenced, so harmless) until the next write removes it; the boot write runs between the stop that
saved it and the start that would load it, so after a reboot it is gone from memory too. The
`flush-address-group` socket command drops a group from memory and deletes its file. A `kill -9` saves nothing. Verified on a device with agent 5.2.9: a reload re-reads the groups
without restarting the agent; a range line is silently ignored, so ranges are written as CIDR blocks;
a `/0` matches nothing (in a group and inline), so it is written as two `/1`; an IPv4-mapped IPv6 address
never matches an IPv4 flow; an empty group or a missing tag matches nothing without errors. IPv6
literals written inline in a criteria, especially the ones starting with `::`, were seen to trigger an
intermittent `criteria parse error` that takes the agent down: a group reference never does.

---

## Verify on a live device
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- uses: actions/setup-go@v7
with:
go-version-file: ${{ matrix.path }}/go.mod
cache-dependency-path: ${{ matrix.path }}/go.sum

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
Expand All @@ -46,6 +47,12 @@ jobs:
run: govulncheck -format sarif ./... > govulncheck.sarif
continue-on-error: true

# govulncheck emits one identical stack per matching OSV affected entry, SARIF requires them unique
- name: Deduplicate SARIF stacks
run: |
jq '.runs[].results[] |= if .stacks then .stacks |= unique else . end' govulncheck.sarif > deduped.sarif
mv deduped.sarif govulncheck.sarif

- name: Upload SARIF to code scanning
uses: github/codeql-action/upload-sarif@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ recent host Ruby (4.x), so the site is built in a `ruby:3.3` container and the
- `files/` is the rootfs overlay for the final image. `files/etc/uci-defaults` holds first-boot defaults.
- Runtime web stack: **nginx** serves `ns-ui` from `/www-ns` and proxies `/api/` → **ns-api-server** on `127.0.0.1:8090`; `ns-api-server` handles auth/JWT and forwards calls to ubus/rpcd handlers.
- System monitoring alerts, including HA alerts, follow the Telegraf → Victoria Metrics/vmalert -> Mimir.
- Every syslog line is cleaned up once by `/etc/rsyslog.d/rules.conf` (rsyslog package) before any output: app without version, trimmed message, and the hostname fixed to UCI `system.hostname` by `rsyslog.init`, never the DNS-resolved FQDN. Packages ship their own rules in `/etc/rsyslog.d/rules.d/<pkg>.conf` to change `$.app`, `$.msg`, `$.sev` or set `$.drop`, and every output (log files, forwarders, controller, Victoria Logs) uses the `ns-file`, `ns-rfc3164` or `ns-rfc5424` template built from those fields. The cleanup runs before `/etc/rsyslog.conf` too, and file and forward actions without a template default to `ns-file` and `ns-rfc3164`, so custom rules get clean logs as well. Selectors still filter on the original severity.
- Many local packages are thin wrappers around upstream code. When changing behavior in one of those areas, inspect the matching upstream repo first and treat the local package as integration glue.

---
Expand All @@ -83,10 +84,13 @@ recent host Ruby (4.x), so the site is built in a `ruby:3.3` container and the
- Set `CATEGORY:=NethSecurity` and `SECTION:=base` in Makefile.
- Use `PKGARCH:=all` for architecture-independent packages (pure Python, shell scripts, etc.).
- **Do not set `PKG_SOURCE_URL`** when package code lives in this repo. Set it only when fetching from external GitHub releases.
- Install wrappers and hooks that are not meant to be run by hand in `/usr/libexec`, not in `/usr/sbin` or `/usr/bin`.
- To add a package to the image, create a corresponding `config/<feature>.conf` fragment that enables it at build time.
- Renovate manages external package versions via magic comments in Makefiles: `# renovate: datasource=github-tags depName=Org/Repo`
- `packages/netifyd` is download-only: prebuilt per-arch binaries, filenames and hashes in `netify-dist.mk`, regenerated by `tools/netifyd-update/netifyd-update.py`. No compile step.
- Subscription status (`ns.subscription info`) is read from the `/etc/ns-plug/subscription.json` cache kept by `subscription-info` in `ns-plug`; everything else only checks `ns-plug.config.system_id`.
- `packages/python3-nethsec/` (the `nethsec` Python library used by all `ns.*` API scripts) is vendored in this repo, not fetched from an external project — read `packages/python3-nethsec/src/nethsec/` directly rather than looking it up on GitHub.
- fail2ban comes from upstream `net/fail2ban` in the pinned packages feed, patched to skip the fw3-era firewall include that restarts it on every firewall reload (`patches/feeds/packages/100-fail2ban-no-firewall-include.patch`) and to keep its DB on the data storage when mounted, else in `/var/run/fail2ban` (`patches/feeds/packages/101-fail2ban-data-storage.patch`); its jails, filters, `ns-insights` action, `ts-fail2ban` generator and `30-fail2ban` hotplug restart live in `ns-threat_shield`.

---

Expand Down
4 changes: 2 additions & 2 deletions build.conf.defaults
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
OWRT_VERSION=v25.12.5
NETHSECURITY_VERSION=8.8.1
OWRT_VERSION=v25.12.6
NETHSECURITY_VERSION=8.9.0
TARGET=x86_64
2 changes: 1 addition & 1 deletion builder/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-only
#

FROM debian:13.4 AS base
FROM debian:13.7 AS base
RUN apt-get update \
&& apt-get install --yes --no-install-recommends --no-install-suggests \
# openwrt build dependencies https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem#debianubuntumint
Expand Down
3 changes: 3 additions & 0 deletions config/ice.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_PACKAGE_ice-firmware=y
CONFIG_PACKAGE_kmod-ice=y

2 changes: 0 additions & 2 deletions config/image_builder.conf

This file was deleted.

2 changes: 1 addition & 1 deletion config/monitoring.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG_PACKAGE_victoria-metrics=y
CONFIG_PACKAGE_victoria-logs=m
CONFIG_PACKAGE_victoria-logs=y
CONFIG_PACKAGE_telegraf=y
1 change: 1 addition & 0 deletions config/ns-thread_shield.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_PACKAGE_ns-threat_shield=y
CONFIG_PACKAGE_fail2ban=y
1 change: 1 addition & 0 deletions config/openvpn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_SMALL=y
CONFIG_OPENVPN_openssl_ENABLE_DCO=y
50 changes: 0 additions & 50 deletions docs/build/custom_images.md

This file was deleted.

2 changes: 2 additions & 0 deletions files/etc/config/firewall
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ config rule 'ns_allow_https'
option src 'wan'
option dest_port '443'
option target 'ACCEPT'
option enabled '0'

config rule 'ns_allow_ui'
option name 'Allow-UI-from-WAN'
option proto 'tcp'
option src 'wan'
option dest_port '9090'
option target 'ACCEPT'
option enabled '0'

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
Expand Down
12 changes: 12 additions & 0 deletions files/etc/uci-defaults/99-nethsec-conloglevel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (C) 2026 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#

# Keep nft log lines and other kernel noise off the console
[ "$(uci -q get system.@system[0].conloglevel)" != "" ] && exit 0

uci -q batch << EOI
set system.@system[0].conloglevel="4"
commit system
EOI
12 changes: 12 additions & 0 deletions files/etc/uci-defaults/99-nethsec-cron-loglevel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (C) 2026 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#

# Stop crond from logging every job it runs, errors are still logged
[ "$(uci -q get system.@system[0].cronloglevel)" != "" ] && exit 0

uci -q batch << EOI
set system.@system[0].cronloglevel="9"
commit system
EOI
4 changes: 2 additions & 2 deletions files/etc/uci-defaults/99-nethsec-nginx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
uci -q batch << EOI
uci -q batch << 'EOI'
set nginx._lan.error_log=syslog:server=unix:/dev/log,nohostname
set nginx._lan.access_log=off
set nginx._lan.access_log='syslog:server=unix:/dev/log,nohostname combined if=$ns_ui_log'
commit nginx
EOI

Expand Down
2 changes: 2 additions & 0 deletions files/etc/uci-defaults/99-nethsec-restore-extra-packages
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Re-enable: the backup 10_disable_services may have disabled it
/etc/init.d/ns-restore-extra-packages enable
/etc/init.d/ns-restore-extra-packages start
13 changes: 9 additions & 4 deletions files/usr/sbin/ns-restore-extra-packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
# Runs via procd init script which handles respawn on failure.
#

if ! grep -qE '\w+\s+overlay$' /etc/backup/installed_packages.txt &>/dev/null; then
# Disable before stop: stop makes procd kill this very process
finish() {
/etc/init.d/ns-restore-extra-packages disable
/etc/init.d/ns-restore-extra-packages stop
exit 0
}

if ! grep -qE '\w+\s+overlay$' /etc/backup/installed_packages.txt &>/dev/null; then
finish
fi

# Check network connectivity
Expand Down Expand Up @@ -39,9 +46,7 @@ while IFS= read -r package; do
done < <(grep -E '\w+\s+overlay$' /etc/backup/installed_packages.txt | awk '{print $1}')

if [ -z "$failed_packages" ]; then
/etc/init.d/ns-restore-extra-packages stop
/etc/init.d/ns-restore-extra-packages disable
exit 0
finish
else
echo "Some packages failed to restore, will retry later"
exit 1
Expand Down
9 changes: 7 additions & 2 deletions packages/adblock/files/adblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ f_nftremove() {
# backup/restore/remove blocklists
#
f_list() {
local file files item array safe_url safe_ips safe_cname safe_domains ip out_rc file_name name
local file files item array safe_url safe_ips safe_cname safe_domains ip out_rc file_name name log_url
local mode="${1}" src_name="${2:-"${src_name}"}" in_rc="${src_rc:-0}" use_cname="0"

case "${mode}" in
Expand Down Expand Up @@ -1222,7 +1222,12 @@ f_list() {
: >"${src_tmpfile}"
fi
else
f_log "info" "download of '${src_name}' failed, url: ${src_url}, rule: ${src_rset:-"-"}, categories: ${src_cat:-"-"}, rc: ${src_rc}"
# strip user:password@ to keep feed credentials out of the log
case "${src_url}" in
*://*@*) log_url="${src_url%%://*}://${src_url##*@}" ;;
*) log_url="${src_url}" ;;
esac
f_log "info" "download of '${src_name}' failed, url: ${log_url}, rule: ${src_rset:-"-"}, categories: ${src_cat:-"-"}, rc: ${src_rc}"
if [ "${adb_action}" != "boot" ] && [ "${adb_action}" != "start" ]; then
f_list restore
out_rc="${?}"
Expand Down
5 changes: 4 additions & 1 deletion packages/banip/files/95-banip-housekeeping
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ if grep -q '"rule_4"' "${custom_feed}"; then
mv -f "${custom_feed}" "${custom_feed}.backup.$(date "+%Y%m%d%H%M%S")"
: > "${custom_feed}"
# rebuild the Nethesis enterprise feeds before banip is started by postinst
/usr/sbin/ts-ip
/usr/sbin/ts-ip --no-start
elif [ -s "${custom_feed}" ]; then
# ts-ip merges a copy of banip.feeds into the custom feeds: refresh it from the new banip.feeds
/usr/sbin/ts-ip --no-start
fi
exit 0
13 changes: 0 additions & 13 deletions packages/banip/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ The `report` sub-command accepts an output mode: `text` (default, human-readable
| ban_resolver | option | - | external resolver used for DNS lookups, by default the local resolver/forwarder will be used |
| ban_remotelog | option | 0 | enable the cgi interface to receive remote logging events |
| ban_remotetoken | option | - | unique token to communicate with the cgi interface |
| ban_blockhook | option | - | full path of an external script, called once for every IP newly blocked by the log service |

<a id="examples"></a>
## Examples
Expand Down Expand Up @@ -546,18 +545,6 @@ Examples to transfer remote logging events from an internal server to banIP via

Please note: for security reasons use this cgi interface only internally and only encrypted via https transfer protocol.

**External hook for newly blocked IPs**
banIP can notify an external program whenever the log service adds a new IP to a blocklist Set (disabled by default). Set `ban_blockhook` to the full path of an executable script, e.g. `/usr/libexec/my-block-hook`. The hook is called once per newly blocked IP, right after the nftables element has been added, with four positional arguments:

```
$1: the blocked IP address, e.g. '198.51.100.44'
$2: the protocol family, either 'v4' or 'v6'
$3: the log count that triggered the block (ban_logcount)
$4: the Set expiry time (ban_nftexpiry), '0s' if the block is permanent
```

Please note: the hook runs synchronously inside the single-threaded log service, so it has to be fast and non-blocking - queue the event and process it elsewhere, never do network I/O in the hook itself. Its exit code and output are ignored.

**Download options**
By default banIP uses the following pre-configured download options:

Expand Down
7 changes: 0 additions & 7 deletions packages/banip/files/banip-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ ban_mailprofile="ban_notify"
ban_mailnotification="0"
ban_remotelog="0"
ban_remotetoken=""
ban_blockhook=""
ban_nftloglevel="warn"
ban_nftpriority="-100"
ban_nftpolicy="memory"
Expand Down Expand Up @@ -2836,12 +2835,6 @@ f_monitor() {
fi
block_cache="${block_cache} ${ip} "
f_log "info" "add IP '${ip}' (cnt: ${ban_logcount}, expiry: ${ban_nftexpiry:-"0"}) to blocklist${proto} Set"

# optional external hook, called once for every newly blocked IP
#
if [ -n "${ban_blockhook}" ] && [ -x "${ban_blockhook}" ]; then
"${ban_blockhook}" "${ip}" "${proto#.}" "${ban_logcount}" "${ban_nftexpiry:-0s}" >/dev/null 2>&1
fi
else
f_log "info" "failed to add IP '${ip}' to blocklist${proto} Set with rc '${?}'"
continue
Expand Down
3 changes: 3 additions & 0 deletions packages/keepalived/files/etc/hotplug.d/keepalived/01-ubus
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh

. /lib/functions.sh
. /lib/functions/keepalived/hotplug.sh

ns_ha_chain_is_stale && exit 0

KEEPALIVED_STATUS_DIR="/var/run/keepalived"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# shellcheck source=/dev/null
. /lib/functions/keepalived/hotplug.sh

ns_ha_chain_is_stale && exit 0

set_service_name dnsmasq

set_restart_if_master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# shellcheck source=/dev/null
. /lib/functions/keepalived/hotplug.sh

ns_ha_chain_is_stale && exit 0

set_service_name dropbear

set_reload_if_backup
Expand Down
9 changes: 9 additions & 0 deletions packages/keepalived/files/lib/functions/keepalived/hotplug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ call_cb() {
fi
}

# True when a newer keepalived event started after this hotplug chain, see ns-ha 00-lock
ns_ha_chain_is_stale() {
local mine latest

mine=$(cat "/var/run/ns-ha/chain.$$" 2>/dev/null) || return 1
latest=$(cat /var/run/ns-ha/last_event 2>/dev/null)
[ "$mine" != "$latest" ]
}

keepalived_hotplug() {
[ -z "$(get_master_cb)" ] && set_master_cb _notify_master
[ -z "$(get_backup_cb)" ] && set_backup_cb _notify_backup
Expand Down
4 changes: 3 additions & 1 deletion packages/netifyd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=netifyd
NETIFYD_VERSION:=5.2.9
PKG_VERSION:=$(NETIFYD_VERSION)
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Darryl Sokoloski <[email protected]>
PKG_LICENSE:=Unlicensed

Expand Down Expand Up @@ -200,6 +200,8 @@ define Package/netifyd/install
$(INSTALL_DATA) ./files/usr/share/netifyd/plugins.d/99-netify-sink-http-auto.conf $(1)/usr/share/netifyd/plugins.d/99-netify-sink-http-auto.conf
# nethesis additional files
$(INSTALL_BIN) ./files/usr/sbin/ns-netifyd-configure.py $(1)/usr/sbin/ns-netifyd-configure
$(INSTALL_DIR) $(1)/etc/telegraf.conf.d
$(INSTALL_DATA) ./files/etc/telegraf.conf.d/netifyd.conf $(1)/etc/telegraf.conf.d/netifyd.conf
# netify-plm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(NETIFYD_FILE_PLM) $(1)/usr/lib/$(NETIFYD_FILE_PLM)
$(LN) /usr/lib/$(NETIFYD_FILE_PLM) $(1)/usr/lib/$(NETIFYD_LINK_PLM)
Expand Down
Loading
Loading