From 5fa592453389cffdedc515321837d797ac23e6e0 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 14 Feb 2026 05:21:07 +0100 Subject: [PATCH] fix(mitmproxy): Add per-instance haproxy_router_enabled override Allow disabling HAProxy router mode per-instance via UCI option `mitmproxy..haproxy_router_enabled`. This prevents port conflicts when running multiple mitmproxy instances (e.g., mitmproxy-out on 8888 and mitmproxy-in on 8889) where only the inbound instance needs HAProxy router mode. Co-Authored-By: Claude Opus 4.5 --- .../secubox-app-mitmproxy/files/usr/sbin/mitmproxyctl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/secubox/secubox-app-mitmproxy/files/usr/sbin/mitmproxyctl b/package/secubox/secubox-app-mitmproxy/files/usr/sbin/mitmproxyctl index 4833c652..98aabd03 100755 --- a/package/secubox/secubox-app-mitmproxy/files/usr/sbin/mitmproxyctl +++ b/package/secubox/secubox-app-mitmproxy/files/usr/sbin/mitmproxyctl @@ -236,7 +236,13 @@ load_config() { addon_script="$(uci_get filtering.addon_script || echo /data/addons/secubox_analytics.py)" # HAProxy router settings - haproxy_router_enabled="$(uci_get haproxy_router.enabled || echo 0)" + # Check instance-specific override first, then global + local inst_haproxy_enabled="$(uci_get ${INSTANCE}.haproxy_router_enabled 2>/dev/null)" + if [ -n "$inst_haproxy_enabled" ]; then + haproxy_router_enabled="$inst_haproxy_enabled" + else + haproxy_router_enabled="$(uci_get haproxy_router.enabled || echo 0)" + fi haproxy_listen_port="$(uci_get haproxy_router.listen_port || echo 8889)" haproxy_threat_detection="$(uci_get haproxy_router.threat_detection || echo 1)" haproxy_routes_file="$(uci_get haproxy_router.routes_file || echo /srv/mitmproxy/haproxy-routes.json)"