#!/bin/sh # Factory Tools - List available SecuBox tools # CGI endpoint for SecuBox Factory echo "Content-Type: application/json" echo "Access-Control-Allow-Origin: *" echo "Access-Control-Allow-Methods: GET, OPTIONS" echo "" # Handle CORS preflight if [ "$REQUEST_METHOD" = "OPTIONS" ]; then exit 0 fi # Define available tools # Each tool has: id, name, description, category, dangerous flag cat << 'EOF' { "tools": [ { "id": "snapshot", "name": "Create Snapshot", "description": "Create signed Merkle snapshot of current configuration", "category": "security", "icon": "camera", "dangerous": false }, { "id": "verify", "name": "Verify Snapshot", "description": "Verify cryptographic signature of current snapshot", "category": "security", "icon": "shield-check", "dangerous": false }, { "id": "gossip", "name": "Gossip Sync", "description": "Synchronize snapshots with peer nodes via gossip protocol", "category": "mesh", "icon": "refresh", "dangerous": false }, { "id": "discover", "name": "Discover Peers", "description": "Scan network for SecuBox peers via mDNS", "category": "mesh", "icon": "search", "dangerous": false }, { "id": "services", "name": "List Services", "description": "Get status of all local services", "category": "monitoring", "icon": "server", "dangerous": false }, { "id": "validate", "name": "Validate Modules", "description": "Run module validation checks", "category": "maintenance", "icon": "check-circle", "dangerous": false }, { "id": "repair", "name": "Auto-Repair", "description": "Attempt automatic repair of common issues", "category": "maintenance", "icon": "wrench", "dangerous": true }, { "id": "backup", "name": "Create Backup", "description": "Create configuration backup", "category": "backup", "icon": "download", "dangerous": false }, { "id": "pending", "name": "Pending Operations", "description": "Show queued offline operations", "category": "queue", "icon": "clock", "dangerous": false }, { "id": "replay", "name": "Replay Pending", "description": "Execute queued offline operations", "category": "queue", "icon": "play", "dangerous": true }, { "id": "fingerprint", "name": "Node Fingerprint", "description": "Show this node's cryptographic fingerprint", "category": "security", "icon": "fingerprint", "dangerous": false }, { "id": "merkle", "name": "Merkle Root", "description": "Calculate current Merkle root of configurations", "category": "security", "icon": "hash", "dangerous": false } ], "categories": [ {"id": "security", "name": "Security", "order": 1}, {"id": "mesh", "name": "Mesh Network", "order": 2}, {"id": "monitoring", "name": "Monitoring", "order": 3}, {"id": "maintenance", "name": "Maintenance", "order": 4}, {"id": "backup", "name": "Backup", "order": 5}, {"id": "queue", "name": "Queue", "order": 6} ] } EOF