Commit graph

54 commits

Author SHA1 Message Date
62ea6ebb7f [IMP] script todo: dashboard — états Pause / Effacée (check virsh lent)
Pendant le suivi, une VM pouvait « stagner » sans qu'on sache pourquoi
(mise en pause, ou effacée à côté). Le dashboard interroge désormais l'état
libvirt (« virsh list --all ») à INTERVALLE LENT (toutes les 10 s, un seul
appel pour tout le parc ; le tableau applique le cache à chaque tick de 2 s) :

- VM en pause (virsh suspend) -> État « ⏸ pause » (non terminal, peut
  reprendre).
- VM absente de virsh (effacée pendant l'attente) -> État «  effacée »,
  terminal (on cesse de lire son log).

Sinon on garde le statut basé sur le log ( /  / ).

Validé headless : running -> , paused -> ⏸ pause, absente ->  effacée.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 09:30:16 +00:00
1fd98e6ab6 [IMP] script todo: commande QEMU « Redimensionner le disque d'une VM »
Nouvelle entrée dans le menu QEMU/KVM (section Gérer). Elle :
- affiche le disque principal (qcow2 via domblklist) + « qemu-img info »
  (taille virtuelle + réelle) et l'état de la VM ;
- demande +NG (agrandir), -NG (réduire) ou NG (taille cible) ;
- applique : agrandissement À CHAUD si la VM tourne (virsh blockresize),
  sinon qemu-img resize ; réduction via qemu-img resize --shrink (VM éteinte
  obligatoire + avertissement fort : le FS invité n'est PAS réduit, risque
  de perte de données) ;
- propose ensuite d'étendre le FS invité via SSH (growpart + resize2fs /
  xfs_growfs / btrfs, device et type de FS détectés).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 09:27:20 +00:00
fdbec6d19d [FIX] script todo: dashboard — stoppe le churn de rendu + nombre de VM
Encore du lag à 16 VM : update_cell était appelé pour CHAQUE ligne à chaque
tick (état + « Durée »), or la Durée — dérivée d'un `started` global — est
identique sur toutes les lignes et se réécrivait sans cesse -> re-render
permanent de la DataTable.

- _set_cell : n'appelle update_cell (donc ne re-render) que si la valeur
  CHANGE. Mesuré : 312 -> 18 update_cell sur 10 ticks × 16 VM.
- La durée « live » passe dans le SOUS-TITRE (une seule mise à jour) ; la
  colonne Durée n'est écrite qu'à la complétion (durée finale figée).
- Le NOMBRE de VM est affiché : titre « … (N VM) », sous-titre
  « k/N terminées · mm:ss ».

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 09:13:56 +00:00
51a9e7b97c [FIX] script todo: résolution d'IP robuste (ping + multi-source + heartbeat)
Sur un gros parc (30 VM, ~18 émulées), la résolution d'IP « bloquait » 10 min
en silence sur les VM lentes. Trois causes traitées :

- Joignabilité par PING (ICMP) d'abord, TCP:22 en repli. Le ping répond dès
  que le réseau de la VM est up, BIEN AVANT sshd : on ne retenait pas une VM
  qui a déjà son IP juste parce que sshd (lent en émulation) n'était pas prêt.
  Le ping distingue toujours le bail actif (répond) du bail périmé (non).
- IP cherchée sur PLUSIEURS sources : lease (dnsmasq), agent (qemu-guest-
  agent DANS la VM) et arp (table ARP hôte). Le bail dnsmasq peut être vide
  sous forte charge alors que la VM a une IP (constaté sur ce parc).
- BATTEMENT toutes les 30 s listant les VM encore en attente + timeout PAR VM
  ramené à 5 min (au lieu de 10) dans la phase de résolution -> plus de
  silence prolongé, et on n'attend pas indéfiniment une VM sans IP.

NB : déployer la matrice complète (30 VM dont ~18 émulées TCG) sature un seul
hôte ; certaines VM émulées n'obtiennent pas de bail DHCP à temps (limite de
capacité, pas un bug). La résolution dégrade désormais proprement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:54:36 +00:00
1e9e5abd1f [IMP] script todo: compteur de complétion, durées par étape + sommaire total
Améliore le suivi du déploiement multi-VM :

- Compteur de COMPLÉTION devant chaque résultat (« [1/26] », « [2/26] »… =
  ordre où les tâches TERMINENT), en plus de l'ID de préparation stable
  (« [7/26] ») — utile car l'exécution parallèle rend les résultats
  désordonnés.
