fix(ssl): configure betapayments.tradhox.com certificate and remove partner-api fallback
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 34s

This commit is contained in:
vickytechkey 2026-10-18 22:04:17 +05:30
parent 493b204d32
commit 852aa0ad33

View file

@ -119,19 +119,13 @@ jobs:
}
# ── 5. Ensure SSL Certificate Exists for betapayments.tradhox.com ─
if [ ! -d "/etc/letsencrypt/live/betapayments.tradhox.com" ]; then
if [ ! -f "/etc/letsencrypt/live/betapayments.tradhox.com/fullchain.pem" ]; then
echo "Requesting SSL certificate for betapayments.tradhox.com..."
sudo systemctl stop nginx || true
sudo certbot certonly --standalone -d betapayments.tradhox.com --non-interactive --agree-tos --register-unsafely-without-email || true
sudo certbot certonly --standalone -d betapayments.tradhox.com --non-interactive --agree-tos -m devops@tradhox.com || true
sudo systemctl start nginx || true
fi
# Fallback if certificate was not created
if [ ! -f "/etc/letsencrypt/live/betapayments.tradhox.com/fullchain.pem" ]; then
echo "Warning: betapayments.tradhox.com cert not present, falling back to existing partner cert temporarily..."
sed -i 's|/etc/letsencrypt/live/betapayments.tradhox.com|/etc/letsencrypt/live/betapartner-api.tradhox.com|g' /tmp/nginx-proxy.conf
fi
# ── 6. Nginx Config ───────────────────────────────────────────
sudo cp /tmp/nginx-proxy.conf /etc/nginx/sites-available/paymentservice
sudo ln -sf /etc/nginx/sites-available/paymentservice /etc/nginx/sites-enabled/paymentservice