From 8afdca1406826b1bb1e351f1ac63e3be18bb4a9c Mon Sep 17 00:00:00 2001 From: slowjoe007 Date: Sat, 5 Oct 2019 17:16:44 +0200 Subject: [PATCH 1/2] handle subscription to EFF mailings non-interactively --- init-letsencrypt.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init-letsencrypt.sh b/init-letsencrypt.sh index 95daadb0..936ac7ce 100755 --- a/init-letsencrypt.sh +++ b/init-letsencrypt.sh @@ -10,6 +10,7 @@ rsa_key_size=4096 data_path="./data/certbot" email="" # Adding a valid address is strongly recommended staging=0 # Set to 1 if you're testing your setup to avoid hitting request limits +subscribe_to_eff=0 # Set to 1 if you provided an e-mail address and want to subscribe to EFF mailings if [ -d "$data_path" ]; then read -p "Existing data found for $domains. Continue and replace existing certificate? (y/N) " decision @@ -60,7 +61,14 @@ done # Select appropriate email arg case "$email" in "") email_arg="--register-unsafely-without-email" ;; - *) email_arg="--email $email" ;; + *) email_arg="--email $email" + if [ $subscribe_to_eff == "1" ] + then + subscribe_arg="--eff-email" + else + subscribe_arg="--no-eff-email" + fi + ;; esac # Enable staging mode if needed @@ -71,6 +79,7 @@ docker-compose run --rm --entrypoint "\ $staging_arg \ $email_arg \ $domain_args \ + $subscribe_arg \ --rsa-key-size $rsa_key_size \ --agree-tos \ --force-renewal" certbot From 2b588fe1591d486007aa7916d066fb970a589100 Mon Sep 17 00:00:00 2001 From: slowjoe007 Date: Thu, 10 Oct 2019 07:45:26 +0200 Subject: [PATCH 2/2] configurability of EFF mailing subscriptions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8c3bd886..ae1eafff 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ application. 3. Modify configuration: - Add domains and email addresses to init-letsencrypt.sh +- Specify if you want to subscribe to EFF mailings - Replace all occurrences of example.org with primary domain (the first one you added to init-letsencrypt.sh) in data/nginx/app.conf 4. Run the init script: