feat(installer): send failure reports to the FWS bug API

When an installation fails the machine does not reboot: it stays on the log
window. Until now the user had a complete report in front of them and no way to
get it to us -- no browser, no mail client in a live session.

The log window now carries two buttons, "Envoyer le rapport aux développeurs"
and "Redémarrer". Sending does not close the window, so it can be retried after
plugging in a network cable, which is the usual reason an install failed in the
first place.

fws-report-bug POSTs to https://fws.laxacube.ch/api/bugs.php. It is written in
python3 with urllib -- no added dependency, and json.dumps escapes raw logs
containing quotes, backslashes and accents, which a shell-built JSON breaks on
at the first line. It attaches the logs (last 200000 characters: the error is
always at the end) and the detected hardware (CPU/GPU model, RAM, UEFI or BIOS,
disks, virtualisation). It never sends the user name or the host name, and the
e-mail only when one is given. Nothing is sent without an explicit click.

profiledef.sh also gains the 0755 permission entry for the new helper, since
repository files are versioned 0644.

Signed-off-by: nocode <suzuku295@gmail.com>
This commit is contained in:
nocode committed 2026-09-09 10:08:30 +02:00
1 parent c2859aace7
commit 0d2300d7ea
3 files changed
+270 -3

No files matched your search

+43 -2
View File
@@ -230,9 +230,50 @@ if command -v liveinst >/dev/null 2>&1; then
systemctl poweroff
else
# Échec (ou install non terminée) : on montre les logs pour diagnostiquer.
#
# La machine NE REDÉMARRE PAS ici (contrairement au cas « réussite ») :
# l'utilisateur reste devant le rapport. Il lui faut donc, DANS cette
# fenêtre, de quoi (a) nous envoyer le rapport et (b) repartir.
# zenity --extra-button ajoute de vrais boutons à la fenêtre de logs :
# au clic, zenity SORT en imprimant le libellé du bouton sur stdout.
# On boucle donc : envoyer un rapport ne ferme pas définitivement les
# logs, et l'utilisateur peut réessayer (typiquement après avoir
# branché un câble réseau) autant de fois qu'il veut.
#
# L'envoi reste MANUEL et jamais automatique : le rapport contient les
# logs de la machine, ça ne part pas sans un clic.
if command -v zenity >/dev/null 2>&1; then
zenity --text-info --title="FWS — logs Anaconda (sortie $rc)" \
--filename="$DBG" --width=1100 --height=720 2>/dev/null &
(
while :; do
_btn="$(zenity --text-info \
--title="FWS — l'installation ne s'est pas terminée (sortie $rc)" \
--filename="$DBG" --width=1100 --height=720 \
--ok-label="Fermer" \
--extra-button="Envoyer le rapport aux développeurs" \
--extra-button="Redémarrer" 2>/dev/null)" || true
case "$_btn" in
"Envoyer le rapport aux développeurs")
if command -v fws-report-bug >/dev/null 2>&1; then
fws-report-bug --gui --type installation \
--app "installateur FWS" \
--logs "$DBG" \
--logs /tmp/fws-post-chroot.log \
2>/dev/null || true
else
zenity --error --width=440 \
--text="fws-report-bug est absent de cette image :\nle rapport ne peut pas être envoyé d'ici." 2>/dev/null || true
fi
;;
"Redémarrer")
systemctl reboot
break
;;
# « Fermer », croix de la fenêtre, ou zenity indisponible
# (X cassé) : on sort — surtout pas de boucle infinie.
*) break ;;
esac
done
) &
fi
wait "$_OB_PID"
fi