Moved static records to more intuitive place

This commit is contained in:
Joona Hoikkala 2016-11-15 09:27:34 +02:00
parent acf59bb0d4
commit 9b452f69ff
No known key found for this signature in database
GPG Key ID: C14AAE0F5ADCB854
3 changed files with 18 additions and 17 deletions

View File

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

View File

@ -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")

View File

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