- Temps d'exécution PAR ÉTAPE : durée de chaque VM (déploiement, résolution
  d'IP) + bilan de phase (« Bilan déploiement : 24 OK, 2 en échec, 26 VM,
  3m10s » ; « IP résolues : 25/26 (2m). »).
- SOMMAIRE TOTAL encadré en fin de flux (VM déployées, total avec
  existantes, temps total).

Helper _fmt_dur (« 45s » / « 2m05s »).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:46:48 +00:00
da1206bcb2 [IMP] script todo: afficher la valeur par défaut des questions oui/non
Chaque question oui/non affiche désormais explicitement la valeur par défaut
appliquée si on laisse vide, ex. :
  « Suivi interactif (dashboard) ? (o/N, défaut : non) : »

Les 18 prompts passent par _is_yes(input(...)) : une réponse vide vaut NON.
On l'indique donc dans les traductions (fr « (o/N, défaut : non) », en
« (y/N, default: no) »). Seules les VALEURS i18n changent ; les clés (donc
les appels t(...) dans todo.py) sont inchangées.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:37:18 +00:00
a74b0c0c4c [IMP] script todo: nb de VM dans le prompt parallèle + IDs de suivi (k/N)
Sur un gros parc (ex. 26 VM), on ne voyait ni combien de VM allaient être
déployées ni lesquelles étaient en cours (résultats parallèles dans le
désordre). Deux améliorations :

- Le prompt de parallélisme affiche le NOMBRE de VM à déployer :
  « Déploiements en parallèle (défaut : 24, 26 VM) : ». Pour cela, la
  séparation à-créer / déjà-existantes est faite AVANT le prompt (on connaît
  le vrai compte).
- Chaque VM reçoit un ID « k/N » suivant l'ordre de préparation, affiché
  dans les résultats de déploiement («  [3/26] nom ») et dans la résolution
  d'IP (« [5/30] nom : ip »). L'ID reste stable même si les résultats
  reviennent dans le désordre -> on suit lesquelles sont traitées.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:33:50 +00:00
372aedb0eb [IMP] script todo: fusionner « Déployer VM » et « infra » + renommage granulaire
Le menu QEMU avait deux commandes de déploiement redondantes : [1] « Déployer
une VM » (mono, noms/ressources personnalisés) et [4] « Déployer l'infra »
(multi, matrice distro×version×archi). Elles sont FUSIONNÉES en une seule,
[1] « Déployer une ou plusieurs VM » (_qemu_deploy), qui gère aussi bien 1 VM
que N, avec :

- renommage GRANULAIRE des VM à la demande (_qemu_customize_names) : noms
  auto par défaut, on en renomme certains par numéros séparés de virgules ;
- multiplicateur de ressources (x1..x4) déjà présent ;
- aperçu dry-run ([2]) qui passe par le même flux et imprime les commandes
  deploy_qemu (--dry-run) via le helper partagé _qemu_build_deploy_parts.

Menu simplifié : [1] Déployer une/plusieurs VM, [2] Aperçu (dry-run),
[3] Télécharger une image, puis Gérer/Catalogue renumérotés. Code mort retiré
(_qemu_deploy_vm, _qemu_prompt_arch, _normalize_disk_size,
_qemu_offer_ssh_config).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:25:38 +00:00
4688e7c606 [IMP] script todo: regrouper les opérations SSH dans un sous-menu Deploy
Le menu Deploy listait 11 entrées « SSH - … » à plat, ce qui le surchargeait.
Elles sont déplacées dans un sous-menu « SSH (hôte distant)… »
(prompt_execute_deploy_ssh), comme le sous-menu QEMU. Le menu Deploy tient
désormais en 5 entrées :

  ── Local ──
  [1] Cloner ERPLibre localement
  [2] Configurer sshfs
  ── Distant & services ──
  [3] SSH (hôte distant)…        -> sous-menu (11 opérations SSH)
  [4] NTFY
  [5] QEMU/KVM…

Le fil d'Ariane affiche « TODO › Execute › Deploy › SSH » dans le sous-menu.
Les libellés et actions SSH sont inchangés (traductions réutilisées).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 08:14:50 +00:00
5a408f1061 [IMP] script todo: infra — multiplicateur de ressources par VM (x1..x4)
Avant le déploiement infra, on demande un multiplicateur de ressources :
x1 (minimum catalogue) .. x4. Il multiplie la RAM (base = minimum de la
version) et les vCPU (base 2), en bornant les vCPU au nombre de cœurs de
l'hôte et en signalant si la RAM totale dépasse la RAM libre.

