feat: Replace SQM with per-client speed control for paid WiFi upgrade

Add parahub-speed-control script (nftables set + tc HTB) for per-IP
speed shaping. Free tier 512kbps, paid tier unlimited. Heartbeat now
parses paid_clients from API response and syncs nftables set.

Replaced sqm-scripts/kmod-sched-cake/luci-app-sqm packages with
tc-full/kmod-ifb/kmod-sched-htb. Section 8 of uci-defaults creates
init.d service for speed control instead of SQM config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 22:35:16 +00:00
parent 968f90611e
commit ef1b9c10ea
4 changed files with 112 additions and 22 deletions

View File

@@ -525,22 +525,26 @@ fi
uci commit dhcp
# ============================================================================
# 8. SQM TRAFFIC SHAPING (Bumblebee only — guest 512 kbps limit)
# 8. SPEED CONTROL (Bumblebee only — per-client shaping, paid Lightning upgrade)
# ============================================================================
if [ "$ROLE" != "bee" ]; then
uci batch <<-SQM_EOF
set sqm.guest=queue
set sqm.guest.enabled='1'
set sqm.guest.interface='br-guest'
set sqm.guest.download='512'
set sqm.guest.upload='512'
set sqm.guest.qdisc='cake'
set sqm.guest.script='piece_of_cake.qos'
set sqm.guest.linklayer='ethernet'
set sqm.guest.overhead='44'
SQM_EOF
uci commit sqm
chmod +x /usr/bin/parahub-speed-control
# Create init.d service for speed control
cat > /etc/init.d/parahub-speed <<'INITEOF'
#!/bin/sh /etc/rc.common
START=99
start() { /usr/bin/parahub-speed-control init; }
stop() {
tc qdisc del dev br-guest root 2>/dev/null
tc qdisc del dev br-guest ingress 2>/dev/null
ip link del ifb-guest 2>/dev/null
nft delete table inet parahub 2>/dev/null
}
INITEOF
chmod +x /etc/init.d/parahub-speed
/etc/init.d/parahub-speed enable
fi
# ============================================================================