Add logic to handle authenticating a websocket with the panel

This commit is contained in:
Dane Everitt
2019-09-08 17:40:06 -07:00
parent 806afc6ed6
commit 1899b1ab4b
4 changed files with 81 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"crypto/tls"
"flag"
"fmt"
"github.com/gorilla/websocket"
@@ -37,8 +38,15 @@ func main() {
if c.Debug {
zap.S().Debugw("running in debug mode")
zap.S().Infow("certificate checking is disabled")
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}
}
config.Set(c)
zap.S().Infof("checking for pterodactyl system user \"%s\"", c.System.User)
if su, err := c.EnsurePterodactylUser(); err != nil {
zap.S().Panicw("failed to create pterodactyl system user", zap.Error(err))