Compare commits
2 commits
bc35aece9b
...
5d94a64efe
Author | SHA1 | Date | |
---|---|---|---|
5d94a64efe | |||
87cb056ce3 |
2 changed files with 10 additions and 0 deletions
|
@ -42,5 +42,9 @@ func CreateConfig(path string, cfg *Config) {
|
|||
cfg.Zerooo.Location = filepath.Join(filepath.Dir(path), cfg.Zerooo.Location)
|
||||
}
|
||||
|
||||
if cfg.Zerooo.Endpoint == "" {
|
||||
cfg.Zerooo.Endpoint = "https://zer.ooo"
|
||||
}
|
||||
|
||||
Check(err, "Couldn't parse %q, err: %s", path, err)
|
||||
}
|
||||
|
|
6
http.go
6
http.go
|
@ -8,7 +8,9 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
import "golang.org/x/crypto/blowfish"
|
||||
|
@ -56,11 +58,13 @@ func NewHttpServer(manager *Manager) *httpServer {
|
|||
|
||||
func (it *httpServer) Start() {
|
||||
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /", strings.ToUpper(request.Method))
|
||||
writer.WriteHeader(200)
|
||||
writer.Write([]byte("Don't"))
|
||||
})
|
||||
|
||||
http.HandleFunc("/create-csr", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /create-csr", strings.ToUpper(request.Method))
|
||||
req := &CreateCSRRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
|
||||
|
@ -81,6 +85,7 @@ func (it *httpServer) Start() {
|
|||
})
|
||||
|
||||
http.HandleFunc("/deliver-crt", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /deliver-crt", strings.ToUpper(request.Method))
|
||||
req := &DeliverCertificateRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
if err != nil {
|
||||
|
@ -98,6 +103,7 @@ func (it *httpServer) Start() {
|
|||
})
|
||||
|
||||
http.HandleFunc("/update-openvpn-config", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /update-openvpn-config", strings.ToUpper(request.Method))
|
||||
req := &UpdateOpenVPNConfigRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue