Mejoras de sesion: estabilizacion, IA, Nexus Yonke y marketplace B2B
- F0 blindaje: Redis/Celery, pg_hba sin trust LAN, secretos a env 600, backups, webhook auth, jobs muertos - F1 caja: bugs POS, reembolsos al corte, apartados, CFDI, topes de descuento en cotizacion/apartado - F2/F7 IA de catalogo: autocategorizacion, dedup de SKUs con embeddings, OCR de facturas, descripciones, claves SAT, limpieza de fitment - F3 IA en el flujo: vision Yonke, preguntas MeLi, venta cruzada, anomalias, sinonimos, busqueda semantica (rerank/embeddings) - F4/F8 escala y cartera: /metrics+Prometheus+Grafana, pool, score de credito, churn, metricas multi-tenant - Nexus Yonke (M1-M6): modelo de datos 1-de-1, alta por donador, vitrina publica, MeLi usado, consignacion, garantia por dias, reportes, etiquetas - Marketplace B2B entre yonkes (catalogo + pedidos cross-tenant) - Seguridad: auth en /api/admin/* (35 endpoints), alertas por tenant - Migraciones v4.27/v4.28; timers expire-demos y rollup-metrics
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
[Unit]
|
||||
Description=Nexus Autoparts automated backup
|
||||
Description=Nexus Autoparts automated backup (master + all tenant DBs)
|
||||
After=postgresql.service
|
||||
OnFailure=nexus-alert@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
WorkingDirectory=/home/Autopartes
|
||||
ExecStart=/bin/bash /home/Autopartes/scripts/backup.sh
|
||||
ExecStart=/bin/bash /home/Autopartes/scripts/backup_selective.sh
|
||||
Environment=RETENTION_DAYS=21
|
||||
Environment=MASTER_DB=nexus_autoparts
|
||||
# Environment=BACKUP_S3_BUCKET=mi-bucket (requiere tools/bin/aws configurado)
|
||||
StandardOutput=append:/var/log/nexus-pos/backup.log
|
||||
StandardError=append:/var/log/nexus-pos/backup.log
|
||||
|
||||
11
systemd/nexus-expire-demos.service
Normal file
11
systemd/nexus-expire-demos.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Nexus demo expiry (downgrade ended demos to free)
|
||||
After=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=postgres
|
||||
Environment=MASTER_DB_NAME=nexus_autoparts
|
||||
WorkingDirectory=/home/Autopartes
|
||||
ExecStart=/usr/bin/python3 /home/Autopartes/scripts/expire_demos.py --apply
|
||||
OnFailure=nexus-alert@%n.service
|
||||
9
systemd/nexus-expire-demos.timer
Normal file
9
systemd/nexus-expire-demos.timer
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Expire ended demo tenants daily
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 03:37:00
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -18,6 +18,7 @@ Environment=REDIS_URL=redis://localhost:6379/0
|
||||
Environment=REDIS_ENABLED=true
|
||||
Environment=MEILI_URL=http://localhost:7700
|
||||
Environment=MEILI_ENABLED=true
|
||||
Environment=MEILI_API_KEY=ac66d5e44381fa0c4c2f949d7026fa19cb8c454a0740262403f27cd76aefed1e
|
||||
Environment=QWEN_API_URL=https://api.nan.builders/v1
|
||||
Environment=QWEN_API_KEY=sk-Yr0e-Y4F4j1NuuK8xdbxIA
|
||||
Environment=QWEN_MODEL=qwen3.6
|
||||
|
||||
10
systemd/nexus-rollup-metrics.service
Normal file
10
systemd/nexus-rollup-metrics.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Nexus tenant metrics rollup (portfolio)
|
||||
After=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=postgres
|
||||
WorkingDirectory=/home/Autopartes
|
||||
ExecStart=/usr/bin/python3 /home/Autopartes/scripts/rollup_tenant_metrics.py --days 3
|
||||
OnFailure=nexus-alert@%n.service
|
||||
9
systemd/nexus-rollup-metrics.timer
Normal file
9
systemd/nexus-rollup-metrics.timer
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Roll up per-tenant business metrics daily
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 04:07:00
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -3,6 +3,8 @@ Description=Nexus Autoparts Dashboard
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
# Número WhatsApp público para botón de cotización del catálogo (formato: 521234567890)
|
||||
Environment=PUBLIC_WA_NUMBER=
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/home/Autopartes/dashboard
|
||||
|
||||
Reference in New Issue
Block a user