Skip to content

Commit

Permalink
U: ssl @ certbot renew - fetch from domains
Browse files Browse the repository at this point in the history
  • Loading branch information
hqdNotional committed Jun 18, 2024
1 parent 5b08115 commit d849faf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ssl/certbot-renew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ CERTBOT_SERVER="https://acme-v02.api.letsencrypt.org/directory"
# Get configs
agent_id=$(docker ps -aqf "name=agent")
# DOMAINS=$(docker exec $agent_id curl -s "http://tasks.web_config/config/cloudflare.domains")
DOMAINS=$(docker exec $agent_id curl -s "http://tasks.web_config/config/cloudflare.$DOMAIN.domains")
EMAILS=$(docker exec $agent_id curl -s "http://tasks.web_config/config/cloudflare.$DOMAIN.emails")
CREDENTIAL=$(docker exec $agent_id curl -s "http://tasks.web_config/config/cloudflare.$DOMAIN.credential")
DOMAINS="*.${DOMAIN}"

# install binary if not exist
install_binary_if_not_exist () {
Expand Down Expand Up @@ -194,6 +194,8 @@ docker exec $CONTAINER_ID mkdir -p /etc/nginx/$TIMESTAMP
docker exec $CONTAINER_ID cp /etc/nginx/privkey.pem /etc/nginx/$TIMESTAMP/privkey.pem
docker exec $CONTAINER_ID cp /etc/nginx/fullchain.pem /etc/nginx/$TIMESTAMP/fullchain.pem

docker exec -it $CONTAINER_ID /bin/bash

# Update nginx proxy
echo "Reload and restart nginx proxy"
docker exec $CONTAINER_ID wget "http://tasks.web_config/config/${DOMAIN}_fullchain.pem" -O /etc/nginx/fullchain.pem
Expand Down

0 comments on commit d849faf

Please sign in to comment.