mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-08 00:51:04 +08:00
Dockerfile for DNS/HTTP wildcard server
This DNS/HTTP server enables the procurement of wildcard certs for sslip.io subdomains. Drive-by: - Removed the apostrophe from the initialized TXT string so that cutting-and-pasting the string is less difficult (but the backslashes and double quotes are still a pain). - The DNS/HTTP server logs output when the TXT record is updated. We log most actions, and this is perhaps the most important one, so it was an oversight that we didn't log it.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"golang.org/x/net/dns/dnsmessage"
|
||||
)
|
||||
|
||||
var txt = `Set this TXT record: curl -X POST http://localhost/update -d '{"txt":"Certificate Authority's validation token"}'`
|
||||
var txt = `Set this TXT record: curl -X POST http://localhost/update -d '{"txt":"Certificate Authority validation token"}'`
|
||||
|
||||
// Txt is for parsing the JSON POST to set the DNS TXT record
|
||||
type Txt struct {
|
||||
@@ -131,5 +131,6 @@ func updateTxtHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
// this is the money shot, where we update the DNS TXT record to what was in the POST request
|
||||
log.Println("Updating TXT record from \"" + txt + "\" → \"" + updateTxt.Txt + "\".")
|
||||
txt = updateTxt.Txt
|
||||
}
|
||||
|
Reference in New Issue
Block a user