skip default server block in cert issuance, remove ssh debug lines
This commit is contained in:
@@ -17,8 +17,7 @@ jobs:
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
|
||||
chmod 600 ~/.ssh/deploy_key
|
||||
cat ~/.ssh/known_hosts
|
||||
ssh -v -o StrictHostKeyChecking=yes -i ~/.ssh/deploy_key deploy@${{ vars.DEPLOY_HOST }} deploy-nginx
|
||||
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/deploy_key deploy@${{ vars.DEPLOY_HOST }} deploy-nginx
|
||||
|
||||
test:
|
||||
needs: deploy
|
||||
|
||||
@@ -90,6 +90,8 @@ if [ "$APP" = "nginx" ]; then
|
||||
missing_certs=false
|
||||
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,6 +102,8 @@ if [ "$APP" = "nginx" ]; then
|
||||
trap 'docker start nginx 2>/dev/null || true' EXIT
|
||||
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=""
|
||||
|
||||
Reference in New Issue
Block a user