Debian Codegraph @

tests/account-encrypted-gpg

raw
1 # GnuPG-encrypted account key (WARN: this test is not interactive)
2
3 PASSPHRASE="test"
4
5 DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends gpg gpg-agent
6
7 gpg --batch --passphrase "$PASSPHRASE" --quick-generate-key "nobody <[email protected]>"
8 keyid="$(gpg --list-secret-key --with-colons | grep -m1 ^fpr: | cut -sd: -f10)"
9 gpg --encrypt -r "$keyid" /etc/lacme/account.key
10 sed -ri '0,\|^#?privkey\s*=.*| {s||privkey = gpg:/etc/lacme/account.key.gpg|}' /etc/lacme/lacme-accountd.conf
11
12 export GPG_TTY="$(tty)" TERM="linux"
13 lacme account
14
15 # vim: set filetype=sh :