add AXFR request handling to support slaves
E2E Tests / e2e-tests (pull_request) Failing after 7s
golangci-lint / lint (pull_request) Failing after 4s
Go Coverage / Build and Test (pull_request) Failing after 13m36s

This commit is contained in:
Simon Zeyer
2026-02-24 19:50:54 +00:00
parent 87db76cf39
commit b2701161cb
3 changed files with 159 additions and 0 deletions
+44
View File
@@ -263,6 +263,50 @@ func (d *acmednsdb) GetByUsername(u uuid.UUID) (acmedns.ACMETxt, error) {
return acmedns.ACMETxt{}, fmt.Errorf("user not found: %s", u.String())
}
func (d *acmednsdb) GetTXTForAllDomains() ([]acmedns.TXTRecord, error) {
d.Mutex.Lock()
defer d.Mutex.Unlock()
var txts []acmedns.TXTRecord
getSQL := `
SELECT Subdomain, Value FROM txt
`
if d.Config.Database.Engine == "sqlite" {
getSQL = getSQLiteStmt(getSQL)
}
sm, err := d.DB.Prepare(getSQL)
if err != nil {
return txts, err
}
defer sm.Close()
rows, err := sm.Query()
if err != nil {
return txts, err
}
defer rows.Close()
for rows.Next() {
var subdomain string
var value string
err = rows.Scan(&subdomain, &value)
if err != nil {
return txts, err
}
d.Logger.Debugw("GetTXTForAllDomains() TXT Record:", subdomain, value)
txts = append(txts, acmedns.TXTRecord{
Subdomain: subdomain,
Value: value,
})
}
return txts, nil
}
func (d *acmednsdb) GetTXTForDomain(domain string) ([]string, error) {
d.Mutex.Lock()
defer d.Mutex.Unlock()