mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Allow multiple startup commands per egg (#1656)
This commit is contained in:
@@ -30,7 +30,7 @@ class EggFactory extends Factory
|
||||
'config_files' => '{}',
|
||||
'name' => $this->faker->name(),
|
||||
'description' => implode(' ', $this->faker->sentences()),
|
||||
'startup' => 'java -jar test.jar',
|
||||
'startup_commands' => ['java -jar test.jar'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-bungeecord.yaml'
|
||||
exported_at: '2025-07-25T13:32:34+00:00'
|
||||
exported_at: '2025-09-05T08:54:34+00:00'
|
||||
name: Bungeecord
|
||||
author: panel@example.com
|
||||
uuid: 9e6b409e-4028-4947-aea8-50a2c404c271
|
||||
@@ -26,7 +26,8 @@ docker_images:
|
||||
'Java 11': 'ghcr.io/parkervcp/yolks:java_11'
|
||||
'Java 8': 'ghcr.io/parkervcp/yolks:java_8'
|
||||
file_denylist: { }
|
||||
startup: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
startup_commands:
|
||||
Default: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
config:
|
||||
files:
|
||||
config.yml:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-forge-minecraft.yaml'
|
||||
exported_at: '2025-08-05T21:00:17+00:00'
|
||||
exported_at: '2025-09-05T08:54:45+00:00'
|
||||
name: 'Forge Minecraft'
|
||||
author: panel@example.com
|
||||
uuid: ed072427-f209-4603-875c-f540c6dd5a65
|
||||
@@ -22,7 +22,8 @@ docker_images:
|
||||
'Java 11': 'ghcr.io/parkervcp/yolks:java_11'
|
||||
'Java 8': 'ghcr.io/parkervcp/yolks:java_8'
|
||||
file_denylist: { }
|
||||
startup: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar {{SERVER_JARFILE}}" || printf %s "@unix_args.txt" )'
|
||||
startup_commands:
|
||||
Default: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar {{SERVER_JARFILE}}" || printf %s "@unix_args.txt" )'
|
||||
config:
|
||||
files:
|
||||
server.properties:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-paper.yaml'
|
||||
exported_at: '2025-08-05T21:00:17+00:00'
|
||||
exported_at: '2025-09-05T08:54:10+00:00'
|
||||
name: Paper
|
||||
author: parker@example.com
|
||||
uuid: 5da37ef6-58da-4169-90a6-e683e1721247
|
||||
@@ -20,7 +20,8 @@ docker_images:
|
||||
'Java 11': 'ghcr.io/parkervcp/yolks:java_11'
|
||||
'Java 8': 'ghcr.io/parkervcp/yolks:java_8'
|
||||
file_denylist: { }
|
||||
startup: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}'
|
||||
startup_commands:
|
||||
Default: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}'
|
||||
config:
|
||||
files:
|
||||
server.properties:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-sponge--sponge-vanilla.yaml'
|
||||
exported_at: '2025-08-05T21:00:17+00:00'
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-sponge.yaml'
|
||||
exported_at: '2025-09-12T08:38:42+00:00'
|
||||
name: Sponge
|
||||
author: panel@example.com
|
||||
uuid: f0d2f88f-1ff3-42a0-b03f-ac44c5571e6d
|
||||
@@ -20,7 +20,8 @@ docker_images:
|
||||
'Java 11': 'ghcr.io/parkervcp/yolks:java_11'
|
||||
'Java 8': 'ghcr.io/parkervcp/yolks:java_8'
|
||||
file_denylist: { }
|
||||
startup: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
startup_commands:
|
||||
Default: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
config:
|
||||
files:
|
||||
server.properties:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/minecraft/egg-vanilla-minecraft.yaml'
|
||||
exported_at: '2025-08-05T20:59:51+00:00'
|
||||
exported_at: '2025-09-05T08:55:10+00:00'
|
||||
name: 'Vanilla Minecraft'
|
||||
author: panel@example.com
|
||||
uuid: 9ac39f3d-0c34-4d93-8174-c52ab9e6c57b
|
||||
@@ -24,7 +24,8 @@ docker_images:
|
||||
'Java 11': 'ghcr.io/parkervcp/yolks:java_11'
|
||||
'Java 8': 'ghcr.io/parkervcp/yolks:java_8'
|
||||
file_denylist: { }
|
||||
startup: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
startup_commands:
|
||||
Default: 'java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}'
|
||||
config:
|
||||
files:
|
||||
server.properties:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/rust/egg-rust.yaml'
|
||||
exported_at: '2025-07-25T13:30:56+00:00'
|
||||
exported_at: '2025-09-05T08:56:17+00:00'
|
||||
name: Rust
|
||||
author: panel@example.com
|
||||
uuid: bace2dfb-209c-452a-9459-7d6f340b07ae
|
||||
@@ -17,9 +17,10 @@ tags:
|
||||
features:
|
||||
- steam_disk_space
|
||||
docker_images:
|
||||
'ghcr.io/parkervcp/games:rust': 'ghcr.io/parkervcp/games:rust'
|
||||
Rust: 'ghcr.io/parkervcp/games:rust'
|
||||
file_denylist: { }
|
||||
startup: './RustDedicated -batchmode +server.port {{SERVER_PORT}} +server.queryport {{QUERY_PORT}} +server.identity "rust" +rcon.port {{RCON_PORT}} +rcon.web true +server.hostname \"{{SERVER_HOSTNAME}}\" +server.level \"{{LEVEL}}\" +server.description \"{{DESCRIPTION}}\" +server.url \"{{SERVER_URL}}\" +server.headerimage \"{{SERVER_IMG}}\" +server.logoimage \"{{SERVER_LOGO}}\" +server.maxplayers {{MAX_PLAYERS}} +rcon.password \"{{RCON_PASS}}\" +server.saveinterval {{SAVEINTERVAL}} +app.port {{APP_PORT}} $( [ -z ${MAP_URL} ] && printf %s "+server.worldsize \"{{WORLD_SIZE}}\" +server.seed \"{{WORLD_SEED}}\"" || printf %s "+server.levelurl {{MAP_URL}}" ) {{ADDITIONAL_ARGS}}'
|
||||
startup_commands:
|
||||
Default: './RustDedicated -batchmode +server.port {{SERVER_PORT}} +server.queryport {{QUERY_PORT}} +server.identity "rust" +rcon.port {{RCON_PORT}} +rcon.web true +server.hostname \"{{SERVER_HOSTNAME}}\" +server.level \"{{LEVEL}}\" +server.description \"{{DESCRIPTION}}\" +server.url \"{{SERVER_URL}}\" +server.headerimage \"{{SERVER_IMG}}\" +server.logoimage \"{{SERVER_LOGO}}\" +server.maxplayers {{MAX_PLAYERS}} +rcon.password \"{{RCON_PASS}}\" +server.saveinterval {{SAVEINTERVAL}} +app.port {{APP_PORT}} $( [ -z ${MAP_URL} ] && printf %s "+server.worldsize \"{{WORLD_SIZE}}\" +server.seed \"{{WORLD_SEED}}\"" || printf %s "+server.levelurl {{MAP_URL}}" ) {{ADDITIONAL_ARGS}}'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/source-engine/egg-custom-source-engine-game.yaml'
|
||||
exported_at: '2025-07-25T13:30:23+00:00'
|
||||
exported_at: '2025-09-05T08:55:22+00:00'
|
||||
name: 'Custom Source Engine Game'
|
||||
author: panel@example.com
|
||||
uuid: 2a42d0c2-c0ba-4067-9a0a-9b95d77a3490
|
||||
@@ -15,9 +15,10 @@ tags:
|
||||
features:
|
||||
- steam_disk_space
|
||||
docker_images:
|
||||
'ghcr.io/parkervcp/games:source': 'ghcr.io/parkervcp/games:source'
|
||||
Source: 'ghcr.io/parkervcp/games:source'
|
||||
file_denylist: { }
|
||||
startup: './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart'
|
||||
startup_commands:
|
||||
Default: './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/source-engine/egg-garrys-mod.yaml'
|
||||
exported_at: '2025-07-25T13:30:30+00:00'
|
||||
exported_at: '2025-09-05T08:54:21+00:00'
|
||||
name: 'Garrys Mod'
|
||||
author: panel@example.com
|
||||
uuid: 60ef81d4-30a2-4d98-ab64-f59c69e2f915
|
||||
@@ -16,9 +16,10 @@ features:
|
||||
- gsl_token
|
||||
- steam_disk_space
|
||||
docker_images:
|
||||
'ghcr.io/parkervcp/games:source': 'ghcr.io/parkervcp/games:source'
|
||||
Source: 'ghcr.io/parkervcp/games:source'
|
||||
file_denylist: { }
|
||||
startup: './srcds_run -game garrysmod -console -port {{SERVER_PORT}} +ip 0.0.0.0 +host_workshop_collection {{WORKSHOP_ID}} +map {{SRCDS_MAP}} +gamemode {{GAMEMODE}} -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}} +maxplayers {{MAX_PLAYERS}} -tickrate {{TICKRATE}} $( [ "$LUA_REFRESH" == "1" ] || printf %s ''-disableluarefresh'' )'
|
||||
startup_commands:
|
||||
Default: './srcds_run -game garrysmod -console -port {{SERVER_PORT}} +ip 0.0.0.0 +host_workshop_collection {{WORKSHOP_ID}} +map {{SRCDS_MAP}} +gamemode {{GAMEMODE}} -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}} +maxplayers {{MAX_PLAYERS}} -tickrate {{TICKRATE}} $( [ "$LUA_REFRESH" == "1" ] || printf %s ''-disableluarefresh'' )'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/source-engine/egg-insurgency.yaml'
|
||||
exported_at: '2025-07-25T13:30:35+00:00'
|
||||
exported_at: '2025-09-05T08:55:34+00:00'
|
||||
name: Insurgency
|
||||
author: panel@example.com
|
||||
uuid: a5702286-655b-4069-bf1e-925c7300b61a
|
||||
@@ -16,9 +16,10 @@ tags:
|
||||
features:
|
||||
- steam_disk_space
|
||||
docker_images:
|
||||
'ghcr.io/parkervcp/games:source': 'ghcr.io/parkervcp/games:source'
|
||||
Source: 'ghcr.io/parkervcp/games:source'
|
||||
file_denylist: { }
|
||||
startup: './srcds_run -game insurgency -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart'
|
||||
startup_commands:
|
||||
Default: './srcds_run -game insurgency -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/source-engine/egg-team-fortress2.yaml'
|
||||
exported_at: '2025-07-25T13:30:44+00:00'
|
||||
exported_at: '2025-09-05T08:55:44+00:00'
|
||||
name: 'Team Fortress 2'
|
||||
author: panel@example.com
|
||||
uuid: 7f8eb681-b2c8-4bf8-b9f4-d79ff70b6e5d
|
||||
@@ -16,9 +16,10 @@ features:
|
||||
- gsl_token
|
||||
- steam_disk_space
|
||||
docker_images:
|
||||
'ghcr.io/parkervcp/games:source': 'ghcr.io/parkervcp/games:source'
|
||||
Source: 'ghcr.io/parkervcp/games:source'
|
||||
file_denylist: { }
|
||||
startup: './srcds_run -game tf -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}}'
|
||||
startup_commands:
|
||||
Default: './srcds_run -game tf -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}}'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/voice-servers/egg-mumble-server.yaml'
|
||||
exported_at: '2025-07-25T13:30:48+00:00'
|
||||
exported_at: '2025-09-05T08:55:54+00:00'
|
||||
name: 'Mumble Server'
|
||||
author: panel@example.com
|
||||
uuid: 727ee758-7fb2-4979-972b-d3eba4e1e9f0
|
||||
@@ -15,7 +15,8 @@ features: { }
|
||||
docker_images:
|
||||
Mumble: 'ghcr.io/parkervcp/yolks:voice_mumble'
|
||||
file_denylist: { }
|
||||
startup: 'mumble-server -fg -ini murmur.ini'
|
||||
startup_commands:
|
||||
Default: 'mumble-server -fg -ini murmur.ini'
|
||||
config:
|
||||
files:
|
||||
murmur.ini:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
_comment: 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL'
|
||||
meta:
|
||||
version: PLCN_v2
|
||||
version: PLCN_v3
|
||||
update_url: 'https://github.com/pelican-dev/panel/raw/main/database/Seeders/eggs/voice-servers/egg-teamspeak3-server.yaml'
|
||||
exported_at: '2025-07-25T13:30:53+00:00'
|
||||
exported_at: '2025-09-05T08:56:06+00:00'
|
||||
name: 'Teamspeak3 Server'
|
||||
author: panel@example.com
|
||||
uuid: 983b1fac-d322-4d5f-a636-436127326b37
|
||||
@@ -15,7 +15,8 @@ features: { }
|
||||
docker_images:
|
||||
Debian: 'ghcr.io/parkervcp/yolks:debian'
|
||||
file_denylist: { }
|
||||
startup: './ts3server default_voice_port={{SERVER_PORT}} query_port={{QUERY_PORT}} filetransfer_ip=0.0.0.0 filetransfer_port={{FILE_TRANSFER}} query_http_port={{QUERY_HTTP}} query_ssh_port={{QUERY_SSH}} query_protocols={{QUERY_PROTOCOLS_VAR}} license_accepted=1'
|
||||
startup_commands:
|
||||
Default: './ts3server default_voice_port={{SERVER_PORT}} query_port={{QUERY_PORT}} filetransfer_ip=0.0.0.0 filetransfer_port={{FILE_TRANSFER}} query_http_port={{QUERY_HTTP}} query_ssh_port={{QUERY_SSH}} query_protocols={{QUERY_PROTOCOLS_VAR}} license_accepted=1'
|
||||
config:
|
||||
files: { }
|
||||
startup:
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('eggs', function (Blueprint $table) {
|
||||
$table->json('startup_commands')->after('startup')->nullable();
|
||||
});
|
||||
|
||||
DB::table('eggs')->select(['id', 'startup'])->cursor()->each(function ($egg) {
|
||||
DB::table('eggs')->where('id', $egg->id)->update(['startup_commands' => json_encode(['Default' => $egg->startup], JSON_UNESCAPED_SLASHES)]);
|
||||
});
|
||||
|
||||
Schema::table('eggs', function (Blueprint $table) {
|
||||
$table->dropColumn('startup');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
DB::transaction(function () {
|
||||
Schema::table('eggs', function (Blueprint $table) {
|
||||
$table->text('startup')->after('startup_commands');
|
||||
});
|
||||
|
||||
DB::table('eggs')->select(['id', 'startup_commands'])->cursor()->each(function ($egg) {
|
||||
DB::table('eggs')->where('id', $egg->id)->update([
|
||||
'startup' => Arr::first(json_decode($egg->startup_commands, true, 512, JSON_THROW_ON_ERROR)),
|
||||
]);
|
||||
});
|
||||
|
||||
Schema::table('eggs', function (Blueprint $table) {
|
||||
$table->dropColumn('startup_commands');
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user