Skip to content

Commit cb9fba5

Browse files
committed
fix(dstack-ingress): stop the placeholder path reporting itself as a failure
On a first tls-alpn-01 run the log read: Generating placeholder certificate for app.example.com Warning: Cert files missing for app.example.com, skipping The warning is what build_combined_pems prints whenever lego has no certificate yet, which on the first pass is exactly the situation the placeholder exists to cover. Nothing is wrong -- skipping is what keeps the placeholder in place so haproxy can bind and forward acme-tls/1 -- but back to back with the line above it reads like the placeholder was discarded, and it is the first thing a new deployment shows. Distinguish the two cases: keeping a placeholder is normal, having neither a certificate nor a placeholder is not. dns-01 has no placeholder, so its copy keeps the original wording.
1 parent ed3ca43 commit cb9fba5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

custom-domain/dstack-ingress/scripts/tlsalpn.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,13 @@ build_combined_pems() {
161161
cat "$fullchain" "$privkey" > "$combined"
162162
chmod 600 "$combined"
163163
echo "Combined PEM created: ${combined}"
164+
elif [ -f "$combined" ]; then
165+
# Expected on a first run: ensure_placeholder_certs has already put a
166+
# self-signed certificate here so haproxy can bind and forward
167+
# acme-tls/1, and the real one does not exist yet. Leave it alone.
168+
echo "No certificate for ${domain} yet; serving the placeholder"
164169
else
165-
echo "Warning: Cert files missing for ${domain}, skipping"
170+
echo "Warning: no certificate or placeholder for ${domain}, skipping"
166171
fi
167172
done <<<"$(get-all-domains.sh)"
168173
}

0 commit comments

Comments
 (0)