lua-resty-acme icon indicating copy to clipboard operation
lua-resty-acme copied to clipboard

feat: support dns-01 challenge

Open yuweizzz opened this issue 1 year ago • 2 comments

support dns-01 challenge.

yuweizzz avatar May 07 '24 09:05 yuweizzz

we still need to return a wildcard domain in domain_whitelist/domain_whitelist_callback if we quire a wildcard domain cert, do you think the new way is ok?

yuweizzz avatar May 15 '24 08:05 yuweizzz

we still need to return a wildcard domain in domain_whitelist/domain_whitelist_callback if we quire a wildcard domain cert, do you think the new way is ok?

I think you missed part of the code in commit, but I get your idea, it works for me. Basically we can do:

local WILDCARD_MATCHED = {}
function is_domain_whitelisted(domain)
  if whitelist[domain] then
    return domain
  else if regex match then
    return WILDCARD_MATCHED 
  end
  return false
end

then

local matched = is_domain_whitelisted(domain)
if matched WILDCARD_MATCHED  then
  --is wildcard match
else if matched then
  --is exact match
else
 --not match
end

fffonion avatar May 15 '24 08:05 fffonion

I will do a final cleanup of commits and merge to master https://github.com/fffonion/lua-resty-acme/pull/115

fffonion avatar May 22 '24 04:05 fffonion

Thanks for this big PR, awesome work! @yuweizzz

fffonion avatar May 22 '24 04:05 fffonion