Skip to content

Instantly share code, notes, and snippets.

@omerxx
Last active February 26, 2021 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save omerxx/d1056ea04b7261e62f522097f55e2a89 to your computer and use it in GitHub Desktop.
Save omerxx/d1056ea04b7261e62f522097f55e2a89 to your computer and use it in GitHub Desktop.
# Generating let's encrypt manual cert with ease
# Usage: ./cert.sh me@company.com my.domain.com
# Output: ~/certbot/.certbot/config
#
generate_certificate() {
email=$1
domain=$2
sudo docker run -it --rm -v ~/certbot:/home/root \
certbot/certbot certonly --config-dir /home/root/.certbot/config \
--logs-dir /home/root/.certbot/logs \
--work-dir /homr/root/.certbot/work \
--manual \
--preferred-challenges=dns \
--email="${email}" \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos -d "${domain}"
}
main() {
email=$1
domain=$2
generate_certificate "$1" "$2"
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment