media: fix natpmpc-helper OOM and API call format

Increase memory limit 32→64Mi (apk install was hitting the 32Mi ceiling).
Fix qBittorrent setPreferences call: use form-encoded json=<string> not
json body nesting.
This commit is contained in:
Will Anderson
2026-04-11 08:24:19 -05:00
parent fd08987e12
commit f99965da0a
@@ -85,11 +85,11 @@ spec:
echo "$(date): Got forwarded port $PORT"
# Also request TCP mapping for the same port
natpmpc -a "$PORT" "$PORT" tcp 60 -g 10.2.0.1 >/dev/null 2>&1
# Update qBittorrent listen port
# Update qBittorrent listen port (form-encoded: json=<json_string>)
SID=$(curl -s -c /tmp/qbt.txt -X POST http://localhost:8080/api/v2/auth/login \
-d "username=admin&password=adminadmin" 2>/dev/null)
curl -s -b /tmp/qbt.txt -X POST http://localhost:8080/api/v2/app/setPreferences \
-d "{\"json\":{\"listen_port\":$PORT,\"random_port\":false}}" >/dev/null 2>&1
-d "json={\"listen_port\":$PORT,\"random_port\":false}" >/dev/null 2>&1
echo "$(date): qBittorrent listen port set to $PORT"
else
echo "$(date): NAT-PMP failed: $OUT"
@@ -98,10 +98,10 @@ spec:
done
resources:
requests:
memory: 16Mi
memory: 32Mi
cpu: 10m
limits:
memory: 32Mi
memory: 64Mi
cpu: 50m
# qBittorrent — shares gluetun's network namespace, all traffic through VPN