forked from LengKundee/MQL5-Google-Onedrive
- Changed `check_authorized` in `scripts/telegram_deploy_bot.py` to fail closed (deny all) if `TELEGRAM_ALLOWED_USER_IDS` is unset or empty. - Updated `scripts/TELEGRAM_BOT_SETUP.md` and `QUICK_DEPLOY.md` to document that `TELEGRAM_ALLOWED_USER_IDS` is now mandatory for bot access. - Added Sentinel Journal entry in `.jules/sentinel.md` documenting the vulnerability and learning. - Verified fix with reproduction script.
2.6 KiB
2.6 KiB
Quick Cloud Deployment Guide
Prerequisites
- Docker Desktop - Must be running
- Fly.io CLI (for Fly.io deployment)
- GitHub account (for Render.com)
Quick Deploy Commands
Option 1: PowerShell Script (Recommended)
# Deploy to Fly.io
.\scripts\deploy_cloud_simple.ps1 -Platform flyio
# Deploy to Render (instructions)
.\scripts\deploy_cloud_simple.ps1 -Platform render
# Deploy to Railway
.\scripts\deploy_cloud_simple.ps1 -Platform railway
Option 2: Python Script
# Deploy to Fly.io
python scripts/deploy_cloud.py flyio
# Deploy to Render
python scripts/deploy_cloud.py render
# Deploy to Railway
python scripts/deploy_cloud.py railway
Option 3: Manual Deployment
Fly.io
-
Install Fly CLI (if not installed):
iwr https://fly.io/install.ps1 -useb | iex -
Login:
flyctl auth login -
Deploy:
flyctl deploy
Render.com
-
Push to GitHub:
git add . git commit -m "Deploy to Render" git push origin main -
Go to Render.com:
- Visit https://render.com
- Create new Web Service
- Connect GitHub repository
- Render auto-detects
render.yaml - Deploy!
Railway.app
-
Install Railway CLI:
npm i -g @railway/cli -
Login and Deploy:
railway login railway init railway up
Environment Variables
Set these secrets in your cloud platform:
Required
PYTHONUNBUFFERED=1TZ=UTCENV=production
Optional (for Telegram Bot)
TELEGRAM_BOT_TOKEN(from config/vault.json)TELEGRAM_ALLOWED_USER_IDS(comma-separated user IDs - REQUIRED for access)
Setting Secrets
Fly.io:
flyctl secrets set TELEGRAM_BOT_TOKEN=your_token_here
Render.com:
- Dashboard → Environment → Add Secret
Railway:
- Dashboard → Variables → Add Variable
Troubleshooting
Docker Not Running
# Start Docker Desktop manually, or:
Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe"
Build Fails
# Test Docker build locally
docker build -f Dockerfile.cloud -t mql5-automation:latest .
Deployment Fails
- Check logs:
flyctl logs(or platform equivalent) - Verify environment variables are set
- Check Dockerfile.cloud syntax
- Ensure requirements.txt is up to date
Next Steps
After deployment:
- ✅ Check app status:
flyctl status - ✅ View logs:
flyctl logs - ✅ Test Telegram bot: Send
/startto your bot - ✅ Monitor: Use platform dashboard