Commit inicial: Projeto YuClusters

This commit is contained in:
Thiago Moura
2026-06-04 18:12:47 -03:00
commit 0a185c0223
28 changed files with 5093 additions and 0 deletions
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
echo "=== Installing Python for Windows via Wine ==="
# We need to install the Windows version of Python inside Wine for MT5 library compatibility
WINEPREFIX=$HOME/.wine wine msiexec /i https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.msi /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
# Verify python installation
WINEPREFIX=$HOME/.wine wine python --version
echo "Python installed successfully."
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
echo "=== Installing Python Libraries via Wine ==="
# Ensure pip is up to date
WINEPREFIX=$HOME/.wine wine python -m pip install --upgrade pip
# Install Flask and MetaTrader5
# The user explicitly warned to be careful with the case sensitivity of MetaTrader5!
WINEPREFIX=$HOME/.wine wine python -m pip install Flask MetaTrader5
echo "Libraries installed successfully."
@@ -0,0 +1,27 @@
#!/bin/bash
set -e
echo "=== Downloading and Installing MetaTrader 5 ==="
export WINEPREFIX=$HOME/.wine
export WINEDLLOVERRIDES="mscoree,mshtml="
# Start Xvfb temporarily for the installation
# Some silent Windows installers still crash if there's no display available
Xvfb :99 -screen 0 1024x768x16 &
XVFB_PID=$!
export DISPLAY=:99
sleep 2
# Download MT5 setup from MetaQuotes official CDN
wget -O mt5setup.exe "https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe"
# Install silently ( /auto )
echo "Installing MT5 silently (this may take a minute)..."
wine mt5setup.exe /auto
# Wait for background installation tasks to complete and shutdown Wine safely
wineserver -w
kill $XVFB_PID || true
rm mt5setup.exe
echo "MT5 installed successfully."
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
echo "=== Starting MT5 Gateway ==="
export WINEPREFIX=$HOME/.wine
export WINEDLLOVERRIDES="mscoree,mshtml="
# Start Xvfb in background
Xvfb :0 -screen 0 1024x768x16 &
export DISPLAY=:0
# Wait for X11
sleep 2
# We start the Flask server via Python in Wine
# The MT5 logic inside app.py will initialize MT5
echo "Starting Flask API Bridge..."
wine python /app/app.py