mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-07-08 14:57:27 +07:00
Add configuration option to disable registration endpoint (#51)
This commit is contained in:
@ -184,6 +184,8 @@ connection = "acme-dns.db"
|
|||||||
[api]
|
[api]
|
||||||
# domain name to listen requests for, mandatory if using tls = "letsencrypt"
|
# domain name to listen requests for, mandatory if using tls = "letsencrypt"
|
||||||
api_domain = ""
|
api_domain = ""
|
||||||
|
# disable registration endpoint
|
||||||
|
disable_registration = false
|
||||||
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
||||||
autocert_port = "80"
|
autocert_port = "80"
|
||||||
# listen ip, default "" listens on all interfaces/addresses
|
# listen ip, default "" listens on all interfaces/addresses
|
||||||
|
@ -36,6 +36,8 @@ connection = "/var/lib/acme-dns/acme-dns.db"
|
|||||||
api_domain = ""
|
api_domain = ""
|
||||||
# listen ip eg. 127.0.0.1
|
# listen ip eg. 127.0.0.1
|
||||||
ip = "0.0.0.0"
|
ip = "0.0.0.0"
|
||||||
|
# disable registration endpoint
|
||||||
|
disable_registration = false
|
||||||
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
||||||
autocert_port = "80"
|
autocert_port = "80"
|
||||||
# listen port, eg. 443 for default HTTPS
|
# listen port, eg. 443 for default HTTPS
|
||||||
|
4
main.go
4
main.go
@ -67,7 +67,9 @@ func startHTTPAPI() {
|
|||||||
// Logwriter for saner log output
|
// Logwriter for saner log output
|
||||||
c.Log = stdlog.New(logwriter, "", 0)
|
c.Log = stdlog.New(logwriter, "", 0)
|
||||||
}
|
}
|
||||||
api.POST("/register", webRegisterPost)
|
if !Config.API.DisableRegistration {
|
||||||
|
api.POST("/register", webRegisterPost)
|
||||||
|
}
|
||||||
api.POST("/update", Auth(webUpdatePost))
|
api.POST("/update", Auth(webUpdatePost))
|
||||||
|
|
||||||
host := Config.API.IP + ":" + Config.API.Port
|
host := Config.API.IP + ":" + Config.API.Port
|
||||||
|
21
types.go
21
types.go
@ -50,16 +50,17 @@ type dbsettings struct {
|
|||||||
|
|
||||||
// API config
|
// API config
|
||||||
type httpapi struct {
|
type httpapi struct {
|
||||||
Domain string `toml:"api_domain"`
|
Domain string `toml:"api_domain"`
|
||||||
IP string
|
IP string
|
||||||
AutocertPort string `toml:"autocert_port"`
|
DisableRegistration bool `toml:"disable_registration"`
|
||||||
Port string `toml:"port"`
|
AutocertPort string `toml:"autocert_port"`
|
||||||
TLS string
|
Port string `toml:"port"`
|
||||||
TLSCertPrivkey string `toml:"tls_cert_privkey"`
|
TLS string
|
||||||
TLSCertFullchain string `toml:"tls_cert_fullchain"`
|
TLSCertPrivkey string `toml:"tls_cert_privkey"`
|
||||||
CorsOrigins []string
|
TLSCertFullchain string `toml:"tls_cert_fullchain"`
|
||||||
UseHeader bool `toml:"use_header"`
|
CorsOrigins []string
|
||||||
HeaderName string `toml:"header_name"`
|
UseHeader bool `toml:"use_header"`
|
||||||
|
HeaderName string `toml:"header_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging config
|
// Logging config
|
||||||
|
Reference in New Issue
Block a user