secubox-openwrt/package/secubox/secubox-p2p/root/www/api/factory/pubkey
CyberMind-FR a9130715e9 feat(p2p): Add SecuBox Factory unified dashboard with signed Merkle snapshots
Implement mesh-distributed, cryptographically-validated control center:

- Add factory.sh library with Ed25519 signing via signify-openbsd
- Add Merkle tree calculation for /etc/config validation
- Add CGI endpoints: dashboard, tools, run, snapshot, pubkey
- Add KISS Web UI (~280 lines vanilla JS, inline CSS, zero deps)
- Add gossip-based 3-peer fanout for snapshot synchronization
- Add offline operations queue with replay on reconnect
- Add LuCI iframe integration under MirrorBox > Factory tab
- Configure uhttpd alias for /factory/ on port 7331
- Bump secubox-p2p version to 0.4.0

Factory UI accessible at http://<device>:7331/factory/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 08:03:54 +01:00

28 lines
553 B
Bash

#!/bin/sh
# Factory Pubkey - Return node's public key for trust verification
# CGI endpoint for SecuBox Factory
echo "Content-Type: text/plain"
echo "Access-Control-Allow-Origin: *"
echo ""
# Handle CORS preflight
if [ "$REQUEST_METHOD" = "OPTIONS" ]; then
exit 0
fi
PUBKEY="/etc/secubox/factory.pub"
if [ -f "$PUBKEY" ]; then
cat "$PUBKEY"
else
# Initialize keys if not present
. /usr/lib/secubox/factory.sh 2>/dev/null
factory_init_keys 2>/dev/null
if [ -f "$PUBKEY" ]; then
cat "$PUBKEY"
else
echo "ERROR: Keys not initialized"
fi
fi