1
1
package cmd
2
2
3
3
import (
4
- "context"
5
4
"errors"
6
5
"fmt"
7
6
"io"
@@ -16,14 +15,12 @@ import (
16
15
"github.com/AlecAivazis/survey/v2"
17
16
"github.com/AlecAivazis/survey/v2/terminal"
18
17
"github.com/apex/log"
19
- "github.com/docker/docker/api/types"
20
18
"github.com/docker/docker/pkg/parsers/kernel"
21
19
"github.com/docker/docker/pkg/parsers/operatingsystem"
22
20
"github.com/goccy/go-json"
23
21
"github.com/spf13/cobra"
24
22
25
23
"github.com/pterodactyl/wings/config"
26
- "github.com/pterodactyl/wings/environment"
27
24
"github.com/pterodactyl/wings/loggers/cli"
28
25
"github.com/pterodactyl/wings/system"
29
26
)
@@ -91,15 +88,15 @@ func diagnosticsCmdRun(*cobra.Command, []string) {
91
88
panic (err )
92
89
}
93
90
94
- dockerVersion , dockerInfo , dockerErr := getDockerInfo ()
91
+ // dockerVersion, dockerInfo, dockerErr := getDockerInfo()
95
92
96
93
output := & strings.Builder {}
97
94
fmt .Fprintln (output , "Pterodactyl Wings - Diagnostics Report" )
98
95
printHeader (output , "Versions" )
99
96
fmt .Fprintln (output , " Wings:" , system .Version )
100
- if dockerErr == nil {
101
- fmt .Fprintln (output , " Docker:" , dockerVersion .Version )
102
- }
97
+ // if dockerErr == nil {
98
+ // fmt.Fprintln(output, " Docker:", dockerVersion.Version)
99
+ // }
103
100
if v , err := kernel .GetKernelVersion (); err == nil {
104
101
fmt .Fprintln (output , " Kernel:" , v )
105
102
}
@@ -131,30 +128,30 @@ func diagnosticsCmdRun(*cobra.Command, []string) {
131
128
fmt .Fprintln (output , " Server Time:" , time .Now ().Format (time .RFC1123Z ))
132
129
fmt .Fprintln (output , " Debug Mode:" , cfg .Debug )
133
130
134
- printHeader (output , "Docker: Info" )
135
- if dockerErr == nil {
136
- fmt .Fprintln (output , "Server Version:" , dockerInfo .ServerVersion )
137
- fmt .Fprintln (output , "Storage Driver:" , dockerInfo .Driver )
138
- if dockerInfo .DriverStatus != nil {
139
- for _ , pair := range dockerInfo .DriverStatus {
140
- fmt .Fprintf (output , " %s: %s\n " , pair [0 ], pair [1 ])
141
- }
142
- }
143
- if dockerInfo .SystemStatus != nil {
144
- for _ , pair := range dockerInfo .SystemStatus {
145
- fmt .Fprintf (output , " %s: %s\n " , pair [0 ], pair [1 ])
146
- }
147
- }
148
- fmt .Fprintln (output , "LoggingDriver:" , dockerInfo .LoggingDriver )
149
- fmt .Fprintln (output , " CgroupDriver:" , dockerInfo .CgroupDriver )
150
- if len (dockerInfo .Warnings ) > 0 {
151
- for _ , w := range dockerInfo .Warnings {
152
- fmt .Fprintln (output , w )
153
- }
154
- }
155
- } else {
156
- fmt .Fprintln (output , dockerErr .Error ())
157
- }
131
+ // printHeader(output, "Docker: Info")
132
+ // if dockerErr == nil {
133
+ // fmt.Fprintln(output, "Server Version:", dockerInfo.ServerVersion)
134
+ // fmt.Fprintln(output, "Storage Driver:", dockerInfo.Driver)
135
+ // if dockerInfo.DriverStatus != nil {
136
+ // for _, pair := range dockerInfo.DriverStatus {
137
+ // fmt.Fprintf(output, " %s: %s\n", pair[0], pair[1])
138
+ // }
139
+ // }
140
+ // if dockerInfo.SystemStatus != nil {
141
+ // for _, pair := range dockerInfo.SystemStatus {
142
+ // fmt.Fprintf(output, " %s: %s\n", pair[0], pair[1])
143
+ // }
144
+ // }
145
+ // fmt.Fprintln(output, "LoggingDriver:", dockerInfo.LoggingDriver)
146
+ // fmt.Fprintln(output, " CgroupDriver:", dockerInfo.CgroupDriver)
147
+ // if len(dockerInfo.Warnings) > 0 {
148
+ // for _, w := range dockerInfo.Warnings {
149
+ // fmt.Fprintln(output, w)
150
+ // }
151
+ // }
152
+ // } else {
153
+ // fmt.Fprintln(output, dockerErr.Error())
154
+ // }
158
155
159
156
printHeader (output , "Docker: Running Containers" )
160
157
c := exec .Command ("docker" , "ps" )
@@ -206,22 +203,6 @@ func diagnosticsCmdRun(*cobra.Command, []string) {
206
203
}
207
204
}
208
205
209
- func getDockerInfo () (types.Version , types.Info , error ) {
210
- client , err := environment .Docker ()
211
- if err != nil {
212
- return types.Version {}, types.Info {}, err
213
- }
214
- dockerVersion , err := client .ServerVersion (context .Background ())
215
- if err != nil {
216
- return types.Version {}, types.Info {}, err
217
- }
218
- dockerInfo , err := client .Info (context .Background ())
219
- if err != nil {
220
- return types.Version {}, types.Info {}, err
221
- }
222
- return dockerVersion , dockerInfo , nil
223
- }
224
-
225
206
func uploadToHastebin (hbUrl , content string ) (string , error ) {
226
207
r := strings .NewReader (content )
227
208
u , err := url .Parse (hbUrl )
0 commit comments