Files
n8n-ffmpeg-proxy/start-n8n.sh
drholy 33b47860f7
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 6m27s
add for container privileged true
2026-01-25 14:06:17 +07:00

25 lines
781 B
Bash

#!/bin/sh
SOCKS_HOST=${SOCKS_IP:-192.168.31.240}
# Wait for SOCKS proxy to be ready
echo "Waiting for SOCKS proxy..."
until nc -z "$SOCKS_HOST" 1080; do
echo "SOCKS proxy not ready yet, waiting..."
sleep 5
done
echo "SOCKS proxy is ready!"
# Start redsocks
redsocks -c /etc/redsocks.conf &
sleep 2
# Set up iptables rules (run as root)
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 -j RETURN 2>/dev/null || true
iptables -t nat -A OUTPUT -p tcp -d 192.168.0.0/16 -j RETURN 2>/dev/null || true
iptables -t nat -A OUTPUT -p tcp -d 10.0.0.0/8 -j RETURN 2>/dev/null || true
iptables -t nat -A OUTPUT -p tcp -d 172.16.0.0/12 -j RETURN 2>/dev/null || true
iptables -t nat -A OUTPUT -p tcp -j REDIRECT --to-ports 12345 2>/dev/null || true
# Start n8n
exec su -c "n8n start" node