# Implantação Grok CLI — Speed Fibra / Aspeednet

> **Período:** 2026-07-06 → 2026-07-12  
> **Hub de execução:** nextcloud `45.65.135.180`  
> **Objetivo deste doc:** inventário do que o Grok CLI implantou e o que ainda falta  
> **NOC:** também em Phoenix → Documentação + aba Changelog  
> **Atualizado:** 2026-07-12

---

## 1. Linha do tempo

| Período | Foco |
|---------|------|
| 06–07/07 | Inventário, hypervisors, DNS upgrade, NetFlow/anomaly, limpeza offline |
| 08–09/07 | Segurança SSH, SpeedShield, BGP privado, plano executável 9/10 |
| 09–10/07 | QoS speedtest, site aspeedfibra, Fibri, WhatsApp, n8n, BGP AS268217 |
| 10–11/07 | Central assinante, SpeedShield produção, OLT/FTTH NOC, AspeedOLT |
| 11–12/07 | AI Guardian, personas Sentinel/Nilson, TV CDNTV, portal, APK, HTTPS |
| 12/07 | UI TV (carrossel, fullscreen), apps oficiais, este inventário NOC |

---

## 2. Já implantado (por área)

### 2.1 Rede e acesso

| Entrega | Status |
|----------|--------|
| Inventário + SSH por chave (cc, tst, esxi, pve, DNS…) | Feito |
| ESXi1/ESXi2 + Proxmox no inventário | Feito |
| WireGuard wg0 + wg-sp-cc documentados/mantidos | Feito |
| Port knock SSH hub | Feito |
| SSH key-only em massa (Fase 2) | Feito |
| fail2ban + IOC + cron.allow | Feito |
| Backup MikroTik madrugada | Feito |
| DNS ns1/ns2 Debian 13 + BIND 9.20 | Feito |
| RPZ AnaBlock (formato BIND 9.20) | Feito |
| ns3/ns4 escravos + hardening | Feito |
| BGP AS268217 ESTABLISHED + anúncios apps/TV | Feito |
| QoS P0 speedtest; fila PPPoE 4.5G→8G | Feito |
| SF-SMTP / bloqueio porta 25 residencial | Feito |

### 2.2 NOC / Phoenix

| Entrega | Status |
|----------|--------|
| Phoenix API + inventário YAML + blackbox | Feito |
| Anomaly Detector + NetFlow | Feito |
| Abas Segurança / Changelog / FTTH | Feito |
| Telegram (modo crítico) | Feito |
| Security Watchdog + alerta se trava | Feito |
| OLT Huawei SNMP + 1400 ONUs SGP | Feito |
| OLT Cianet removida (offline) | Feito |

### 2.3 SpeedShield / DDoS

| Entrega | Status |
|----------|--------|
| VM 149 (CPU/RAM/disco) | Feito |
| Mitigação REST MikroTik real | Feito |
| Produção + FP CGNAT corrigido | Feito |
| Prune DB / locks | Feito |
| speedshield-auto (Sentinel) | Feito |

### 2.4 Speedtest

| Entrega | Status |
|----------|--------|
| Ookla tst HTTPS + systemd | Feito |
| LibreSpeed tema Speed Fibra | Feito |
| nPerf 156 Ubuntu 24 | Feito |
| Links no site comercial | Feito |

### 2.5 Site comercial + automação

| Entrega | Status |
|----------|--------|
| www.aspeedfibra.com.br redesign + social | Feito |
| Mascote Fibri + kit + reels + leads | Feito |
| n8n HTTPS + webhook Fibri | Feito |
| WhatsApp Business (menu, QR, kit) | Feito |
| Central do Assinante same-origin (proxy SGP) | Feito (ver pendência política) |

### 2.6 IA

| Entrega | Status |
|----------|--------|
| Speed Fibra AI + Guardian | Feito |
| Personas Nilson + Sentinel + Duo | Feito |
| Telegram /sentinel /arquiteto /duo | Feito |

### 2.7 FTTH / AspeedOLT

| Entrega | Status |
|----------|--------|
| VM gpon `.154` + AspeedOLT | Feito |
| Speed Fibra Control F2–F6 | Feito |
| Dual-engine OLT bridge | Feito |

### 2.8 TV / CDNTV / Apps

| Entrega | Status |
|----------|--------|
| SSH origin/edge CDNTV | Feito |
| Portal Speed Fibra TV (FastAPI) | Feito |
| VM speed-tv `.155` | Feito |
| https://tv.aspeednet.com.br + LE | Feito |
| Login AAA + canais CDNTV | Feito |
| Fix tela preta (.ts 404 edge) | Feito |
| UI carrossel + strip flutuante + fullscreen | Feito |
| AI control TV (tv_control, Guardian p8) | Feito |
| APK SpeedFibraTV.apk + PWA + fonte iOS | Feito |
| Hub portal desligado (só VM) | Feito |

