Renombrar FlotillasGPS a ADAN en todo el proyecto
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
# Referencia de API
|
||||
|
||||
Documentacion de la API REST de FlotillasGPS.
|
||||
Documentacion de la API REST de ADAN.
|
||||
|
||||
## Informacion General
|
||||
|
||||
- **Base URL**: `https://flotillas.tudominio.com/api/v1`
|
||||
- **Base URL**: `https://adan.tudominio.com/api/v1`
|
||||
- **Autenticacion**: JWT Bearer Token
|
||||
- **Formato**: JSON
|
||||
- **Documentacion interactiva**: `https://flotillas.tudominio.com/api/docs`
|
||||
- **Documentacion interactiva**: `https://adan.tudominio.com/api/docs`
|
||||
|
||||
## Autenticacion
|
||||
|
||||
@@ -649,7 +649,7 @@ GET /reportes/{id}/descargar
|
||||
### Conexion
|
||||
|
||||
```javascript
|
||||
const ws = new WebSocket('wss://flotillas.tudominio.com/ws/v1/ubicaciones');
|
||||
const ws = new WebSocket('wss://adan.tudominio.com/ws/v1/ubicaciones');
|
||||
|
||||
ws.onopen = () => {
|
||||
// Autenticar
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Guia de Configuracion
|
||||
|
||||
Configuracion detallada de todos los componentes del sistema FlotillasGPS.
|
||||
Configuracion detallada de todos los componentes del sistema ADAN.
|
||||
|
||||
## Variables de Entorno
|
||||
|
||||
El archivo `/opt/flotillas/.env` contiene todas las configuraciones del sistema.
|
||||
El archivo `/opt/adan/.env` contiene todas las configuraciones del sistema.
|
||||
|
||||
### Base de Datos
|
||||
|
||||
```bash
|
||||
# PostgreSQL
|
||||
DATABASE_URL=postgresql://flotillas:PASSWORD@localhost:5432/flotillas_db
|
||||
DATABASE_URL=postgresql://adan:PASSWORD@localhost:5432/adan_db
|
||||
|
||||
# Conexiones maximas al pool
|
||||
DB_POOL_SIZE=10
|
||||
@@ -60,7 +60,7 @@ MEDIAMTX_WEBRTC=http://localhost:8889
|
||||
MEDIAMTX_HLS=http://localhost:8888
|
||||
|
||||
# Directorio de grabaciones
|
||||
VIDEO_STORAGE_PATH=/opt/flotillas/videos
|
||||
VIDEO_STORAGE_PATH=/opt/adan/videos
|
||||
VIDEO_RETENTION_DAYS=30
|
||||
```
|
||||
|
||||
@@ -71,7 +71,7 @@ MQTT_HOST=localhost
|
||||
MQTT_PORT=1883
|
||||
MQTT_USER=mesh_gateway
|
||||
MQTT_PASSWORD=password_seguro
|
||||
MQTT_TOPIC=flotillas/mesh/#
|
||||
MQTT_TOPIC=adan/mesh/#
|
||||
```
|
||||
|
||||
### Notificaciones
|
||||
@@ -82,18 +82,18 @@ SMTP_HOST=smtp.tudominio.com
|
||||
SMTP_PORT=587
|
||||
SMTP_USER=notificaciones@tudominio.com
|
||||
SMTP_PASSWORD=password
|
||||
SMTP_FROM=FlotillasGPS <notificaciones@tudominio.com>
|
||||
SMTP_FROM=ADAN <notificaciones@tudominio.com>
|
||||
|
||||
# Push Notifications (Firebase)
|
||||
FIREBASE_CREDENTIALS_FILE=/opt/flotillas/firebase-credentials.json
|
||||
FIREBASE_CREDENTIALS_FILE=/opt/adan/firebase-credentials.json
|
||||
```
|
||||
|
||||
### Dominio
|
||||
|
||||
```bash
|
||||
DOMAIN=flotillas.tudominio.com
|
||||
API_URL=https://flotillas.tudominio.com/api
|
||||
FRONTEND_URL=https://flotillas.tudominio.com
|
||||
DOMAIN=adan.tudominio.com
|
||||
API_URL=https://adan.tudominio.com/api
|
||||
FRONTEND_URL=https://adan.tudominio.com
|
||||
```
|
||||
|
||||
---
|
||||
@@ -108,8 +108,8 @@ Archivo: `/opt/traccar/conf/traccar.xml`
|
||||
<properties>
|
||||
<!-- Base de datos -->
|
||||
<entry key='database.driver'>org.postgresql.Driver</entry>
|
||||
<entry key='database.url'>jdbc:postgresql://localhost:5432/flotillas_db</entry>
|
||||
<entry key='database.user'>flotillas</entry>
|
||||
<entry key='database.url'>jdbc:postgresql://localhost:5432/adan_db</entry>
|
||||
<entry key='database.user'>adan</entry>
|
||||
<entry key='database.password'>TU_PASSWORD</entry>
|
||||
|
||||
<!-- Deshabilitar web UI de Traccar (usamos nuestro dashboard) -->
|
||||
@@ -192,7 +192,7 @@ hlsSegmentDuration: 1s
|
||||
|
||||
# Grabacion
|
||||
record: no # Manejamos grabacion desde nuestra API
|
||||
recordPath: /opt/flotillas/videos/%path/%Y%m%d_%H%M%S.mp4
|
||||
recordPath: /opt/adan/videos/%path/%Y%m%d_%H%M%S.mp4
|
||||
|
||||
# Paths (camaras)
|
||||
paths:
|
||||
@@ -231,17 +231,17 @@ credentials-file: /root/.cloudflared/TU_TUNNEL_ID.json
|
||||
|
||||
ingress:
|
||||
# API Backend
|
||||
- hostname: flotillas.tudominio.com
|
||||
- hostname: adan.tudominio.com
|
||||
path: /api/*
|
||||
service: http://localhost:8000
|
||||
|
||||
# WebSocket
|
||||
- hostname: flotillas.tudominio.com
|
||||
- hostname: adan.tudominio.com
|
||||
path: /ws/*
|
||||
service: http://localhost:8000
|
||||
|
||||
# Frontend (default)
|
||||
- hostname: flotillas.tudominio.com
|
||||
- hostname: adan.tudominio.com
|
||||
service: http://localhost:3000
|
||||
|
||||
# Catch-all
|
||||
@@ -352,21 +352,21 @@ ufw enable
|
||||
|
||||
## Configuracion de Systemd Services
|
||||
|
||||
### flotillas-api.service
|
||||
### adan-api.service
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=FlotillasGPS API Backend
|
||||
Description=ADAN API Backend
|
||||
After=network.target postgresql.service redis.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
WorkingDirectory=/opt/flotillas/backend
|
||||
Environment="PATH=/opt/flotillas/venv/bin"
|
||||
EnvironmentFile=/opt/flotillas/.env
|
||||
ExecStart=/opt/flotillas/venv/bin/uvicorn app.main:app \
|
||||
WorkingDirectory=/opt/adan/backend
|
||||
Environment="PATH=/opt/adan/venv/bin"
|
||||
EnvironmentFile=/opt/adan/.env
|
||||
ExecStart=/opt/adan/venv/bin/uvicorn app.main:app \
|
||||
--host 127.0.0.1 \
|
||||
--port 8000 \
|
||||
--workers 4 \
|
||||
@@ -379,18 +379,18 @@ RestartSec=5
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
### flotillas-web.service
|
||||
### adan-web.service
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=FlotillasGPS Web Frontend
|
||||
Description=ADAN Web Frontend
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
WorkingDirectory=/opt/flotillas/frontend
|
||||
WorkingDirectory=/opt/adan/frontend
|
||||
ExecStart=/usr/bin/npx serve -s dist -l 3000
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
@@ -439,11 +439,11 @@ Despues de modificar archivos de configuracion:
|
||||
systemctl daemon-reload
|
||||
|
||||
# Reiniciar servicio especifico
|
||||
systemctl restart flotillas-api
|
||||
systemctl restart adan-api
|
||||
|
||||
# Reiniciar todos los servicios
|
||||
systemctl restart flotillas-api flotillas-web traccar mediamtx
|
||||
systemctl restart adan-api adan-web traccar mediamtx
|
||||
|
||||
# Verificar estado
|
||||
systemctl status flotillas-api flotillas-web traccar mediamtx
|
||||
systemctl status adan-api adan-web traccar mediamtx
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Guia de Instalacion
|
||||
|
||||
Esta guia cubre la instalacion completa del sistema FlotillasGPS en un servidor Proxmox.
|
||||
Esta guia cubre la instalacion completa del sistema ADAN en un servidor Proxmox.
|
||||
|
||||
## Requisitos Previos
|
||||
|
||||
@@ -31,7 +31,7 @@ Esta guia cubre la instalacion completa del sistema FlotillasGPS en un servidor
|
||||
|
||||
1. Click en "Create VM"
|
||||
2. **General**:
|
||||
- Name: `flotillas-server`
|
||||
- Name: `adan-server`
|
||||
- Start at boot: Si
|
||||
3. **OS**:
|
||||
- ISO image: ubuntu-22.04-live-server-amd64.iso
|
||||
@@ -77,9 +77,9 @@ sudo apt install -y git curl wget
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
sudo git clone https://git.consultoria-as.com/tu-usuario/flotillas-gps.git flotillas
|
||||
sudo chown -R $USER:$USER /opt/flotillas
|
||||
cd /opt/flotillas
|
||||
sudo git clone https://git.consultoria-as.com/tu-usuario/adan.git adan
|
||||
sudo chown -R $USER:$USER /opt/adan
|
||||
cd /opt/adan
|
||||
```
|
||||
|
||||
## Paso 4: Configurar Variables
|
||||
@@ -93,7 +93,7 @@ nano deploy/scripts/install.sh
|
||||
Modificar las variables al inicio:
|
||||
|
||||
```bash
|
||||
DOMAIN="flotillas.tudominio.com" # Tu dominio
|
||||
DOMAIN="adan.tudominio.com" # Tu dominio
|
||||
ADMIN_EMAIL="admin@tudominio.com" # Email del admin
|
||||
```
|
||||
|
||||
@@ -124,7 +124,7 @@ El script realizara automaticamente:
|
||||
|
||||
1. Ir a **Zero Trust** > **Access** > **Tunnels**
|
||||
2. Click **Create a tunnel**
|
||||
3. Nombre: `flotillas`
|
||||
3. Nombre: `adan`
|
||||
4. Copiar el token del tunnel
|
||||
|
||||
### En tu servidor:
|
||||
@@ -141,17 +141,17 @@ En el dashboard del tunnel, agregar Public Hostnames:
|
||||
|
||||
| Subdomain | Domain | Service |
|
||||
|-----------|--------|---------|
|
||||
| flotillas | tudominio.com | http://localhost:3000 |
|
||||
| flotillas | tudominio.com | http://localhost:8000 (path: /api/*) |
|
||||
| flotillas | tudominio.com | http://localhost:8000 (path: /ws/*) |
|
||||
| adan | tudominio.com | http://localhost:3000 |
|
||||
| adan | tudominio.com | http://localhost:8000 (path: /api/*) |
|
||||
| adan | tudominio.com | http://localhost:8000 (path: /ws/*) |
|
||||
|
||||
## Paso 7: Verificar Instalacion
|
||||
|
||||
### Verificar servicios:
|
||||
|
||||
```bash
|
||||
sudo systemctl status flotillas-api
|
||||
sudo systemctl status flotillas-web
|
||||
sudo systemctl status adan-api
|
||||
sudo systemctl status adan-web
|
||||
sudo systemctl status traccar
|
||||
sudo systemctl status mediamtx
|
||||
sudo systemctl status cloudflared
|
||||
@@ -161,7 +161,7 @@ Todos deben mostrar `active (running)`.
|
||||
|
||||
### Verificar acceso web:
|
||||
|
||||
Abrir en navegador: `https://flotillas.tudominio.com`
|
||||
Abrir en navegador: `https://adan.tudominio.com`
|
||||
|
||||
Deberia mostrar la pagina de login.
|
||||
|
||||
@@ -181,7 +181,7 @@ Las credenciales se generaron durante la instalacion.
|
||||
Ver credenciales guardadas:
|
||||
|
||||
```bash
|
||||
cat /opt/flotillas/.credentials
|
||||
cat /opt/adan/.credentials
|
||||
```
|
||||
|
||||
Ejemplo de salida:
|
||||
@@ -190,8 +190,8 @@ Ejemplo de salida:
|
||||
=================================
|
||||
CREDENCIALES DE ACCESO
|
||||
=================================
|
||||
Dashboard: https://flotillas.tudominio.com
|
||||
Admin Email: admin@flotillas.tudominio.com
|
||||
Dashboard: https://adan.tudominio.com
|
||||
Admin Email: admin@adan.tudominio.com
|
||||
Admin Password: xK9mN2pL5qR8
|
||||
Database Password: [guardado en .env]
|
||||
=================================
|
||||
@@ -229,17 +229,17 @@ Si el servidor esta detras de NAT:
|
||||
|
||||
```bash
|
||||
# Ver logs detallados
|
||||
journalctl -u flotillas-api -n 100 --no-pager
|
||||
journalctl -u adan-api -n 100 --no-pager
|
||||
|
||||
# Verificar configuracion
|
||||
cat /opt/flotillas/.env
|
||||
cat /opt/adan/.env
|
||||
```
|
||||
|
||||
### No puedo acceder al dashboard
|
||||
|
||||
```bash
|
||||
# Verificar tunnel
|
||||
cloudflared tunnel info flotillas
|
||||
cloudflared tunnel info adan
|
||||
|
||||
# Reiniciar tunnel
|
||||
sudo systemctl restart cloudflared
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Integracion Meshtastic
|
||||
|
||||
Guia para configurar dispositivos Meshtastic con FlotillasGPS.
|
||||
Guia para configurar dispositivos Meshtastic con ADAN.
|
||||
|
||||
## Que es Meshtastic
|
||||
|
||||
@@ -11,7 +11,7 @@ Meshtastic es una plataforma de comunicacion mesh usando radio LoRa:
|
||||
- **Bajo costo**: Dispositivos desde $20 USD
|
||||
- **Bajo consumo**: Semanas de bateria
|
||||
|
||||
### Casos de Uso en Flotillas
|
||||
### Casos de Uso en ADAN
|
||||
|
||||
- Vehiculos en zonas rurales sin cobertura celular
|
||||
- Operaciones en minas, campos, areas remotas
|
||||
@@ -48,7 +48,7 @@ Meshtastic es una plataforma de comunicacion mesh usando radio LoRa:
|
||||
| MQTT / Internet
|
||||
v
|
||||
[Tu Servidor]
|
||||
FlotillasGPS
|
||||
ADAN
|
||||
```
|
||||
|
||||
---
|
||||
@@ -153,7 +153,7 @@ meshtastic --set mqtt.enabled true
|
||||
meshtastic --set mqtt.address tu-servidor.com
|
||||
meshtastic --set mqtt.username mesh_gateway
|
||||
meshtastic --set mqtt.password tu_password
|
||||
meshtastic --set mqtt.root_topic flotillas/mesh
|
||||
meshtastic --set mqtt.root_topic adan/mesh
|
||||
meshtastic --set mqtt.encryption_enabled true
|
||||
meshtastic --set mqtt.json_enabled true
|
||||
```
|
||||
@@ -168,7 +168,7 @@ MQTT Enabled: true
|
||||
MQTT Server: tu-servidor.com:1883
|
||||
MQTT Username: mesh_gateway
|
||||
MQTT Password: tu_password
|
||||
Root Topic: flotillas/mesh
|
||||
Root Topic: adan/mesh
|
||||
JSON Enabled: true
|
||||
```
|
||||
|
||||
@@ -190,7 +190,7 @@ mosquitto_passwd -c /etc/mosquitto/passwd mesh_gateway
|
||||
# Ingresar password
|
||||
```
|
||||
|
||||
Configuracion `/etc/mosquitto/conf.d/flotillas.conf`:
|
||||
Configuracion `/etc/mosquitto/conf.d/adan.conf`:
|
||||
```
|
||||
listener 1883
|
||||
allow_anonymous false
|
||||
@@ -207,12 +207,12 @@ systemctl restart mosquitto
|
||||
Suscribirse al topic para ver mensajes:
|
||||
|
||||
```bash
|
||||
mosquitto_sub -h localhost -t "flotillas/mesh/#" -u mesh_gateway -P tu_password
|
||||
mosquitto_sub -h localhost -t "adan/mesh/#" -u mesh_gateway -P tu_password
|
||||
```
|
||||
|
||||
Deberian aparecer mensajes JSON cuando los nodos envien posicion.
|
||||
|
||||
### 3. Configurar en FlotillasGPS
|
||||
### 3. Configurar en ADAN
|
||||
|
||||
Variables de entorno en `.env`:
|
||||
```bash
|
||||
@@ -220,7 +220,7 @@ MQTT_HOST=localhost
|
||||
MQTT_PORT=1883
|
||||
MQTT_USER=mesh_gateway
|
||||
MQTT_PASSWORD=tu_password
|
||||
MQTT_TOPIC=flotillas/mesh/#
|
||||
MQTT_TOPIC=adan/mesh/#
|
||||
```
|
||||
|
||||
---
|
||||
@@ -319,7 +319,7 @@ Cada vehiculo puede actuar como relay si esta configurado como ROUTER_CLIENT.
|
||||
|
||||
1. Verificar que el gateway recibe mensajes:
|
||||
```bash
|
||||
mosquitto_sub -h localhost -t "flotillas/mesh/#" -u mesh_gateway -P password
|
||||
mosquitto_sub -h localhost -t "adan/mesh/#" -u mesh_gateway -P password
|
||||
```
|
||||
|
||||
2. Verificar que el nodo esta en el mismo canal:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Solucion de Problemas
|
||||
|
||||
Guia para diagnosticar y resolver problemas comunes en FlotillasGPS.
|
||||
Guia para diagnosticar y resolver problemas comunes en ADAN.
|
||||
|
||||
## Diagnostico Rapido
|
||||
|
||||
@@ -8,10 +8,10 @@ Guia para diagnosticar y resolver problemas comunes en FlotillasGPS.
|
||||
|
||||
```bash
|
||||
# Ver estado de todos los servicios
|
||||
systemctl status flotillas-api flotillas-web traccar mediamtx cloudflared redis postgresql
|
||||
systemctl status adan-api adan-web traccar mediamtx cloudflared redis postgresql
|
||||
|
||||
# Resumen rapido
|
||||
for svc in flotillas-api flotillas-web traccar mediamtx cloudflared; do
|
||||
for svc in adan-api adan-web traccar mediamtx cloudflared; do
|
||||
echo "$svc: $(systemctl is-active $svc)"
|
||||
done
|
||||
```
|
||||
@@ -20,10 +20,10 @@ done
|
||||
|
||||
```bash
|
||||
# API Backend
|
||||
journalctl -u flotillas-api -f
|
||||
journalctl -u adan-api -f
|
||||
|
||||
# Frontend
|
||||
journalctl -u flotillas-web -f
|
||||
journalctl -u adan-web -f
|
||||
|
||||
# Traccar (GPS)
|
||||
journalctl -u traccar -f
|
||||
@@ -45,7 +45,7 @@ curl http://localhost:8000/api/v1/health
|
||||
curl http://localhost:3000
|
||||
|
||||
# Base de datos
|
||||
psql -U flotillas -d flotillas_db -c "SELECT 1"
|
||||
psql -U adan -d adan_db -c "SELECT 1"
|
||||
|
||||
# Redis
|
||||
redis-cli ping
|
||||
@@ -64,12 +64,12 @@ redis-cli ping
|
||||
1. Estado del tunnel de Cloudflare:
|
||||
```bash
|
||||
systemctl status cloudflared
|
||||
cloudflared tunnel info flotillas
|
||||
cloudflared tunnel info adan
|
||||
```
|
||||
|
||||
2. Estado del frontend:
|
||||
```bash
|
||||
systemctl status flotillas-web
|
||||
systemctl status adan-web
|
||||
curl http://localhost:3000
|
||||
```
|
||||
|
||||
@@ -90,17 +90,17 @@ systemctl restart cloudflared
|
||||
|
||||
**Verificar**:
|
||||
```bash
|
||||
systemctl status flotillas-api
|
||||
systemctl status adan-api
|
||||
curl http://localhost:8000/api/v1/health
|
||||
```
|
||||
|
||||
**Soluciones**:
|
||||
```bash
|
||||
# Reiniciar backend
|
||||
systemctl restart flotillas-api
|
||||
systemctl restart adan-api
|
||||
|
||||
# Ver logs de error
|
||||
journalctl -u flotillas-api -n 100 --no-pager
|
||||
journalctl -u adan-api -n 100 --no-pager
|
||||
```
|
||||
|
||||
### Error de SSL/Certificado
|
||||
@@ -186,7 +186,7 @@ curl http://localhost:8082/api/devices
|
||||
**Verificar**:
|
||||
```bash
|
||||
# Ver ubicaciones recientes en DB
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT vehiculo_id, tiempo, lat, lng
|
||||
FROM ubicaciones
|
||||
ORDER BY tiempo DESC
|
||||
@@ -210,7 +210,7 @@ psql -U flotillas -d flotillas_db -c "
|
||||
**Verificar en el servidor**:
|
||||
```bash
|
||||
# Ver ultimas ubicaciones de apps
|
||||
journalctl -u flotillas-api | grep "ubicacion" | tail -20
|
||||
journalctl -u adan-api | grep "ubicacion" | tail -20
|
||||
```
|
||||
|
||||
### App no puede conectar al servidor
|
||||
@@ -238,7 +238,7 @@ journalctl -u flotillas-api | grep "ubicacion" | tail -20
|
||||
**En el servidor**:
|
||||
```bash
|
||||
# Ver logs de notificaciones
|
||||
journalctl -u flotillas-api | grep "push\|notification"
|
||||
journalctl -u adan-api | grep "push\|notification"
|
||||
```
|
||||
|
||||
---
|
||||
@@ -284,21 +284,21 @@ ffprobe rtsp://usuario:password@IP_CAMARA/stream
|
||||
|
||||
1. Espacio en disco:
|
||||
```bash
|
||||
df -h /opt/flotillas/videos
|
||||
df -h /opt/adan/videos
|
||||
```
|
||||
|
||||
2. Permisos:
|
||||
```bash
|
||||
ls -la /opt/flotillas/videos
|
||||
ls -la /opt/adan/videos
|
||||
```
|
||||
|
||||
**Solucion**:
|
||||
```bash
|
||||
# Liberar espacio
|
||||
find /opt/flotillas/videos -name "*.mp4" -mtime +30 -delete
|
||||
find /opt/adan/videos -name "*.mp4" -mtime +30 -delete
|
||||
|
||||
# Arreglar permisos
|
||||
chown -R www-data:www-data /opt/flotillas/videos
|
||||
chown -R www-data:www-data /opt/adan/videos
|
||||
```
|
||||
|
||||
---
|
||||
@@ -312,7 +312,7 @@ chown -R www-data:www-data /opt/flotillas/videos
|
||||
systemctl status postgresql
|
||||
|
||||
# Verificar que acepta conexiones
|
||||
psql -U flotillas -d flotillas_db -c "SELECT 1"
|
||||
psql -U adan -d adan_db -c "SELECT 1"
|
||||
```
|
||||
|
||||
**Soluciones**:
|
||||
@@ -329,7 +329,7 @@ journalctl -u postgresql -f
|
||||
**Verificar**:
|
||||
```bash
|
||||
# Ver consultas lentas
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT pid, now() - pg_stat_activity.query_start AS duration, query
|
||||
FROM pg_stat_activity
|
||||
WHERE state != 'idle'
|
||||
@@ -341,26 +341,26 @@ psql -U flotillas -d flotillas_db -c "
|
||||
|
||||
1. Ejecutar VACUUM:
|
||||
```bash
|
||||
psql -U flotillas -d flotillas_db -c "VACUUM ANALYZE;"
|
||||
psql -U adan -d adan_db -c "VACUUM ANALYZE;"
|
||||
```
|
||||
|
||||
2. Verificar indices:
|
||||
```bash
|
||||
psql -U flotillas -d flotillas_db -c "\di"
|
||||
psql -U adan -d adan_db -c "\di"
|
||||
```
|
||||
|
||||
### Disco lleno por ubicaciones
|
||||
|
||||
**Verificar**:
|
||||
```bash
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT pg_size_pretty(pg_total_relation_size('ubicaciones'));
|
||||
"
|
||||
```
|
||||
|
||||
**Solucion**: Comprimir datos antiguos (TimescaleDB):
|
||||
```bash
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT compress_chunk(c)
|
||||
FROM show_chunks('ubicaciones', older_than => INTERVAL '7 days') c;
|
||||
"
|
||||
@@ -406,10 +406,10 @@ ps aux | grep uvicorn
|
||||
|
||||
1. Aumentar workers en el servicio:
|
||||
```bash
|
||||
# Editar /etc/systemd/system/flotillas-api.service
|
||||
# Editar /etc/systemd/system/adan-api.service
|
||||
# Cambiar --workers 4 a --workers 8
|
||||
systemctl daemon-reload
|
||||
systemctl restart flotillas-api
|
||||
systemctl restart adan-api
|
||||
```
|
||||
|
||||
2. Verificar conexiones a Redis:
|
||||
@@ -429,7 +429,7 @@ redis-cli info clients
|
||||
systemctl status mosquitto
|
||||
|
||||
# Suscribirse para ver mensajes
|
||||
mosquitto_sub -h localhost -t "flotillas/mesh/#" -u mesh_gateway -P password
|
||||
mosquitto_sub -h localhost -t "adan/mesh/#" -u mesh_gateway -P password
|
||||
```
|
||||
|
||||
**Verificar configuracion del gateway**:
|
||||
@@ -441,7 +441,7 @@ mosquitto_sub -h localhost -t "flotillas/mesh/#" -u mesh_gateway -P password
|
||||
|
||||
**Verificar**:
|
||||
```bash
|
||||
journalctl -u flotillas-api | grep "meshtastic\|mesh"
|
||||
journalctl -u adan-api | grep "meshtastic\|mesh"
|
||||
```
|
||||
|
||||
**Solucion**: Verificar que el servicio MQTT esta corriendo en el backend.
|
||||
@@ -455,38 +455,38 @@ journalctl -u flotillas-api | grep "meshtastic\|mesh"
|
||||
**Verificar**:
|
||||
```bash
|
||||
# Espacio en disco
|
||||
df -h /opt/flotillas/backups
|
||||
df -h /opt/adan/backups
|
||||
|
||||
# Permisos
|
||||
ls -la /opt/flotillas/scripts/backup.sh
|
||||
ls -la /opt/adan/scripts/backup.sh
|
||||
```
|
||||
|
||||
**Ejecutar manualmente para ver errores**:
|
||||
```bash
|
||||
/opt/flotillas/scripts/backup.sh 2>&1 | tee /tmp/backup.log
|
||||
/opt/adan/scripts/backup.sh 2>&1 | tee /tmp/backup.log
|
||||
```
|
||||
|
||||
### Restauracion falla
|
||||
|
||||
**Verificar integridad del backup**:
|
||||
```bash
|
||||
gunzip -t /opt/flotillas/backups/db_FECHA.sql.gz
|
||||
gunzip -t /opt/adan/backups/db_FECHA.sql.gz
|
||||
```
|
||||
|
||||
**Restaurar paso a paso**:
|
||||
```bash
|
||||
# Parar servicios
|
||||
systemctl stop flotillas-api
|
||||
systemctl stop adan-api
|
||||
|
||||
# Recrear base de datos
|
||||
psql -U postgres -c "DROP DATABASE flotillas_db;"
|
||||
psql -U postgres -c "CREATE DATABASE flotillas_db OWNER flotillas;"
|
||||
psql -U postgres -c "DROP DATABASE adan_db;"
|
||||
psql -U postgres -c "CREATE DATABASE adan_db OWNER adan;"
|
||||
|
||||
# Restaurar
|
||||
gunzip -c backup.sql.gz | psql -U flotillas -d flotillas_db
|
||||
gunzip -c backup.sql.gz | psql -U adan -d adan_db
|
||||
|
||||
# Iniciar servicios
|
||||
systemctl start flotillas-api
|
||||
systemctl start adan-api
|
||||
```
|
||||
|
||||
---
|
||||
@@ -495,7 +495,7 @@ systemctl start flotillas-api
|
||||
|
||||
```bash
|
||||
# Estado general del sistema
|
||||
systemctl status flotillas-api flotillas-web traccar mediamtx cloudflared
|
||||
systemctl status adan-api adan-web traccar mediamtx cloudflared
|
||||
|
||||
# Uso de recursos
|
||||
htop
|
||||
@@ -503,7 +503,7 @@ df -h
|
||||
free -h
|
||||
|
||||
# Logs en tiempo real
|
||||
journalctl -u flotillas-api -f
|
||||
journalctl -u adan-api -f
|
||||
|
||||
# Conexiones activas
|
||||
ss -tlnp
|
||||
@@ -515,10 +515,10 @@ netstat -tlnp
|
||||
curl -s http://localhost:8000/api/v1/health | jq
|
||||
|
||||
# Test de base de datos
|
||||
psql -U flotillas -d flotillas_db -c "SELECT COUNT(*) FROM vehiculos;"
|
||||
psql -U adan -d adan_db -c "SELECT COUNT(*) FROM vehiculos;"
|
||||
|
||||
# Ultimas ubicaciones
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT v.nombre, u.tiempo, u.lat, u.lng, u.velocidad
|
||||
FROM ubicaciones u
|
||||
JOIN vehiculos v ON u.vehiculo_id = v.id
|
||||
@@ -527,7 +527,7 @@ psql -U flotillas -d flotillas_db -c "
|
||||
"
|
||||
|
||||
# Alertas pendientes
|
||||
psql -U flotillas -d flotillas_db -c "
|
||||
psql -U adan -d adan_db -c "
|
||||
SELECT COUNT(*) as pendientes FROM alertas WHERE atendida = false;
|
||||
"
|
||||
```
|
||||
@@ -545,12 +545,12 @@ Si no puedes resolver el problema:
|
||||
echo "=== FECHA ==="
|
||||
date
|
||||
echo "=== SERVICIOS ==="
|
||||
systemctl status flotillas-api flotillas-web traccar mediamtx cloudflared
|
||||
systemctl status adan-api adan-web traccar mediamtx cloudflared
|
||||
echo "=== RECURSOS ==="
|
||||
free -h
|
||||
df -h
|
||||
echo "=== LOGS RECIENTES ==="
|
||||
journalctl -u flotillas-api -n 50 --no-pager
|
||||
journalctl -u adan-api -n 50 --no-pager
|
||||
} > /tmp/diagnostico.txt
|
||||
```
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Manual del Administrador
|
||||
|
||||
Guia completa para administrar el sistema FlotillasGPS.
|
||||
Guia completa para administrar el sistema ADAN.
|
||||
|
||||
## Acceso al Sistema
|
||||
|
||||
### Iniciar Sesion
|
||||
|
||||
1. Abrir `https://flotillas.tudominio.com` en el navegador
|
||||
1. Abrir `https://adan.tudominio.com` en el navegador
|
||||
2. Ingresar email y contrasena
|
||||
3. Click en "Ingresar"
|
||||
|
||||
@@ -386,15 +386,15 @@ Los mensajes y respuestas aparecen como conversacion en el detalle del conductor
|
||||
|
||||
```bash
|
||||
ssh admin@servidor
|
||||
/opt/flotillas/scripts/backup.sh
|
||||
/opt/adan/scripts/backup.sh
|
||||
```
|
||||
|
||||
Los backups se guardan en `/opt/flotillas/backups/`
|
||||
Los backups se guardan en `/opt/adan/backups/`
|
||||
|
||||
### Restaurar Backup
|
||||
|
||||
```bash
|
||||
/opt/flotillas/scripts/restore.sh /opt/flotillas/backups/db_20260121.sql.gz
|
||||
/opt/adan/scripts/restore.sh /opt/adan/backups/db_20260121.sql.gz
|
||||
```
|
||||
|
||||
### Backups Automaticos
|
||||
@@ -408,5 +408,5 @@ Se ejecutan diariamente a las 3:00 AM. Se mantienen los ultimos 7 dias.
|
||||
Para problemas tecnicos:
|
||||
|
||||
1. Revisar [Solucion de Problemas](troubleshooting.md)
|
||||
2. Revisar logs: `journalctl -u flotillas-api -f`
|
||||
2. Revisar logs: `journalctl -u adan-api -f`
|
||||
3. Contactar soporte tecnico
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
# Manual del Conductor - App FlotillasGPS
|
||||
# Manual del Conductor - App ADAN
|
||||
|
||||
Guia completa para usar la aplicacion movil de FlotillasGPS.
|
||||
Guia completa para usar la aplicacion movil de ADAN.
|
||||
|
||||
## Instalacion de la App
|
||||
|
||||
### Android
|
||||
|
||||
1. Abrir Play Store
|
||||
2. Buscar "FlotillasGPS Conductor"
|
||||
2. Buscar "ADAN Conductor"
|
||||
3. Instalar la aplicacion
|
||||
4. Abrir la app
|
||||
|
||||
### iPhone
|
||||
|
||||
1. Abrir App Store
|
||||
2. Buscar "FlotillasGPS Conductor"
|
||||
2. Buscar "ADAN Conductor"
|
||||
3. Instalar la aplicacion
|
||||
4. Abrir la app
|
||||
|
||||
@@ -238,7 +238,7 @@ La app muestra el numero de telefono de emergencia de tu empresa. Puedes tocarlo
|
||||
Si tienes problemas con el GPS:
|
||||
|
||||
1. Ir a **Configuracion** del telefono
|
||||
2. Buscar la app **FlotillasGPS**
|
||||
2. Buscar la app **ADAN**
|
||||
3. Tocar **Permisos**
|
||||
4. Asegurar que **Ubicacion** este en **Siempre permitir**
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Configuracion de Video Streaming
|
||||
|
||||
Guia para configurar camaras y video streaming en FlotillasGPS.
|
||||
Guia para configurar camaras y video streaming en ADAN.
|
||||
|
||||
## Arquitectura de Video
|
||||
|
||||
@@ -12,7 +12,7 @@ Camaras en Vehiculos Servidor Dashboard/App
|
||||
[Cam IP] --RTSP--> |
|
||||
|
|
||||
[Grabaciones]
|
||||
/opt/flotillas/videos/
|
||||
/opt/adan/videos/
|
||||
```
|
||||
|
||||
## Tipos de Camaras Soportadas
|
||||
@@ -50,7 +50,7 @@ Cualquier camara con:
|
||||
|
||||
### 4. Celular como Dashcam
|
||||
|
||||
La app FlotillasGPS puede usar la camara del celular:
|
||||
La app ADAN puede usar la camara del celular:
|
||||
- Sin costo adicional
|
||||
- Calidad depende del celular
|
||||
- Consume bateria y datos
|
||||
@@ -240,7 +240,7 @@ Configurar en **Configuracion** > **Retencion de datos**:
|
||||
Script de limpieza automatica:
|
||||
```bash
|
||||
# Ejecutar diariamente via cron
|
||||
find /opt/flotillas/videos -name "*.mp4" -mtime +30 -delete
|
||||
find /opt/adan/videos -name "*.mp4" -mtime +30 -delete
|
||||
```
|
||||
|
||||
---
|
||||
@@ -344,10 +344,10 @@ Soluciones:
|
||||
Verificar:
|
||||
```bash
|
||||
# Espacio en disco
|
||||
df -h /opt/flotillas/videos
|
||||
df -h /opt/adan/videos
|
||||
|
||||
# Permisos
|
||||
ls -la /opt/flotillas/videos
|
||||
ls -la /opt/adan/videos
|
||||
|
||||
# Logs de MediaMTX
|
||||
journalctl -u mediamtx -f
|
||||
|
||||
Reference in New Issue
Block a user