feat: Complete ATLAS system installation and API fixes

## Backend Changes
- Add new API endpoints: combustible, pois, mantenimiento, video, configuracion
- Fix vehiculos endpoint to return paginated response with items array
- Add /vehiculos/all endpoint for non-paginated list
- Add /geocercas/all endpoint
- Add /alertas/configuracion GET/PUT endpoints
- Add /viajes/activos and /viajes/iniciar endpoints
- Add /reportes/stats, /reportes/templates, /reportes/preview endpoints
- Add /conductores/all and /conductores/disponibles endpoints
- Update router.py to include all new modules

## Frontend Changes
- Fix authentication token handling (snake_case vs camelCase)
- Update vehiculosApi.listAll to use /vehiculos/all
- Fix FuelGauge component usage in Combustible page
- Fix chart component exports (named + default exports)
- Update API client for proper token refresh

## Infrastructure
- Rename services from ADAN to ATLAS
- Configure Cloudflare tunnel for atlas.consultoria-as.com
- Update systemd service files
- Configure PostgreSQL with TimescaleDB
- Configure Redis, Mosquitto, Traccar, MediaMTX

## Documentation
- Update installation guides
- Update API reference
- Rename all ADAN references to ATLAS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
ATLAS Admin
2026-01-25 03:04:23 +00:00
parent 0dfce3ce20
commit e59aa2a742
73 changed files with 4415 additions and 450 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# ============================================
# Sistema de ADAN - Script de Restauracion
# Sistema de ATLAS - Script de Restauracion
# ============================================
# Restaura backups de base de datos y configuracion
#
@@ -29,8 +29,8 @@ NC='\033[0m'
# ---------------------------------------------
# Variables
# ---------------------------------------------
INSTALL_DIR="${INSTALL_DIR:-/opt/adan}"
BACKUP_DIR="${BACKUP_DIR:-/var/backups/adan}"
INSTALL_DIR="${INSTALL_DIR:-/opt/atlas}"
BACKUP_DIR="${BACKUP_DIR:-/var/backups/atlas}"
# Cargar variables de entorno
if [[ -f "$INSTALL_DIR/.env" ]]; then
@@ -40,8 +40,8 @@ fi
# Base de datos
DB_HOST="${POSTGRES_HOST:-localhost}"
DB_PORT="${POSTGRES_PORT:-5432}"
DB_NAME="${POSTGRES_DB:-adan}"
DB_USER="${POSTGRES_USER:-adan}"
DB_NAME="${POSTGRES_DB:-atlas}"
DB_USER="${POSTGRES_USER:-atlas}"
DB_PASSWORD="${POSTGRES_PASSWORD:-}"
# Opciones
@@ -109,7 +109,7 @@ parse_args() {
}
show_help() {
echo "Sistema de ADAN - Restauracion de Backup"
echo "Sistema de ATLAS - Restauracion de Backup"
echo ""
echo "Uso: $0 [opciones]"
echo ""
@@ -124,7 +124,7 @@ show_help() {
echo " $0 --list"
echo " $0 --latest"
echo " $0 --date 20240115"
echo " $0 --db /var/backups/adan/daily/adan_20240115_030000_db.sql.gz"
echo " $0 --db /var/backups/atlas/daily/atlas_20240115_030000_db.sql.gz"
}
# ---------------------------------------------
@@ -204,7 +204,7 @@ find_backup_by_date() {
local type="$1"
local date="$2"
local pattern="adan_${date}*_${type}.*gz"
local pattern="atlas_${date}*_${type}.*gz"
local found=$(ls -t "$BACKUP_DIR/daily"/$pattern 2>/dev/null | head -1)
@@ -222,8 +222,8 @@ find_backup_by_date() {
stop_services() {
log_info "Deteniendo servicios..."
systemctl stop adan-api 2>/dev/null || true
systemctl stop adan-web 2>/dev/null || true
systemctl stop atlas-api 2>/dev/null || true
systemctl stop atlas-web 2>/dev/null || true
# Esperar a que se detengan
sleep 2
@@ -237,8 +237,8 @@ stop_services() {
start_services() {
log_info "Iniciando servicios..."
systemctl start adan-api 2>/dev/null || true
systemctl start adan-web 2>/dev/null || true
systemctl start atlas-api 2>/dev/null || true
systemctl start atlas-web 2>/dev/null || true
log_success "Servicios iniciados"
}
@@ -389,7 +389,7 @@ restore_config() {
fi
# Servicios systemd
for service in $temp_dir/etc/systemd/system/adan-*.service; do
for service in $temp_dir/etc/systemd/system/atlas-*.service; do
if [[ -f "$service" ]]; then
cp "$service" /etc/systemd/system/
log_info "Restaurado: $(basename "$service")"
@@ -472,7 +472,7 @@ main() {
# Modo interactivo si no se especificaron opciones
if [[ -z "$DB_BACKUP" ]] && [[ -z "$CONFIG_BACKUP" ]] && [[ "$USE_LATEST" != "true" ]] && [[ -z "$RESTORE_DATE" ]]; then
echo ""
echo "Sistema de ADAN - Restauracion"
echo "Sistema de ATLAS - Restauracion"
echo "===================================="
echo ""
echo "Selecciona una opcion:"
@@ -540,8 +540,8 @@ main() {
log_success "=========================================="
echo ""
echo "Verifica que los servicios esten funcionando:"
echo " systemctl status adan-api"
echo " systemctl status adan-web"
echo " systemctl status atlas-api"
echo " systemctl status atlas-web"
echo ""
}