Metadata-Version: 2.4
Name: remote-desktop-dashboard
Version: 2.0.3
Summary: Remote Desktop Dashboard — monitor machines and connect via Microsoft Windows App
Project-URL: Homepage, https://github.com/your-org/remote-desktop-dashboard
Project-URL: Documentation, https://github.com/your-org/remote-desktop-dashboard#readme
Project-URL: Repository, https://github.com/your-org/remote-desktop-dashboard
Author: Operations
License: MIT
License-File: LICENSE
Keywords: dashboard,fastapi,monitoring,rdp,remote-desktop,windows
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Requires-Dist: alembic>=1.14.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: psutil>=6.1.0
Requires-Dist: pydantic-settings>=2.6.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: python-multipart>=0.0.17
Requires-Dist: pywin32>=308; sys_platform == 'win32'
Requires-Dist: sqlalchemy>=2.0.36
Requires-Dist: uvicorn[standard]>=0.32.0
Requires-Dist: wmi>=1.5.1; sys_platform == 'win32'
Provides-Extra: dev
Requires-Dist: httpx>=0.28.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9.10; extra == 'postgres'
Description-Content-Type: text/markdown

# Remote Desktop Dashboard

Browser-based dashboard to **monitor** and **connect** to ATC1–ATC10 machines. Replaces the legacy Remote Desktop Connection workflow with live status, machine locking, and one-click access via the [Microsoft Windows App](https://apps.microsoft.com/detail/9N1F85V9T8BN) — **no `.rdp` file download**.

## Features

- Live machine status (online/offline, users, MobaXterm, ETGui, cameras, COM tools)
- **Connect** opens Windows App directly (`ms-rd:` / `rdp://` protocol — credential prompt in Windows)
- **Machine lock**: when you connect, the machine is reserved under your name; **Release** or auto-timeout frees it
- WebSocket live dashboard updates
- Windows monitoring agent on each machine

## Architecture

```
Browser  ──Connect (protocol URI)──►  Windows App  ──RDP──►  ATC machine
   │                                        ▲
   └── REST + WebSocket ◄──►  Dashboard server ◄── agent reports
```

| Command | Purpose |
|---------|---------|
| `remote-desktop-dashboard` | Start server |
| `rdd-agent` | Windows monitoring agent |
| `remote-desktop-dashboard-seed` | Add machines to DB |

## Quick start

```powershell
pip install -e .
remote-desktop-dashboard-seed --file data\machines.example.json
remote-desktop-dashboard
```

Open **http://127.0.0.1:8080/**

1. Enter **Your name** (used for locking).
2. Optionally enter **Windows login** (`DOMAIN\user`) — password is entered in Windows App.
3. Click **Connect** on a machine.

### Windows App setup

1. Install [Windows App from Microsoft Store](https://apps.microsoft.com/detail/9N1F85V9T8BN).
2. Set it as the default app for Remote Desktop / `rdp://` links (Windows Settings → Apps → Default apps).
3. When the browser asks to open a link, choose **Windows App** and allow the protocol.

## Machine locking

| Action | Behavior |
|--------|----------|
| **Connect** | Locks machine under your name, opens Windows App |
| **Release** | Frees the machine for others |
| **Heartbeat** | Sent every 60s while you hold the lock |
| **Auto-release** | After ~7 min without heartbeat (`RDD_LOCK_TIMEOUT_SECONDS` + grace) |
| **Leave page** | Sends release beacon for your locks |

If someone else holds the lock, Connect is disabled and you see **In use: *name***.

## Configuration

| Variable | Default | Description |
|----------|---------|-------------|
| `RDD_DATABASE_URL` | `sqlite:///./remote_desktop_dashboard.db` | Database |
| `RDD_HOST` / `RDD_PORT` | `0.0.0.0` / `8080` | Server bind |
| `RDD_LOCK_TIMEOUT_SECONDS` | `300` | Lock idle timeout |
| `RDD_USE_WINDOWS_APP` | `true` | Prefer `ms-rd:` over `rdp://` |
| `RDD_RDP_PORT` | `3389` | RDP port |
| `RDD_RDP_DEFAULT_DOMAIN` | *(empty)* | Prepended to username |
| `RDD_MACHINE_NAME` | — | Agent: ATC1…ATC10 |
| `RDD_SERVER_URL` | `http://127.0.0.1:8080` | Agent target |

## Insert machines (ATC1–ATC10)

```powershell
copy data\machines.example.json data\machines.json
# edit hostnames and IPs
remote-desktop-dashboard-seed --file data\machines.json
```

## Agent on each ATC machine

```powershell
set RDD_MACHINE_NAME=ATC1
set RDD_SERVER_URL=http://YOUR_SERVER:8080
rdd-agent --interval 30
```

## API (connect & lock)

```http
POST /api/v1/machines/ATC1/connect
{"operator": "Alice", "rdp_username": "DOMAIN\\alice", "use_hostname": true}

POST /api/v1/machines/ATC1/lock/heartbeat
{"operator": "Alice"}

POST /api/v1/machines/ATC1/lock/release
{"operator": "Alice"}
```

Response includes `launch_uri` (Windows App) and `fallback_uri` (`rdp://`).

## Publish to PyPI

```powershell
pip install build twine
python -m build
python -m twine upload dist/*
pip install remote-desktop-dashboard
remote-desktop-dashboard
```

## License

MIT