- Le prompt affiche les ressources de l'hôte (vCPU, RAM libre) et, pour
  chaque multiplicateur, le total RAM + vCPU/VM avec un ⚠ si ça dépasse.
- Le plan reflète les ressources effectives (vCPU + RAM×mult par VM).
- Les jobs passent --memory et --vcpus effectifs à deploy_qemu (avant,
  l'infra laissait le minimum catalogue + 2 vCPU par défaut).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 09:39:59 +00:00
939e26ba83 [IMP] script todo: en-tête d'install (date, distro, version, archi) dans le log
Le log d'installation commence désormais par un en-tête identifiant
l'installation : date, VM, distribution + version, architecture, branche, IP.
Écrit dès la création du log (plus jamais vide au démarrage).

_qemu_install_erplibre_monitored déduit distro/version/arch de chaque VM
(nom via _qemu_infra_name + arch via virsh dumpxml) et les passe à
launch_installs, qui écrit l'en-tête et les stocke dans le manifeste.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 08:57:36 +00:00
50617e3909 [IMP] script todo: infra — architecture [all] (matrice distro×version×arch)
Menu « Déployer l'infra ERPLibre » : la sélection d'architecture propose
désormais [all] = toutes les architectures supportées. L'architecture
devient une dimension à part entière de la matrice de déploiement.

- [all] archis + [all] catalogue : une VM par (distro, version, archi
  publiée par cette distro). Ex. ubuntu -> amd64/arm64/s390x, debian/fedora
  -> amd64/arm64, arch -> amd64 (30 VM au total avec le catalogue courant).
- [all] archis + [granulaire] : la liste à plat inclut l'archi ([amd64]/
  [arm64]/[s390x]) ; on choisit des combinaisons précises par virgules.
- [all] archis + [principal] : version par défaut de chaque distro × chaque
  archi supportée.
- Une archi précise (arm64/s390x) restreint le catalogue aux distros qui la
  publient (inchangé).

selected porte l'archi par élément ; les noms sont suffixés par archi pour
les non-natives (erplibre-ubuntu-2604-s390x) -> pas de collision. --arch
transmis par VM. Chaque distro ne reçoit que les archis QU'ELLE publie.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 08:51:45 +00:00
0930f30cd3 [IMP] script todo: suffixe d'arch dans le nom + log d'install non vide
1) Nommage : _qemu_infra_name ajoute un suffixe d'architecture quand elle
   diffère de la native de l'hôte -> déployer un s390x sur un hôte amd64
   donne « erplibre-ubuntu-2604-s390x » (au lieu de « erplibre-ubuntu-2604 »).
   Évite les collisions de noms entre archis et rend l'archi visible. Passé
   dans les 3 appelants (VM unique + plan + jobs de l'infra).

2) Log d'installation vide : sur une archi ÉMULÉE (s390x/arm64 sur x86) le
   boot prend plusieurs minutes ; pendant ce temps l'attente n'écrivait rien
   -> le log restait VIDE et paraissait « bloqué ». _launch_one écrit
   désormais un en-tête d'attente immédiat + un battement toutes les ~30 s,
   et l'attente sshd/cloud-init passe de ~12 à ~20 min (boot émulé lent).
   _qemu_wait_ssh (chemin streamé) : timeout porté à 20 min également.

