timewebcloud: fix subdomain support

This commit is contained in:
Fernandez Ludovic 2026-02-12 17:23:13 +01:00
commit 8f604c6860
2 changed files with 6 additions and 9 deletions

View file

@ -3,9 +3,11 @@ package internal
import "fmt"
type DNSRecord struct {
ID int `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
ID int `json:"id,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
// SubDomain is the full name of a subdomain (not only the subdomain label).
SubDomain string `json:"subdomain,omitempty"`
}

View file

@ -110,15 +110,10 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
return fmt.Errorf("timewebcloud: could not find zone for domain %q: %w", domain, err)
}
subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone)
if err != nil {
return fmt.Errorf("timewebcloud: %w", err)
}
record := internal.DNSRecord{
Type: "TXT",
Value: info.Value,
SubDomain: subDomain,
SubDomain: dns01.UnFqdn(info.EffectiveFQDN),
}
response, err := d.client.CreateRecord(context.Background(), authZone, record)