pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.81k stars 1.74k forks source link

Variable not filled when not provided thanks to API #4129

Closed Elikill58 closed 2 years ago

Elikill58 commented 2 years ago

Current Behavior

The variable (SERVER_JARFILE) is empty, so the server can't start

Expected Behavior

The default value is used when the variable is empty

Steps to Reproduce

  1. Create an egg with a variable that accept nullable, with default value. For example, SERVER_JARFILE var.
  2. Use API with my-panel.fr/api/application/servers with a JSON that doesn't write the variable. I.E. don't set SERVER_JARFILE in the JSON.
  3. Run it, and let see the var be empty and not filled by the default value

Panel Version

1.8.1

Wings Version

-

Games and/or Eggs Affected

Minecraft (Paper)

Docker Image

ghcr.io/pterodactyl/yolks:java_8

Error Logs

No response

Is there an existing issue for this?

trenutoo commented 2 years ago

This is not a bug and rather a feature request. The API expects you to provide the environment. When creating a server through the Panel, it fetches the environment from the egg and applies it. You'd have to perform the same thing.

Elikill58 commented 2 years ago

This is not a bug and rather a feature request. The API expects you to provide the environment. When creating a server through the Panel, it fetches the environment from the egg and applies it. You'd have to perform the same thing.

Ok, but :

trenutoo commented 2 years ago

This is not a bug and rather a feature request. The API expects you to provide the environment. When creating a server through the Panel, it fetches the environment from the egg and applies it. You'd have to perform the same thing.

Ok, but :

  • I give all informations to know which is the egg, nest etc
  • When default values are applied ?

They are never applied by themselves. You can view they default values when you fetch the egg.You have to request the environment of the egg and apply it to your server creation request. The panel does it the same way to fill the default values.

Elikill58 commented 2 years ago

This is not a bug and rather a feature request. The API expects you to provide the environment. When creating a server through the Panel, it fetches the environment from the egg and applies it. You'd have to perform the same thing.

Ok, but :

  • I give all informations to know which is the egg, nest etc
  • When default values are applied ?

They are never applied by themselves. You can view they default values when you fetch the egg.You have to request the environment of the egg and apply it to your server creation request. The panel does it the same way to fill the default values.

Ok, so can this issue be knwon as feature request to don't have to make a request before making the create request ?

parkervcp commented 2 years ago

So far I see that you have an egg with a mis-configured variable then. A value that is needed was made nullable. When you do the post to the panel with that value unset it's essentially setting the value to null.

I also have a workaround. Pull the egg info, build the new server off that, send a new server request with all the defaults when new values were not applied.