Pass through startup as argument

This commit is contained in:
Dane Everitt 2019-04-03 22:20:39 -07:00
parent 08af485c40
commit 3e4fcd527d
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 11 additions and 5 deletions

View File

@ -88,13 +88,13 @@ func (d *DockerEnvironment) Create() error {
conf := &container.Config{ conf := &container.Config{
Hostname: "container", Hostname: "container",
User: "pterodactyl", User: d.Configuration.Container.User,
AttachStdin: true, AttachStdin: true,
AttachStdout: true, AttachStdout: true,
AttachStderr: true, AttachStderr: true,
OpenStdin: true,
Tty: true, Tty: true,
Cmd: strings.Split(d.Server.Invocation, " "),
Image: d.Server.Container.Image, Image: d.Server.Container.Image,
Env: d.environmentVariables(), Env: d.environmentVariables(),
@ -118,10 +118,16 @@ func (d *DockerEnvironment) Create() error {
// Returns the environment variables for a server in KEY="VALUE" form. // Returns the environment variables for a server in KEY="VALUE" form.
func (d *DockerEnvironment) environmentVariables() []string { func (d *DockerEnvironment) environmentVariables() []string {
var out []string var out = []string{
fmt.Sprintf("STARTUP=%s", d.Server.Invocation),
}
for k, v := range d.Server.EnvVars { for k, v := range d.Server.EnvVars {
out = append(out, fmt.Sprintf("%s=\"%s\"", k, v)) if strings.ToUpper(k) == "STARTUP" {
continue
}
out = append(out, fmt.Sprintf("%s=\"%s\"", strings.ToUpper(k), v))
} }
return out return out

View File

@ -169,4 +169,4 @@ func (s *Server) IsBootable() bool {
// for the server is setup, and that all of the necessary files are created. // for the server is setup, and that all of the necessary files are created.
func (s *Server) CreateEnvironment() error { func (s *Server) CreateEnvironment() error {
return s.environment.Create() return s.environment.Create()
} }