mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-13 20:08:05 +08:00
🎉 Sync 2026-10-13 02:34:41
This commit is contained in:
1 parent
b537a62e59
commit
72c44a6325
38 files changed
+3510
-1734
No files matched your search
+3
-6
@@ -9,13 +9,10 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=miniupnpd
|
||||
PKG_VERSION:=2.3.11
|
||||
PKG_RELEASE:=10
|
||||
PKG_RELEASE:=11
|
||||
|
||||
#PKG_SOURCE_URL:=https://github.com/miniupnp/miniupnp/releases/download/miniupnpd_$(subst .,_,$(PKG_VERSION))
|
||||
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
#PKG_HASH:=66cb3c3d697ab2bb3a61d3c48628166d6ba328d7c2dbeb95898fdf2a3202af7b
|
||||
# Build from GitHub tag archives, as release archive differ in code comments to the public repository
|
||||
PKG_SOURCE_VERSION:=63ac33eaa49332cde15fd509b539a260b531da05
|
||||
# Build from GitHub archives, as release archives differ from Git in code comments; patches cannot be 1:1 applied
|
||||
PKG_SOURCE_VERSION:=f8c4f4c3320820e615b281147b3043f66c195f17
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/miniupnp/miniupnp/tar.gz/$(PKG_SOURCE_VERSION)?
|
||||
PKG_SOURCE:=miniupnp-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_HASH:=skip
|
||||
|
||||
@@ -126,7 +126,7 @@ upnpd_generate_config() {
|
||||
log "IPv6 not ready yet; delay start"
|
||||
sleep 5
|
||||
pass=$((pass + 1))
|
||||
[ "$pass" = "4" ] && log "IPv6 GUA not yet available, UPnP IGD mapping not possible" && break
|
||||
[ "$pass" = "2" ] && log "IPv6 GUA not yet available, UPnP IGDv2 IPv6 mapping may not work" && break
|
||||
done
|
||||
fi
|
||||
# Only perform an STUN CGNAT test if necessary, with a private/CGNAT-reserved external IPv4
|
||||
|
||||
@@ -8,8 +8,9 @@ config upnpd 'settings'
|
||||
# Enable networks, multiple can be specified, separated by a space
|
||||
option internal_iface 'lan'
|
||||
option access_defaults 'accept-high-ports' # default none
|
||||
#option accept_ports ''
|
||||
#option reject_ports '21 23 135 137-139 445 3389'
|
||||
option check_acl '0' # default 1
|
||||
#option ipv6_disable '0'
|
||||
#option allow_third_party_mapping '0'
|
||||
# Extra logging by setting to info or debug (previously 1)
|
||||
option log_output 'default'
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ Link: https://github.com/Self-Hosting-Group/wiki/wiki/Port-Mapping-Protocols-Ove
|
||||
|
||||
--- a/upnphttp.c
|
||||
+++ b/upnphttp.c
|
||||
@@ -319,9 +319,22 @@ ParseHttpHeaders(struct upnphttp * h)
|
||||
@@ -321,9 +321,22 @@ ParseHttpHeaders(struct upnphttp * h)
|
||||
}
|
||||
else if(strncasecmp(line, "user-agent:", 11) == 0)
|
||||
{
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Executable
+93
@@ -0,0 +1,93 @@
|
||||
#!/bin/sh
|
||||
# Functional tests for the miniupnpd IGD/NAT-PMP daemon variants. The package
|
||||
# version is checked by the build framework, so it is not tested here.
|
||||
|
||||
bin=/usr/sbin/miniupnpd
|
||||
|
||||
# Binary, runtime linking and the OpenWrt integration files common to both
|
||||
# firewall variants. "miniupnpd -h" exits non-zero but must print the usage
|
||||
# banner, which also proves every shared-library dep resolves at runtime.
|
||||
common_checks() {
|
||||
[ -x "$bin" ] || { echo "FAIL: $bin missing or not executable"; exit 1; }
|
||||
"$bin" -h 2>&1 | grep -q "^Usage:" \
|
||||
|| { echo "FAIL: 'miniupnpd -h' printed no usage banner"; exit 1; }
|
||||
[ -x /etc/init.d/miniupnpd ] || { echo "FAIL: init script missing"; exit 1; }
|
||||
grep -q "USE_PROCD=1" /etc/init.d/miniupnpd \
|
||||
|| { echo "FAIL: init script is not a procd service"; exit 1; }
|
||||
grep -q "config upnpd" /etc/config/upnpd \
|
||||
|| { echo "FAIL: /etc/config/upnpd is not valid UCI"; exit 1; }
|
||||
[ -f /etc/hotplug.d/iface/50-miniupnpd ] \
|
||||
|| { echo "FAIL: iface hotplug script missing"; exit 1; }
|
||||
}
|
||||
|
||||
# The config-file parser runs before any firewall or socket setup, so it can be
|
||||
# exercised inside the CI container. A bogus option must be rejected non-zero
|
||||
# and a minimal valid config must be accepted without a parse error.
|
||||
config_checks() {
|
||||
good="/tmp/miniupnpd-good.$$.conf"
|
||||
bad="/tmp/miniupnpd-bad.$$.conf"
|
||||
log="/tmp/miniupnpd.$$.log"
|
||||
cat > "$good" <<-EOF
|
||||
ext_ifname=lo
|
||||
listening_ip=127.0.0.1
|
||||
port=5000
|
||||
enable_natpmp=yes
|
||||
enable_upnp=yes
|
||||
notify_interval=60
|
||||
uuid=00000000-0000-0000-0000-000000000000
|
||||
EOF
|
||||
echo "not_a_real_option=1" > "$bad"
|
||||
|
||||
if "$bin" -f "$bad" -d > "$log" 2>&1; then
|
||||
echo "FAIL: invalid config option was accepted"
|
||||
rm -f "$good" "$bad" "$log"; exit 1
|
||||
fi
|
||||
grep -qiE "invalid option|Error reading configuration" "$log" \
|
||||
|| { echo "FAIL: no parse error reported for bad config"
|
||||
rm -f "$good" "$bad" "$log"; exit 1; }
|
||||
|
||||
# A valid config: launch briefly and confirm the parser accepted it. The
|
||||
# daemon may later stop at firewall/socket setup in the container; that is
|
||||
# past the parser and irrelevant to this check.
|
||||
"$bin" -f "$good" -d > "$log" 2>&1 &
|
||||
mpid=$!
|
||||
sleep 2
|
||||
kill "$mpid" 2>/dev/null
|
||||
wait "$mpid" 2>/dev/null
|
||||
if grep -qiE "invalid option|Error reading configuration" "$log"; then
|
||||
echo "FAIL: valid config was rejected by the parser"
|
||||
rm -f "$good" "$bad" "$log"; exit 1
|
||||
fi
|
||||
rm -f "$good" "$bad" "$log"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
miniupnpd-iptables)
|
||||
# iptables variant ships the fw3 shell include. Its uci-defaults seeder
|
||||
# is not checked here: the postinst sources /etc/uci-defaults/* and
|
||||
# deletes each script that succeeds, so it is gone by now.
|
||||
common_checks
|
||||
[ -f /usr/share/miniupnpd/firewall.include ] || { echo "FAIL: firewall.include missing"; exit 1; }
|
||||
sh -n /usr/share/miniupnpd/firewall.include \
|
||||
|| { echo "FAIL: firewall.include has a shell syntax error"; exit 1; }
|
||||
config_checks
|
||||
echo "miniupnpd-iptables: all functional tests passed"
|
||||
;;
|
||||
miniupnpd-nftables)
|
||||
# nftables variant ships the nft rule fragments consumed by fw4.
|
||||
common_checks
|
||||
for f in table-post/20-miniupnpd.nft \
|
||||
chain-post/dstnat/20-miniupnpd.nft \
|
||||
chain-post/forward/20-miniupnpd.nft \
|
||||
chain-post/srcnat/20-miniupnpd.nft; do
|
||||
[ -s "/usr/share/nftables.d/$f" ] \
|
||||
|| { echo "FAIL: nft fragment $f missing or empty"; exit 1; }
|
||||
done
|
||||
config_checks
|
||||
echo "miniupnpd-nftables: all functional tests passed"
|
||||
;;
|
||||
*)
|
||||
echo "Untested package: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user