Validé : nommage (amd64/natif sans suffixe, s390x/arm64 suffixés) ; le log
se remplit dès le départ (en-tête + « ... 30s »).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 08:15:46 +00:00
88dc1d5409 [IMP] script qemu: support arm64/aarch64 (+ archi native marquée d'un *)
Ajoute l'architecture arm64 (aarch64) au déploiement, en plus d'amd64
(x86_64) et s390x. Disponibilité réelle vérifiée (juillet 2026) :
- arm64 : Ubuntu, Debian, Fedora (Arch : pas d'image cloud aarch64 -> rejet).
- s390x : Ubuntu seulement (inchangé).

deploy_qemu.py :
- host_arch() : arch native de l'hôte ; toute arch différente est ÉMULÉE
  (TCG, --virt-type qemu) — plus de liste FOREIGN_ARCHES figée.
- virt_install : arm64 -> --arch aarch64 --machine virt --boot uefi (firmware
  AAVMF résolu par libvirt) ; s390x inchangé ; x86 UEFI/OVMF inchangé.
- ensure_emulator(arch) généralisé : installe qemu-system-aarch64 + firmware
  UEFI AAVMF (arm64) ou qemu-system-s390x (s390x), selon le gestionnaire de
  paquets, avec vérif de présence (binaire + firmware pour arm64).
- Validation --arch tôt via ARCH_DISTRO_SUPPORT (message clair si la distro
  ne publie pas l'arch). Les URLs d'images arm64 marchent déjà via les alias
  (fedora/arch aarch64 ; ubuntu/debian arm64).

todo.py : menus d'architecture (VM unique + infra) proposent amd64/arm64/
s390x selon la distro ; l'architecture NATIVE de l'hôte est marquée d'un *
(défaut) ; les autres sont signalées « émulé, lent ». Le catalogue infra est
restreint aux distros publiant l'arch choisie (arm64 -> ubuntu/debian/fedora,
s390x -> ubuntu).

install_debian_dependency.sh : wkhtmltopdf (deb amd64 en dur) ignoré
best-effort sur toute arch non-x86_64 (au lieu d'avorter l'install).

Validé : dry-runs Ubuntu/Debian/Fedora arm64 (bonnes URLs + virt-install
aarch64/virt/uefi/qemu), rejet Arch arm64, non-régression s390x, menus et
filtrage simulés (natif *, arm64 par distro).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 07:56:20 +00:00
3bf8fc2972 [IMP] script todo: infra deploy — option granulaire + choix d'architecture
Menu « Déployer l'infra ERPLibre » :

- Nouveau choix [granulaire] dans la sélection des distributions : affiche
  la liste À PLAT de TOUTES les versions du catalogue (distro + version,
  défauts marqués d'un *) et permet d'en choisir plusieurs par leurs numéros
  séparés par des virgules (ex. « 1,3,12 »). Complète [all] et [principal].

- Demande l'ARCHITECTURE du parc en début de flux, par défaut l'architecture
  NATIVE de l'hôte (amd64/arm64/s390x via uname -m). s390x est proposé mais
  émulé (lent) et n'a d'images cloud que pour Ubuntu -> le catalogue est
  alors restreint à Ubuntu (les autres distros sont ignorées avec un
  avertissement). --arch est transmis à deploy_qemu.py quand ≠ amd64.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 07:35:25 +00:00
37a999b911 [ADD] script qemu: support architecture s390x (IBM Z, Ubuntu)
Ajoute --arch s390x au déploiement QEMU. Réalité constatée (juillet 2026) :
seul Ubuntu publie des images cloud s390x (cloud-images.ubuntu.com : OK) ;
Debian et Fedora n'en publient pas (404), Arch ne cible que x86_64/aarch64.
s390x est donc scopé à Ubuntu et rejeté proprement pour les autres distros.

deploy_qemu.py :
- FOREIGN_ARCHES / S390X_DISTROS : s390x n'est valide que pour Ubuntu.
- virt_install : sur s390x -> --arch s390x, --machine s390-ccw-virtio,
  --virt-type qemu (émulation TCG, pas de KVM sur hôte x86), console SCLP
  (pas de série ISA), amorçage IPL/zipl (aucun --boot UEFI/BIOS). Les
  disques/réseau bus=virtio sont mappés en virtio-ccw par libvirt.
- ensure_s390x_emulator : installe qemu-system-s390x au besoin
  (apt: qemu-system-misc, dnf: qemu-system-s390x, pacman:
  qemu-emulators-full, zypper: qemu-s390).
- Avertit que s390x est ÉMULÉ (lent) sur un hôte x86.

todo.py : le menu « Déployer une VM » demande l'architecture (s390x proposé
uniquement pour Ubuntu, avec avertissement lenteur) et passe --arch.

install_debian_dependency.sh : wkhtmltopdf n'a pas de build s390x -> skip
best-effort au lieu d'avorter l'install (la branche s390x rust-all existait
déjà pour compiler les wheels).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 07:03:19 +00:00
4a821226fb [IMP] script todo: print all log paths when opening the install monitor
After "Opening the interactive monitor..." the install now lists every
VM's log file path, so they can be read or shared even when leaving the
dashboard before the installs finish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 04:41:41 +00:00
0830c895eb [FIX] script todo: reliable curl/git/make install + copyable logs
Root cause of "git/make: command not found": the bootstrap ran
"apt-get update -qq && apt-get install -y $PKGS". Inside an && list,
set -e does NOT abort on failure, so when apt-get update failed (flaky
VM network) the install was silently skipped and the script marched on
without git/make. Now: "apt-get update || true; apt-get install -y
$PKGS" (update best-effort, install mandatory), followed by an explicit
"command -v curl git make" check that exits with a clear message
("Outil manquant ... (reseau de la VM ?)") instead of a cryptic failure
later. Shared by the streamed and the monitored install paths.

Dashboard: add "c" to copy the selected VM's full log to the clipboard
(OSC 52, works over SSH) with a notification; the ssh bar documents
Shift+drag for native terminal selection; on close, print a ready-to-
copy "tail -n +1 <logdir>/*.log" to share the logs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 04:40:18 +00:00
d4d3d801c3 [ADD] script todo: interactive Textual dashboard for ERPLibre installs
Deploying ERPLibre (single VM [1] and infra [4]) now asks "Interactive
monitoring dashboard?". When yes, the installs run DETACHED (setsid, one
log file + exit marker per VM) and a Textual dashboard opens:

- left: a table of VMs with live status ( running /  done /  failed
  with exit code) and elapsed time;
- right: the selected VM's log, tailed live (f toggles follow);
- footer: the VM's ssh command; s suspends the dashboard and SSHes in;
- q quits back to the menu — the installs keep running detached, so you
  can leave before they finish and reopen later on the same log dir.

New module qemu_install_monitor.py holds the detached launcher and the
Textual app. The remote install script is factored into
_qemu_erplibre_remote_cmd. Falls back gracefully if textual is missing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 04:27:25 +00:00
8d8d0750b0 [FIX] script todo: wait for SSH before the ERPLibre install
Right after boot the VM's sshd may not be up yet (notably on Fedora),
so the install failed with "Connection refused". _qemu_install_erplibre_vm
now polls SSH (ssh ... true, BatchMode) for up to 3 minutes and skips
with a clear message if it never answers, instead of failing instantly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 04:10:33 +00:00
83a28ed9e8 [IMP] script todo: add "principal" choice to infra (one main VM per distro)
The infra distribution prompt now accepts "principal" (alongside
numbers and "all"): it deploys the default version of each distro —
ubuntu 24.04, debian 12, fedora 42 — one VM each. The default version is
also marked with a * in the distro listing so it is visible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 04:08:38 +00:00
65a0d6f907 [IMP] script todo: offer ERPLibre install on single VM + run make targets
"Deploy a new VM" now asks, after a successful deploy, whether to
install ERPLibre into ~/git/erplibre (pick a branch), just like the
infra command.

Installing ERPLibre no longer only clones the repo: after the clone it
runs "make install_os" then "make install_odoo_18" over SSH (the
erplibre user has passwordless sudo from cloud-init). The Odoo target is
a constant (ERPLIBRE_ODOO_TARGET) and both the single-VM and infra flows
use the same install path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 03:48:56 +00:00
6ac7624950 [IMP] script todo: extend "Clean up QEMU" with 4 more sweeps
The cleanup command now runs, each listed and confirmed independently:

1. orphan files (disks/seeds/.part/nvram) — as before;
2. ghost domains: libvirt domains whose disk no longer exists ->
   offer destroy + undefine --nvram;
3. stale codename-named Ubuntu images (noble/resolute/... left by the
   move to /releases/ version-named images) -> targeted delete;
4. orphan ~/.ssh/config entries: "Host erplibre-*" blocks with no
   matching VM (personal SSH hosts are never touched);
5. stale libvirt DHCP leases whose MAC belongs to no VM (best-effort
   rewrite of the dnsmasq status file + SIGHUP; they also self-expire);
6. the full base-image cache remains an explicit opt-out at the end.

Detections verified read-only on the host.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 03:12:43 +00:00
c0ceb6bea7 [IMP] script todo: add "Clean up QEMU" (orphan files) command
New Manage entry that finds and lists QEMU leftovers with no matching
libvirt domain, then asks before deleting:

- working disks /var/lib/libvirt/images/<name>.qcow2
- cloud-init seeds .../iso/<name>-seed.iso
- interrupted downloads (*.part)
- orphan UEFI nvram files

Sizes are shown human-readable with a total. Cached base cloud images
(reusable) are listed and offered separately, since removing them forces
a re-download; this also cleans the stale codename-named duplicates left
by the switch to /releases/ version-named images.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 02:31:56 +00:00
d83d244805 [FIX] script todo/qemu: safer VM deploy prompt (size unit, name, errors)
Three papercuts hit when creating a VM from the menu:

1. Disk size "30" was passed verbatim to qemu-img resize, which read it
   as 30 BYTES and failed ("use --shrink"). The prompt now shows units
   (e.g. 30G, 1T) and a bare number is normalised to GB ("30" -> "30G"),
   in the menu and in deploy_qemu.py itself.
2. The VM name is no longer required: leaving it blank uses the default
   erplibre-<distro>-<version> (e.g. erplibre-ubuntu-2604). Distro and
   version are now asked first so the default can be offered.
3. The menu ignored the deploy exit code and carried on to "wait for the
   VM IP" even after a failure, hanging forever with the error scrolled
   off. It now checks the return code and stops with a clear message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-28 02:26:07 +00:00
19e3801d2c [IMP] script todo: deploy the ERPLibre infra in parallel
The infra fleet was deployed one VM at a time, each blocking up to 90s
waiting for its DHCP lease. Deploys now run concurrently through a
ThreadPoolExecutor (default min(count, 4), promptable), with each job's
output captured and printed per VM as it finishes (no interleaving). VMs
are created with --no-wait-ip so workers return quickly; IPs are then
collected once for the ~/.ssh/config step. Preferred over shelling out
to GNU parallel: no external dependency, grouped output, and it stays
integrated with the ssh-config and ERPLibre-clone steps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 08:15:41 +00:00
78e7cf55c6 [IMP] script todo: default erplibre/erplibre login + ~/.ssh/config entry
VMs were created with user "erplibre" but NO password (lock_passwd:
true), so the serial console refused every login and only SSH-by-key
worked — hence "can't connect".

- The todo deploy flow (single VM and infra) now sets a default console
  password "erplibre" for the "erplibre" user, in addition to the SSH
  key, so virsh console and password SSH both work. It is shown as
  "Console/SSH login: erplibre / erplibre" and can be changed at the
  single-VM prompt.
- The console entry now prints the default login and the Ctrl+] hint.
- After creating a VM, offer to add it to ~/.ssh/config (Host <name>,
  HostName <ip>, User erplibre) so "ssh <name>" just works; the infra
  flow asks once and adds every VM. Existing blocks for the same Host
  are replaced, the rest of the file is preserved, mode kept 600.

