Support naming docker images on eggs; closes #4052

Bumps PTDL_v1 export images to PTDL_v2, updates the Minecraft specific eggs to use named images.
This commit is contained in:
DaneEveritt 2022-05-07 17:45:22 -04:00
parent 53207abcb3
commit c8faf64059
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
17 changed files with 212 additions and 261 deletions

View file

@ -1,10 +1,10 @@
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2021-11-14T19:23:12+00:00",
"exported_at": "2022-05-07T17:35:07-04:00",
"name": "Bungeecord",
"author": "support@pterodactyl.io",
"description": "For a long time, Minecraft server owners have had a dream that encompasses a free, easy, and reliable way to connect multiple Minecraft servers together. BungeeCord is the answer to said dream. Whether you are a small server wishing to string multiple game-modes together, or the owner of the ShotBow Network, BungeeCord is the ideal solution for you. With the help of BungeeCord, you will be able to unlock your community's full potential.",
@ -13,12 +13,12 @@
"java_version",
"pid_limit"
],
"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"
],
"docker_images": {
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
"config": {
@ -42,7 +42,8 @@
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|alpha_num|between:1,6"
"rules": "required|alpha_num|between:1,6",
"field_type": "text"
},
{
"name": "Bungeecord Jar File",
@ -51,7 +52,8 @@
"default_value": "bungeecord.jar",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/",
"field_type": "text"
}
]
}
}

View file

@ -1,10 +1,10 @@
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2021-12-11T22:51:29+00:00",
"exported_at": "2022-05-07T17:35:08-04:00",
"name": "Forge Minecraft",
"author": "support@pterodactyl.io",
"description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.",
@ -13,12 +13,12 @@
"java_version",
"pid_limit"
],
"images": [
"ghcr.io\/pterodactyl\/yolks:java_17",
"ghcr.io\/pterodactyl\/yolks:java_16",
"ghcr.io\/pterodactyl\/yolks:java_11",
"ghcr.io\/pterodactyl\/yolks:java_8"
],
"docker_images": {
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s \"-jar {{SERVER_JARFILE}}\" || printf %s \"@unix_args.txt\" )",
"config": {
@ -42,7 +42,8 @@
"default_value": "server.jar",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/",
"field_type": "text"
},
{
"name": "Minecraft Version",
@ -51,7 +52,8 @@
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:9"
"rules": "required|string|max:9",
"field_type": "text"
},
{
"name": "Build Type",
@ -60,7 +62,8 @@
"default_value": "recommended",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:recommended,latest"
"rules": "required|string|in:recommended,latest",
"field_type": "text"
},
{
"name": "Forge Version",
@ -69,7 +72,8 @@
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:25"
"rules": "nullable|string|max:25",
"field_type": "text"
}
]
}

View file

@ -1,10 +1,10 @@
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-03-11T10:21:01-05:00",
"exported_at": "2022-05-07T17:35:09-04:00",
"name": "Paper",
"author": "parker@pterodactyl.io",
"description": "High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.",
@ -13,12 +13,12 @@
"java_version",
"pid_limit"
],
"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"
],
"docker_images": {
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}",
"config": {
@ -42,7 +42,8 @@
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:20"
"rules": "nullable|string|max:20",
"field_type": "text"
},
{
"name": "Server Jar File",
@ -51,7 +52,8 @@
"default_value": "server.jar",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/",
"field_type": "text"
},
{
"name": "Download Path",
@ -60,7 +62,8 @@
"default_value": "",
"user_viewable": false,
"user_editable": false,
"rules": "nullable|string"
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Build Number",
@ -69,7 +72,8 @@
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:20"
"rules": "required|string|max:20",
"field_type": "text"
}
]
}
}

View file

@ -1,10 +1,10 @@
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2021-10-22T19:19:17+02:00",
"exported_at": "2022-05-07T17:35:10-04:00",
"name": "Sponge (SpongeVanilla)",
"author": "support@pterodactyl.io",
"description": "SpongeVanilla is the SpongeAPI implementation for Vanilla Minecraft.",
@ -13,11 +13,11 @@
"java_version",
"pid_limit"
],
"images": [
"ghcr.io\/pterodactyl\/yolks:java_8",
"ghcr.io\/pterodactyl\/yolks:java_11",
"ghcr.io\/pterodactyl\/yolks:java_16"
],
"docker_images": {
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
"config": {
@ -41,7 +41,8 @@
"default_value": "1.12.2-7.3.0",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([a-zA-Z0-9.\\-_]+)$\/"
"rules": "required|regex:\/^([a-zA-Z0-9.\\-_]+)$\/",
"field_type": "text"
},
{
"name": "Server Jar File",
@ -50,7 +51,8 @@
"default_value": "server.jar",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/",
"field_type": "text"
}
]
}
}

View file

@ -1,10 +1,10 @@
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v1",
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2021-11-14T19:18:30+00:00",
"exported_at": "2022-05-07T17:35:11-04:00",
"name": "Vanilla Minecraft",
"author": "support@pterodactyl.io",
"description": "Minecraft is a game about placing blocks and going on adventures. Explore randomly generated worlds and build amazing things from the simplest of homes to the grandest of castles. Play in Creative Mode with unlimited resources or mine deep in Survival Mode, crafting weapons and armor to fend off dangerous mobs. Do all this alone or with friends.",
@ -13,12 +13,12 @@
"java_version",
"pid_limit"
],
"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"
],
"docker_images": {
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
"config": {
@ -42,7 +42,8 @@
"default_value": "server.jar",
"user_viewable": true,
"user_editable": true,
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/",
"field_type": "text"
},
{
"name": "Server Version",
@ -51,7 +52,8 @@
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|between:3,15"
"rules": "required|string|between:3,15",
"field_type": "text"
}
]
}
}

View file

@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class MigrateEggImagesArrayToNewFormat extends Migration
{
/**
* Run the migrations. This will loop over every egg on the system and update the
* images array to both exist, and have key => value pairings to support naming the
* images provided.
*/
public function up()
{
DB::table('eggs')->select(['id', 'docker_images'])->cursor()->each(function ($egg) {
$images = is_null($egg->docker_images) ? [] : json_decode($egg->docker_images, true, 512, JSON_THROW_ON_ERROR);
$results = [];
foreach ($images as $key => $value) {
$results[is_int($key) ? $value : $key] = $value;
}
DB::table('eggs')->where('id', $egg->id)->update(['docker_images' => $results]);
});
}
/**
* Reverse the migrations. This just keeps the values from the docker images array.
*
* @return void
*/
public function down()
{
DB::table('eggs')->select(['id', 'docker_images'])->cursor()->each(function ($egg) {
DB::table('eggs')->where('id', $egg->id)->update([
'docker_images' => array_values(json_decode($egg->docker_images, true, 512, JSON_THROW_ON_ERROR)),
]);
});
}
}