diff --git a/main.go b/main.go index 8147055..3b3cf54 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,10 @@ import ( "syscall" "time" + "github.com/golang-jwt/jwt/v5" + "github.com/sirupsen/logrus" + "go.uber.org/automaxprocs/maxprocs" + "github.com/UnAfraid/wg-ui/pkg/api" "github.com/UnAfraid/wg-ui/pkg/auth" "github.com/UnAfraid/wg-ui/pkg/config" @@ -21,9 +25,6 @@ import ( "github.com/UnAfraid/wg-ui/pkg/subscription" "github.com/UnAfraid/wg-ui/pkg/user" "github.com/UnAfraid/wg-ui/pkg/wg" - "github.com/golang-jwt/jwt/v5" - "github.com/sirupsen/logrus" - "go.uber.org/automaxprocs/maxprocs" ) const ( diff --git a/pkg/api/internal/directive/directive_authenticated.go b/pkg/api/internal/directive/directive_authenticated.go index 393a2b0..7521aa9 100755 --- a/pkg/api/internal/directive/directive_authenticated.go +++ b/pkg/api/internal/directive/directive_authenticated.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/99designs/gqlgen/graphql" + "github.com/UnAfraid/wg-ui/pkg/api/internal/model" ) diff --git a/pkg/api/internal/handler/authentication_handler.go b/pkg/api/internal/handler/authentication_handler.go index a3128ed..e7b6b4a 100644 --- a/pkg/api/internal/handler/authentication_handler.go +++ b/pkg/api/internal/handler/authentication_handler.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/99designs/gqlgen/graphql/handler/transport" + "github.com/UnAfraid/wg-ui/pkg/api/internal/model" "github.com/UnAfraid/wg-ui/pkg/auth" "github.com/UnAfraid/wg-ui/pkg/user" diff --git a/pkg/api/internal/handler/dataloader_middleware.go b/pkg/api/internal/handler/dataloader_middleware.go index f3d0f42..65c23c9 100755 --- a/pkg/api/internal/handler/dataloader_middleware.go +++ b/pkg/api/internal/handler/dataloader_middleware.go @@ -6,12 +6,13 @@ import ( "net/http" "time" + "github.com/graph-gophers/dataloader/v7" + "github.com/UnAfraid/wg-ui/pkg/api/internal/model" "github.com/UnAfraid/wg-ui/pkg/internal/adapt" "github.com/UnAfraid/wg-ui/pkg/peer" "github.com/UnAfraid/wg-ui/pkg/server" "github.com/UnAfraid/wg-ui/pkg/user" - "github.com/graph-gophers/dataloader/v7" ) var ( diff --git a/pkg/api/internal/mutation/mutation_resolver.go b/pkg/api/internal/mutation/mutation_resolver.go index c523954..92eaaca 100755 --- a/pkg/api/internal/mutation/mutation_resolver.go +++ b/pkg/api/internal/mutation/mutation_resolver.go @@ -3,11 +3,12 @@ package mutation import ( "context" + "golang.zx2c4.com/wireguard/wgctrl/wgtypes" + "github.com/UnAfraid/wg-ui/pkg/api/internal/model" "github.com/UnAfraid/wg-ui/pkg/api/internal/resolver" "github.com/UnAfraid/wg-ui/pkg/auth" "github.com/UnAfraid/wg-ui/pkg/manage" - "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) type mutationResolver struct { diff --git a/pkg/api/internal/query/helper.go b/pkg/api/internal/query/helper.go index 764a7d3..39b0e4a 100644 --- a/pkg/api/internal/query/helper.go +++ b/pkg/api/internal/query/helper.go @@ -6,11 +6,12 @@ import ( "fmt" "sync" + "github.com/graph-gophers/dataloader/v7" + "github.com/UnAfraid/wg-ui/pkg/api/internal/handler" "github.com/UnAfraid/wg-ui/pkg/api/internal/model" "github.com/UnAfraid/wg-ui/pkg/api/internal/resolver" "github.com/UnAfraid/wg-ui/pkg/internal/adapt" - "github.com/graph-gophers/dataloader/v7" ) func idsToStringIds(idKind model.IdKind, ids []*model.ID) ([]string, error) { diff --git a/pkg/api/router.go b/pkg/api/router.go index 9687b7e..24ab753 100755 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -10,6 +10,11 @@ import ( "github.com/99designs/gqlgen/graphql/handler/lru" "github.com/99designs/gqlgen/graphql/handler/transport" gqlplayground "github.com/99designs/gqlgen/graphql/playground" + "github.com/go-chi/chi/v5" + "github.com/gorilla/websocket" + "github.com/rs/cors" + "github.com/sirupsen/logrus" + "github.com/UnAfraid/wg-ui/pkg/api/internal/handler" "github.com/UnAfraid/wg-ui/pkg/api/internal/resolver" "github.com/UnAfraid/wg-ui/pkg/api/internal/tools/frontend" @@ -23,10 +28,6 @@ import ( "github.com/UnAfraid/wg-ui/pkg/server" "github.com/UnAfraid/wg-ui/pkg/user" "github.com/UnAfraid/wg-ui/pkg/wg" - "github.com/go-chi/chi/v5" - "github.com/gorilla/websocket" - "github.com/rs/cors" - "github.com/sirupsen/logrus" ) const ( diff --git a/pkg/datastore/bbolt/peer_repository.go b/pkg/datastore/bbolt/peer_repository.go index 66ae3b2..cb3e022 100644 --- a/pkg/datastore/bbolt/peer_repository.go +++ b/pkg/datastore/bbolt/peer_repository.go @@ -9,9 +9,10 @@ import ( "time" "github.com/UnAfraid/searchindex" + "go.etcd.io/bbolt" + "github.com/UnAfraid/wg-ui/pkg/internal/adapt" "github.com/UnAfraid/wg-ui/pkg/peer" - "go.etcd.io/bbolt" ) const ( diff --git a/pkg/datastore/bbolt/server_repository.go b/pkg/datastore/bbolt/server_repository.go index bf77548..a5acc75 100644 --- a/pkg/datastore/bbolt/server_repository.go +++ b/pkg/datastore/bbolt/server_repository.go @@ -9,9 +9,10 @@ import ( "time" "github.com/UnAfraid/searchindex" + "go.etcd.io/bbolt" + "github.com/UnAfraid/wg-ui/pkg/internal/adapt" "github.com/UnAfraid/wg-ui/pkg/server" - "go.etcd.io/bbolt" ) const ( diff --git a/pkg/datastore/bbolt/user_repository.go b/pkg/datastore/bbolt/user_repository.go index edd6b96..60d2245 100644 --- a/pkg/datastore/bbolt/user_repository.go +++ b/pkg/datastore/bbolt/user_repository.go @@ -9,8 +9,9 @@ import ( "time" "github.com/UnAfraid/searchindex" - "github.com/UnAfraid/wg-ui/pkg/user" "go.etcd.io/bbolt" + + "github.com/UnAfraid/wg-ui/pkg/user" ) const ( diff --git a/pkg/manage/service.go b/pkg/manage/service.go index 6215d00..67a43c2 100644 --- a/pkg/manage/service.go +++ b/pkg/manage/service.go @@ -5,11 +5,12 @@ import ( "errors" "time" + "github.com/sirupsen/logrus" + "github.com/UnAfraid/wg-ui/pkg/peer" "github.com/UnAfraid/wg-ui/pkg/server" "github.com/UnAfraid/wg-ui/pkg/user" "github.com/UnAfraid/wg-ui/pkg/wg" - "github.com/sirupsen/logrus" ) type Service interface { diff --git a/pkg/peer/service.go b/pkg/peer/service.go index 056eaa2..e7c4cb5 100644 --- a/pkg/peer/service.go +++ b/pkg/peer/service.go @@ -8,10 +8,11 @@ import ( "strings" "time" - "github.com/UnAfraid/wg-ui/pkg/server" - "github.com/UnAfraid/wg-ui/pkg/subscription" "github.com/google/uuid" "github.com/sirupsen/logrus" + + "github.com/UnAfraid/wg-ui/pkg/server" + "github.com/UnAfraid/wg-ui/pkg/subscription" ) var ( diff --git a/pkg/server/server.go b/pkg/server/server.go index fab58bb..ab788d9 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -10,8 +10,9 @@ import ( "strings" "time" - "github.com/UnAfraid/wg-ui/pkg/internal/adapt" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" + + "github.com/UnAfraid/wg-ui/pkg/internal/adapt" ) var namePattern = regexp.MustCompile("[a-zA-Z0-9.-_]{1,16}") diff --git a/pkg/server/service.go b/pkg/server/service.go index a1832da..609baf9 100644 --- a/pkg/server/service.go +++ b/pkg/server/service.go @@ -8,10 +8,11 @@ import ( "strings" "time" - "github.com/UnAfraid/wg-ui/pkg/subscription" "github.com/google/uuid" "github.com/sirupsen/logrus" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" + + "github.com/UnAfraid/wg-ui/pkg/subscription" ) var ( diff --git a/pkg/user/service.go b/pkg/user/service.go index 4351f60..1db708b 100644 --- a/pkg/user/service.go +++ b/pkg/user/service.go @@ -9,9 +9,10 @@ import ( "strings" "time" - "github.com/UnAfraid/wg-ui/pkg/subscription" "github.com/google/uuid" "github.com/sirupsen/logrus" + + "github.com/UnAfraid/wg-ui/pkg/subscription" ) var ( diff --git a/pkg/wg/interface_linux.go b/pkg/wg/interface_linux.go index 8d03a6c..5e8c363 100644 --- a/pkg/wg/interface_linux.go +++ b/pkg/wg/interface_linux.go @@ -8,9 +8,10 @@ import ( "slices" "strings" - "github.com/UnAfraid/wg-ui/pkg/server" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" + + "github.com/UnAfraid/wg-ui/pkg/server" ) func configureInterface(name string, address string, mtu int) error { diff --git a/pkg/wg/service.go b/pkg/wg/service.go index bb5016b..e453cd2 100644 --- a/pkg/wg/service.go +++ b/pkg/wg/service.go @@ -8,12 +8,13 @@ import ( "strings" "time" - "github.com/UnAfraid/wg-ui/pkg/internal/adapt" - "github.com/UnAfraid/wg-ui/pkg/peer" - "github.com/UnAfraid/wg-ui/pkg/server" "github.com/sirupsen/logrus" "golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" + + "github.com/UnAfraid/wg-ui/pkg/internal/adapt" + "github.com/UnAfraid/wg-ui/pkg/peer" + "github.com/UnAfraid/wg-ui/pkg/server" ) const (