From 729eadee33a43a1e8687affe90f39363e7ec774a Mon Sep 17 00:00:00 2001 From: Timothy Kim Date: Fri, 20 Mar 2026 16:55:52 -0400 Subject: [PATCH] use *.*.conf glob to match only domain conf files for cert issuance --- scripts/deploy.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index a87c8a7..9051066 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -88,10 +88,8 @@ fi if [ "$APP" = "nginx" ]; then # Issue certs for any new domains (brief nginx downtime while certbot binds port 80) missing_certs=false - for conf in /opt/hantim/docker/nginx/conf.d/*.conf; do + for conf in /opt/hantim/docker/nginx/conf.d/*.*.conf; do cert_name=$(basename "$conf" .conf) - # skip catch-all default server blocks (server_name _) - grep -qP 'server_name\s+_\s*;' "$conf" && continue if [ ! -d "/etc/letsencrypt/live/$cert_name" ]; then missing_certs=true break @@ -100,10 +98,8 @@ if [ "$APP" = "nginx" ]; then if [ "$missing_certs" = true ]; then docker stop nginx 2>/dev/null || true trap 'docker start nginx 2>/dev/null || true' EXIT - for conf in /opt/hantim/docker/nginx/conf.d/*.conf; do + for conf in /opt/hantim/docker/nginx/conf.d/*.*.conf; do cert_name=$(basename "$conf" .conf) - # skip catch-all default server blocks (server_name _) - grep -qP 'server_name\s+_\s*;' "$conf" && continue if [ ! -d "/etc/letsencrypt/live/$cert_name" ]; then domains=$(grep -oP 'server_name\s+\K[^;]+' "$conf" | tr ' ' '\n' | sort -u) domain_args=""