Note: VMs created before this change have no console password — delete
and redeploy them to get the erplibre/erplibre login.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:47:33 +00:00
9876a03ac7 [IMP] script todo: section the big menus + QEMU console & all-IPs
Group the longer menus with section headers (reordering items so the
numbering stays sequential within each section):

- Execute: Development / Data / Sources & documentation / AI &
  automation / Deployment, network & security / Preferences.
- QEMU/KVM: Deployment / Manage / Catalog.
- Database: Backup / Restore / Danger zone.
- RTK: Setup / Status / Optimize.
- Config: Generate / Advanced.

The QEMU config-entry lookup now skips section rows so appended
makefile entries still map to the right number.

Also in the QEMU menu:
- new "Open the console on a VM" entry (lists VMs, asks which, reminds
  Ctrl+] to quit, runs virsh console);
- "Show a VM IP address" accepts "all" to print every VM's IP.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:41:00 +00:00
2020e15b5e [IMP] script todo: group the Deploy menu into sections (SSH, ...)
fill_help_info() now renders {"section": "..."} entries as a header line
without consuming a number, so numbering stays continuous over the real
commands (the hardcoded elif chains keep matching). The Deploy menu is
split into "Local", "SSH (remote host)" and "Virtualization &
notifications", making the long SSH block easy to scan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:30:06 +00:00
ef78b9d315 [IMP] script todo: add "Delete VM(s)" QEMU command
New QEMU/KVM menu entry to remove one, several or all VMs. It lists the
defined domains, lets you pick by number or "all", asks whether to also
delete the disk images (the qcow2 working disk + the seed ISO), shows
what will be removed and asks for confirmation. Each VM is powered off
(destroy) then undefined (--nvram, with a fallback for older virsh);
disks are only deleted when explicitly requested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:26:28 +00:00
3e2224b782 [IMP] script todo: add "Deploy ERPLibre infra" QEMU command
New QEMU/KVM entry that stands up a fleet of minimal VMs, one per
selected cloud image. It:

