Phase 4 enhancements: WebSocket auth, HTTPS UI, plugin hooks, build fixes

Security:
- Add token-based WebSocket authentication (closes critical security gap)
  - In-memory token store with 24h TTL (token_store.py)
  - POST /api/auth/token exchanges Basic Auth for WS token
  - GET /api/auth/status public endpoint for auth check
  - WebSocket validates token query param, rejects with close code 4401
  - Frontend LoginPrompt modal for credential entry
  - WebSocket manager handles full auth flow with auth_required state
  - No-op when AUTH_ENABLED=false (preserves existing behavior)

HTTPS:
- Wire HTTPS toggle in Settings UI (POST /api/system/ssl/toggle)
- Add certificate regeneration button
- Display SSL info (expiration, SANs, SHA256 fingerprint)

Plugins:
- Wire trigger_hook("pm3_command") in PM3 service
- Wire trigger_hook("update_check") in update manager

Build/Infrastructure:
- Enable NetworkManager in pi-gen AP setup stage
- Add HF booster board detection patch for Proxmark3
- Update LED PWM control patch
- Fix BLE adapter, UPS drivers, WiFi manager improvements
- Update HTTPS support stage script

Documentation:
- Update PROJECT_STATUS.md and IMPLEMENTATION_PRIORITIES.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
michael
2026-03-03 11:45:11 -08:00
parent 4f35df1781
commit 2ec89041ef
24 changed files with 1249 additions and 362 deletions

View File

@@ -6,12 +6,12 @@ Based on hardware testing with Proxmark3 Easy and `LED_ORDER=PM3EASY`:
### LED Configuration
| LED | Color | GPIO Pin | PWM Channel | Brightness | Physical Position |
|-----|--------|----------|-------------|------------|-------------------|
| A | Green | PA0 | PWM0 | ✅ 0-100% | 1st (leftmost) |
| B | Blue | PA2 | PWM2 | ✅ 0-100% | 4th (rightmost) |
| C | Orange | PA9 | None | On/Off | 2nd |
| D | Red | PA8 | None | On/Off | 3rd |
| LED | Color | GPIO Pin | PWM Channel | Brightness | Effects | Physical Position |
|-----|--------|----------|-------------|------------|---------|-------------------|
| A | Green | PA0 | PWM0 | ✅ 0-100% | All | 1st (leftmost) |
| B | Blue | PA2 | PWM2 | ✅ 0-100% | All | 4th (rightmost) |
| C | Orange | PA9 | None | On/Off | Blink | 2nd |
| D | Red | PA8 | None | On/Off | Blink | 3rd |
**Physical LED order (left to right):** Green, Orange, Red, Blue
@@ -40,18 +40,18 @@ From `include/config_gpio.h` with `LED_ORDER_PM3EASY`:
With default LED ordering (no `LED_ORDER_PM3EASY`):
| LED | Color | GPIO Pin | PWM Channel | Notes |
|-----|---------|----------|-------------|-------|
| A | Orange | PA0 | PWM0 | ✅ Brightness capable |
| B | Green | PA8 | None | On/Off only |
| C | Red | PA9 | None | On/Off only |
| D | Red2 | PA2 | PWM2 | ✅ Brightness capable |
| LED | Color | GPIO Pin | PWM Channel | Brightness | Effects |
|-----|---------|----------|-------------|------------|---------|
| A | Orange | PA0 | PWM0 | ✅ 0-100% | All |
| B | Green | PA8 | None | On/Off | Blink |
| C | Red | PA9 | None | On/Off | Blink |
| D | Red2 | PA2 | PWM2 | ✅ 0-100% | All |
**Note:** Only LEDs on PA0 and PA2 can use PWM brightness control on any PM3 variant.
**Note:** Only LEDs on PA0 and PA2 can use PWM brightness control and PWM effects (pulse, fade) on any PM3 variant.
## Usage Examples
### Proxmark3 Easy
### Basic LED Control
```bash
# Green LED at 50% brightness
@@ -70,9 +70,45 @@ hw led --led d --toggle
hw led --led a,b --brightness 30
```
### LED Effects
Three effects are available: **pulse**, **fade**, and **blink**.
```bash
# Pulse effect (PWM LEDs only: A, B)
# Smoothly fades in and out
hw led --led a --pulse # 5 cycles @ 500ms default
hw led --led a,b --pulse --count 10 # 10 cycles
hw led --led a --pulse --speed 300 # Faster pulse (300ms cycle)
hw led --led b --pulse --count 0 # Infinite until button press
# Fade effect (PWM LEDs only: A, B)
# Starts at full brightness, fades to off
hw led --led a --fade # Default 500ms fade
hw led --led a,b --fade --speed 1000 # Slower 1-second fade
# Blink effect (ALL LEDs supported: A, B, C, D)
# Alternates on/off
hw led --led a,b,c,d --blink # All LEDs, 5 blinks
hw led --led c,d --blink --count 20 # Non-PWM LEDs work too
hw led --led all --blink --speed 200 # Fast blink (200ms cycle)
hw led --led a --blink --count 0 # Infinite until stopped
```
### Effect Parameters
| Parameter | Description | Range | Default |
|-----------|-------------|-------|---------|
| `--speed` | Cycle time in milliseconds | 50-10000 | 500 |
| `--count` | Number of effect cycles | 0-65535 | 5 |
**Note:** `--count 0` runs the effect indefinitely until interrupted by:
- Pressing the button on the Proxmark3 device
- Sending any other command
### Multi-Device Identification
Use brightness levels to distinguish between multiple Proxmark3 devices:
Use brightness levels and effects to distinguish between multiple Proxmark3 devices:
```bash
# Device 1: Dim green
@@ -81,9 +117,11 @@ hw led --led a --brightness 20
# Device 2: Bright blue
hw led --led b --brightness 100
# Device 3: Medium green + dim blue
hw led --led a --brightness 60
hw led --led b --brightness 30
# Device 3: Pulsing green (easy to spot)
hw led --led a --pulse --count 0
# Device 4: Fast blinking all LEDs
hw led --led all --blink --speed 200 --count 0
```
## Hardware Testing Notes
@@ -102,5 +140,6 @@ hw led --led b --brightness 30
---
**Last Updated:** 2025-12-02
**Last Updated:** 2026-01-06
**Hardware:** Proxmark3 Easy with LED_ORDER=PM3EASY
**Effects Added:** pulse, fade, blink (v1.1)