Refactoring (#327)
* chore: enable more linters and fix linter issues * ci: enable linter checks on all branches and disable recurring checks recurring linter checks don't make that much sense. The code & linter checks should not change on their own over night ;) * chore: update packages * Revert "chore: update packages" This reverts commit 30250bf28c4b39e9e5b3af012a4e28ab036bf9af. * chore: manually upgrade some packages
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package acmedns
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"net"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Check if IP belongs to an allowed net
|
||||
|
||||
@@ -2,6 +2,7 @@ package acmedns
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
||||
+2
-1
@@ -2,9 +2,10 @@ package acmedns
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"math/big"
|
||||
"regexp"
|
||||
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
func sanitizeIPv6addr(s string) string {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package acmedns
|
||||
|
||||
import (
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"os"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
func fakeConfig() AcmeDnsConfig {
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ func TestApiRegister(t *testing.T) {
|
||||
NotContainsKey("error")
|
||||
|
||||
allowfrom := map[string][]interface{}{
|
||||
"allowfrom": []interface{}{"123.123.123.123/32",
|
||||
"allowfrom": {"123.123.123.123/32",
|
||||
"2001:db8:a0b:12f0::1/32",
|
||||
"[::1]/64",
|
||||
},
|
||||
@@ -140,7 +140,7 @@ func TestApiRegisterBadAllowFrom(t *testing.T) {
|
||||
for _, v := range invalidVals {
|
||||
|
||||
allowfrom := map[string][]interface{}{
|
||||
"allowfrom": []interface{}{v}}
|
||||
"allowfrom": {v}}
|
||||
|
||||
response := e.POST("/register").
|
||||
WithJSON(allowfrom).
|
||||
|
||||
+2
-1
@@ -4,11 +4,12 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
type key int
|
||||
|
||||
@@ -2,9 +2,10 @@ package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
|
||||
"github.com/mholt/acmez/acme"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
// ChallengeProvider implements go-acme/lego Provider interface which is used for ACME DNS challenge handling
|
||||
|
||||
+2
-1
@@ -6,8 +6,9 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
// RegResponse is a struct for registration response JSON
|
||||
|
||||
+4
-2
@@ -2,11 +2,13 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"github.com/google/uuid"
|
||||
"regexp"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
func jsonError(message string) []byte {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"testing"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
|
||||
+4
-2
@@ -10,12 +10,14 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
_ "github.com/glebarez/go-sqlite"
|
||||
"github.com/google/uuid"
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
type acmednsdb struct {
|
||||
|
||||
@@ -4,10 +4,12 @@ import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"testing"
|
||||
|
||||
"github.com/erikstmartin/go-testdb"
|
||||
"go.uber.org/zap"
|
||||
"testing"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
type testResult struct {
|
||||
|
||||
@@ -5,14 +5,16 @@ import (
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"github.com/acme-dns/acme-dns/pkg/database"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/erikstmartin/go-testdb"
|
||||
"github.com/miekg/dns"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zaptest/observer"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"github.com/acme-dns/acme-dns/pkg/database"
|
||||
)
|
||||
|
||||
type resolver struct {
|
||||
|
||||
@@ -2,8 +2,9 @@ package nameserver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/miekg/dns"
|
||||
"strings"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
func (n *Nameserver) handleRequest(w dns.ResponseWriter, r *dns.Msg) {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package nameserver
|
||||
|
||||
import (
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
"github.com/miekg/dns"
|
||||
"go.uber.org/zap"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/acme-dns/acme-dns/pkg/acmedns"
|
||||
)
|
||||
|
||||
// Records is a slice of ResourceRecords
|
||||
|
||||
@@ -2,9 +2,10 @@ package nameserver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/miekg/dns"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
// ParseRecords parses a slice of DNS record string
|
||||
|
||||
Reference in New Issue
Block a user