Automate fix for "GnuPG keys missing" problem
I started up Tails but cannot see my GNUPG keys. They just all randomly disappeared for no reason. Any fix would be nice.
# Analysis
In the few cases where users provided enough info for us to analyze anything, `~/.gnupg/pubring.kbx` was empty.
# Solution
Thankfully, GnuPG stores a backup of `pubring.kbx` in `~/.gnupg/pubring.kbx~`. So we can do this: at login time, if `pubring.kbx` is empty but `pubring.kbx~` is not, then we delete the former, and rename `pubring.kbx~` to `pubring.kbx`. Should tell the user know we're doing this, or even ask them for confirmation first?
# Feedback needed
if this problem happens to you, please check the size of `~/.gnupg/pubring.kbx` and `~/.gnupg/pubring.kbx~`. If the former is empty but the latter is not, please try to delete the former and rename the latter to `~/.gnupg/pubring.kbx`: this will hopefully solve the problem. Let us know!
issue