Moved static records to more intuitive place
This commit is contained in:
parent
acf59bb0d4
commit
9b452f69ff
25
config.cfg
25
config.cfg
@ -5,18 +5,6 @@ domain = "auth.example.org"
|
|||||||
nsname = "ns1.auth.example.org"
|
nsname = "ns1.auth.example.org"
|
||||||
# admin email address, with @ substituted with .
|
# admin email address, with @ substituted with .
|
||||||
nsadmin = "admin.example.org"
|
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
|
# predefined records that we're serving in addition to the TXT
|
||||||
records = [
|
records = [
|
||||||
# default A
|
# default A
|
||||||
@ -29,6 +17,19 @@ records = [
|
|||||||
"auth.example.org. NS ns2.auth.example.org.",
|
"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]
|
[logconfig]
|
||||||
# logging level
|
# logging level
|
||||||
loglevel = "debug"
|
loglevel = "debug"
|
||||||
|
|||||||
2
main.go
2
main.go
@ -58,7 +58,7 @@ func main() {
|
|||||||
logging.SetBackend(logFormatter)
|
logging.SetBackend(logFormatter)
|
||||||
|
|
||||||
// Read the default records in
|
// Read the default records in
|
||||||
RR.Parse(DnsConf.Api.StaticRecords)
|
RR.Parse(DnsConf.General.StaticRecords)
|
||||||
|
|
||||||
// Open database
|
// Open database
|
||||||
err = DB.Init("acme-dns.db")
|
err = DB.Init("acme-dns.db")
|
||||||
|
|||||||
8
types.go
8
types.go
@ -23,9 +23,10 @@ type AuthMiddleware struct{}
|
|||||||
|
|
||||||
// Config file general section
|
// Config file general section
|
||||||
type general struct {
|
type general struct {
|
||||||
Domain string
|
Domain string
|
||||||
Nsname string
|
Nsname string
|
||||||
Nsadmin string
|
Nsadmin string
|
||||||
|
StaticRecords []string `toml:"records"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// API config
|
// API config
|
||||||
@ -35,7 +36,6 @@ type httpapi struct {
|
|||||||
Tls string
|
Tls string
|
||||||
Tls_cert_privkey string
|
Tls_cert_privkey string
|
||||||
Tls_cert_fullchain string
|
Tls_cert_fullchain string
|
||||||
StaticRecords []string `toml:"records"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging config
|
// Logging config
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user