- lets you pick distros then versions (multi-select, "all" per level, or
  the whole catalogue), reading the specs straight from deploy_qemu.py so
  there is no duplication;
- prints a plan with each VM's minimum RAM/disk, the total concurrent RAM
  and virtual disk, and the host's available RAM, warning when the fleet
  cannot all run at once;
- deploys sequentially after confirmation (minimum sizing per version),
  skipping VMs that already exist;
- optionally clones ERPLibre into ~/git/erplibre on each VM, asking which
  branch (list fetched via git ls-remote) and pulling git in through
  cloud-init.

Naming is erplibre-<distro>-<version> (e.g. erplibre-ubuntu-2404).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:52:39 +00:00
9c8e7454f3 [IMP] script qemu: multi-distro (Debian/Fedora), resilient osinfo, 26.04
Generalise the deployer beyond Ubuntu with a distro registry and a new
--distro flag (ubuntu default, debian, fedora). Each distro keeps its
own codenames, osinfo ids and per-version minimum RAM/disk. Image URLs
are built per distro (Ubuntu current/, Debian latest/, Fedora resolved
from the release index since it has no "latest" link).

Add --list-images to print the whole catalogue with specs, exposed in
the todo menu ("List available images and specs"); the deploy/download
flows now prompt for the distro first.

