From 230d0a96b7eccd5e586dadb29ce160e7089b57c6 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 28 Oct 2024 21:50:31 +0200 Subject: [PATCH] fix: set tsigKey when creating a domain --- internal/db/domains.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/db/domains.go b/internal/db/domains.go index 8be8ebd..b68b459 100644 --- a/internal/db/domains.go +++ b/internal/db/domains.go @@ -95,8 +95,9 @@ func FetchAllDomains() ([]Domain, error) { func CreateDomain(domain string, aRecord string, owner string) error { ulid := ulid.Make().String() apikey := util.GenAPIKey() - _, err := DBConn.Exec(`INSERT INTO domains(id, apikey, ddns_domain, a_record, owner) - VALUES ($1, $2, $3, $4, $5)`, ulid, apikey, domain, aRecord, owner) + tsigKey := util.GenTsigKey() + _, err := DBConn.Exec(`INSERT INTO domains(id, apikey, ddns_domain, a_record, tsigkey, owner) + VALUES ($1, $2, $3, $4, $5, $6)`, ulid, apikey, domain, aRecord, tsigKey, owner) if err != nil { return err } -- 2.44.1