mirror of
https://github.com/PretendoNetwork/super-mario-maker.git
synced 2026-04-25 16:19:26 -05:00
Added kerberos password generation
This commit is contained in:
parent
616a2a1978
commit
8ff2a00801
13
init.go
13
init.go
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
|
@ -31,7 +32,6 @@ func init() {
|
|||
s3SecureEnv := os.Getenv("PN_SMM_CONFIG_S3_SECURE")
|
||||
|
||||
postgresURI := os.Getenv("PN_SMM_POSTGRES_URI")
|
||||
kerberosPassword := os.Getenv("PN_SMM_KERBEROS_PASSWORD")
|
||||
authenticationServerPort := os.Getenv("PN_SMM_AUTHENTICATION_SERVER_PORT")
|
||||
secureServerHost := os.Getenv("PN_SMM_SECURE_SERVER_HOST")
|
||||
secureServerPort := os.Getenv("PN_SMM_SECURE_SERVER_PORT")
|
||||
|
|
@ -44,12 +44,15 @@ func init() {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
if strings.TrimSpace(kerberosPassword) == "" {
|
||||
globals.Logger.Warningf("PN_SMM_KERBEROS_PASSWORD environment variable not set. Using default password: %q", globals.KerberosPassword)
|
||||
} else {
|
||||
globals.KerberosPassword = kerberosPassword
|
||||
kerberosPassword := make([]byte, 0x10)
|
||||
_, err = rand.Read(kerberosPassword)
|
||||
if err != nil {
|
||||
globals.Logger.Error("Error generating Kerberos password")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
globals.KerberosPassword = string(kerberosPassword)
|
||||
|
||||
if strings.TrimSpace(authenticationServerPort) == "" {
|
||||
globals.Logger.Error("PN_SMM_AUTHENTICATION_SERVER_PORT environment variable not set")
|
||||
os.Exit(0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user