From c52439132d3143168064dc09277d8607fde59d5d Mon Sep 17 00:00:00 2001 From: Boy132 Date: Tue, 18 Mar 2025 17:35:15 +0100 Subject: [PATCH] Add `tags` to egg importer & exporter, add tags to egg jsons (#1125) * add tags to egg importer & exporter * add tags to stock eggs --- app/Models/Egg.php | 2 ++ app/Models/Node.php | 1 + app/Services/Eggs/Sharing/EggExporterService.php | 1 + app/Services/Eggs/Sharing/EggImporterService.php | 5 +++-- database/Seeders/eggs/minecraft/egg-bungeecord.json | 6 +++++- database/Seeders/eggs/minecraft/egg-forge-minecraft.json | 5 ++++- database/Seeders/eggs/minecraft/egg-paper.json | 5 ++++- .../Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.json | 5 ++++- database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json | 5 ++++- database/Seeders/eggs/rust/egg-rust.json | 6 +++++- .../egg-counter--strike--global-offensive.json | 6 +++++- .../eggs/source-engine/egg-custom-source-engine-game.json | 6 +++++- database/Seeders/eggs/source-engine/egg-garrys-mod.json | 6 +++++- database/Seeders/eggs/source-engine/egg-insurgency.json | 6 +++++- database/Seeders/eggs/source-engine/egg-team-fortress2.json | 6 +++++- database/Seeders/eggs/voice-servers/egg-mumble-server.json | 5 ++++- .../Seeders/eggs/voice-servers/egg-teamspeak3-server.json | 5 ++++- 17 files changed, 66 insertions(+), 15 deletions(-) diff --git a/app/Models/Egg.php b/app/Models/Egg.php index 1852fa5f7..300371f25 100644 --- a/app/Models/Egg.php +++ b/app/Models/Egg.php @@ -46,6 +46,7 @@ use Illuminate\Support\Str; * @property string|null $inherit_config_stop * @property string $inherit_file_denylist * @property string[]|null $inherit_features + * @property string[] $tags * @property \Illuminate\Database\Eloquent\Collection|\App\Models\Server[] $servers * @property int|null $servers_count * @property \Illuminate\Database\Eloquent\Collection|\App\Models\EggVariable[] $variables @@ -128,6 +129,7 @@ class Egg extends Model implements Validatable 'config_files' => ['required_without:config_from', 'nullable', 'json'], 'update_url' => ['sometimes', 'nullable', 'string'], 'force_outgoing_ip' => ['sometimes', 'boolean'], + 'tags' => ['array'], ]; protected $attributes = [ diff --git a/app/Models/Node.php b/app/Models/Node.php index 00bba17d8..85a8053bd 100644 --- a/app/Models/Node.php +++ b/app/Models/Node.php @@ -104,6 +104,7 @@ class Node extends Model implements Validatable 'daemon_listen' => ['required', 'numeric', 'between:1,65535'], 'maintenance_mode' => ['boolean'], 'upload_size' => ['int', 'between:1,1024'], + 'tags' => ['array'], ]; /** diff --git a/app/Services/Eggs/Sharing/EggExporterService.php b/app/Services/Eggs/Sharing/EggExporterService.php index b03b50928..d41591f0b 100644 --- a/app/Services/Eggs/Sharing/EggExporterService.php +++ b/app/Services/Eggs/Sharing/EggExporterService.php @@ -27,6 +27,7 @@ class EggExporterService 'author' => $egg->author, 'uuid' => $egg->uuid, 'description' => $egg->description, + 'tags' => $egg->tags, 'features' => $egg->features, 'docker_images' => $egg->docker_images, 'file_denylist' => Collection::make($egg->inherit_file_denylist)->filter(function ($value) { diff --git a/app/Services/Eggs/Sharing/EggImporterService.php b/app/Services/Eggs/Sharing/EggImporterService.php index 98fdad1fb..31fb7f44f 100644 --- a/app/Services/Eggs/Sharing/EggImporterService.php +++ b/app/Services/Eggs/Sharing/EggImporterService.php @@ -160,6 +160,7 @@ class EggImporterService * @param array{ * name: string, * description: string, + * tags: string[], * features: string[], * docker_images: string[], * file_denylist: string[], @@ -176,10 +177,10 @@ class EggImporterService return $model->forceFill([ 'name' => Arr::get($parsed, 'name'), 'description' => Arr::get($parsed, 'description'), + 'tags' => Arr::get($parsed, 'tags', []), 'features' => Arr::get($parsed, 'features'), 'docker_images' => Arr::get($parsed, 'docker_images'), - 'file_denylist' => Collection::make(Arr::get($parsed, 'file_denylist')) - ->filter(fn ($value) => !empty($value)), + 'file_denylist' => Collection::make(Arr::get($parsed, 'file_denylist'))->filter(fn ($value) => !empty($value)), 'update_url' => Arr::get($parsed, 'meta.update_url'), 'config_files' => Arr::get($parsed, 'config.files'), 'config_startup' => Arr::get($parsed, 'config.startup'), diff --git a/database/Seeders/eggs/minecraft/egg-bungeecord.json b/database/Seeders/eggs/minecraft/egg-bungeecord.json index 949ed12fd..a4e328978 100644 --- a/database/Seeders/eggs/minecraft/egg-bungeecord.json +++ b/database/Seeders/eggs/minecraft/egg-bungeecord.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-bungeecord.json" }, - "exported_at": "2024-11-23T22:22:34+00:00", + "exported_at": "2025-03-18T12:35:34+00:00", "name": "Bungeecord", "author": "panel@example.com", "uuid": "9e6b409e-4028-4947-aea8-50a2c404c271", "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.", + "tags": [ + "minecraft", + "proxy" + ], "features": [ "eula", "java_version", diff --git a/database/Seeders/eggs/minecraft/egg-forge-minecraft.json b/database/Seeders/eggs/minecraft/egg-forge-minecraft.json index 1accb121a..8ac58cc3e 100644 --- a/database/Seeders/eggs/minecraft/egg-forge-minecraft.json +++ b/database/Seeders/eggs/minecraft/egg-forge-minecraft.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-forge-minecraft.json" }, - "exported_at": "2024-11-23T22:22:35+00:00", + "exported_at": "2025-03-18T12:35:39+00:00", "name": "Forge Minecraft", "author": "panel@example.com", "uuid": "ed072427-f209-4603-875c-f540c6dd5a65", "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.", + "tags": [ + "minecraft" + ], "features": [ "eula", "java_version", diff --git a/database/Seeders/eggs/minecraft/egg-paper.json b/database/Seeders/eggs/minecraft/egg-paper.json index 26e2505e3..f4a428293 100644 --- a/database/Seeders/eggs/minecraft/egg-paper.json +++ b/database/Seeders/eggs/minecraft/egg-paper.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-paper.json" }, - "exported_at": "2024-11-23T22:22:36+00:00", + "exported_at": "2025-03-18T12:35:44+00:00", "name": "Paper", "author": "parker@example.com", "uuid": "5da37ef6-58da-4169-90a6-e683e1721247", "description": "High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.", + "tags": [ + "minecraft" + ], "features": [ "eula", "java_version", diff --git a/database/Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.json b/database/Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.json index de4585a50..2296aba9a 100644 --- a/database/Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.json +++ b/database/Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-sponge--sponge-vanilla.json" }, - "exported_at": "2024-11-23T22:22:37+00:00", + "exported_at": "2025-03-18T12:35:50+00:00", "name": "Sponge (SpongeVanilla)", "author": "panel@example.com", "uuid": "f0d2f88f-1ff3-42a0-b03f-ac44c5571e6d", "description": "SpongeVanilla is the SpongeAPI implementation for Vanilla Minecraft.", + "tags": [ + "minecraft" + ], "features": [ "eula", "java_version", diff --git a/database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json b/database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json index 6e74e244e..d5ca65719 100644 --- a/database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json +++ b/database/Seeders/eggs/minecraft/egg-vanilla-minecraft.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/minecraft\/egg-vanilla-minecraft.json" }, - "exported_at": "2024-11-23T22:22:38+00:00", + "exported_at": "2025-03-18T12:35:55+00:00", "name": "Vanilla Minecraft", "author": "panel@example.com", "uuid": "9ac39f3d-0c34-4d93-8174-c52ab9e6c57b", "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.", + "tags": [ + "minecraft" + ], "features": [ "eula", "java_version", diff --git a/database/Seeders/eggs/rust/egg-rust.json b/database/Seeders/eggs/rust/egg-rust.json index 8192eec97..b38868888 100644 --- a/database/Seeders/eggs/rust/egg-rust.json +++ b/database/Seeders/eggs/rust/egg-rust.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/rust\/egg-rust.json" }, - "exported_at": "2024-11-23T22:22:46+00:00", + "exported_at": "2025-03-18T12:36:48+00:00", "name": "Rust", "author": "panel@example.com", "uuid": "bace2dfb-209c-452a-9459-7d6f340b07ae", "description": "The only aim in Rust is to survive. To do this you will need to overcome struggles such as hunger, thirst and cold. Build a fire. Build a shelter. Kill animals for meat. Protect yourself from other players, and kill them for meat. Create alliances with other players and form a town. Do whatever it takes to survive.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "steam_disk_space" ], diff --git a/database/Seeders/eggs/source-engine/egg-counter--strike--global-offensive.json b/database/Seeders/eggs/source-engine/egg-counter--strike--global-offensive.json index 7ae0654b2..f8c0fd0ad 100644 --- a/database/Seeders/eggs/source-engine/egg-counter--strike--global-offensive.json +++ b/database/Seeders/eggs/source-engine/egg-counter--strike--global-offensive.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/source-engine\/egg-counter--strike--global-offensive.json" }, - "exported_at": "2024-11-23T22:22:39+00:00", + "exported_at": "2025-03-18T12:36:01+00:00", "name": "Counter-Strike: Global Offensive", "author": "panel@example.com", "uuid": "437c367d-06be-498f-a604-fdad135504d7", "description": "Counter-Strike: Global Offensive is a multiplayer first-person shooter video game developed by Hidden Path Entertainment and Valve Corporation.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "gsl_token", "steam_disk_space" diff --git a/database/Seeders/eggs/source-engine/egg-custom-source-engine-game.json b/database/Seeders/eggs/source-engine/egg-custom-source-engine-game.json index 8404fb111..00c9de02e 100644 --- a/database/Seeders/eggs/source-engine/egg-custom-source-engine-game.json +++ b/database/Seeders/eggs/source-engine/egg-custom-source-engine-game.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/source-engine\/egg-custom-source-engine-game.json" }, - "exported_at": "2024-11-23T22:22:40+00:00", + "exported_at": "2025-03-18T12:36:07+00:00", "name": "Custom Source Engine Game", "author": "panel@example.com", "uuid": "2a42d0c2-c0ba-4067-9a0a-9b95d77a3490", "description": "This option allows modifying the startup arguments and other details to run a custom SRCDS based game on the panel.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "steam_disk_space" ], diff --git a/database/Seeders/eggs/source-engine/egg-garrys-mod.json b/database/Seeders/eggs/source-engine/egg-garrys-mod.json index 4545ad366..96a332d86 100644 --- a/database/Seeders/eggs/source-engine/egg-garrys-mod.json +++ b/database/Seeders/eggs/source-engine/egg-garrys-mod.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/source-engine\/egg-garrys-mod.json" }, - "exported_at": "2024-11-23T22:22:41+00:00", + "exported_at": "2025-03-18T12:36:13+00:00", "name": "Garrys Mod", "author": "panel@example.com", "uuid": "60ef81d4-30a2-4d98-ab64-f59c69e2f915", "description": "Garrys Mod, is a sandbox physics game created by Garry Newman, and developed by his company, Facepunch Studios.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "gsl_token", "steam_disk_space" diff --git a/database/Seeders/eggs/source-engine/egg-insurgency.json b/database/Seeders/eggs/source-engine/egg-insurgency.json index 638bc3fa3..737056af9 100644 --- a/database/Seeders/eggs/source-engine/egg-insurgency.json +++ b/database/Seeders/eggs/source-engine/egg-insurgency.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/source-engine\/egg-insurgency.json" }, - "exported_at": "2024-11-23T22:22:42+00:00", + "exported_at": "2025-03-18T12:36:22+00:00", "name": "Insurgency", "author": "panel@example.com", "uuid": "a5702286-655b-4069-bf1e-925c7300b61a", "description": "Take to the streets for intense close quarters combat, where a team's survival depends upon securing crucial strongholds and destroying enemy supply in this multiplayer and cooperative Source Engine based experience.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "steam_disk_space" ], diff --git a/database/Seeders/eggs/source-engine/egg-team-fortress2.json b/database/Seeders/eggs/source-engine/egg-team-fortress2.json index a2ea97c46..0002106d4 100644 --- a/database/Seeders/eggs/source-engine/egg-team-fortress2.json +++ b/database/Seeders/eggs/source-engine/egg-team-fortress2.json @@ -4,11 +4,15 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/source-engine\/egg-team-fortress2.json" }, - "exported_at": "2024-11-23T22:22:43+00:00", + "exported_at": "2025-03-18T12:36:28+00:00", "name": "Team Fortress 2", "author": "panel@example.com", "uuid": "7f8eb681-b2c8-4bf8-b9f4-d79ff70b6e5d", "description": "Team Fortress 2 is a team-based first-person shooter multiplayer video game developed and published by Valve Corporation. It is the sequel to the 1996 mod Team Fortress for Quake and its 1999 remake.", + "tags": [ + "source", + "steamcmd" + ], "features": [ "gsl_token", "steam_disk_space" diff --git a/database/Seeders/eggs/voice-servers/egg-mumble-server.json b/database/Seeders/eggs/voice-servers/egg-mumble-server.json index d228930f3..9f34bdf80 100644 --- a/database/Seeders/eggs/voice-servers/egg-mumble-server.json +++ b/database/Seeders/eggs/voice-servers/egg-mumble-server.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/voice-servers\/egg-mumble-server.json" }, - "exported_at": "2024-11-23T22:22:44+00:00", + "exported_at": "2025-03-18T12:36:35+00:00", "name": "Mumble Server", "author": "panel@example.com", "uuid": "727ee758-7fb2-4979-972b-d3eba4e1e9f0", "description": "Mumble is an open source, low-latency, high quality voice chat software primarily intended for use while gaming.", + "tags": [ + "voice" + ], "features": [], "docker_images": { "Mumble": "ghcr.io\/parkervcp\/yolks:voice_mumble" diff --git a/database/Seeders/eggs/voice-servers/egg-teamspeak3-server.json b/database/Seeders/eggs/voice-servers/egg-teamspeak3-server.json index 51fe74624..cd98e2833 100644 --- a/database/Seeders/eggs/voice-servers/egg-teamspeak3-server.json +++ b/database/Seeders/eggs/voice-servers/egg-teamspeak3-server.json @@ -4,11 +4,14 @@ "version": "PLCN_v1", "update_url": "https:\/\/github.com\/pelican-dev\/panel\/raw\/main\/database\/Seeders\/eggs\/voice-servers\/egg-teamspeak3-server.json" }, - "exported_at": "2024-11-23T22:22:45+00:00", + "exported_at": "2025-03-18T12:36:41+00:00", "name": "Teamspeak3 Server", "author": "panel@example.com", "uuid": "983b1fac-d322-4d5f-a636-436127326b37", "description": "VoIP software designed with security in mind, featuring crystal clear voice quality, endless customization options, and scalabilty up to thousands of simultaneous users.", + "tags": [ + "voice" + ], "features": [], "docker_images": { "Debian": "ghcr.io\/parkervcp\/yolks:debian"