chore(setup): rimuovi gen_config.py legacy
Script standalone con schema obsoleto (env-vars based, mancano ai_context, console_url, network, vendor_heartbeat). Non piu' richiamato da nessun altro file (verificato con grep). Tutta la generazione argos.json e' ora inline in setup_server.py nella funzione _build_config_dict().
This commit is contained in:
parent
a68324725f
commit
58f4bf9de4
110
gen_config.py
110
gen_config.py
|
|
@ -1,110 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
ARGOS SOC — Generatore argos.json
|
||||
Legge le variabili d'ambiente impostate dall'installer e genera /opt/argos/config/argos.json
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
|
||||
def e(key, default=""):
|
||||
return os.environ.get(key, default)
|
||||
|
||||
config = {
|
||||
"_version": "1.0",
|
||||
"_cliente": e("CLIENTE"),
|
||||
"_domain": e("DOMAIN"),
|
||||
"_installed": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||
|
||||
"cliente": {
|
||||
"name": e("CLIENTE"),
|
||||
"full_name": e("CLIENTE_FULL"),
|
||||
"domain": e("CLIENTE_DOMAIN"),
|
||||
"type": e("CLIENTE_TYPE", "enterprise"),
|
||||
"sharepoint_tenant": e("SP_TENANT")
|
||||
},
|
||||
|
||||
"system": {
|
||||
"secret_key": e("SECRET_KEY"),
|
||||
"internal_api_key": e("INTERNAL_KEY"),
|
||||
"anthropic_key": e("ANTHROPIC_KEY"),
|
||||
"ai_context": e("AI_CONTEXT", "ARGOS SOC"),
|
||||
"tz": "Europe/Rome"
|
||||
},
|
||||
|
||||
"paths": {
|
||||
"data_dir": "/opt/argos/data",
|
||||
"feeds_dir": "/opt/argos/feeds",
|
||||
"logs_dir": "/opt/argos/logs",
|
||||
"config_dir": "/opt/argos/config",
|
||||
"analytics_db": "/opt/argos/data/analytics.db",
|
||||
"analytics_exclude_entities": ""
|
||||
},
|
||||
|
||||
"ports": {
|
||||
"backend": 8080,
|
||||
"sync": 8081,
|
||||
"ops": 8082,
|
||||
"analytics": 8083
|
||||
},
|
||||
|
||||
"opensearch": {
|
||||
"url": e("OS_URL"),
|
||||
"user": e("OS_USER", "admin"),
|
||||
"password": e("OS_PASS")
|
||||
},
|
||||
|
||||
"wazuh": {
|
||||
"api_url": e("WAZUH_API_URL"),
|
||||
"api_user": e("WAZUH_API_USER", "wazuh"),
|
||||
"api_pass": e("WAZUH_API_PASS"),
|
||||
"manager_name": e("WAZUH_MANAGER", "wazuh")
|
||||
},
|
||||
|
||||
"entra": {
|
||||
"tenant_id": e("ENTRA_TENANT"),
|
||||
"client_id": e("ENTRA_CLIENT"),
|
||||
"client_secret": e("ENTRA_SECRET")
|
||||
},
|
||||
|
||||
"eset": {
|
||||
"region": "eu",
|
||||
"api_user": e("ESET_USER"),
|
||||
"api_pass": e("ESET_PASS")
|
||||
},
|
||||
|
||||
"fortigate": {
|
||||
"hosts": e("FGT_HOSTS"),
|
||||
"port": e("FGT_PORT", "443"),
|
||||
"tokens": e("FGT_TOKENS"),
|
||||
"names": e("FGT_NAMES")
|
||||
},
|
||||
|
||||
"smtp": {
|
||||
"host": e("SMTP_HOST"),
|
||||
"port": int(e("SMTP_PORT", "587")),
|
||||
"user": e("SMTP_USER"),
|
||||
"password": e("SMTP_PASS"),
|
||||
"from_email": e("FROM_EMAIL")
|
||||
},
|
||||
|
||||
"threat_intel": {
|
||||
"abuseipdb_key": e("ABUSEIPDB_KEY"),
|
||||
"maltiverse_key": e("MALTIVERSE_KEY")
|
||||
},
|
||||
|
||||
"pdf": {
|
||||
"org_name": e("PDF_ORG_NAME"),
|
||||
"author": e("PDF_AUTHOR", "Tecnotel Servizi SRL"),
|
||||
"motto": e("PDF_MOTTO", "Controllo totale. Difesa continua."),
|
||||
"classification": e("PDF_CLASS", "RISERVATO - USO INTERNO"),
|
||||
"app_logo": "/opt/argos/app/frontend/dist/logo_argos_bianco.png",
|
||||
"client_logo": "/opt/argos/data/logo_cliente_pdf.png"
|
||||
}
|
||||
}
|
||||
|
||||
out = "/opt/argos/config/argos.json"
|
||||
with open(out, "w") as f:
|
||||
json.dump(config, f, indent=2, ensure_ascii=False)
|
||||
|
||||
print(f"argos.json generato: {out}")
|
||||
Loading…
Reference in New Issue