diff --git a/install_files/securedrop-app-code/debian/postinst b/install_files/securedrop-app-code/debian/postinst index bab2330891..b37a2a972a 100644 --- a/install_files/securedrop-app-code/debian/postinst +++ b/install_files/securedrop-app-code/debian/postinst @@ -116,6 +116,12 @@ case "$1" in echo allow-loopback-pinentry > /var/lib/securedrop/keys/gpg-agent.conf fi + # Migrate private keyring to gpg2.1 if needed + if [ ! -d "/var/lib/securedrop/keys/private-keys-v1.d" ]; then + # Then we should migrate the keyring + gpg2 --homedir=/var/lib/securedrop/keys --batch --import < /var/lib/securedrop/keys/secring.gpg + fi + chown -R www-data:www-data /var/lib/securedrop /var/www/securedrop pip install --no-index --find-links=/var/securedrop/wheelhouse --upgrade \