|
| 1 | +# Access & Credentials — ETL Microservices Platform |
| 2 | + |
| 3 | +> **Security note:** I valori mostrati qui sono i **default di sviluppo** definiti in `.env.example`. |
| 4 | +> In produzione, sovrascrivili tutti nel file `.env` (mai committare `.env` su Git). |
| 5 | +
|
| 6 | +--- |
| 7 | + |
| 8 | +## Quick Reference — Service URLs |
| 9 | + |
| 10 | +| Servizio | URL | Credenziali | |
| 11 | +|---|---|---| |
| 12 | +| **Grafana** (dashboard monitoraggio) | http://localhost:3000 | `admin` / `change-me-strong-password` | |
| 13 | +| **Prometheus** (metriche raw) | http://localhost:9090 | — nessuna auth — | |
| 14 | +| **Airflow** (orchestrazione DAG) | http://localhost:8080 | `admin` / `admin` (creato al primo avvio) | |
| 15 | +| **Streamlit UI** (AI pipeline builder) | http://localhost:8501 | — nessuna auth — | |
| 16 | +| **cAdvisor** (container metrics) | http://localhost:8088 | — nessuna auth — | |
| 17 | +| **PostgreSQL** (DB interno Airflow) | `localhost:5432` | `airflow` / `change-me-strong-password` | |
| 18 | +| **statsd-exporter** (metrics Airflow→Prom) | http://localhost:9102/metrics | — nessuna auth — | |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## ETL Microservices — Porte & Health Endpoints |
| 23 | + |
| 24 | +Tutti i servizi espongono `GET /health` e `GET /metrics`. |
| 25 | + |
| 26 | +| Container | Porta | Health check | |
| 27 | +|---|---|---| |
| 28 | +| `extract-csv-service` | 5001 | http://localhost:5001/health | |
| 29 | +| `clean-nan-service` | 5002 | http://localhost:5002/health | |
| 30 | +| `delete-columns-service` | 5004 | http://localhost:5004/health | |
| 31 | +| `extract-sql-service` | 5005 | http://localhost:5005/health | |
| 32 | +| `extract-api-service` | 5006 | http://localhost:5006/health | |
| 33 | +| `extract-excel-service` | 5007 | http://localhost:5007/health | |
| 34 | +| `join-datasets-service` | 5008 | http://localhost:5008/health | |
| 35 | +| `load-data-service` | 5009 | http://localhost:5009/health | |
| 36 | +| `data-quality-service` | 5010 | http://localhost:5010/health | |
| 37 | +| `outlier-detection-service` | 5011 | http://localhost:5011/health | |
| 38 | +| `text-completion-llm-service` | 5012 | http://localhost:5012/health | |
| 39 | + |
| 40 | +> **Porta 5003** — non assegnata (gap storico). Prossimo servizio disponibile: **5013**. |
| 41 | +
|
| 42 | +--- |
| 43 | + |
| 44 | +## Variabili d'Ambiente — `.env` |
| 45 | + |
| 46 | +Copia `.env.example` in `.env` e modifica i valori prima di avviare lo stack. |
| 47 | + |
| 48 | +```bash |
| 49 | +cp .env.example .env |
| 50 | +``` |
| 51 | + |
| 52 | +| Variabile | Default | Descrizione | |
| 53 | +|---|---|---| |
| 54 | +| `POSTGRES_USER` | `airflow` | Username PostgreSQL | |
| 55 | +| `POSTGRES_PASSWORD` | `change-me-strong-password` | Password PostgreSQL ⚠️ cambia in produzione | |
| 56 | +| `POSTGRES_DB` | `airflow` | Nome database PostgreSQL | |
| 57 | +| `GF_SECURITY_ADMIN_PASSWORD` | `change-me-strong-password` | Password admin Grafana ⚠️ cambia in produzione | |
| 58 | +| `ETL_DATA_ROOT` | `/app/data` | Root directory dati nei container | |
| 59 | +| `ALLOW_PRIVATE_API_URLS` | `false` | Permette URL privati nell'extract-api-service | |
| 60 | +| `HF_MODELS_PATH` | `./hf_models` | Path locale cache modelli HuggingFace | |
| 61 | +| `LLM_PROVIDER` | `openai` | Provider AI: `openai` oppure `local` | |
| 62 | +| `OPENAI_API_KEY` | *(vuoto)* | API key OpenAI — richiesta se `LLM_PROVIDER=openai` | |
| 63 | +| `OPENAI_MODEL` | `gpt-4o-mini` | Modello OpenAI da usare | |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Credenziali Airflow |
| 68 | + |
| 69 | +L'utente admin viene creato automaticamente al primo avvio dal `CMD` nel Dockerfile Airflow |
| 70 | +(idempotente: se esiste già non lo ricrea). |
| 71 | + |
| 72 | +| Campo | Valore default | |
| 73 | +|---|---| |
| 74 | +| Username | `admin` | |
| 75 | +| Password | `admin` | |
| 76 | +| URL | http://localhost:8080 | |
| 77 | + |
| 78 | +> Se stai usando un'istanza già avviata **prima** di questa modifica, crea l'utente manualmente: |
| 79 | +> ```bash |
| 80 | +> docker exec airflow airflow users create \ |
| 81 | +> --username admin --password admin \ |
| 82 | +> --firstname Admin --lastname ETL \ |
| 83 | +> --role Admin --email admin@etl.local |
| 84 | +> ``` |
| 85 | +> Cambia la password dopo il primo login: `Admin → Users → admin → Edit`. |
| 86 | +
|
| 87 | +--- |
| 88 | +
|
| 89 | +## Grafana — Login |
| 90 | +
|
| 91 | +| Campo | Valore default | |
| 92 | +|---|---| |
| 93 | +| URL | http://localhost:3000 | |
| 94 | +| Username | `admin` | |
| 95 | +| Password | valore di `GF_SECURITY_ADMIN_PASSWORD` nel `.env` (default: `change-me-strong-password`) | |
| 96 | +
|
| 97 | +Il datasource **Prometheus** e il dashboard **ETL Microservices — Monitoring Overview** sono pre-caricati automaticamente tramite provisioning (non serve configurazione manuale). |
| 98 | +
|
| 99 | +--- |
| 100 | +
|
| 101 | +## PostgreSQL — Connessione diretta |
| 102 | +
|
| 103 | +SQLAlchemy URI (usata internamente da Airflow, utile anche per ispezione diretta): |
| 104 | +``` |
| 105 | +postgresql+psycopg2://airflow:change-me-strong-password@localhost:5432/airflow |
| 106 | +``` |
| 107 | +
|
| 108 | +--- |
| 109 | + |
| 110 | +## Checklist Sicurezza (Produzione) |
| 111 | + |
| 112 | +- [ ] Cambia `POSTGRES_PASSWORD` con una password forte |
| 113 | +- [ ] Cambia `GF_SECURITY_ADMIN_PASSWORD` con una password forte |
| 114 | +- [ ] Imposta `OPENAI_API_KEY` con la tua chiave reale |
| 115 | +- [ ] Aggiungi autenticazione ai microservizi (attualmente open su rete interna) |
| 116 | +- [ ] Non esporre le porte ETL (5001–5012) su IP pubblici |
| 117 | +- [ ] Abilita HTTPS per Grafana e Airflow in ambienti esposti |
| 118 | +- [ ] Ruota credenziali Airflow admin dopo il primo login |
0 commit comments