gen cert scripts

This commit is contained in:
deflax 2021-10-10 13:39:51 +00:00
parent a1260602df
commit 3731d473cd
2 changed files with 19 additions and 0 deletions

7
gen-selfsigned.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
cd data/certificates
openssl genrsa -out default.key 2048
openssl req -new -key default.key -out default.csr
openssl x509 -req -days 3650 -in default.csr -signkey default.key -out default.crt
cat default.key default.crt >> default.pem

12
issue-certificate.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
CB=`docker ps --format='{{.Names}}' --filter=label=meta.role=certbot`
EMAIL=$2
CERTNAME=$1
DOMAIN=$1
docker exec $CB certbot certonly --non-interactive --standalone --email $2 --agree-tos --keep --preferred-challenges http --cert-name "$CERTNAME" -d "$DOMAIN"
cat ./data/certbot/etc/live/$CERTNAME/privkey.pem ./data/certbot/etc/live/$CERTNAME/fullchain.pem > /certificates/$CERTNAME.pem"