Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vogtinator
Copy link
Member

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.

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
Copy link
Member

lnussel commented Dec 13, 2023

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
Copy link
Member Author

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
Copy link
Member

lnussel commented Dec 21, 2023

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
Copy link
Member

lnussel commented Dec 21, 2023

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
Copy link
Member Author

Does it fit 80x24 with qrencode -m2?

@lnussel
Copy link
Member

lnussel commented Dec 21, 2023

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
Copy link
Member

lnussel commented Dec 21, 2023

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

@aplanas aplanas force-pushed the master branch 2 times, most recently from ed0f3e9 to 8f4f68f Compare October 2, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants