A cross-platform system monitoring and control server that provides real-time access to system metrics through both HTTP and WebSocket APIs.
- Arch Linux (
platforms/archLink.py
) - Full featured implementation - macOS (
platforms/macosLink.py
) - Native macOS implementation
cd platforms/
python archLink.py
cd platforms/
python macosLink.py
The server will start on:
- HTTP API:
http://127.0.0.1:5001
- WebSocket:
ws://127.0.0.1:5002
Module | Arch Linux | macOS | Description |
---|---|---|---|
System | ✅ | ✅ | Basic system information and hardware details |
CPU | ✅ | ✅ | Real-time CPU usage monitoring |
Memory | ✅ | ✅ | RAM usage statistics |
Disk | ✅ | ✅ | Storage usage information |
Network | ✅ | ✅ | Network I/O statistics |
WiFi | ✅ | ✅ | WiFi status and network scanning |
Bluetooth | ✅ | ✅ | Bluetooth device discovery |
Battery | ✅ | ✅ | Battery status (if available) |
Brightness | ✅ | Display brightness control | |
Volume | ✅ | ✅ | Audio volume control |
USB Drives | ✅ | ✅ | USB drive management and file access |
Temperature | 🚧 | 🚧 | System temperature (planned) |
✅ = Fully implemented
🚧 = Planned/partial implementation
- Real-time Monitoring: WebSocket-based live system metrics
- Cross-platform: Platform-specific optimizations for Arch Linux and macOS
- Secure Access: CORS protection and origin validation
- USB File Access: Safe file operations on mounted USB drives
- System Control: Brightness and volume adjustment
- Bluetooth Scanning: Low-energy device discovery
- WiFi Management: Network scanning and connection status
For detailed implementation information, see PLATFORM_DOCUMENTATION.md
Both platforms use the same configuration from link.conf
:
{
"allowed_modules": ["system", "cpu", "memory", "disk", "network", "bluetooth", "battery", "temperature"],
"allowed_origins": ["https://turbowarp.org", "https://origin.mistium.com", "http://localhost:5001", "http://localhost:5002", "http://localhost:3000", "http://127.0.0.1:5001", "http://127.0.0.1:5002", "http://127.0.0.1:3000"]
}
pip install flask flask-cors psutil requests websockets bleak
sudo pacman -S python-flask python-flask-cors python-psutil python-requests python-websockets python-bleak
sudo pacman -S python-pulsectl python-pyudev networkmanager python-gobject
sudo pacman -S brightnessctl bluez-utils alsa-utils udisks2
pip install flask flask-cors psutil requests websockets bleak
brew install brightness # Optional, for brightness control
# System information
curl http://127.0.0.1:5001/sysinfo
# USB drives
curl http://127.0.0.1:5001/usb/drives
# Volume control
curl http://127.0.0.1:5001/volume/get
curl -X POST http://127.0.0.1:5001/volume/set/50
const ws = new WebSocket('ws://127.0.0.1:5002');
// Get system metrics
ws.send(JSON.stringify({cmd: 'get_metrics'}));
// Set brightness
ws.send(JSON.stringify({cmd: 'brightness_set', val: 75}));
// Set volume
ws.send(JSON.stringify({cmd: 'volume_set', val: 50}));
- Origin Validation: Configurable CORS origins
- Local Access: Automatic localhost access
- Path Restriction: USB file operations only
- System Protection: No access to system directories
[Add your license information here]