Spaces:
Runtime error
Runtime error
Silicon Valley - Admin
Enhance Dockerfile, README, and server configuration for improved security and functionality
13c3439
| title: Kaio API Server | |
| emoji: 馃殌 | |
| colorFrom: blue | |
| colorTo: indigo | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # Kaio API Server | |
| Este servidor proporciona una API REST y WebSocket para ejecutar comandos y gestionar archivos de forma segura. | |
| ## Caracter铆sticas de Seguridad | |
| - Autenticaci贸n mediante tokens de sesi贸n | |
| - Rate limiting por IP/sesi贸n | |
| - Ejecuci贸n de comandos en entorno aislado | |
| - Validaci贸n de entrada con Pydantic | |
| - CORS configurado para endpoints espec铆ficos | |
| - Logs estructurados y monitorizables | |
| ## Endpoints | |
| ### REST API | |
| - `GET /status` - Estado del servidor y versi贸n | |
| - `GET /health` - Health check del servidor | |
| - `POST /command` - Ejecutar comando (requiere autenticaci贸n) | |
| ### WebSocket | |
| - `wss://<space-name>.hf.space/session` - Conexi贸n WebSocket para sesiones | |
| ## Configuraci贸n | |
| El servidor se puede configurar mediante variables de entorno: | |
| ```env | |
| TIMEOUT=60 | |
| LOG_LEVEL=INFO | |
| MAX_MESSAGE_SIZE=16777216 | |
| RATE_LIMIT=100 | |
| SESSION_TIMEOUT=3600 | |
| ``` | |
| ## Monitoreo | |
| - M茅tricas Prometheus disponibles en `/metrics` | |
| - Logs estructurados en formato JSON | |
| - Health checks peri贸dicos | |
| ## Seguridad | |
| - Ejecuta como usuario no-root | |
| - Aislamiento de contenedor | |
| - Validaci贸n de entrada estricta | |
| - L铆mites de recursos configurables | |
| ## Desarrollo Local | |
| ```bash | |
| # Construir imagen | |
| docker build -t kaio-server . | |
| # Ejecutar servidor | |
| docker run -p 7860:7860 kaio-server | |
| ``` | |
| ## Producci贸n | |
| Se recomienda: | |
| 1. Configurar l铆mites de recursos | |
| 2. Habilitar logging estructurado | |
| 3. Configurar monitoreo | |
| 4. Revisar configuraci贸n CORS | |