Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

setup-certbot: More reasonable non-interactive behaviour.

Alex Vandiver52b1bd69a927
diff --git a/scripts/setup/setup-certbot b/scripts/setup/setup-certbot
index 2c91a6c5547..a7d997bddbb 100755
--- a/scripts/setup/setup-certbot
+++ b/scripts/setup/setup-certbot
@@ -101,14 +101,19 @@ case " $os_id $os_id_like " in
;;
esac
-# We don't use --no-interactive, because certbot needs to ask the user
-# to agree to the Let's Encrypt Subscriber Agreement (aka ToS).
-# Passing --force-interactive suppresses a warning, but also brings up
-# an annoying prompt we stifle with --no-eff-email.
+# If we aren't being run interactively, default to keeping the
+# existing certificate (rather than burning through a renewal)
+# If run interactively, certbot will prompt.
+default_keep=()
+if [ ! -t 0 ]; then
+ default_keep=(--keep-until-expiring)
+fi
+
certbot certonly "${method_args[@]}" \
"${HOSTNAMES[@]}" -m "$EMAIL" \
"${agree_tos[@]}" \
- --force-interactive --no-eff-email
+ "${default_keep[@]}" \
+ --no-eff-email
symlink_with_backup() {
if [ -e "$2" ]; then