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.7k stars 1.7k forks source link

Turn egg images into an object instead of a list #4052

Closed TekExplorer closed 2 years ago

TekExplorer commented 2 years ago

Is there an existing feature request for this?

Describe the feature you would like to see.

Currently, eggs have docker images saved as a list. This has worked so far, but the java_version feature, when used on an egg that doesn't have the hard-coded images simply won't work.

This is problematic, as features should be reusable by design since they can be added to any egg.

_As a side note, eula really should have been called minecraft_eula_

Describe the solution you'd like.

Turning it into an object/map is better as then you can assign names to each image.

Ex: from

    "images": [
        "ghcr.io\/pterodactyl\/yolks:java_8",
        "ghcr.io\/pterodactyl\/yolks:java_11",
        "ghcr.io\/pterodactyl\/yolks:java_16",
        "ghcr.io\/pterodactyl\/yolks:java_17"
    ],

to

    "images": {
       "Java 8":  "ghcr.io\/pterodactyl\/yolks:java_8",
       "Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
       "Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
       "Java 17": "ghcr.io\/pterodactyl\/yolks:java_17"
    },

And it should be easy enough to support the list format by just setting the images' names to the image itself ex: "ghcr.io\/pterodactyl\/yolks:java_8": "ghcr.io\/pterodactyl\/yolks:java_8"

Additional context to this request.

This should make the mentioned java_version image less jank and more reusable, and future features that might do something similar would find it easier to do so.

yesBad commented 2 years ago

Pretty hot idea ♨️

Would love this 😄

Jelcoo commented 2 years ago

As far as I know, v2 will use yaml eggs. With that, all eggs have to be re-written, so there will probably a big improvement in the system anyway.

TekExplorer commented 2 years ago

As far as I know, v2 will use yaml eggs. With that, all eggs have to be re-written, so there will probably a big improvement in the system anyway.

not necessarily. Json is valid yaml, after all.