Skip to content

Commit 4524ef1

Browse files
committed
fix(ingress): use issuewild CAA tag for wildcard domains
For wildcard domains like *.example.com, set CAA record on example.com with issuewild tag instead of issue tag on *.example.com.
1 parent edd773f commit 4524ef1

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,20 @@ set_caa_record() {
268268
return
269269
fi
270270

271+
local caa_domain caa_tag
272+
if [[ "$domain" == \*.* ]]; then
273+
caa_domain="${domain#\*.}"
274+
caa_tag="issuewild"
275+
else
276+
caa_domain="$domain"
277+
caa_tag="issue"
278+
fi
279+
271280
ACCOUNT_URI=$(jq -j '.uri' "$account_file")
272-
echo "Adding CAA record for $domain, accounturi=$ACCOUNT_URI"
281+
echo "Adding CAA record ($caa_tag) for $caa_domain, accounturi=$ACCOUNT_URI"
273282
dnsman.py set_caa \
274-
--domain "$domain" \
275-
--caa-tag "issue" \
283+
--domain "$caa_domain" \
284+
--caa-tag "$caa_tag" \
276285
--caa-value "letsencrypt.org;validationmethods=dns-01;accounturi=$ACCOUNT_URI"
277286

278287
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)