openSUSE / disk-encryption-tool

MIT License
2 stars 6 forks source link

jeos-firstboot-diskencrypt: Show recovery key in a dialog #4

Open Vogtinator opened 11 months ago

Vogtinator commented 11 months ago

Don't keep it around in issue.d, where everyone can see it, but show it in a nicer way that also has to be confirmed by the user.

lnussel commented 11 months ago

IIRC I had it like that originally but decided to put it in issue.d as it's more convenient to c&p from there in VMs with serial console. It's only there on first boot after all.

Vogtinator commented 11 months ago

IIRC I had it like that originally but decided to put it in issue.d as it's more convenient to c&p from there in VMs with serial console. It's only there on first boot after all.

Copy-paste should work with dialog, maybe it needs --no-mouse?

lnussel commented 10 months ago

As supected there's an issue with line breaks in a default 80x24 tty. IIRC that's why I didn't do it:

jeos-recovery

In the actual image it even looked worse :-) boot-12

lnussel commented 10 months ago

it actually fits with one space and using 0 as width to use the full width.

To avoid scrolling with the qr code we could use a yesno dialog with custom no label to show the qr code only on key press

Vogtinator commented 10 months ago

Does it fit 80x24 with qrencode -m2?

lnussel commented 10 months ago

no difference AFAICT

could use something like this:

echo -ne "\nPlease take note of the following recovery key for disk unlocking:\n " > "$recoverymsgfile"
keyctl pipe "$crypt_keyid" >> "$recoverymsgfile"
if [ -x /usr/bin/qrencode ]; then
        args=(--extra-button --extra-label "Show QR code")
fi

dialog --title "Disk Encryption Recovery Key" "${args[@]}" --textbox "$recoverymsgfile" 30 0
if [ "$?" = 3 ]; then
        keyctl pipe "$crypt_keyid" | qrencode -t utf8i > "$recoverymsgfile"
        dialog --title "QR code for mobile phone" --textbox "$recoverymsgfile" 30 0
fi
lnussel commented 10 months ago

nevertheless I still think the issue.d file is just fine for the purpose