security: SECRET_KEY from env, CORS restricted to localhost
- Replace hardcoded secret_key with os.environ.get('SECRET_KEY')
- RuntimeError if SECRET_KEY not set (fail fast)
- Restrict CORS to localhost:8765 origins (was allow all with credentials)
- Add .gitignore excluding db, env, __pycache__, backups
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
# Boat&Ship-Finder — Guía de Instalación
|
||||
## Broker Intelligence Platform + Ollama (Windows + Tailscale)
|
||||
|
||||
---
|
||||
|
||||
## LO QUE TIENES
|
||||
|
||||
```
|
||||
Boat&Ship-Finder/
|
||||
├── INSTALAR.bat ← Ejecuta esto PRIMERO (una sola vez)
|
||||
├── INICIAR.bat ← Ejecuta esto cada vez que quieras usar la app
|
||||
├── server.py ← Backend Python (Flask + Ollama)
|
||||
└── static/
|
||||
└── index.html ← Frontend (dashboard completo)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PASO 1 — Verificar que Ollama está corriendo
|
||||
|
||||
1. Abre **Ollama Desktop** desde tu barra de tareas
|
||||
2. Verifica en el navegador: http://localhost:11434
|
||||
- Debes ver: `Ollama is running`
|
||||
|
||||
Los modelos que usará el sistema:
|
||||
- **qwen2.5:72b** → Extracción y análisis principal
|
||||
- **llama3.1:8b** → Clasificación rápida
|
||||
- **nomic-embed-text** → Deduplicación semántica
|
||||
|
||||
---
|
||||
|
||||
## PASO 2 — Instalar (solo la primera vez)
|
||||
|
||||
1. Pon todos los archivos en una carpeta (ej: `C:\Boat&Ship-Finder\`)
|
||||
2. Doble clic en **INSTALAR.bat**
|
||||
3. Espera que termine (instala Flask y dependencias Python)
|
||||
|
||||
---
|
||||
|
||||
## PASO 3 — Iniciar el servidor
|
||||
|
||||
1. Doble clic en **INICIAR.bat**
|
||||
2. Verás en pantalla:
|
||||
```
|
||||
Acceso local: http://localhost:8000
|
||||
Acceso Tailscale: http://100.x.x.x:8000
|
||||
```
|
||||
3. Abre esa URL en tu navegador o celular
|
||||
|
||||
---
|
||||
|
||||
## ACCESO DESDE CELULAR (Tailscale)
|
||||
|
||||
1. Instala Tailscale en tu celular (App Store / Play Store)
|
||||
2. Inicia sesión con la misma cuenta que tu Windows
|
||||
3. Abre en el celular: `http://100.x.x.x:8000`
|
||||
(usa la IP que muestra INICIAR.bat)
|
||||
|
||||
---
|
||||
|
||||
## CÓMO USAR LA APP
|
||||
|
||||
### Buscar con IA
|
||||
- Clic en **"⚡ Buscar con IA Local"** (barra de búsqueda)
|
||||
- Escribe en lenguaje natural:
|
||||
- `"remolcador acero más de 30 metros en subasta"`
|
||||
- `"fishing vessel noruego buen precio"`
|
||||
- `"offshore support vessel government surplus Florida"`
|
||||
- La IA consulta +60 fuentes y extrae resultados
|
||||
|
||||
### Analizar un anuncio
|
||||
- Clic en **"📋 Analizar"**
|
||||
- Pega el texto de cualquier anuncio (periódico, email, clasificado)
|
||||
- La IA extrae automáticamente todos los datos técnicos
|
||||
|
||||
### Guardar favoritas
|
||||
- Clic en ☆ en cualquier tarjeta
|
||||
- Ver en la pestaña **"★ Guardadas"**
|
||||
|
||||
### Crear alertas
|
||||
- Pestaña **"🔔 Alertas"**
|
||||
- Define criterios (tipo, precio, estado)
|
||||
- El sistema notifica cuando encuentra coincidencias
|
||||
|
||||
---
|
||||
|
||||
## FUENTES MONITOREADAS (+60)
|
||||
|
||||
### Subastas USA
|
||||
GovPlanet, GovDeals, PropertyRoom, PublicSurplus, AuctionTime, IronPlanet, HiBid, Copart, BidSpotter
|
||||
|
||||
### Subastas Internacionales
|
||||
Ritchie Bros, Euro Auctions, Troostwijk, Surplex, BVA, Catawiki, ShipXchange
|
||||
|
||||
### Venta Especializada
|
||||
YachtWorld, Boats.com, BoatTrader, Apollo Duck, Rightboat, Boat24, Seaboats, NauticExpo
|
||||
|
||||
### Clasificados Globales
|
||||
Craigslist, eBay Marine, Facebook Marketplace, Kijiji, Gumtree, Subito.it, LeBonCoin, Wallapop, MercadoLibre, OLX
|
||||
|
||||
### Salvage & Wrecks
|
||||
Salvex, MarineWrecks, BoatBreakers, NavAuctions, Barnacle Marine
|
||||
|
||||
### Revistas & Noticias
|
||||
Boat International, Superyacht Times, The Triton, WorkBoat, Lloyd's List, TradeWinds, Maritime Executive, Splash247
|
||||
|
||||
### Registros
|
||||
USCG, UK Ship Register, Panama Registry, Marshall Islands, Liberian Registry, Bahamas Maritime
|
||||
|
||||
---
|
||||
|
||||
## CAMBIAR EL MODELO DE IA
|
||||
|
||||
Edita `server.py`, sección `MODELS`:
|
||||
|
||||
```python
|
||||
MODELS = {
|
||||
'extract': 'qwen2.5:72b', # Cambia por cualquier modelo que tengas
|
||||
'classify': 'llama3.1:8b',
|
||||
'embed': 'nomic-embed-text',
|
||||
'parse': 'qwen3-coder:latest'
|
||||
}
|
||||
```
|
||||
|
||||
Para ver tus modelos disponibles: http://localhost:11434/api/tags
|
||||
|
||||
---
|
||||
|
||||
## SOLUCIÓN DE PROBLEMAS
|
||||
|
||||
| Problema | Solución |
|
||||
|----------|----------|
|
||||
| "Servidor desconectado" | Ejecuta INICIAR.bat |
|
||||
| "Ollama no responde" | Abre Ollama Desktop |
|
||||
| Sin resultados en búsqueda | Verifica que qwen2.5:72b está descargado |
|
||||
| No accede desde celular | Verifica que Tailscale está activo en ambos dispositivos |
|
||||
| Puerto 8000 ocupado | Cambia `port=8000` a `port=8001` en server.py |
|
||||
|
||||
---
|
||||
|
||||
## AGREGAR MÁS FUENTES
|
||||
|
||||
En `server.py`, sección `SOURCES`, agrega:
|
||||
|
||||
```python
|
||||
"Mi categoría": [
|
||||
{"name": "NombreSitio", "url": "https://sitio.com", "type": "auction"},
|
||||
],
|
||||
```
|
||||
|
||||
Tipos disponibles: `auction`, `broker`, `classifieds`, `salvage`, `news`, `magazine`, `registry`, `commercial`
|
||||
Reference in New Issue
Block a user