From 68c69c771333cae64d16f84b1c2f1ceb2b702e56 Mon Sep 17 00:00:00 2001 From: Olivier <1+olivier@noreply.raspot.in> Date: Wed, 19 Aug 2026 17:01:20 +0200 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"workstation-setup/src"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workstation-setup/src/Main.qml | 83 ++++++++++++------- workstation-setup/src/ProvisioningBackend.cpp | 68 ++++++++------- workstation-setup/src/main.cpp | 2 +- 3 files changed, 92 insertions(+), 61 deletions(-) diff --git a/workstation-setup/src/Main.qml b/workstation-setup/src/Main.qml index e30963a..c1a9a3d 100644 --- a/workstation-setup/src/Main.qml +++ b/workstation-setup/src/Main.qml @@ -17,9 +17,9 @@ Kirigami.ApplicationWindow { property var steps: [ { "title": "Bienvenue", "subtitle": "Première connexion" }, - { "title": "Mot de passe", "subtitle": "Protection LUKS2" }, - { "title": "YubiKey", "subtitle": "Création du PIN" }, - { "title": "Association", "subtitle": "Déverrouillage FIDO2" }, + { "title": "Mot de passe", "subtitle": "Protection des données" }, + { "title": "YubiKey", "subtitle": "Création du code PIN" }, + { "title": "Association", "subtitle": "Association de la clé" }, { "title": "Terminé", "subtitle": "Poste prêt" } ] @@ -126,18 +126,20 @@ Kirigami.ApplicationWindow { component PrimaryButton: Controls.Button { id: control - implicitHeight: 48 - implicitWidth: 180 - leftPadding: 24 - rightPadding: 24 + implicitHeight: 52 + leftPadding: 26 + rightPadding: 26 + implicitWidth: Math.max(210, buttonLabel.implicitWidth + leftPadding + rightPadding) contentItem: Controls.Label { + id: buttonLabel text: control.text color: "white" font.pixelSize: 15 font.weight: Font.DemiBold horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter + wrapMode: Text.NoWrap } background: Rectangle { @@ -291,7 +293,7 @@ Kirigami.ApplicationWindow { font.weight: Font.Bold } Controls.Label { - text: "Provisioning sécurisé" + text: "Configuration sécurisée" color: "#b9cee5" font.pixelSize: 12 } @@ -410,13 +412,29 @@ Kirigami.ApplicationWindow { } } - StackLayout { + Item { + id: pageViewport Layout.fillWidth: true Layout.fillHeight: true - currentIndex: root.currentStep + clip: true + + Row { + id: pageStrip + height: parent.height + spacing: 0 + x: -root.currentStep * pageViewport.width + + Behavior on x { + NumberAnimation { + duration: 330 + easing.type: Easing.OutCubic + } + } // 0 - Bienvenue Item { + width: pageViewport.width + height: pageViewport.height ColumnLayout { anchors.fill: parent spacing: 20 @@ -432,7 +450,7 @@ Kirigami.ApplicationWindow { Controls.Label { Layout.maximumWidth: 720 Layout.alignment: Qt.AlignHCenter - text: "Votre espace personnel est déjà protégé par un volume LUKS2. Il reste à remplacer le mot de passe temporaire et à préparer votre YubiKey." + text: "Votre espace personnel est déjà chiffré. Il reste à remplacer le mot de passe temporaire et à préparer votre YubiKey." wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter color: "#64748b" @@ -443,7 +461,7 @@ Kirigami.ApplicationWindow { Layout.maximumWidth: 720 Layout.alignment: Qt.AlignHCenter iconText: "🔐" - text: "À la fin, votre home pourra être déverrouillé soit avec votre mot de passe personnel, soit avec votre YubiKey et son PIN." + text: "À la fin, vous pourrez ouvrir votre espace personnel soit avec votre mot de passe, soit avec votre YubiKey et son code PIN." } Item { Layout.fillHeight: true } PrimaryButton { @@ -459,6 +477,8 @@ Kirigami.ApplicationWindow { // 1 - Mot de passe Item { + width: pageViewport.width + height: pageViewport.height ColumnLayout { anchors.fill: parent spacing: 16 @@ -471,7 +491,7 @@ Kirigami.ApplicationWindow { } Controls.Label { Layout.fillWidth: true - text: "Ce mot de passe reste votre solution de secours si la YubiKey est oubliée ou indisponible. Le changement est appliqué directement à systemd-homed et au chiffrement LUKS2." + text: "Ce mot de passe reste votre solution de secours si la YubiKey est oubliée ou indisponible." wrapMode: Text.WordWrap color: "#64748b" font.pixelSize: 14 @@ -523,7 +543,7 @@ Kirigami.ApplicationWindow { PrimaryButton { Layout.alignment: Qt.AlignRight - text: provisioning.busy ? "Modification…" : "Modifier le mot de passe" + text: provisioning.busy ? "Modification…" : "Valider le mot de passe" enabled: root.passwordStepValid && !provisioning.busy onClicked: { root.operationError = "" @@ -541,6 +561,8 @@ Kirigami.ApplicationWindow { // 2 - PIN YubiKey Item { + width: pageViewport.width + height: pageViewport.height ColumnLayout { anchors.fill: parent spacing: 16 @@ -553,7 +575,7 @@ Kirigami.ApplicationWindow { } Controls.Label { Layout.fillWidth: true - text: "Branchez une seule YubiKey vierge puis choisissez son premier PIN FIDO2. Aucun PIN temporaire n'est utilisé." + text: "Branchez une seule YubiKey vierge puis choisissez son code PIN. Aucun code PIN temporaire n'est utilisé." wrapMode: Text.WordWrap color: "#64748b" font.pixelSize: 14 @@ -561,13 +583,13 @@ Kirigami.ApplicationWindow { InfoBox { iconText: "☝" - text: "La clé doit sortir d'un reset FIDO2 et ne posséder aucun PIN. Cette étape ne crée aucun fichier u2f-mappings." + text: "La YubiKey doit être vierge ou avoir été réinitialisée. Elle ne doit pas déjà posséder de code PIN." } Item { Layout.preferredHeight: 8 } - FieldLabel { text: "Nouveau PIN FIDO2" } + FieldLabel { text: "Nouveau code PIN" } SecretField { id: newPin } - FieldLabel { text: "Confirmation du PIN" } + FieldLabel { text: "Confirmation du code PIN" } SecretField { id: confirmPin } ErrorBox { } @@ -575,7 +597,7 @@ Kirigami.ApplicationWindow { PrimaryButton { Layout.alignment: Qt.AlignRight - text: provisioning.busy ? "Initialisation…" : "Créer le PIN" + text: provisioning.busy ? "Initialisation…" : "Créer le code PIN" enabled: root.pinStepValid && !provisioning.busy onClicked: { root.operationError = "" @@ -591,19 +613,21 @@ Kirigami.ApplicationWindow { // 3 - Association FIDO2 au home Item { + width: pageViewport.width + height: pageViewport.height ColumnLayout { anchors.fill: parent spacing: 16 Controls.Label { - text: "Associez la YubiKey à votre home chiffré" + text: "Associez la YubiKey à votre espace personnel" color: "#0f172a" font.pixelSize: 28 font.weight: Font.Bold } Controls.Label { Layout.fillWidth: true - text: "systemd-homed va ajouter la YubiKey comme second moyen de déverrouillage du volume LUKS2. Votre mot de passe personnel reste valide en secours." + text: "La YubiKey sera ajoutée comme second moyen d'ouvrir votre espace personnel chiffré. Votre mot de passe reste utilisable en secours." wrapMode: Text.WordWrap color: "#64748b" font.pixelSize: 14 @@ -611,13 +635,13 @@ Kirigami.ApplicationWindow { InfoBox { iconText: "🔐" - text: "Saisissez le mot de passe que vous venez de choisir et le PIN de la YubiKey. Aucune recovery key n'est demandée dans ce workflow." + text: "Saisissez le mot de passe que vous venez de choisir et le code PIN de la YubiKey." } InfoBox { visible: !provisioning.busy iconText: "☝" - text: "Après avoir lancé l'association, l'assistant vous indiquera précisément quand toucher la YubiKey. Plusieurs touchers peuvent être nécessaires." + text: "Après avoir lancé l'association, suivez les indications affichées à l'écran. La YubiKey peut demander plusieurs touchers." } Rectangle { @@ -665,7 +689,7 @@ Kirigami.ApplicationWindow { Layout.fillWidth: true text: provisioning.fidoTouchRequired ? "TOUCHEZ LA YUBIKEY MAINTENANT" - : "Association FIDO2 en cours" + : "Association de la YubiKey en cours" wrapMode: Text.WordWrap color: provisioning.fidoTouchRequired ? "#9a3412" : "#1d4ed8" font.pixelSize: provisioning.fidoTouchRequired ? 18 : 15 @@ -687,7 +711,7 @@ Kirigami.ApplicationWindow { Item { Layout.preferredHeight: 8 } FieldLabel { text: "Votre mot de passe personnel actuel" } SecretField { id: fidoPassword } - FieldLabel { text: "PIN de la YubiKey" } + FieldLabel { text: "Code PIN de la YubiKey" } SecretField { id: fidoPin } ErrorBox { } @@ -711,6 +735,8 @@ Kirigami.ApplicationWindow { // 4 - Terminé Item { + width: pageViewport.width + height: pageViewport.height ColumnLayout { anchors.fill: parent spacing: 18 @@ -745,7 +771,7 @@ Kirigami.ApplicationWindow { Controls.Label { Layout.maximumWidth: 720 Layout.alignment: Qt.AlignHCenter - text: "Votre mot de passe personnel protège le home LUKS2 et votre YubiKey est désormais enrôlée dans systemd-homed. Vous pourrez ouvrir votre session avec le mot de passe ou avec la YubiKey + PIN." + text: "Votre espace personnel est chiffré et votre YubiKey est prête. Vous pourrez ouvrir votre session avec votre mot de passe ou avec votre YubiKey et son code PIN." wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter color: "#64748b" @@ -757,7 +783,7 @@ Kirigami.ApplicationWindow { Layout.maximumWidth: 720 Layout.alignment: Qt.AlignHCenter iconText: "✓" - text: "Aucun u2f-mappings n'est utilisé. Les données FIDO2 nécessaires au déverrouillage sont gérées par systemd-homed." + text: "Votre configuration sécurisée est terminée. Conservez votre YubiKey avec vous et mémorisez son code PIN." } Item { Layout.fillHeight: true } @@ -770,7 +796,8 @@ Kirigami.ApplicationWindow { } } } - } + } // Row pageStrip + } // pageViewport } } } diff --git a/workstation-setup/src/ProvisioningBackend.cpp b/workstation-setup/src/ProvisioningBackend.cpp index b88d049..a1ae064 100644 --- a/workstation-setup/src/ProvisioningBackend.cpp +++ b/workstation-setup/src/ProvisioningBackend.cpp @@ -248,25 +248,29 @@ void ProvisioningBackend::handleHelperStdout(Operation operation, const QByteArr bool changed = false; if (line == QByteArrayLiteral("EVENT_FIDO_INITIALIZING")) { - m_fidoTouchRequired = false; - m_fidoStatus = QStringLiteral("Initialisation de l'association FIDO2…"); + m_fidoTouchRequired = true; + ++m_fidoTouchRequestCount; + m_fidoStatus = QStringLiteral("Touchez la YubiKey dès qu’elle clignote. Plusieurs touchers peuvent être demandés pendant cette étape. (%1)") + .arg(m_fidoTouchRequestCount); changed = true; } else if (line == QByteArrayLiteral("EVENT_FIDO_GENERATING")) { - m_fidoTouchRequired = false; - m_fidoStatus = QStringLiteral("Génération du secret FIDO2…"); + m_fidoTouchRequired = true; + ++m_fidoTouchRequestCount; + m_fidoStatus = QStringLiteral("Touchez de nouveau la YubiKey dès qu’elle clignote. (%1)") + .arg(m_fidoTouchRequestCount); changed = true; } else if (line == QByteArrayLiteral("EVENT_FIDO_UPDATING_HOME")) { m_fidoTouchRequired = false; - m_fidoStatus = QStringLiteral("Mise à jour du home chiffré…"); + m_fidoStatus = QStringLiteral("Mise à jour de votre espace personnel…"); changed = true; } else if (line == QByteArrayLiteral("EVENT_FIDO_SYNCHRONIZING")) { m_fidoTouchRequired = false; - m_fidoStatus = QStringLiteral("Synchronisation des clés de chiffrement…"); + m_fidoStatus = QStringLiteral("Finalisation de la protection…"); changed = true; } else if (line == QByteArrayLiteral("EVENT_FIDO_TOUCH_REQUIRED")) { m_fidoTouchRequired = true; ++m_fidoTouchRequestCount; - m_fidoStatus = QStringLiteral("Touchez la YubiKey maintenant — demande %1. Il peut y avoir plusieurs touchers pendant cette étape.") + m_fidoStatus = QStringLiteral("Touchez la YubiKey maintenant. Plusieurs touchers peuvent être demandés pendant cette étape. (%1)") .arg(m_fidoTouchRequestCount); changed = true; } @@ -373,7 +377,7 @@ void ProvisioningBackend::initializePin(const QString &newPin, return; } if (m_pinDone) { - emit pinChangeFinished(true, QStringLiteral("Le PIN FIDO2 a déjà été initialisé.")); + emit pinChangeFinished(true, QStringLiteral("Le code PIN de la YubiKey a déjà été initialisé.")); return; } if (newPin.size() < 4 || confirmation.size() < 4) { @@ -407,15 +411,15 @@ void ProvisioningBackend::enrollFido(const QString ¤tPassword, return; } if (!m_passwordDone || !m_pinDone) { - emit fidoEnrollmentFinished(false, QStringLiteral("Le mot de passe et le PIN doivent être configurés avant l'association FIDO2.")); + emit fidoEnrollmentFinished(false, QStringLiteral("Le mot de passe et le code PIN doivent être configurés avant d'associer la YubiKey.")); return; } if (m_fidoDone) { - emit fidoEnrollmentFinished(true, QStringLiteral("La YubiKey est déjà associée au home chiffré.")); + emit fidoEnrollmentFinished(true, QStringLiteral("La YubiKey est déjà associée à votre espace personnel.")); return; } if (currentPassword.isEmpty() || pin.size() < 4) { - emit fidoEnrollmentFinished(false, QStringLiteral("Saisissez votre mot de passe actuel et le PIN de la YubiKey.")); + emit fidoEnrollmentFinished(false, QStringLiteral("Saisissez votre mot de passe actuel et le code PIN de la YubiKey.")); return; } if (containsLineBreak(currentPassword) || containsLineBreak(pin)) { @@ -424,7 +428,7 @@ void ProvisioningBackend::enrollFido(const QString ¤tPassword, } resetFidoInteraction(); - m_fidoStatus = QStringLiteral("Préparation de l'association FIDO2…"); + m_fidoStatus = QStringLiteral("Préparation de l'association de la YubiKey…"); emit fidoInteractionChanged(); startHelper(Operation::Fido, @@ -558,20 +562,20 @@ void ProvisioningBackend::startHelper(Operation operation, case Operation::Password: markerCreated = createMarker(passwordMarker()); message = markerCreated - ? QStringLiteral("Votre nouveau mot de passe protège maintenant votre home chiffré.") + ? QStringLiteral("Votre nouveau mot de passe protège maintenant votre espace personnel.") : QStringLiteral("Le mot de passe a été modifié mais l'état local n'a pas pu être enregistré."); break; case Operation::Pin: markerCreated = createMarker(pinMarker()); message = markerCreated - ? QStringLiteral("Le PIN FIDO2 de votre YubiKey est maintenant initialisé.") + ? QStringLiteral("Le code PIN de votre YubiKey est maintenant initialisé.") : QStringLiteral("Le PIN a été créé mais l'état local n'a pas pu être enregistré."); break; case Operation::Fido: markerCreated = createMarker(fidoMarker()); message = markerCreated - ? QStringLiteral("Votre YubiKey peut maintenant déverrouiller votre home chiffré.") - : QStringLiteral("La YubiKey a été enrôlée mais l'état local n'a pas pu être enregistré."); + ? QStringLiteral("Votre YubiKey peut maintenant ouvrir votre espace personnel chiffré.") + : QStringLiteral("La YubiKey a été associée mais l'état local n'a pas pu être enregistré."); break; } } else { @@ -602,8 +606,8 @@ void ProvisioningBackend::startHelper(Operation operation, if (operation == Operation::Fido) { m_fidoTouchRequired = false; m_fidoStatus = helperSucceeded && markerCreated - ? QStringLiteral("Association FIDO2 terminée.") - : QStringLiteral("Association FIDO2 interrompue."); + ? QStringLiteral("Association de la YubiKey terminée.") + : QStringLiteral("Association de la YubiKey interrompue."); emit fidoInteractionChanged(); } @@ -622,7 +626,7 @@ QString ProvisioningBackend::safeMessageForFailure(Operation operation, if (timedOut || exitCode == 124 || output.contains(QStringLiteral("timeout"))) { if (operation == Operation::Fido) { - return QStringLiteral("L'association FIDO2 a expiré. Laissez la YubiKey branchée et touchez-la lorsqu'elle clignote."); + return QStringLiteral("L'association de la YubiKey a expiré. Laissez-la branchée et recommencez l'opération."); } return QStringLiteral("L'opération a expiré avant de pouvoir être terminée."); } @@ -634,45 +638,45 @@ QString ProvisioningBackend::safeMessageForFailure(Operation operation, if (output.contains(QStringLiteral("new_rejected"))) { return QStringLiteral("Le nouveau mot de passe a été refusé par la politique de sécurité."); } - return QStringLiteral("Le mot de passe n'a pas pu être modifié par systemd-homed."); + return QStringLiteral("Le mot de passe n'a pas pu être modifié."); } if (operation == Operation::Pin) { if (output.contains(QStringLiteral("pin_already_configured"))) { - return QStringLiteral("Cette YubiKey possède déjà un PIN FIDO2. Utilisez une YubiKey vierge ou réinitialisée."); + return QStringLiteral("Cette YubiKey possède déjà un code PIN. Utilisez une YubiKey vierge ou réinitialisée."); } if (output.contains(QStringLiteral("pin_auth_blocked"))) { return QStringLiteral("Les opérations PIN sont temporairement bloquées. Débranchez puis rebranchez la YubiKey."); } if (output.contains(QStringLiteral("pin_blocked"))) { - return QStringLiteral("Le PIN FIDO2 est bloqué. La YubiKey doit être réinitialisée avant provisioning."); + return QStringLiteral("Le code PIN est bloqué. La YubiKey doit être réinitialisée avant de recommencer."); } if (output.contains(QStringLiteral("multiple_yubikey"))) { - return QStringLiteral("Plusieurs clés FIDO2 sont détectées. Ne laissez branchée que la YubiKey d'Alice."); + return QStringLiteral("Plusieurs clés de sécurité sont détectées. Ne laissez branchée que votre YubiKey."); } if (output.contains(QStringLiteral("no_yubikey"))) { - return QStringLiteral("Aucune YubiKey FIDO2 compatible n'a été détectée."); + return QStringLiteral("Aucune YubiKey compatible n'a été détectée."); } if (output.contains(QStringLiteral("pin_policy"))) { - return QStringLiteral("Le PIN choisi ne respecte pas la politique FIDO2 de la YubiKey."); + return QStringLiteral("Le code PIN choisi n'est pas accepté par la YubiKey."); } - return QStringLiteral("Le PIN FIDO2 n'a pas pu être initialisé."); + return QStringLiteral("Le code PIN de la YubiKey n'a pas pu être initialisé."); } if (output.contains(QStringLiteral("fido_bad_password"))) { - return QStringLiteral("Le mot de passe personnel fourni est incorrect ou insuffisant pour mettre à jour le home."); + return QStringLiteral("Le mot de passe fourni est incorrect."); } if (output.contains(QStringLiteral("fido_bad_pin"))) { - return QStringLiteral("Le PIN de la YubiKey est incorrect. Ne réessayez pas plusieurs fois : vérifiez le PIN avant une nouvelle tentative."); + return QStringLiteral("Le code PIN de la YubiKey est incorrect. Vérifiez-le avant une nouvelle tentative."); } if (output.contains(QStringLiteral("multiple_yubikey"))) { - return QStringLiteral("Plusieurs clés FIDO2 sont détectées. Ne laissez branchée que la YubiKey d'Alice."); + return QStringLiteral("Plusieurs clés de sécurité sont détectées. Ne laissez branchée que votre YubiKey."); } if (output.contains(QStringLiteral("no_yubikey"))) { - return QStringLiteral("Aucune YubiKey FIDO2 compatible n'a été détectée."); + return QStringLiteral("Aucune YubiKey compatible n'a été détectée."); } if (output.contains(QStringLiteral("fido_enroll_failed"))) { - return QStringLiteral("La YubiKey n'a pas pu être associée au home. Vérifiez le mot de passe, le PIN et touchez la clé lorsqu'elle clignote."); + return QStringLiteral("La YubiKey n'a pas pu être associée à votre espace personnel. Vérifiez le mot de passe et le code PIN."); } - return QStringLiteral("L'association FIDO2 au home chiffré a échoué."); + return QStringLiteral("L'association de la YubiKey à votre espace personnel a échoué."); } diff --git a/workstation-setup/src/main.cpp b/workstation-setup/src/main.cpp index 73ef7ca..3af3533 100644 --- a/workstation-setup/src/main.cpp +++ b/workstation-setup/src/main.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) QGuiApplication::setOrganizationName(QStringLiteral("Raspot")); QGuiApplication::setOrganizationDomain(QStringLiteral("raspot.in")); QGuiApplication::setApplicationName(QStringLiteral("NixOS Workstations Setup")); - QGuiApplication::setApplicationVersion(QStringLiteral("1.8.5")); + QGuiApplication::setApplicationVersion(QStringLiteral("1.8.6")); QGuiApplication::setDesktopFileName(QStringLiteral("org.raspot.nixosworkstations.setup")); QCommandLineParser parser;