From 5037443c7a5e4b01d285348b1b5f429152dad72d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 12 Dec 2022 11:40:32 -0800 Subject: chore(wpcarro/gpg): Delete import/export gpg scripts These are encoded in configs/default.nix anyhow. Change-Id: Ie1181f91ee7a65b43ce75d8af9ecc2c1b49dbf73 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7577 Autosubmit: wpcarro Reviewed-by: wpcarro Tested-by: BuildkiteCI --- users/wpcarro/configs/.gnupg/export.sh | 29 ----------------------------- users/wpcarro/configs/.gnupg/import.sh | 28 ---------------------------- 2 files changed, 57 deletions(-) delete mode 100755 users/wpcarro/configs/.gnupg/export.sh delete mode 100755 users/wpcarro/configs/.gnupg/import.sh (limited to 'users/wpcarro') diff --git a/users/wpcarro/configs/.gnupg/export.sh b/users/wpcarro/configs/.gnupg/export.sh deleted file mode 100755 index 31def2beb179..000000000000 --- a/users/wpcarro/configs/.gnupg/export.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Run this script to export all the information required to transport your GPG -# information. -# Usage: ./export.sh -# TODO: run this periodically as a job. - -output="$(pwd)/export.zip" -destination="$(mktemp -d)" - -function cleanup() { - rm -rf "${destination}" -} -trap cleanup EXIT - -gpg --armor --export >"${destination}/public.asc" -gpg --armor --export-secret-keys >"${destination}/secret.asc" -gpg --armor --export-ownertrust >"${destination}/ownertrust.txt" - -# Strangely enough this appears to be the only way to create a zip of a -# directory that doesn't contain the (noisy) full paths of each item from the -# source filesystem. (i.e. -j doesn't cooperate with -r) -pushd "${destination}" -zip -r "${output}" ./* -popd - -echo "$(realpath ${output})" diff --git a/users/wpcarro/configs/.gnupg/import.sh b/users/wpcarro/configs/.gnupg/import.sh deleted file mode 100755 index bb449267ce5e..000000000000 --- a/users/wpcarro/configs/.gnupg/import.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Run this script to import all of the information exported by `export.sh`. -# Usage: ./import.sh path/to/export.zip - -if [ -z "${1+x}" ]; then - echo "You must specify the path to export.zip. Exiting..." - exit 1 -fi - -destination="$(mktemp -d)" - -function cleanup() { - rm -rf "${destination}" -} -trap cleanup EXIT - -unzip "${1}" -d "${destination}" >/dev/null - -gpg --import "${destination}/public.asc" -gpg --import "${destination}/secret.asc" -gpg --import-ownertrust "${destination}/ownertrust.txt" - -# Run this at the end to output some verification -gpg --list-keys -gpg --list-secret-keys -- cgit 1.4.1