Fix startup variables not being properly updated on server reboot; closes pterodactyl/panel#2255

This commit is contained in:
Dane Everitt
2020-08-27 21:08:33 -07:00
parent 711ee2258c
commit 7d8710824c
11 changed files with 119 additions and 51 deletions

View File

@@ -70,12 +70,6 @@ func New(id string, m *Metadata, c *environment.Configuration) (*Environment, er
return e, nil
}
func (e *Environment) SetStopConfiguration(c *api.ProcessStopConfiguration) {
e.mu.Lock()
e.meta.Stop = c
e.mu.Unlock()
}
func (e *Environment) Type() string {
return "docker"
}
@@ -166,3 +160,19 @@ func (e *Environment) ExitState() (uint32, bool, error) {
return uint32(c.State.ExitCode), c.State.OOMKilled, nil
}
// Returns the environment configuration allowing a process to make modifications of the
// environment on the fly.
func (e *Environment) Config() *environment.Configuration {
e.mu.RLock()
defer e.mu.RUnlock()
return e.Configuration
}
// Sets the stop configuration for the environment.
func (e *Environment) SetStopConfiguration(c *api.ProcessStopConfiguration) {
e.mu.Lock()
e.meta.Stop = c
e.mu.Unlock()
}