Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
830cceb62c | ||
|
|
9f896759f0 | ||
|
|
476f6fc555 | ||
|
|
e2e84ede6b | ||
|
|
562d7cbad4 |
@@ -0,0 +1,17 @@
|
|||||||
|
builds:
|
||||||
|
- binary: acme-dns
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- 386
|
||||||
|
- amd64
|
||||||
|
|
||||||
|
archive:
|
||||||
|
format: tar.gz
|
||||||
|
files:
|
||||||
|
- LICENSE
|
||||||
|
- README.md
|
||||||
|
- Dockerfile
|
||||||
|
- config.cfg
|
||||||
@@ -14,6 +14,7 @@ COPY --from=builder /go/src/github.com/joohoi/acme-dns .
|
|||||||
RUN mkdir -p /etc/acme-dns
|
RUN mkdir -p /etc/acme-dns
|
||||||
RUN mkdir -p /var/lib/acme-dns
|
RUN mkdir -p /var/lib/acme-dns
|
||||||
RUN rm -rf ./config.cfg
|
RUN rm -rf ./config.cfg
|
||||||
|
RUN apk --no-cache add ca-certificates && update-ca-certificates
|
||||||
|
|
||||||
VOLUME ["/etc/acme-dns", "/var/lib/acme-dns"]
|
VOLUME ["/etc/acme-dns", "/var/lib/acme-dns"]
|
||||||
ENTRYPOINT ["./acme-dns"]
|
ENTRYPOINT ["./acme-dns"]
|
||||||
|
|||||||
@@ -186,6 +186,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 = ""
|
||||||
|
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
||||||
|
autocert_port = "80"
|
||||||
# listen port, eg. 443 for default HTTPS
|
# listen port, eg. 443 for default HTTPS
|
||||||
port = "8080"
|
port = "8080"
|
||||||
# possible values: "letsencrypt", "cert", "none"
|
# possible values: "letsencrypt", "cert", "none"
|
||||||
@@ -214,6 +216,9 @@ header_name = "X-Forwarded-For"
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
- v0.3.2 Dockerfile was fixed for users using autocert feature
|
||||||
|
- v0.3.1 Added goreleaser for distributing binary builds of the releases
|
||||||
|
- v0.3 Changed autocert to use HTTP-01 challenges, as TLS-SNI is disabled by Let's Encrypt
|
||||||
- v0.2 Now powered by httprouter, support wildcard certificates, Docker images
|
- v0.2 Now powered by httprouter, support wildcard certificates, Docker images
|
||||||
- v0.1 Initial release
|
- v0.1 Initial release
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
# autocert HTTP port, eg. 80 for answering Let's Encrypt HTTP-01 challenges. Mandatory if using tls = "letsencrypt".
|
||||||
|
autocert_port = "80"
|
||||||
# listen port, eg. 443 for default HTTPS
|
# listen port, eg. 443 for default HTTPS
|
||||||
port = "80"
|
port = "80"
|
||||||
# possible values: "letsencrypt", "cert", "none"
|
# possible values: "letsencrypt", "cert", "none"
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ func startHTTPAPI() {
|
|||||||
Prompt: autocert.AcceptTOS,
|
Prompt: autocert.AcceptTOS,
|
||||||
HostPolicy: autocert.HostWhitelist(Config.API.Domain),
|
HostPolicy: autocert.HostWhitelist(Config.API.Domain),
|
||||||
}
|
}
|
||||||
|
autocerthost := Config.API.IP + ":" + Config.API.AutocertPort
|
||||||
|
log.WithFields(log.Fields{"autocerthost": autocerthost, "domain": Config.API.Domain}).Debug("Opening HTTP port for autocert")
|
||||||
|
go http.ListenAndServe(autocerthost, m.HTTPHandler(nil))
|
||||||
cfg.GetCertificate = m.GetCertificate
|
cfg.GetCertificate = m.GetCertificate
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: host,
|
Addr: host,
|
||||||
@@ -90,7 +93,7 @@ func startHTTPAPI() {
|
|||||||
TLSConfig: cfg,
|
TLSConfig: cfg,
|
||||||
ErrorLog: stdlog.New(logwriter, "", 0),
|
ErrorLog: stdlog.New(logwriter, "", 0),
|
||||||
}
|
}
|
||||||
log.WithFields(log.Fields{"host": host, "domain": Config.API.Domain}).Info("Listening HTTPS autocert")
|
log.WithFields(log.Fields{"host": host, "domain": Config.API.Domain}).Info("Listening HTTPS, using certificate from autocert")
|
||||||
log.Fatal(srv.ListenAndServeTLS("", ""))
|
log.Fatal(srv.ListenAndServeTLS("", ""))
|
||||||
case "cert":
|
case "cert":
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ type dbsettings struct {
|
|||||||
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"`
|
||||||
Port string `toml:"port"`
|
Port string `toml:"port"`
|
||||||
TLS string
|
TLS string
|
||||||
TLSCertPrivkey string `toml:"tls_cert_privkey"`
|
TLSCertPrivkey string `toml:"tls_cert_privkey"`
|
||||||
|
|||||||
Reference in New Issue
Block a user