Resilient osinfo: when the local osinfo-db does not know an id (e.g.
ubuntu26.04, fedora43+), fall back to virt-install detect=on,require=off
instead of failing. Ubuntu 26.04 (resolute) is now enabled.

Also: throttle the download progress to integer-percent steps (single
updating line on a TTY, at most 101 lines when captured by the menu),
and skip the spurious "network is already active" error by checking the
libvirt network state before net-start.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:38:04 +00:00
0d985ab449 [FIX] script todo: list VMs before asking which IP to show
The "Show a VM IP address" entry prompted for a VM name with no visible
list, so the user had to guess the name/ID. It now runs virsh list --all
first and asks for a "VM name or ID", making the expected input obvious.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:27:00 +00:00
a202143c30 [IMP] script qemu: default VM sizing to per-version minimums
Replace the fixed 8192 MB / 4 vCPU / 20G defaults with the minimum
resources required by the chosen Ubuntu version (libosinfo/osinfo-db
values): 20.04 -> 2048 MB/5G, 22.04 -> 2048 MB/10G, 24.04+ -> 3072
MB/20G. --vcpus now defaults to 2. This stops a small host from being
starved by an oversized default (an 8 GB VM failed to allocate on a
6.7 GB host) and silences the libvirt "less than recommended" warning.

In the todo menu, leaving the RAM/vCPU/disk fields blank now means
"version minimum" (the flag is simply not passed) instead of forcing
8192/4/20G. Any explicit value still overrides. README regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 06:26:43 +00:00
935919e07b [IMP] script todo: add QEMU/KVM VM deploy menu
Expose the QEMU deploy script from the interactive assistant so users
can create, preview, download and manage Ubuntu VMs without memorising
CLI flags. Adds a QEMU/KVM entry under Deploy, its fr/en translations,
and an extensible qemu_from_makefile section in todo.json.

Generated by Claude Code 2.1.210 claude-opus-4-8

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-07-15 11:48:12 +00:00
eb64155f3c [IMP] todo: add erase-database menu command
Give users a guided, confirmation-gated way to drop one or all
databases from the interactive CLI. Previously this meant running
make db_drop_all or odoo_bin db --drop by hand, which is easy to
mistype and offers no safeguard. The new entry requires an explicit
'oui'/'yes' (default no) before any irreversible deletion.

Generated by Claude Code 2.1.191 claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-06-25 02:37:22 -04:00
3136bb694f [ADD] install: add NTFY self-hosted push notification server
Add a one-command installer for the ntfy push notification server
(Ubuntu/Debian and Arch Linux), wired into the todo.py Deploy menu.

Users can now deploy a local ntfy server from the CLI and subscribe
to topics from their mobile device (ntfy app) to receive push
notifications from ERPLibre.

Generated by Claude Code 2.1.101 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-05-19 15:17:45 -04:00
e03befb28e [ADD] make: add SSH remote deployment targets and todo.py integration
Enable deploying and managing ERPLibre on remote servers via SSH
directly from make and the interactive todo.py CLI, since only
local deployment was previously supported.

