avoid panic from environment; ref pterodactyl/panel#2307

This commit is contained in:
Dane Everitt
2020-09-07 15:37:35 -07:00
parent 5bead443ad
commit 001bbfad1b
2 changed files with 10 additions and 9 deletions

View File

@@ -143,6 +143,15 @@ func (e *Environment) Create() error {
a := e.Configuration.Allocations()
evs := e.Configuration.EnvironmentVariables()
for i, v := range evs {
// Convert 127.0.0.1 to the pterodactyl0 network interface if the environment is Docker
// so that the server operates as expected.
if v == "SERVER_IP=127.0.0.1" {
evs[i] = "SERVER_IP="+config.Get().Docker.Network.Interface
}
}
conf := &container.Config{
Hostname: e.Id,
Domainname: config.Get().Docker.Domainname,