---

## 3. Ainda falta implantar

### A) Segurança (plano 9/10)

| # | Item | Nota |
|---|------|------|
| A1 | Fase 3.1 — 2FA | Adiada out/2026 |
| A2 | Fase 3.2 — SSH só VPN | Adiada out/2026 |
| A3 | AnaBlock API 403 | Cadastro IP/CNPJ |
| A4 | Keystore APK em cofre seguro | Hoje senha de build dev |
| A5 | Revalidar key-only em todos os hosts | Pós-mudanças |
| A6 | Rotação senhas MikroTik/ESXi | Processo |

### B) NOC / operação

| # | Item |
|---|------|
| B1 | Health estável (UISP/Veloc/hub-SP inventário) |
| B2 | SGP host OLT → `10.100.97.2` (manual) |
| B3 | Runbook plantão único |
| B4 | Backup automático speed-tv + gpon + edge TV |
| B5 | Teste de carga TV multi-viewer |
| B6 | node_exporter em todas VMs críticas |

### C) Rede / peering

| # | Item |
|---|------|
| C1 | AS268217: filtro de saída no peer (full table) |
| C2 | Documentar QoS final pós-8G |
| C3 | hub-SP monitor via túnel WG |

### D) Site / comercial

| # | Item |
|---|------|
| D1 | Política final: Central SGP vs só WhatsApp |
| D2 | Processo CRM leads Fibri |
| D3 | Planos com preços reais |
| D4 | Analytics no site |

### E) FTTH / AspeedOLT

| # | Item |
|---|------|
| E1 | Homologação provisionamento ONU real |
| E2 | SGP authorize 100% produção |
| E3 | Geo completo CTO/cliente |
| E4 | Stress test escala 5k ONUs |

### F) IA / Guardian

| # | Item |
|---|------|
| F1 | Auto só ações seguras (whitelist) |
| F2 | Heal cobrindo todos serviços críticos |
| F3 | Knowledge base atualizada |
| F4 | Auditoria imutável de ações |

### G) TV / apps

| # | Item |
|---|------|
| G1 | EPG real (guide CDNTV) |
| G2 | Renovação token/rtoken |
| G3 | Favoritos / últimos canais |
| G4 | Login = assinante SGP (plano TV) |
| G5 | Google Play / App Store |
| G6 | IPA assinado (Mac + Apple) |
| G7 | Store IDs MSE (ainda vazios) |
| G8 | QR + manual instalação APK |
| G9 | Auto-hide HUD player |
| G10 | Hardware origin/edge se crescer carga |

### H) Legal / conteúdo

| # | Item |
|---|------|
| H1 | Auditoria jurídica canais |
| H2 | Termos de uso portal TV |

---

## 4. Top 15 acionáveis (ordem sugerida)

1. SGP OLT IP → `10.100.97.2`  
2. Decisão Central SGP vs WhatsApp  
3. EPG + renovação token TV  
4. Login TV × SGP plano ativo  
5. QR + manual APK  
6. Fase 3 segurança (quando autorizar)  
7. AnaBlock API 403  
8. AspeedOLT 1 ONU real end-to-end  
9. Backup automático VMs críticas  
10. Play Store / TestFlight  
11. Filtro BGP AS268217 (lado peer)  
12. Guardian auto + runbook plantão  
13. Teste de carga TV + PPPoE 8G  
14. Termos de uso site/TV  
15. Limpeza inventário Phoenix  

---

## 5. URLs úteis

| Serviço | URL / host |
|---------|------------|
| Portal TV | https://tv.aspeednet.com.br |
| APK Android | https://tv.aspeednet.com.br/static/apps/SpeedFibraTV.apk |
| Play CDNTV | https://play.aspeednet.com.br |
| Phoenix NOC | https://noc.aspeednet.com.br/phoenix/ |
| Docs infra | https://noc.aspeednet.com.br/phoenix/docs (ou /documentacao) |
| Site | https://www.aspeedfibra.com.br |
| n8n | https://n8n.aspeednet.com.br |
| Speedtest | https://tst.aspeednet.com.br |

---

## 6. Fontes

- `/root/aspeednet-network/CHANGELOG.md`
- `/root/aspeednet-network/docs/PLANO-EXECUTAVEL.md`
- `/root/aspeednet-network/INVENTORY.md`
- Sessões Grok CLI (compaction 06–12/07/2026)
- Changelog SQLite NOC: `/opt/speedfibra-monitor/data/changelog.db`

## 7. Registro automático (desde 12/07)

Ver `docs/MEMORANDO-AUTO-CHANGELOG.md` e CLI `noc-changelog`.

