Files
trading_bot_v3/setup-manual-captcha.sh
mindesbunister b91d35ad60 Fix timeframe selection bug and syntax errors
- Fixed critical timeframe mapping bug where '4h' was interpreted as '4 minutes'
- Now prioritizes minute values: '4h' -> ['240', '240m', '4h', '4H']
- Added fallback mechanism to enter exact minutes (240) in custom interval input
- Fixed multiple syntax errors in tradingview-automation.ts:
  * Missing closing parentheses in console.log statements
  * Missing parentheses in writeFile and JSON.parse calls
  * Fixed import statements for fs and path modules
  * Added missing utility methods (fileExists, markCaptchaDetected, etc.)
- Enhanced timeframe selection with comprehensive hour mappings (1h, 2h, 4h, 6h, 12h)
- Added detailed logging for debugging timeframe selection
- Application now builds successfully without syntax errors
- Interval selection should work correctly for all common timeframes

Key improvements:
 4h chart selection now works correctly (240 minutes, not 4 minutes)
 All TypeScript compilation errors resolved
 Enhanced debugging output for timeframe mapping
 Robust fallback mechanisms for interval selection
 Docker integration and manual CAPTCHA handling maintained
2025-07-13 13:57:35 +02:00

62 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# Script to enable manual CAPTCHA solving in Docker environment
# This script helps set up the Docker container for GUI access
echo "🤖 Manual CAPTCHA Solving Setup for Trading Bot"
echo "=============================================="
echo ""
# Check if we're running in Docker environment
if [ -f /.dockerenv ]; then
echo "✅ Running inside Docker container"
# Start Xvfb if not already running (for virtual display)
if ! pgrep -x "Xvfb" > /dev/null; then
echo "🖥️ Starting virtual display (Xvfb)..."
Xvfb :99 -ac -screen 0 1920x1080x24 &
export DISPLAY=:99
sleep 2
else
echo "✅ Virtual display already running"
export DISPLAY=:99
fi
# Install VNC server if not present (for remote GUI access)
if ! command -v x11vnc &> /dev/null; then
echo "📦 Installing VNC server for remote access..."
apt-get update -qq
apt-get install -y x11vnc > /dev/null 2>&1
fi
# Start VNC server for remote access
if ! pgrep -x "x11vnc" > /dev/null; then
echo "🔗 Starting VNC server on port 5900..."
x11vnc -display :99 -nopw -listen localhost -xkb -ncache 10 -ncache_cr &
sleep 2
echo "✅ VNC server started - you can connect via VNC to localhost:5900"
else
echo "✅ VNC server already running"
fi
echo ""
echo "🎯 Instructions for Manual CAPTCHA Solving:"
echo "1. Connect to VNC server: vnc://localhost:5900"
echo "2. Or use SSH with X11 forwarding: ssh -X user@host"
echo "3. When CAPTCHA appears, the automation will pause"
echo "4. Click 'I am not a robot' checkbox in the browser"
echo "5. Complete any additional challenges"
echo "6. Do NOT click the login button - automation handles this"
echo "7. Wait for the automation to continue"
echo ""
else
echo "⚠️ Not running in Docker - this script is for Docker environment"
echo "For local development, ensure your DISPLAY variable is set correctly"
export DISPLAY=${DISPLAY:-:0}
echo "Current DISPLAY: $DISPLAY"
fi
echo "🚀 Manual CAPTCHA setup complete!"
echo "Now you can run the analyze function and handle CAPTCHAs manually."