Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: update dependencies #198

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"crypto/tls"
"encoding/json"
"fmt"
"io"
"net/http"
Expand All @@ -13,7 +14,6 @@ import (

"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/terminal"
"github.com/goccy/go-json"
"github.com/spf13/cobra"

"github.com/pterodactyl/wings/config"
Expand Down
2 changes: 1 addition & 1 deletion cmd/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
Expand All @@ -19,7 +20,6 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/parsers/kernel"
"github.com/docker/docker/pkg/parsers/operatingsystem"
"github.com/goccy/go-json"
"github.com/spf13/cobra"

"github.com/pterodactyl/wings/config"
Expand Down
2 changes: 1 addition & 1 deletion config/config_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package config

import (
"encoding/base64"
"encoding/json"
"sort"

"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/registry"
"github.com/goccy/go-json"
)

type dockerNetworkInterfaces struct {
Expand Down
2 changes: 1 addition & 1 deletion environment/docker/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package docker

import (
"context"
"encoding/json"
"io"
"net/http"
"reflect"
Expand All @@ -13,7 +14,6 @@ import (
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/client"
"github.com/docker/docker/errdefs"
"github.com/goccy/go-json"

"github.com/pterodactyl/wings/config"
)
Expand Down
10 changes: 5 additions & 5 deletions environment/docker/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (e *Environment) Attach(ctx context.Context) error {
return nil
}

opts := types.ContainerAttachOptions{
opts := container.AttachOptions{
Stdin: true,
Stdout: true,
Stderr: true,
Expand Down Expand Up @@ -103,7 +103,7 @@ func (e *Environment) Attach(ctx context.Context) error {
// container. This allows memory, cpu, and IO limitations to be adjusted on the
// fly for individual instances.
func (e *Environment) InSituUpdate() error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

if _, err := e.ContainerInspect(ctx); err != nil {
Expand Down Expand Up @@ -270,7 +270,7 @@ func (e *Environment) Destroy() error {
// We set it to stopping than offline to prevent crash detection from being triggered.
e.SetState(environment.ProcessStoppingState)

err := e.client.ContainerRemove(context.Background(), e.Id, types.ContainerRemoveOptions{
err := e.client.ContainerRemove(context.Background(), e.Id, container.RemoveOptions{
RemoveVolumes: true,
RemoveLinks: false,
Force: true,
Expand Down Expand Up @@ -316,7 +316,7 @@ func (e *Environment) SendCommand(c string) error {
// is running or not, it will simply try to read the last X bytes of the file
// and return them.
func (e *Environment) Readlog(lines int) ([]string, error) {
r, err := e.client.ContainerLogs(context.Background(), e.Id, types.ContainerLogsOptions{
r, err := e.client.ContainerLogs(context.Background(), e.Id, container.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Tail: strconv.Itoa(lines),
Expand Down Expand Up @@ -355,7 +355,7 @@ func (e *Environment) ensureImageExists(image string) error {
// Give it up to 15 minutes to pull the image. I think this should cover 99.8% of cases where an
// image pull might fail. I can't imagine it will ever take more than 15 minutes to fully pull
// an image. Let me know when I am inevitably wrong here...
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*15)
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
defer cancel()

// Get a registry auth configuration from the config.
Expand Down
8 changes: 2 additions & 6 deletions environment/docker/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"emperror.dev/errors"
"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"

Expand All @@ -26,7 +25,7 @@ import (
// is running does not result in the server becoming un-bootable.
func (e *Environment) OnBeforeStart(ctx context.Context) error {
// Always destroy and re-create the server container to ensure that synced data from the Panel is used.
if err := e.client.ContainerRemove(ctx, e.Id, types.ContainerRemoveOptions{RemoveVolumes: true}); err != nil {
if err := e.client.ContainerRemove(ctx, e.Id, container.RemoveOptions{RemoveVolumes: true}); err != nil {
if !client.IsErrNotFound(err) {
return errors.WrapIf(err, "environment/docker: failed to remove container during pre-boot")
}
Expand Down Expand Up @@ -121,7 +120,7 @@ func (e *Environment) Start(ctx context.Context) error {
return errors.WrapIf(err, "environment/docker: failed to attach to container")
}

if err := e.client.ContainerStart(actx, e.Id, types.ContainerStartOptions{}); err != nil {
if err := e.client.ContainerStart(actx, e.Id, container.StartOptions{}); err != nil {
return errors.WrapIf(err, "environment/docker: failed to start container")
}

Expand Down Expand Up @@ -305,13 +304,11 @@ func (e *Environment) SignalContainer(ctx context.Context, signal string) error
}

return nil

}

// Terminate forcefully terminates the container using the signal provided.
// then sets its state to stopped.
func (e *Environment) Terminate(ctx context.Context, signal string) error {

// Send the signal to the container to kill it
if err := e.SignalContainer(ctx, signal); err != nil {
return errors.WithStack(err)
Expand All @@ -322,5 +319,4 @@ func (e *Environment) Terminate(ctx context.Context, signal string) error {
e.SetState(environment.ProcessOfflineState)

return nil

}
2 changes: 1 addition & 1 deletion environment/docker/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package docker

import (
"context"
"encoding/json"
"io"
"math"
"time"

"emperror.dev/errors"
"github.com/docker/docker/api/types"
"github.com/goccy/go-json"

"github.com/pterodactyl/wings/environment"
)
Expand Down
2 changes: 1 addition & 1 deletion events/events.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package events

import (
"encoding/json"
"strings"

"emperror.dev/errors"
"github.com/goccy/go-json"

"github.com/pterodactyl/wings/system"
)
Expand Down
75 changes: 38 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/pterodactyl/wings

go 1.21
go 1.21.0

toolchain go1.22.5

require (
emperror.dev/errors v0.8.1
Expand All @@ -10,27 +12,26 @@ require (
github.com/acobaugh/osrelease v0.1.0
github.com/apex/log v1.9.0
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/beevik/etree v1.3.0
github.com/beevik/etree v1.4.1
github.com/buger/jsonparser v1.1.1
github.com/cenkalti/backoff/v4 v4.3.0
github.com/creasty/defaults v1.7.0
github.com/creasty/defaults v1.8.0
github.com/docker/docker v25.0.4+incompatible
github.com/docker/go-connections v0.5.0
github.com/fatih/color v1.16.0
github.com/fatih/color v1.17.0
github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf
github.com/gabriel-vasile/mimetype v1.4.3
github.com/gabriel-vasile/mimetype v1.4.5
github.com/gammazero/workerpool v1.1.3
github.com/gbrlsnchs/jwt/v3 v3.0.1
github.com/gin-gonic/gin v1.9.1
github.com/gin-gonic/gin v1.10.0
github.com/glebarez/sqlite v1.11.0
github.com/go-co-op/gocron v1.37.0
github.com/goccy/go-json v0.10.2
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.1
github.com/gorilla/websocket v1.5.3
github.com/iancoleman/strcase v0.3.0
github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0
github.com/juju/ratelimit v1.0.2
github.com/klauspost/compress v1.17.8
github.com/klauspost/compress v1.17.9
github.com/klauspost/pgzip v1.2.6
github.com/magiconair/properties v1.8.7
github.com/mattn/go-colorable v0.1.13
Expand All @@ -39,27 +40,28 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/sftp v1.13.6
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.22.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0
golang.org/x/crypto v0.26.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.24.0
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/gorm v1.25.9
gorm.io/gorm v1.25.11
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.12.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.5 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/bodgit/plumbing v1.3.0 // indirect
github.com/bodgit/sevenzip v1.5.1 // indirect
github.com/bodgit/windows v1.0.1 // indirect
github.com/bytedance/sonic v1.11.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/bytedance/sonic v1.12.2 // indirect
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
Expand All @@ -70,11 +72,12 @@ require (
github.com/gammazero/deque v0.2.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/glebarez/go-sqlite v1.22.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -85,7 +88,7 @@ require (
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magefile/mage v1.15.0 // indirect
Expand All @@ -99,7 +102,7 @@ require (
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -111,27 +114,25 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.50.0 // indirect
go.opentelemetry.io/otel v1.25.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/arch v0.9.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/protobuf v1.33.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gotest.tools/v3 v3.0.2 // indirect
modernc.org/libc v1.49.3 // indirect
modernc.org/libc v1.60.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/sqlite v1.29.6 // indirect
modernc.org/sqlite v1.32.0 // indirect
)
Loading
Loading