Skip to content

dickyermawan/remo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

REMO - Remote Control Bot

πŸ€– Telegram bot untuk remote control laptop Windows via webhook

Secure dashboard + Bot commands untuk:

  • Power control (lock, sleep, shutdown, restart)
  • System monitoring (CPU, RAM, disk, battery)
  • Audio control (volume, mute)
  • Screenshot capture
  • Web dashboard dengan login authentication

πŸš€ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Configure

# Copy template
copy .env.example .env

# Edit .env dengan:
# - Bot token dari @BotFather
# - User ID dari @userinfobot
# - Cloudflare domain
# - Dashboard credentials

3. Run Background (No Console)

# Simple double-click:
start.bat

# Or manual:
python main.pyw

Bot runs in background, no window!

4. Access Dashboard

http://localhost:8443/

Login dengan credentials dari .env


πŸ“¦ Features

πŸ€– Telegram Bot Commands

  • /start - Info bot dan authorized user
  • /status - System stats (CPU, RAM, disk, battery, uptime)
  • /screenshot - Capture & send screenshot
  • /lock - Lock screen
  • /sleep - Sleep mode
  • /shutdown - Shutdown (dengan konfirmasi)
  • /restart - Restart (dengan konfirmasi)
  • /volume <0-100> - Set volume level
  • /mute - Mute audio
  • /unmute - Unmute audio

🌐 Web Dashboard

  • βœ… Secure login (bcrypt password hashing)
  • βœ… Real-time system stats (CPU, RAM, Disk, Uptime)
  • βœ… Live logs viewer (auto-refresh)
  • βœ… Bot status monitoring
  • βœ… Mobile responsive
  • βœ… Session management (24hr timeout)
  • βœ… Rate limiting (5 login attempts / 15min)

πŸ”’ Security

  • User ID whitelist
  • Webhook secret token
  • Rate limiting (30 cmds/min)
  • Bcrypt password hashing
  • Signed session cookies (HttpOnly, SameSite)
  • CSRF protection ready
  • All secrets in .env (gitignored)

🎯 Background Mode

Bot runs completely hidden (no console window):

Start Bot

start.bat          # Recommended
# or
python main.pyw    # Direct launch

Stop Bot

stop.bat

Auto-Start on Windows Boot

# Run as Administrator:
enable_autostart.bat

# To disable:
disable_autostart.bat

Why it works:

  • Uses main.pyw (Windows background app)
  • Logger auto-detects pythonw (skips console)
  • Writes to logs/remo.log only

πŸ“ Project Structure

remo/
β”œβ”€β”€ main.py          # Main app (with console)
β”œβ”€β”€ main.pyw         # Background mode (no console)
β”œβ”€β”€ start.bat        # Start background
β”œβ”€β”€ stop.bat         # Stop bot
β”œβ”€β”€ enable_autostart.bat    # Setup auto-start
β”œβ”€β”€ disable_autostart.bat   # Remove auto-start
β”œβ”€β”€ config.py        # Configuration
β”œβ”€β”€ .env             # Secrets (NOT committed)
β”œβ”€β”€ .env.example     # Template
β”œβ”€β”€ bot/
β”‚   β”œβ”€β”€ handlers.py  # Telegram command handlers
β”‚   └── middleware.py # Auth & rate limiting
β”œβ”€β”€ system/
β”‚   β”œβ”€β”€ power.py     # Power control
β”‚   β”œβ”€β”€ audio.py     # Volume control
β”‚   β”œβ”€β”€ display.py   # Screenshot & brightness
β”‚   └── status.py    # System monitoring
β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ auth.py      # Authentication system
β”‚   β”œβ”€β”€ routes.py    # Web routes & API
β”‚   └── templates/   # HTML templates
β”œβ”€β”€ utils/
β”‚   └── logger.py    # Logging (file + console)
└── logs/
    └── remo.log     # Application logs

πŸ”§ Configuration

All config in .env file:

# Bot
REMO_BOT_TOKEN=your_bot_token
REMO_USER_ID=your_telegram_user_id

# Webhook
REMO_WEBHOOK_DOMAIN=your.domain.com
REMO_WEBHOOK_PORT=8443

# Dashboard
REMO_DASHBOARD_USERNAME=admin
REMO_DASHBOARD_PASSWORD=SecurePassword123!
REMO_DASHBOARD_SECRET_KEY=auto_generated

# Device (optional)
REMO_DEVICE_NAME=Main Laptop
REMO_DEVICE_ID=main-laptop

🌐 Webhook Setup

Via Cloudflare Tunnel (Recommended)

  1. Install cloudflared

    choco install cloudflared
  2. Configure tunnel (see cloudflared-config.yml)

  3. Run tunnel

    cloudflared tunnel run remo-bot
  4. Set webhook

    python set_webhook.py set

πŸ“ Logs

All logs in logs/remo.log:

  • Rotation: 10 MB per file
  • Retention: 7 days
  • Compression: zip

View live logs dalam dashboard atau check file.


πŸ›‘οΈ Security Best Practices

βœ… Done:

  • All secrets in .env (gitignored)
  • Bcrypt password hashing
  • Session security (signed cookies)
  • Rate limiting (bot & dashboard)
  • User ID whitelist
  • Webhook secret validation

⚠️ Recommendations:

  • Use strong dashboard password
  • Keep Cloudflare Tunnel running
  • Update dependencies regularly
  • Review SECURITY.md for audit details

πŸ“š Documentation

  • QUICKSTART.md - Simple start/stop guide
  • HOW_TO_RUN.md - Detailed webhook setup
  • SECURITY.md - Security audit & best practices
  • TROUBLESHOOTING.md - Common issues
  • SERVICE_INSTALL.md - Windows Service setup (optional)

πŸŽ‰ Status

PRODUCTION READY!

βœ… Bot working
βœ… Dashboard secure & responsive
βœ… Background mode stable
βœ… Auto-start ready
βœ… Open-source safe (no hardcoded secrets)


πŸ“œ License

MIT - Free to use & modify


Made with ❀️ for remote laptop control

About

REMO - Lock your PC remotely

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors