make certbot auto-agree to TOS if NONINTERACTIVE=1 env var is set (#1399)
authorNils <mail@nilsnh.no>
Sun, 15 Jul 2018 15:24:15 +0000 (17:24 +0200)
committerJoshua Tauberer <jt@occams.info>
Sun, 15 Jul 2018 15:24:15 +0000 (11:24 -0400)
Vagrantfile
setup/start.sh

index b4bcb25..0161ae0 100644 (file)
@@ -19,9 +19,12 @@ Vagrant.configure("2") do |config|
   config.vm.network "private_network", ip: "192.168.50.4"
 
   config.vm.provision :shell, :inline => <<-SH
-       # Set environment variables so that the setup script does
-       # not ask any questions during provisioning. We'll let the
-       # machine figure out its own public IP.
+  # Set environment variables so that the setup script does
+  # not ask any questions during provisioning. We'll let the
+  # machine figure out its own public IP.
+  #
+  # Please note: NONINTERACTIVE=1 mode means that you'll automatically agree
+  # to Let's Encrypt's ACME Subscriber Agreement.
     export NONINTERACTIVE=1
     export PUBLIC_IP=auto
     export PUBLIC_IPV6=auto
index 86b34c8..b13e80c 100755 (executable)
@@ -139,7 +139,8 @@ echo "Mail-in-a-Box uses Let's Encrypt to provision free certificates"
 echo "to enable HTTPS connections to your box. You'll now be asked to agree"
 echo "to Let's Encrypt's terms of service."
 echo
-certbot register --register-unsafely-without-email --config-dir $STORAGE_ROOT/ssl/lets_encrypt
+certbot register $([ "$NONINTERACTIVE" == 1 ] && echo "--agree-tos") \
+    --register-unsafely-without-email --config-dir $STORAGE_ROOT/ssl/lets_encrypt
 fi
 
 # Done.