2
0
mirror of https://github.com/namecoin/ncdns synced 2024-11-16 00:13:01 +00:00

(WIP) Support tlsrestrictnsssync.

Tested and working; still need to run static analysis.
This commit is contained in:
JeremyRand 2018-09-19 15:45:31 +00:00
parent 5235417cf4
commit 9bcdd25a1d
No known key found for this signature in database
GPG Key ID: B3F2D165786D6570
2 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import "github.com/namecoin/ncdns/namecoin"
import "github.com/namecoin/ncdns/util"
import "github.com/namecoin/ncdns/ncdomain"
import "github.com/namecoin/ncdns/tlshook"
import "github.com/namecoin/tlsrestrictnss/tlsrestrictnsssync"
import "github.com/hlandau/xlog"
import "sync"
import "fmt"
@ -107,6 +108,11 @@ func convertEmail(email string) (string, error) {
// Do low-level queries against an abstract zone file. This is the per-query
// entrypoint from madns.
func (b *Backend) Lookup(qname string) (rrs []dns.RR, err error) {
if !tlsrestrictnsssync.IsReady() {
err = fmt.Errorf("tlsrestrictnss not ready")
return
}
btx := &btx{}
btx.b = b
btx.qname = qname

View File

@ -15,6 +15,7 @@ import (
"github.com/namecoin/ncdns/backend"
"github.com/namecoin/ncdns/namecoin"
"github.com/namecoin/ncdns/tlsoverridefirefox/tlsoverridefirefoxsync"
"github.com/namecoin/tlsrestrictnss/tlsrestrictnsssync"
"gopkg.in/hlandau/madns.v1"
)
@ -220,6 +221,11 @@ func (s *Server) Start() error {
return fmt.Errorf("Couldn't start Firefox override sync: %s", err)
}
err = tlsrestrictnsssync.Start()
if err != nil {
return fmt.Errorf("Couldn't start tlsrestrictnss sync: %s", err)
}
return nil
}