Quote from: tyra on October 09, 2026, 04:04:15 AMобновиться от Оригинальный проект MrTheory: до SpyLive/os-xray можно? или полная переустановка? у меня переключения между Instance через apply не переключает(apply крутится без остановки) останавливаю через ctrl f5 только через индивидуальные боковые старт, стоп включаю выключаю, restart all так же крутится не останавливаясь остановка таже через ctrl f5 .os-xray v3.1.3 — исправления Apply, Restart All и переключения инстансов
fetch -o /tmp/opnsense-xray.tar.gz https://github.com/SpyLive/os-xray/releases/download/v3.1.3/opnsense-xray-v3.1.3.tar.gz
cd /tmp
tar xzf opnsense-xray.tar.gz
cd opnsense-xray
sh install.sh
sh upgrade.sh
[16-Oct-2026 11:21:39 Europe/Berlin] PHP Fatal error: Uncaught TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given in /usr/local/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php:171
Stack trace:
#0 /usr/local/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php(171): implode(',', NULL)
#1 /usr/local/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php(381): OPNsense\AcmeClient\LeCertificate->import(true)
#2 /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php(169): OPNsense\AcmeClient\LeCertificate->issue()
#3 /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php(198): main()
#4 {main}
thrown in /usr/local/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php on line 171
pf_match_translation_rule < pf_get_translation < pf_test_rule < pf_test < pf_check_out < pfil_mbuf_fwd < ip_tryforward
# pfctl -sn | head -1
nat-anchor "miniupnpd" all <-- first rule, evaluated for EVERY new connection
# pfctl -a miniupnpd -sn | grep -c '^nat'
10747 <-- after 5 days uptime
# wc -l /var/run/miniupnpd.leases
66 <-- actual active mappings
nat quick on pppoe0 inet proto udp from 10.0.140.69 port = 26592 to any keep state label "NAT-PMP 26592 UDP" rtable 0 -> x.x.x.x port 26592
miniupnpd: could not find nat rule to delete iport=22062 addr=0a008c45
before after
LAN host, max 377 ms, 32 stalls 1 ms, 0 stalls
2nd WAN router, max 235 ms, 20 stalls 17 ms, 0 stalls
WAN gateway (dpinger) jitter 30-140 ms 16 ms RTT, 0.3 ms jitter, 0 % loss
miniupnpd anchor >6,000 nat rules 133 rules (= leases x rdr+nat)
pfctl -a miniupnpd -sn | grep -c '^nat' # compare with the next line
wc -l /var/run/miniupnpd.leases
grep -c "could not find nat rule" /var/log/miniupnpd/latest.log
If the nat count is far above the number of leases, you have the leak. Note: pfctl -a miniupnpd -sn often returns truncated output while miniupnpd is writing to the anchor. Run it a few times and take the maximum.#!/bin/sh
# Restart miniupnpd when its nat anchor holds far more rules than active leases
LEASES=/var/run/miniupnpd.leases
STAMP=/var/run/upnp-watchdog.last
pgrep -x miniupnpd > /dev/null || exit 0
nat=0
for i in 1 2 3; do # listing may be truncated while miniupnpd writes -> take max
n=$(pfctl -a miniupnpd -sn 2>/dev/null | grep -c '^nat')
[ "$n" -gt "$nat" ] && nat=$n
done
leases=$(wc -l < $LEASES 2>/dev/null | tr -d ' '); leases=${leases:-0}
limit=$((leases * 2 + 20))
[ "$nat" -le "$limit" ] && exit 0
if [ -f $STAMP ] && [ $(( $(date +%s) - $(cat $STAMP) )) -lt 3600 ]; then exit 0; fi
logger -t upnp-watchdog "nat=$nat leases=$leases limit=$limit -> restarting miniupnpd"
/usr/local/sbin/pluginctl -s miniupnpd restart > /dev/null 2>&1
date +%s > $STAMP
[check]
command:/usr/local/bin/upnp-watchdog.sh
parameters:
type:script
message:UPnP anchor watchdog check
description:UPnP Watchdog: clean up orphaned NAT rules
Then run service configd restart and add a cron job under System → Settings → Cron (command "UPnP Watchdog", every 15 minutes). Note: the script and the action file live outside config.xml, so you have to recreate them after a reinstall.