Skip to content

Commit e77c54f

Browse files
committed
getuto: add manual timeout around GPG connection to keyserver.
Some kinds of ISP site blocks terminate connection after it is established. This leaves GPG thinking it's connected successfully and waiting for keys. Add manual timeout invocations over keyserver calls. Set timeout for them longer than GPG connection timeout. Closes: #5 Closes: #6
1 parent 5f62138 commit e77c54f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

getuto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ getuto_refresh() {
7373
# Refresh all keys from the keyserver if we can.
7474
for keyserver in "${mykeyservers[@]}" ; do
7575
# TODO: keys.openpgp.org lacks a UID for our keys, need to verify email
76-
gpg ${QUIET_GPG} --batch --keyserver "${keyserver}" --refresh-keys || true
76+
timeout -k 5m 3.5m gpg ${QUIET_GPG} --batch --keyserver "${keyserver}" --refresh-keys || true
7777
done
7878
# We only sign (-> ultimate trust) the keys we originally import, so this is fine and
7979
# just serves as an additional refresh method.
@@ -167,7 +167,7 @@ if [[ ! -d ${GNUPGHOME} ]] ; then
167167

168168
# TODO: keys.openpgp.org lacks a UID for our keys, need to verify email
169169
for keyserver in "${mykeyservers[@]}" ; do
170-
gpg ${QUIET_GPG} --batch --keyserver "${keyserver}" --recv-keys ${myrelkeys} || true
170+
timeout -k 5m 3.5m gpg ${QUIET_GPG} --batch --keyserver "${keyserver}" --recv-keys ${myrelkeys} || true
171171
done
172172
# We only sign (-> ultimate trust) the keys we originally import, so this is fine and
173173
# just serves as an additional refresh method.

0 commit comments

Comments
 (0)