docker-letsencrypt/cert.sh

15 lines
717 B
Bash
Raw Normal View History

2015-12-05 23:47:49 -06:00
#!/bin/bash
path=$(pwd)
echo -n "Your Domain:"
read domain
docker-compose up -d
openssl genrsa 4096 > $path/certs/$domain.key
2015-12-06 00:16:22 -06:00
openssl req -new -sha256 -key $path/certs/$domain.key -subj "/CN=$domain" > $path/certs/$domain.csr
python $path/acme_tiny.py --account-key account.key --csr $path/certs/$domain.csr --acme-dir $path/www/ > $path/certs/pre.$domain.crt
2015-12-05 23:47:49 -06:00
wget -O - https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem > $path/certs/letsencrypt-intermediate.pem
2015-12-06 00:16:22 -06:00
cat $path/certs/pre.$domain.crt $path/certs/letsencrypt-intermediate.pem > $path/certs/$domain.crt
2015-12-05 23:47:49 -06:00
rm $path/certs/letsencrypt-intermediate.pem
2015-12-06 00:16:22 -06:00
rm $path/certs/pre.$domain.crt
2015-12-05 23:47:49 -06:00
rm $path/certs/$domain.csr
2015-12-06 00:28:15 -06:00
docker-compose stop
docker-compose rm -f