From 74aa218cf06b49f6210785140d484b888da3c2e7 Mon Sep 17 00:00:00 2001 From: MarekWojt Date: Thu, 5 Jan 2023 20:15:33 +0100 Subject: [PATCH 1/3] fix missing text on auth/internal failure --- web/web.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/web.go b/web/web.go index 64367ae..83ef280 100644 --- a/web/web.go +++ b/web/web.go @@ -190,11 +190,13 @@ func authenticatedRequest(request func(ctx *fasthttp.RequestCtx)) func(ctx *fast authenticated, err := auth.IsPasswordAuthenticated(authRequest) if err != nil { + ctx.WriteString("Internal server error") ctx.SetStatusCode(fasthttp.StatusInternalServerError) return } if !authenticated { + ctx.WriteString("Authentication failed") ctx.SetStatusCode(fasthttp.StatusForbidden) return } From 6e2d00bd6cb79e8869bfc9264874f949e1172361 Mon Sep 17 00:00:00 2001 From: MarekWojt Date: Thu, 5 Jan 2023 20:16:52 +0100 Subject: [PATCH 2/3] fix ipv6 updating ipv4 in update both action --- web/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index 83ef280..bb8a303 100644 --- a/web/web.go +++ b/web/web.go @@ -148,7 +148,7 @@ func update(ctx *fasthttp.RequestCtx) { } if ipv6 != "" { - err := dns.UpdateIpv4(domain, ipv4) + err := dns.UpdateIpv6(domain, ipv6) if err != nil { ctx.WriteString(err.Error()) ctx.SetStatusCode(fasthttp.StatusNotFound) From 250cd56b19cce2cc98c26b99e608ba665610e325 Mon Sep 17 00:00:00 2001 From: MarekWojt Date: Thu, 5 Jan 2023 20:31:38 +0100 Subject: [PATCH 3/3] fix needed "." suffix in auth domain list --- auth/auth.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auth/auth.go b/auth/auth.go index 245059f..bc218d0 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -1,6 +1,7 @@ package auth import ( + "github.com/MarekWojt/gertdns/util" "github.com/raja/argon2pw" ) @@ -40,7 +41,8 @@ func (selfUser *userRaw) Tidy() (user, error) { // Create a map => faster access times parsedDomains := make(map[string]string) for _, domain := range selfUser.Domains { - parsedDomains[domain] = domain + parsedDomain := util.ParseDomain(domain) + parsedDomains[parsedDomain] = parsedDomain } parsedUser := user{