- New conf/make.ssh.Makefile with 11 targets: ssh_check, ssh_push,
  ssh_install, ssh_run, ssh_stop, ssh_restart, ssh_status, ssh_logs,
  ssh_make, ssh_install_systemd, ssh_install_nginx
- Variables: SSH_HOST (required), SSH_USER, SSH_PORT, SSH_KEY,
  SSH_PATH, SSH_TARGET, SSH_DOMAIN, SSH_ADMIN_EMAIL
- Execute > Deploy menu extended with 11 SSH options in todo.py
- All strings translated fr/en in todo_i18n.py

Generated by Claude Code 2.1.101 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-05-19 15:17:45 -04:00
32315a2dba [ADD] installation: add optional extra modules (CybroOdoo)
CybroOdoo repos are large and slow to clone, making them unsuitable
for default installation. Moves them to opt-in per-version extra
manifests, introduces .erplibre-state.json to track installation
options per Odoo version, and surfaces the choice in the TODO CLI
sub-menu. Switch auto-detects extra from state and warns when no
state is recorded.

Generated by Claude Code 2.1.87 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-05-19 15:17:45 -04:00
c8025eb2a0 [IMP] todo: add sshfs configuration command
Add interactive sshfs mount setup to the system configuration
menu. Users can enter SSH host details manually or select from
~/.ssh/config, then configure a persistent mount with fstab.
Includes i18n strings for all new UI text.

Generated by Claude Code 2.1.81 model claude-sonnet-4-6
2026-03-23 00:33:26 -04:00
340a55e685 [IMP] todo: git patch 2026-03-22 22:21:16 -04:00
bee6d50018 [ADD] todo: add deploy menu with git clone
Allow users to deploy ERPLibre to a local directory
via git clone from the TODO interactive menu, making
onboarding simpler for new developers.

Generated by Claude Code 2.1.74 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-14 23:26:31 -04:00
4fc15c306b [REF] todo: use English text as i18n keys
Replace snake_case i18n keys with their English
translation so developers can read the code without
cross-referencing the translations dictionary.
Remove 5 obsolete duplicate entries.

Generated by Claude Code 2.1.74 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-14 23:26:31 -04:00
91c835d57e [IMP] todo: add Claude configs submenu and command listing
Refactor single commit setup into a generic deployment
mechanism for Claude commands, allowing easy addition of
new commands. Add todo_add_command template and an option
to list installed custom commands with their dates.

Generated by Claude Code 2.1.74 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-14 23:26:31 -04:00
c2e08f1de0 [IMP] todo: add git remote, vim config and automation
Add git remote add command with default name "localhost",
git editor vim configuration via todo.json, and a Claude
automation tool to dynamically add commands to todo.json.
Support new bash_command key in execute_from_configuration.

Generated by Claude Code 2.1.74 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-14 23:15:54 -04:00
230c55c432 [ADD] todo: add RTK management menu
Integrate RTK (Rust Token Killer) into the interactive CLI
to let users install, configure, and monitor token savings
directly from the ERPLibre todo interface.

Generated by Claude Code 2.1.74 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-14 23:15:54 -04:00
1e731114f5 [IMP] script: update copyright year to 2026
Reflect the current year in all TechnoLibre
license headers across script/, test/, and docker/.

Generated by Claude Code 2.1.74 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 23:16:05 -04:00
4a46ebbf4c [REF] script: add type hints to execute and i18n
Improve code maintainability and IDE support by adding
type annotations to function signatures and instance
variables in execute.py and todo_i18n.py. Also let
Black simplify unnecessary parentheses.

Generated by Claude Code 2.1.72 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 03:25:43 -04:00
666f285fca [REF] script: improve naming and translate to English
Continue variable renaming to remove Hungarian notation
prefixes (dct_, lst_) and adopt descriptive names. Translate
remaining French comments and user-facing strings to English
for consistency across the codebase.

Generated by Claude Code 2.1.72 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 03:25:27 -04:00
98d2ea890c [ADD] todo: add AI assistant tools menu with Claude Code commit setup
Provide developers with a streamlined way to configure Claude Code
commit templates directly from the TODO CLI, reducing manual setup
and ensuring consistent commit formatting across the team.

Generated by Claude Code 2.1.72 model claude-opus-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
2026-03-11 02:06:02 -04:00