modified: README.md
This commit is contained in:
118
README.md
118
README.md
@@ -51,6 +51,7 @@ Per l’indirizzo IP viene mostrato:
|
|||||||
|
|
||||||
## 📂 Struttura del progetto
|
## 📂 Struttura del progetto
|
||||||
|
|
||||||
|
```
|
||||||
myip-webapp/
|
myip-webapp/
|
||||||
├─ app.py
|
├─ app.py
|
||||||
├─ requirements.txt
|
├─ requirements.txt
|
||||||
@@ -60,6 +61,7 @@ myip-webapp/
|
|||||||
│ ├─ logo.png
|
│ ├─ logo.png
|
||||||
│ └─ favicon.ico
|
│ └─ favicon.ico
|
||||||
└─ README.md
|
└─ README.md
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -69,6 +71,120 @@ myip-webapp/
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t myip:latest .
|
docker build -t myip:latest .
|
||||||
docker run -p 8080:8000 myip
|
```
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -p 8080:8000 myip
|
||||||
|
```
|
||||||
|
|
||||||
|
Apri:
|
||||||
|
|
||||||
|
```
|
||||||
http://localhost:8080
|
http://localhost:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ☸️ Deploy in Kubernetes (Helm)
|
||||||
|
|
||||||
|
### values.yaml minimale
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: nginx
|
||||||
|
host: myip.example.com
|
||||||
|
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-production
|
||||||
|
nginx.ingress.kubernetes.io/use-forwarded-headers: "true"
|
||||||
|
nginx.ingress.kubernetes.io/real-ip-header: "X-Forwarded-For"
|
||||||
|
nginx.ingress.kubernetes.io/compute-full-forwarded-for: "true"
|
||||||
|
|
||||||
|
tls:
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### ingress-nginx PROXY protocol (fondamentale)
|
||||||
|
|
||||||
|
Nella ConfigMap del controller:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
data:
|
||||||
|
use-proxy-protocol: "true"
|
||||||
|
real-ip-header: "proxy_protocol"
|
||||||
|
set-real-ip-from: "10.166.93.0/24"
|
||||||
|
use-forwarded-headers: "true"
|
||||||
|
```
|
||||||
|
|
||||||
|
### HAProxy (L4) davanti ad ingress-nginx
|
||||||
|
|
||||||
|
```haproxy
|
||||||
|
server backend1 10.166.93.34:443 send-proxy-v2 check
|
||||||
|
server backend2 10.166.93.35:443 send-proxy-v2 check
|
||||||
|
server backend3 10.166.93.36:443 send-proxy-v2 check
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧠 Note Tecniche
|
||||||
|
|
||||||
|
### Determinazione dell’IP reale
|
||||||
|
|
||||||
|
L’app utilizza:
|
||||||
|
|
||||||
|
```python
|
||||||
|
X-Forwarded-For → X-Real-IP → remote_addr
|
||||||
|
```
|
||||||
|
|
||||||
|
ed è compatibile con proxy multipli e ingress-nginx.
|
||||||
|
|
||||||
|
### Lookup RIPE
|
||||||
|
|
||||||
|
Usa la API ufficiale RIPEstat:
|
||||||
|
|
||||||
|
- `/network-info/`
|
||||||
|
- `/as-overview/`
|
||||||
|
|
||||||
|
Timeout veloce (2s) per non bloccare la UI.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 Personalizzazioni
|
||||||
|
|
||||||
|
Tutto il design è modificabile in:
|
||||||
|
|
||||||
|
```
|
||||||
|
static/myip.css
|
||||||
|
```
|
||||||
|
|
||||||
|
Puoi sostituire:
|
||||||
|
- `logo.png` → per branding
|
||||||
|
- `favicon.ico` → icona personalizzata
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🏁 Roadmap
|
||||||
|
|
||||||
|
- [ ] Endpoint `/api/ip`
|
||||||
|
- [ ] Multi-theme (light/dark manuale)
|
||||||
|
- [ ] Mini-widget JavaScript includibile in altri siti
|
||||||
|
- [ ] Supporto IPv6-only
|
||||||
|
- [ ] Caching locale del lookup RIPE
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🤝 Credits
|
||||||
|
|
||||||
|
- Frontend & Styling by ChatGPT + NETECH style guidelines
|
||||||
|
- Backend Python + Flask
|
||||||
|
- Lookup dati: **RIPEstat Data API**
|
||||||
|
- Supporto PROXY prot. v2: HAProxy + ingress-nginx
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📄 Licenza
|
||||||
|
|
||||||
|
MIT (o altra licenza a tua scelta)
|
||||||
|
|||||||
Reference in New Issue
Block a user