diff --git a/config.cfg b/config.cfg index e8c787a..c3644d1 100644 --- a/config.cfg +++ b/config.cfg @@ -5,18 +5,6 @@ domain = "auth.example.org" nsname = "ns1.auth.example.org" # admin email address, with @ substituted with . nsadmin = "admin.example.org" - -[api] -# domain name to listen requests for, mandatory if using tls = "letsencrypt" -# use "" (empty string) to bind to all interfaces -api_domain = "" -# listen port, eg. 443 for default HTTPS -port = "8080" -# possible values: "letsencrypt", "cert", "false" -tls = "letsencrypt" -# only used if tls = "cert" -tls_cert_privkey = "/etc/tls/example.org/privkey.pem" -tls_cert_fullchain = "/etc/tls/example.org/fullchain.pem" # predefined records that we're serving in addition to the TXT records = [ # default A @@ -29,6 +17,19 @@ records = [ "auth.example.org. NS ns2.auth.example.org.", ] + +[api] +# domain name to listen requests for, mandatory if using tls = "letsencrypt" +# use "" (empty string) to bind to all interfaces +api_domain = "" +# listen port, eg. 443 for default HTTPS +port = "8080" +# possible values: "letsencrypt", "cert", "false" +tls = "letsencrypt" +# only used if tls = "cert" +tls_cert_privkey = "/etc/tls/example.org/privkey.pem" +tls_cert_fullchain = "/etc/tls/example.org/fullchain.pem" + [logconfig] # logging level loglevel = "debug" diff --git a/main.go b/main.go index c6839c4..cce4118 100644 --- a/main.go +++ b/main.go @@ -58,7 +58,7 @@ func main() { logging.SetBackend(logFormatter) // Read the default records in - RR.Parse(DnsConf.Api.StaticRecords) + RR.Parse(DnsConf.General.StaticRecords) // Open database err = DB.Init("acme-dns.db") diff --git a/types.go b/types.go index a014834..02a282e 100644 --- a/types.go +++ b/types.go @@ -23,9 +23,10 @@ type AuthMiddleware struct{} // Config file general section type general struct { - Domain string - Nsname string - Nsadmin string + Domain string + Nsname string + Nsadmin string + StaticRecords []string `toml:"records"` } // API config @@ -35,7 +36,6 @@ type httpapi struct { Tls string Tls_cert_privkey string Tls_cert_fullchain string - StaticRecords []string `toml:"records"` } // Logging config