@@ 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
}