Merge pull request '0.4.0 - installer allineato al Central Hub' (#3) from setup-0.4.0-central-hub into main

This commit is contained in:
tecnotel 2026-10-06 23:08:15 +02:00
commit 66ef8d3b13
3 changed files with 34 additions and 18 deletions

View File

@ -1,3 +1,5 @@
> **0.4.0** (6 ottobre 2026): licenze dell'**IRIDE Central Hub** (`iride-license.tecnotel.ai`), accettate insieme a quelle gia' emesse dal vecchio portale; heartbeat al Hub firmato con il segreto della licenza (niente chiave condivisa); bot Gitea di riserva `iride-hub-bot`; dipendenze Python installate con `constraints.txt` (versioni collaudate, come `update.sh`); modello AI di testo scritto solo se indicato (altrimenti decide IRIDE).
# IRIDE — Setup & Installer
Tecnotel Servizi SRL — [www.tecnotelsrl.com](https://www.tecnotelsrl.com)
@ -23,7 +25,7 @@ curl bootstrap.sh | sudo bash
- VM **Ubuntu 24.04 o 26.04 LTS** pulita (Python 3.12/3.14), accesso `sudo`.
- Sizing minimo: 2 vCPU / 4 GB RAM / 40 GB disco (il DB è SQLite, niente broker).
- Uscita verso `repo.argosdefense.io` (codice e aggiornamenti) e `license.argosdefense.io`
- Uscita verso `repo.argosdefense.io` (codice e aggiornamenti) e `iride-license.tecnotel.ai`
(licenze, heartbeat); per i canali: Meta, Telegram, provider SMS, OpenAI.
- Ingresso: `443` dal pubblico se i canali usano webhook (WhatsApp, Telegram in
webhook), `8888` **solo** dal tuo IP durante il wizard, `22` solo dagli IP admin.

View File

@ -1 +1 @@
0.3.1
0.4.0

View File

@ -36,18 +36,22 @@ APP_USER = "iride"
PORT = 8888
PRODUCT = "iride"
# ── Licenza — chiave pubblica Ed25519 del vendor (raw 32 byte, base64) ────────
# Stessa costante di iride/backend/core/license.py e del portale Tecnotel.
_LICENSE_PUBLIC_KEY_B64 = "GMRsZMoxOlCBiJU66EsQcj0ZO0gVd0GHB5LelEo/hns="
# ── Licenza — chiavi pubbliche Ed25519 accettate (raw 32 byte, base64) ────────
# Stesse chiavi di iride/backend/core/license.py (VENDOR_PUBLIC_KEYS). Dal 0.4.0 le licenze IRIDE le emette
# l'IRIDE Central Hub (iride-license.tecnotel.ai); la chiave del vecchio portale ARGOS resta per le licenze gia' emesse.
_LICENSE_PUBLIC_KEYS = {
"iride-hub-202610": "VOPs+x8pmwKoVTBKmePiQOzrClYChY1inlGEnJw6fcE=",
"argos-portal": "GMRsZMoxOlCBiJU66EsQcj0ZO0gVd0GHB5LelEo/hns=",
}
# ── Clone: username Basic Auth del bot Gitea al quale appartiene il token.
# Le licenze IRIDE lo portano nel payload (gitea_user); fallback al bot ARGOS.
GITEA_BOT_USER = "iride-portal-bot"
# Le licenze IRIDE lo portano nel payload (gitea_user); in mancanza, il bot di sola lettura del Central Hub.
GITEA_BOT_USER = "iride-hub-bot"
GITEA_REPO_PATH = "/tecnotel/iride.git"
# ── Heartbeat verso il portale vendor (stessa chiave di registrazione ARGOS) ──
VENDOR_HEARTBEAT_URL = "https://license.argosdefense.io"
VENDOR_INSTALL_KEY = "5b1ab5c872383f686d3a25a5e123adca"
# ── Heartbeat verso l'IRIDE Central Hub, firmato con il segreto della licenza (niente chiave condivisa:
# il portale ARGOS non accetta piu' heartbeat IRIDE e il Hub ha spento la chiave condivisa).
VENDOR_HEARTBEAT_URL = "https://iride-license.tecnotel.ai"
SERVICES = ["iride-api", "iride-worker", "iride-scheduler"]
@ -106,11 +110,16 @@ def verify_license(raw_bytes):
return (False, None, "Licenza senza firma (campo 'signature' mancante)")
payload = json.dumps(raw, sort_keys=True, separators=(",", ":"))
raw["signature"] = sig
pub = Ed25519PublicKey.from_public_bytes(base64.b64decode(_LICENSE_PUBLIC_KEY_B64))
firma_ok = False
for chiave in _LICENSE_PUBLIC_KEYS.values():
try:
pub.verify(base64.b64decode(sig), payload.encode())
Ed25519PublicKey.from_public_bytes(base64.b64decode(chiave)).verify(base64.b64decode(sig), payload.encode())
firma_ok = True
break
except InvalidSignature:
return (False, None, "Firma non valida: licenza manomessa o emessa da un altro vendor.")
continue
if not firma_ok:
return (False, None, "Firma non valida: licenza manomessa o non emessa dall'IRIDE Central Hub.")
except ImportError:
return (False, None, "Libreria 'cryptography' non disponibile: apt install python3-cryptography")
except Exception as e:
@ -186,13 +195,15 @@ def generate_iride_json(data):
"vendor_heartbeat": {
"enabled": True,
"url": VENDOR_HEARTBEAT_URL,
"install_key": VENDOR_INSTALL_KEY,
"install_key": "",
"interval_h": 6,
},
},
"ai": {
"text": {"provider": provider,
"options": {"model": data.get("ai_model", "").strip() or "gpt-4.1-mini", "temperature": 0.3}},
# modello solo se indicato: altrimenti decide IRIDE (profili AI per famiglia di canale, 0.120)
"options": {"temperature": 0.3, **({"model": data.get("ai_model", "").strip()}
if data.get("ai_model", "").strip() else {})}},
"realtime": {"provider": "openai", "options": {"model": ""}},
"providers": {
"openai": {"api_key": api_key if provider == "openai" else "", "base_url": "https://api.openai.com/v1"},
@ -279,7 +290,10 @@ def install(data):
if not venv_dir.exists():
run(f"python3 -m venv {venv_dir}")
run(f"{venv_dir}/bin/pip install --upgrade pip -q")
run(f"{venv_dir}/bin/pip install -r {APP_DIR}/backend/requirements.txt -q")
# Versioni collaudate (come update.sh): con constraints.txt se il repository lo contiene
vincoli = APP_DIR / "backend/constraints.txt"
run(f"{venv_dir}/bin/pip install -r {APP_DIR}/backend/requirements.txt -q"
+ (f" -c {vincoli}" if vincoli.exists() else ""))
chown(venv_dir)
log(f"Virtualenv pronto ({run(f'{venv_dir}/bin/python --version', check=False).stdout.strip()})")