roturLink

A cross-platform system monitoring and control server that provides real-time access to system metrics through both HTTP and WebSocket APIs.

Supported Platforms

Quick Start

Arch Linux

cd platforms/
python archLink.py

macOS

cd platforms/
python macosLink.py

The server will start on:

Available Modules

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
⚠️ = Requires additional tools
🚧 = Planned/partial implementation

Key Features

Documentation

For detailed implementation information, see PLATFORM_DOCUMENTATION.md

Configuration

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"]
}

Dependencies

Common Dependencies

pip install flask flask-cors psutil requests websockets bleak

Arch Linux Specific

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

macOS Specific

pip install flask flask-cors psutil requests websockets bleak
brew install brightness  # Optional, for brightness control

API Usage

HTTP Endpoints

# 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

WebSocket Commands

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}));

Security

License

MIT