Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle subscription to EFF mailings non-interactively #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 10 additions & 1 deletion init-letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down