diff --git a/api/api.go b/api/api.go index 4b16abf..cdb9954 100644 --- a/api/api.go +++ b/api/api.go @@ -2,17 +2,18 @@ package api import ( "bytes" - "emperror.dev/errors" "encoding/json" "fmt" - "github.com/apex/log" - "github.com/pterodactyl/wings/config" - "github.com/pterodactyl/wings/system" "io" "io/ioutil" "net/http" "strings" "time" + + "emperror.dev/errors" + "github.com/apex/log" + "github.com/pterodactyl/wings/config" + "github.com/pterodactyl/wings/system" ) // Initializes the requester instance. diff --git a/api/process_configuration.go b/api/process_configuration.go index d16b9b2..b8849a7 100644 --- a/api/process_configuration.go +++ b/api/process_configuration.go @@ -2,10 +2,11 @@ package api import ( "encoding/json" - "github.com/apex/log" - "github.com/pterodactyl/wings/parser" "regexp" "strings" + + "github.com/apex/log" + "github.com/pterodactyl/wings/parser" ) type OutputLineMatcher struct { diff --git a/api/server_endpoints.go b/api/server_endpoints.go index ad47c75..acab7ff 100644 --- a/api/server_endpoints.go +++ b/api/server_endpoints.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "fmt" + "strconv" + "sync" + "github.com/apex/log" "github.com/pterodactyl/wings/config" "golang.org/x/sync/errgroup" - "strconv" - "sync" ) const ( diff --git a/api/sftp_endpoints.go b/api/sftp_endpoints.go index bc480eb..b1e0f39 100644 --- a/api/sftp_endpoints.go +++ b/api/sftp_endpoints.go @@ -1,9 +1,10 @@ package api import ( + "regexp" + "emperror.dev/errors" "github.com/apex/log" - "regexp" ) type SftpAuthRequest struct { diff --git a/cmd/config_finder.go b/cmd/config_finder.go index 4437f01..3e9f42a 100644 --- a/cmd/config_finder.go +++ b/cmd/config_finder.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/pterodactyl/wings/config" "os" "path/filepath" + + "github.com/pterodactyl/wings/config" ) // We've gone through a couple of iterations of where the configuration is stored. This diff --git a/cmd/configure.go b/cmd/configure.go index 8538721..93a9341 100644 --- a/cmd/configure.go +++ b/cmd/configure.go @@ -4,10 +4,6 @@ import ( "crypto/tls" "encoding/json" "fmt" - "github.com/AlecAivazis/survey/v2" - "github.com/AlecAivazis/survey/v2/terminal" - "github.com/pterodactyl/wings/config" - "github.com/spf13/cobra" "io/ioutil" "net/http" "net/url" @@ -15,6 +11,11 @@ import ( "path" "regexp" "time" + + "github.com/AlecAivazis/survey/v2" + "github.com/AlecAivazis/survey/v2/terminal" + "github.com/pterodactyl/wings/config" + "github.com/spf13/cobra" ) var ( diff --git a/cmd/diagnostics.go b/cmd/diagnostics.go index 12fcf02..5514723 100644 --- a/cmd/diagnostics.go +++ b/cmd/diagnostics.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/pterodactyl/wings/environment" "io" "io/ioutil" "net/http" @@ -16,6 +15,8 @@ import ( "strings" "time" + "github.com/pterodactyl/wings/environment" + "github.com/AlecAivazis/survey/v2" "github.com/AlecAivazis/survey/v2/terminal" "github.com/docker/docker/api/types" diff --git a/cmd/root.go b/cmd/root.go index d1e26a0..4ddf4f2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,8 +2,15 @@ package cmd import ( "crypto/tls" - "emperror.dev/errors" "fmt" + log2 "log" + "net/http" + "os" + "path" + "path/filepath" + "strings" + + "emperror.dev/errors" "github.com/NYTimes/logrotate" "github.com/apex/log" "github.com/apex/log/handlers/multi" @@ -21,12 +28,6 @@ import ( "github.com/spf13/cobra" "golang.org/x/crypto/acme" "golang.org/x/crypto/acme/autocert" - log2 "log" - "net/http" - "os" - "path" - "path/filepath" - "strings" ) var ( diff --git a/config/config.go b/config/config.go index 1b3fc4d..06c1157 100644 --- a/config/config.go +++ b/config/config.go @@ -1,12 +1,7 @@ package config import ( - "emperror.dev/errors" "fmt" - "github.com/cobaugh/osrelease" - "github.com/creasty/defaults" - "github.com/gbrlsnchs/jwt/v3" - "gopkg.in/yaml.v2" "io/ioutil" "os" "os/exec" @@ -14,6 +9,12 @@ import ( "strconv" "strings" "sync" + + "emperror.dev/errors" + "github.com/cobaugh/osrelease" + "github.com/creasty/defaults" + "github.com/gbrlsnchs/jwt/v3" + "gopkg.in/yaml.v2" ) const DefaultLocation = "/etc/pterodactyl/config.yml" diff --git a/config/config_docker.go b/config/config_docker.go index 5db650b..f538173 100644 --- a/config/config_docker.go +++ b/config/config_docker.go @@ -3,6 +3,7 @@ package config import ( "encoding/base64" "encoding/json" + "github.com/docker/docker/api/types" ) diff --git a/config/config_system.go b/config/config_system.go index b97cc76..c87dd21 100644 --- a/config/config_system.go +++ b/config/config_system.go @@ -2,9 +2,7 @@ package config import ( "context" - "emperror.dev/errors" "fmt" - "github.com/apex/log" "html/template" "io/ioutil" "os" @@ -13,6 +11,9 @@ import ( "path/filepath" "regexp" "time" + + "emperror.dev/errors" + "github.com/apex/log" ) // Defines basic system configuration settings. diff --git a/environment/allocations.go b/environment/allocations.go index b741f8a..b6b8c8d 100644 --- a/environment/allocations.go +++ b/environment/allocations.go @@ -2,9 +2,10 @@ package environment import ( "fmt" + "strconv" + "github.com/docker/go-connections/nat" "github.com/pterodactyl/wings/config" - "strconv" ) // Defines the allocations available for a given server. When using the Docker environment diff --git a/environment/docker.go b/environment/docker.go index 569c492..fb59b92 100644 --- a/environment/docker.go +++ b/environment/docker.go @@ -2,10 +2,11 @@ package environment import ( "context" - "github.com/apex/log" "strconv" "sync" + "github.com/apex/log" + "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" diff --git a/environment/environment.go b/environment/environment.go index 364af2c..c880161 100644 --- a/environment/environment.go +++ b/environment/environment.go @@ -1,8 +1,9 @@ package environment import ( - "github.com/pterodactyl/wings/events" "os" + + "github.com/pterodactyl/wings/events" ) const ( diff --git a/environment/settings.go b/environment/settings.go index 608124e..1878eb0 100644 --- a/environment/settings.go +++ b/environment/settings.go @@ -2,9 +2,10 @@ package environment import ( "fmt" - "github.com/apex/log" "math" "strconv" + + "github.com/apex/log" ) type Mount struct { diff --git a/events/events.go b/events/events.go index 7dde28c..de6589e 100644 --- a/events/events.go +++ b/events/events.go @@ -2,9 +2,10 @@ package events import ( "encoding/json" - "github.com/gammazero/workerpool" "strings" "sync" + + "github.com/gammazero/workerpool" ) type Event struct { diff --git a/events/pool.go b/events/pool.go index 0636eea..fd291e6 100644 --- a/events/pool.go +++ b/events/pool.go @@ -1,8 +1,9 @@ package events import ( - "github.com/gammazero/workerpool" "reflect" + + "github.com/gammazero/workerpool" ) type CallbackPool struct { diff --git a/installer/installer.go b/installer/installer.go index b046eca..2065fd0 100644 --- a/installer/installer.go +++ b/installer/installer.go @@ -1,8 +1,9 @@ package installer import ( - "emperror.dev/errors" "encoding/json" + + "emperror.dev/errors" "github.com/asaskevich/govalidator" "github.com/buger/jsonparser" "github.com/pterodactyl/wings/api" diff --git a/parser/helpers.go b/parser/helpers.go index afd1a58..ef60e44 100644 --- a/parser/helpers.go +++ b/parser/helpers.go @@ -2,16 +2,17 @@ package parser import ( "bytes" - "emperror.dev/errors" - "github.com/Jeffail/gabs/v2" - "github.com/apex/log" - "github.com/buger/jsonparser" - "github.com/iancoleman/strcase" "io/ioutil" "os" "regexp" "strconv" "strings" + + "emperror.dev/errors" + "github.com/Jeffail/gabs/v2" + "github.com/apex/log" + "github.com/buger/jsonparser" + "github.com/iancoleman/strcase" ) // Regex to match anything that has a value matching the format of {{ config.$1 }} which diff --git a/parser/parser.go b/parser/parser.go index 0bd03ac..a122b9b 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -2,8 +2,14 @@ package parser import ( "bufio" - "emperror.dev/errors" "encoding/json" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + + "emperror.dev/errors" "github.com/apex/log" "github.com/beevik/etree" "github.com/buger/jsonparser" @@ -12,11 +18,6 @@ import ( "github.com/pterodactyl/wings/config" "gopkg.in/ini.v1" "gopkg.in/yaml.v2" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" ) // The file parsing options that are available for a server configuration file. diff --git a/router/error.go b/router/error.go index bd610d3..f56876a 100644 --- a/router/error.go +++ b/router/error.go @@ -1,16 +1,17 @@ package router import ( - "emperror.dev/errors" "fmt" + "net/http" + "os" + "strings" + + "emperror.dev/errors" "github.com/apex/log" "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/pterodactyl/wings/server" "github.com/pterodactyl/wings/server/filesystem" - "net/http" - "os" - "strings" ) type RequestError struct { diff --git a/router/middleware.go b/router/middleware.go index 7635f5b..c3f32fd 100644 --- a/router/middleware.go +++ b/router/middleware.go @@ -1,14 +1,15 @@ package router import ( + "io" + "net/http" + "strings" + "emperror.dev/errors" "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/server" - "io" - "net/http" - "strings" ) type Middleware struct{} diff --git a/router/router_download.go b/router/router_download.go index 9bafa65..abd8960 100644 --- a/router/router_download.go +++ b/router/router_download.go @@ -3,12 +3,13 @@ package router import ( "bufio" "errors" - "github.com/gin-gonic/gin" - "github.com/pterodactyl/wings/router/tokens" - "github.com/pterodactyl/wings/server/backup" "net/http" "os" "strconv" + + "github.com/gin-gonic/gin" + "github.com/pterodactyl/wings/router/tokens" + "github.com/pterodactyl/wings/server/backup" ) // Handle a download request for a server backup. diff --git a/router/router_server.go b/router/router_server.go index 9726ceb..dae87a7 100644 --- a/router/router_server.go +++ b/router/router_server.go @@ -3,15 +3,16 @@ package router import ( "bytes" "context" + "net/http" + "os" + "strconv" + "emperror.dev/errors" "github.com/apex/log" "github.com/gin-gonic/gin" "github.com/pterodactyl/wings/router/downloader" "github.com/pterodactyl/wings/router/tokens" "github.com/pterodactyl/wings/server" - "net/http" - "os" - "strconv" ) type serverProcData struct { diff --git a/router/router_server_backup.go b/router/router_server_backup.go index 8a44af9..b0afd19 100644 --- a/router/router_server_backup.go +++ b/router/router_server_backup.go @@ -1,13 +1,14 @@ package router import ( - "emperror.dev/errors" "fmt" + "net/http" + "os" + + "emperror.dev/errors" "github.com/gin-gonic/gin" "github.com/pterodactyl/wings/server" "github.com/pterodactyl/wings/server/backup" - "net/http" - "os" ) // Backs up a server. diff --git a/router/router_server_ws.go b/router/router_server_ws.go index 8c7dadd..936e534 100644 --- a/router/router_server_ws.go +++ b/router/router_server_ws.go @@ -3,10 +3,11 @@ package router import ( "context" "encoding/json" + "time" + "github.com/gin-gonic/gin" ws "github.com/gorilla/websocket" "github.com/pterodactyl/wings/router/websocket" - "time" ) // Upgrades a connection to a websocket and passes events along between. diff --git a/router/router_system.go b/router/router_system.go index b3707e8..140decc 100644 --- a/router/router_system.go +++ b/router/router_system.go @@ -2,14 +2,15 @@ package router import ( "bytes" + "net/http" + "strings" + "github.com/apex/log" "github.com/gin-gonic/gin" "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/installer" "github.com/pterodactyl/wings/server" "github.com/pterodactyl/wings/system" - "net/http" - "strings" ) // Returns information about the system that wings is running on. diff --git a/router/router_transfer.go b/router/router_transfer.go index ed9bf94..ee13c97 100644 --- a/router/router_transfer.go +++ b/router/router_transfer.go @@ -3,10 +3,19 @@ package router import ( "bufio" "crypto/sha256" - "emperror.dev/errors" "encoding/hex" "encoding/json" "fmt" + "io" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + "sync/atomic" + "time" + + "emperror.dev/errors" "github.com/apex/log" "github.com/gin-gonic/gin" "github.com/google/uuid" @@ -19,14 +28,6 @@ import ( "github.com/pterodactyl/wings/router/tokens" "github.com/pterodactyl/wings/server" "github.com/pterodactyl/wings/system" - "io" - "net/http" - "os" - "path/filepath" - "strconv" - "strings" - "sync/atomic" - "time" ) // Number of ticks in the progress bar diff --git a/server/archiver.go b/server/archiver.go index f424963..f799fca 100644 --- a/server/archiver.go +++ b/server/archiver.go @@ -2,15 +2,16 @@ package server import ( "crypto/sha256" - "emperror.dev/errors" "encoding/hex" - "github.com/mholt/archiver/v3" - "github.com/pterodactyl/wings/config" - "github.com/pterodactyl/wings/server/filesystem" "io" "io/ioutil" "os" "path/filepath" + + "emperror.dev/errors" + "github.com/mholt/archiver/v3" + "github.com/pterodactyl/wings/config" + "github.com/pterodactyl/wings/server/filesystem" ) // Archiver represents a Server Archiver. diff --git a/server/backup.go b/server/backup.go index 7ec94cf..1e086d9 100644 --- a/server/backup.go +++ b/server/backup.go @@ -1,12 +1,13 @@ package server import ( + "io/ioutil" + "os" + "emperror.dev/errors" "github.com/apex/log" "github.com/pterodactyl/wings/api" "github.com/pterodactyl/wings/server/backup" - "io/ioutil" - "os" ) // Notifies the panel of a backup's state and returns an error if one is encountered diff --git a/server/config_parser.go b/server/config_parser.go index c8f231b..794d6e7 100644 --- a/server/config_parser.go +++ b/server/config_parser.go @@ -1,8 +1,9 @@ package server import ( - "github.com/gammazero/workerpool" "runtime" + + "github.com/gammazero/workerpool" ) // Parent function that will update all of the defined configuration files for a server diff --git a/server/configuration.go b/server/configuration.go index da7daaa..5013650 100644 --- a/server/configuration.go +++ b/server/configuration.go @@ -1,8 +1,9 @@ package server import ( - "github.com/pterodactyl/wings/environment" "sync" + + "github.com/pterodactyl/wings/environment" ) type Configuration struct { diff --git a/server/console.go b/server/console.go index 2e6d7d7..1a41f2b 100644 --- a/server/console.go +++ b/server/console.go @@ -2,14 +2,15 @@ package server import ( "context" - "emperror.dev/errors" "fmt" - "github.com/mitchellh/colorstring" - "github.com/pterodactyl/wings/config" - "github.com/pterodactyl/wings/system" "sync" "sync/atomic" "time" + + "emperror.dev/errors" + "github.com/mitchellh/colorstring" + "github.com/pterodactyl/wings/config" + "github.com/pterodactyl/wings/system" ) var ErrTooMuchConsoleData = errors.New("console is outputting too much data") @@ -114,7 +115,7 @@ func (ct *ConsoleThrottler) Increment(onTrigger func()) error { func (s *Server) Throttler() *ConsoleThrottler { s.throttleOnce.Do(func() { s.throttler = &ConsoleThrottler{ - isThrottled: system.NewAtomicBool(false), + isThrottled: system.NewAtomicBool(false), ConsoleThrottles: config.Get().Throttles, } }) diff --git a/server/crash.go b/server/crash.go index ddb8ecb..63f7480 100644 --- a/server/crash.go +++ b/server/crash.go @@ -2,11 +2,12 @@ package server import ( "fmt" - "github.com/pterodactyl/wings/config" - "github.com/pterodactyl/wings/environment" "strconv" "sync" "time" + + "github.com/pterodactyl/wings/config" + "github.com/pterodactyl/wings/environment" ) type CrashHandler struct { diff --git a/server/filesystem.go b/server/filesystem.go index 9e346d3..d86b526 100644 --- a/server/filesystem.go +++ b/server/filesystem.go @@ -1,8 +1,9 @@ package server import ( - "github.com/pterodactyl/wings/server/filesystem" "os" + + "github.com/pterodactyl/wings/server/filesystem" ) func (s *Server) Filesystem() *filesystem.Filesystem { diff --git a/server/install.go b/server/install.go index 21a9191..7faf69d 100644 --- a/server/install.go +++ b/server/install.go @@ -4,6 +4,13 @@ import ( "bufio" "bytes" "context" + "html/template" + "io" + "os" + "path/filepath" + "strconv" + "strings" + "emperror.dev/errors" "github.com/apex/log" "github.com/docker/docker/api/types" @@ -14,12 +21,6 @@ import ( "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/environment" "github.com/pterodactyl/wings/system" - "html/template" - "io" - "os" - "path/filepath" - "strconv" - "strings" ) // Executes the installation stack for a server process. Bubbles any errors up to the calling diff --git a/server/listeners.go b/server/listeners.go index 8318a75..767cbf1 100644 --- a/server/listeners.go +++ b/server/listeners.go @@ -2,14 +2,15 @@ package server import ( "encoding/json" + "regexp" + "strconv" + "sync" + "github.com/apex/log" "github.com/pterodactyl/wings/api" "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/environment" "github.com/pterodactyl/wings/events" - "regexp" - "strconv" - "sync" ) var dockerEvents = []string{ diff --git a/server/loader.go b/server/loader.go index 101987d..c2d401e 100644 --- a/server/loader.go +++ b/server/loader.go @@ -1,9 +1,14 @@ package server import ( - "emperror.dev/errors" "encoding/json" "fmt" + "os" + "path/filepath" + "runtime" + "time" + + "emperror.dev/errors" "github.com/apex/log" "github.com/gammazero/workerpool" "github.com/pterodactyl/wings/api" @@ -11,10 +16,6 @@ import ( "github.com/pterodactyl/wings/environment" "github.com/pterodactyl/wings/environment/docker" "github.com/pterodactyl/wings/server/filesystem" - "os" - "path/filepath" - "runtime" - "time" ) var servers = NewCollection(nil) diff --git a/server/mounts.go b/server/mounts.go index 2a23a2a..8530874 100644 --- a/server/mounts.go +++ b/server/mounts.go @@ -1,11 +1,12 @@ package server import ( + "path/filepath" + "strings" + "github.com/apex/log" "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/environment" - "path/filepath" - "strings" ) // To avoid confusion when working with mounts, assume that a server.Mount has not been properly diff --git a/server/power.go b/server/power.go index 0b4713c..0e08953 100644 --- a/server/power.go +++ b/server/power.go @@ -2,12 +2,13 @@ package server import ( "context" + "os" + "time" + "emperror.dev/errors" "github.com/pterodactyl/wings/config" "github.com/pterodactyl/wings/environment" "golang.org/x/sync/semaphore" - "os" - "time" ) type PowerAction string diff --git a/server/resources.go b/server/resources.go index 8f873e9..f074af1 100644 --- a/server/resources.go +++ b/server/resources.go @@ -1,10 +1,11 @@ package server import ( - "github.com/pterodactyl/wings/environment" - "github.com/pterodactyl/wings/system" "sync" "sync/atomic" + + "github.com/pterodactyl/wings/environment" + "github.com/pterodactyl/wings/system" ) // Defines the current resource usage for a given server instance. If a server is offline you diff --git a/server/server.go b/server/server.go index c2e2798..f7acc9a 100644 --- a/server/server.go +++ b/server/server.go @@ -2,8 +2,11 @@ package server import ( "context" - "emperror.dev/errors" "fmt" + "strings" + "sync" + + "emperror.dev/errors" "github.com/apex/log" "github.com/creasty/defaults" "github.com/pterodactyl/wings/api" @@ -14,8 +17,6 @@ import ( "github.com/pterodactyl/wings/server/filesystem" "github.com/pterodactyl/wings/system" "golang.org/x/sync/semaphore" - "strings" - "sync" ) // High level definition for a server instance being controlled by Wings. diff --git a/server/state.go b/server/state.go index c845e46..682b8b7 100644 --- a/server/state.go +++ b/server/state.go @@ -2,12 +2,13 @@ package server import ( "encoding/json" - "github.com/pterodactyl/wings/config" - "github.com/pterodactyl/wings/environment" "io" "io/ioutil" "os" "sync" + + "github.com/pterodactyl/wings/config" + "github.com/pterodactyl/wings/environment" ) var stateMutex sync.Mutex diff --git a/server/update.go b/server/update.go index dee759e..cc45946 100644 --- a/server/update.go +++ b/server/update.go @@ -1,8 +1,9 @@ package server import ( - "emperror.dev/errors" "encoding/json" + + "emperror.dev/errors" "github.com/buger/jsonparser" "github.com/imdario/mergo" "github.com/pterodactyl/wings/environment" diff --git a/server/websockets.go b/server/websockets.go index bfa87fa..2669a0c 100644 --- a/server/websockets.go +++ b/server/websockets.go @@ -2,8 +2,9 @@ package server import ( "context" - "github.com/google/uuid" "sync" + + "github.com/google/uuid" ) type WebsocketBag struct { diff --git a/sftp/handler.go b/sftp/handler.go index 257c4e6..68eed8c 100644 --- a/sftp/handler.go +++ b/sftp/handler.go @@ -1,14 +1,15 @@ package sftp import ( - "github.com/apex/log" - "github.com/patrickmn/go-cache" - "github.com/pkg/sftp" "io" "io/ioutil" "os" "path/filepath" "sync" + + "github.com/apex/log" + "github.com/patrickmn/go-cache" + "github.com/pkg/sftp" ) type FileSystem struct { diff --git a/sftp/server.go b/sftp/server.go index 82241a0..a0ae24b 100644 --- a/sftp/server.go +++ b/sftp/server.go @@ -6,11 +6,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "github.com/apex/log" - "github.com/patrickmn/go-cache" - "github.com/pkg/sftp" - "github.com/pterodactyl/wings/api" - "golang.org/x/crypto/ssh" "io" "io/ioutil" "net" @@ -18,6 +13,12 @@ import ( "path" "strings" "time" + + "github.com/apex/log" + "github.com/patrickmn/go-cache" + "github.com/pkg/sftp" + "github.com/pterodactyl/wings/api" + "golang.org/x/crypto/ssh" ) type Settings struct { diff --git a/system/system.go b/system/system.go index 2559873..5a9a3cb 100644 --- a/system/system.go +++ b/system/system.go @@ -1,8 +1,9 @@ package system import ( - "github.com/docker/docker/pkg/parsers/kernel" "runtime" + + "github.com/docker/docker/pkg/parsers/kernel" ) type Information struct {