From 2a6b48753a99f1f692b3ced88880d5786d018d48 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 6 Jul 2017 21:51:38 -0400 Subject: [PATCH 01/16] Add Rust service --- database/seeds/RustServiceTableSeeder.php | 262 ++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 database/seeds/RustServiceTableSeeder.php diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php new file mode 100644 index 000000000..65b2a9951 --- /dev/null +++ b/database/seeds/RustServiceTableSeeder.php @@ -0,0 +1,262 @@ +. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +use Illuminate\Database\Seeder; +use Pterodactyl\Models\Service; +use Pterodactyl\Models\ServiceOption; +use Pterodactyl\Models\ServiceVariable; + +class SourceServiceTableSeeder extends Seeder +{ + /** + * The core service ID. + * + * @var Models\Service + */ + protected $service; + + /** + * Stores all of the option objects. + * + * @var array + */ + protected $option = []; + + /** + * Run the database seeds. + * + * @return void + */ + public function run() + { + $this->addCoreService(); + $this->addCoreOptions(); + $this->addVariables(); + } + + private function addCoreService() + { + $this->service = Service::updateOrCreate([ + 'author' => config('pterodactyl.service.core'), + 'folder' => 'rust', + ], [ + 'name' => 'Rust', + '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.', + 'startup' => './RustDedicated -batchmode +server.port {{SERVER_PORT}} +server.identity "rust" +rcon.port {{RCON_PORT}} +rcon.web true +server.hostname \"{{HOSTNAME}}\" +server.level \"{{LEVEL}}\" +server.description \"{{DESCRIPTION}}\" +server.url \"{{URL}}\" +server.headerimage \"{{SERVER_IMG}}\" +server.worldsize \"{{WORLD_SIZE}}\" +server.seed \"{{SEED}}\" +server.maxplayers {{MAX_PLAYERS}} +rcon.password \"{{RCON_PASS}}\" {{ADDITIONAL_ARGS}}', + 'index_file' => Service::defaultIndexFile(), + ]); + } + + private function addCoreOptions() + { + $script = <<<'EOF' +apt update +apt -y --no-install-recommends install curl lib32gcc1 ca-certificates + +cd /tmp +curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz + +mkdir -p /mnt/server/steam +tar -xzvf steamcmd.tar.gz -C /mnt/server/steam +cd /mnt/server/steam + +chown -R root:root /mnt + +export HOME=/mnt/server +./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 258550 +quit + +mkdir -p /mnt/server/.steam/sdk32 +cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so +EOF; + + $this->option['rustvanilla'] = ServiceOption::updateOrCreate([ + 'service_id' => $this->service->id, + 'tag' => 'rustvanilla', + ], [ + 'name' => 'Vanilla', + 'description' => 'Vanilla Rust server.', + 'docker_image' => 'tenten8401/pterodactyl-rust', + 'config_startup' => '{"done": "Server startup complete", "userInteraction": []}', + 'config_files' => '{}', + 'config_logs' => '{"custom": false, "location": "latest.log"}', + 'config_stop' => 'quit', + 'config_from' => null, + 'startup' => null, + 'script_install' => $script, + 'script_entry' => 'bash', + 'script_container' => 'ubuntu:latest', + ]); + } + + private function addVariables() + { + $this->addVanillaVariables(); + } + + private function addVanillaVariables() + { + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'LD_LIBRARY_PATH', + ], [ + 'name' => 'LD_LIBRARY_PATH', + 'description' => 'A fix for Rust not starting.', + 'default_value' => './RustDedicated_Data/Plugins/x86_64', + 'user_viewable' => 0, + 'user_editable' => 0, + 'rules' => 'required', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'HOSTNAME', + ], [ + 'name' => 'Server Name', + 'description' => 'The name of your server in the public server list.', + 'default_value' => 'A Rust Server', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'LEVEL', + ], [ + 'name' => 'Level', + 'description' => 'The world file for Rust to use.', + 'default_value' => 'Procedural Map', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'DESCRIPTION', + ], [ + 'name' => 'Description', + 'description' => 'The description under your server title. Commonly used for rules & info.', + 'default_value' => 'Powered by Pterodactyl', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'URL', + ], [ + 'name' => 'URL', + 'description' => 'The URL for your server. This is what comes up when clicking the "Visit Website" button.', + 'default_value' => 'http://pterodactyl.io', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'url', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'WORLD_SIZE', + ], [ + 'name' => 'World Size', + 'description' => 'The world size for a procedural map.', + 'default_value' => '3000', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'SEED', + ], [ + 'name' => 'World Seed', + 'description' => 'The seed for a procedural map.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'present', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'MAX_PLAYERS', + ], [ + 'name' => 'Max Players', + 'description' => 'The maximum amount of players allowed in the server at once.', + 'default_value' => '40', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'SERVER_IMG', + ], [ + 'name' => 'Server Header Image', + 'description' => 'The header image for the top of your server listing.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'url', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'RCON_PORT', + ], [ + 'name' => 'RCON Port', + 'description' => 'Port for RCON connections.', + 'default_value' => '8401', + 'user_viewable' => 1, + 'user_editable' => 0, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'RCON_PASS', + ], [ + 'name' => 'RCON Password', + 'description' => 'Remote console access password.', + 'default_value' => 'CHANGEME', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustvanilla']->id, + 'env_variable' => 'ADDITIONAL_ARGS', + ], [ + 'name' => 'Additional Arguments', + 'description' => 'Add additional startup parameters to the server.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'present', + ]); + } +} From f230b194ff5a96133978f5ad51070ecb41d86bb0 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 6 Jul 2017 22:08:49 -0400 Subject: [PATCH 02/16] Add Rust to seeder & rename class to appropriate name --- database/seeds/DatabaseSeeder.php | 1 + database/seeds/RustServiceTableSeeder.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index e6b59672b..ae48c7c82 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -16,6 +16,7 @@ class DatabaseSeeder extends Seeder $this->call(MinecraftServiceTableSeeder::class); $this->call(SourceServiceTableSeeder::class); + $this->call(RustServiceTableSeeder::class); $this->call(TerrariaServiceTableSeeder::class); $this->call(VoiceServiceTableSeeder::class); diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index 65b2a9951..01f219341 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -26,7 +26,7 @@ use Pterodactyl\Models\Service; use Pterodactyl\Models\ServiceOption; use Pterodactyl\Models\ServiceVariable; -class SourceServiceTableSeeder extends Seeder +class RustServiceTableSeeder extends Seeder { /** * The core service ID. From a6bef1b71b35aec4d6e1b1d9beace898a0a151b9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 6 Jul 2017 22:17:51 -0400 Subject: [PATCH 03/16] Fix StyleCI complaints --- database/seeds/RustServiceTableSeeder.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index 01f219341..862254132 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -126,7 +126,7 @@ EOF; 'user_editable' => 0, 'rules' => 'required', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'HOSTNAME', @@ -138,7 +138,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required|string', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'LEVEL', @@ -150,7 +150,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required|string', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'DESCRIPTION', @@ -162,7 +162,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'URL', @@ -174,7 +174,7 @@ EOF; 'user_editable' => 1, 'rules' => 'url', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'WORLD_SIZE', @@ -186,7 +186,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required|integer', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'SEED', @@ -198,7 +198,7 @@ EOF; 'user_editable' => 1, 'rules' => 'present', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'MAX_PLAYERS', @@ -210,7 +210,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required|integer', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'SERVER_IMG', @@ -222,7 +222,7 @@ EOF; 'user_editable' => 1, 'rules' => 'url', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'RCON_PORT', @@ -234,7 +234,7 @@ EOF; 'user_editable' => 0, 'rules' => 'required|integer', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'RCON_PASS', @@ -246,7 +246,7 @@ EOF; 'user_editable' => 1, 'rules' => 'required', ]); - + ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'ADDITIONAL_ARGS', From 4c639906b409b33c0ed8d38b561f40551f8e5743 Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sat, 8 Jul 2017 15:52:40 -0500 Subject: [PATCH 04/16] Add CS:GO to Source Service Option (#538) * Added CS:GO This allows users to select rather or not to use cs:go for a server. * Removed debugging outputs * Replace tabs with spaces to pass StyleCI * Remove more pesky tabs I apparently missed them the first time. * Fix pesky issues with starts This fix is to repair the startup for csgo and remove the required accounts. * Better explanation for STEAM_ACC * Removed dupe ips * Added and fixed lines * Set a default map to be loaded in. * Set the variables rules to match what they would need to be * Removed a pesky space --- database/seeds/SourceServiceTableSeeder.php | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/database/seeds/SourceServiceTableSeeder.php b/database/seeds/SourceServiceTableSeeder.php index 171aebecc..040421420 100644 --- a/database/seeds/SourceServiceTableSeeder.php +++ b/database/seeds/SourceServiceTableSeeder.php @@ -192,6 +192,50 @@ EOF; 'script_entry' => 'bash', 'script_container' => 'ubuntu:16.04', ]); + + $script = <<<'EOF' +#!/bin/bash +# CSGO Installation Script +# +# Server Files: /mnt/server +apt -y update +apt -y --no-install-recommends install curl lib32gcc1 ca-certificates + +cd /tmp +curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz + +mkdir -p /mnt/server/steamcmd +tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd +cd /mnt/server/steamcmd + +# SteamCMD fails otherwise for some reason, even running as root. +# This is changed at the end of the install process anyways. +chown -R root:root /mnt + +export HOME=/mnt/server +./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 740 +quit + +mkdir -p /mnt/server/.steam/sdk32 +cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so +EOF; + + $this->option['csgo'] = ServiceOption::updateOrCreate([ + 'service_id' => $this->service->id, + 'tag' => 'csgo', + ], [ + 'name' => 'Counter-Strike: Global Offensive', + 'description' => 'Counter-Strike: Global Offensive is a multiplayer first-person shooter video game developed by Hidden Path Entertainment and Valve Corporation.', + 'docker_image' => 'quay.io/pterodactyl/core:source', + 'config_startup' => '{"done": "VAC secure mode is activated.", "userInteraction": []}', + 'config_files' => null, + 'config_logs' => '{"custom": true, "location": "logs/latest.log"}', + 'config_stop' => 'quit', + 'config_from' => $this->option['source']->id, + 'startup' => './srcds_run -game csgo -console -port {{SERVER_PORT}} +ip 0.0.0.0 +map {{SRCDS_MAP}} -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}}', + 'script_install' => $script, + 'script_entry' => 'bash', + 'script_container' => 'ubuntu:16.04', + ]); } private function addVariables() @@ -199,6 +243,7 @@ EOF; $this->addInsurgencyVariables(); $this->addTF2Variables(); $this->addArkVariables(); + $this->addCSGOVariables(); $this->addCustomVariables(); } @@ -319,6 +364,33 @@ EOF; ]); } + private function addCSGOVariables() + { + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['csgo']->id, + 'env_variable' => 'SRCDS_MAP', + ], [ + 'name' => 'Map', + 'description' => 'The default map for the server.', + 'default_value' => 'de_dust2', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string|alpha_dash', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['csgo']->id, + 'env_variable' => 'STEAM_ACC', + ], [ + 'name' => 'Steam Account Token', + 'description' => 'The Steam Account Token required for the server to be displayed publicly.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string|alpha_num|size:32', + ]); + } + private function addCustomVariables() { ServiceVariable::updateOrCreate([ From 951baaca54e0cc1dad2a137ff4cb68ba2851cf94 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 8 Jul 2017 17:09:01 -0400 Subject: [PATCH 05/16] Specify ubuntu version & add string validation --- database/seeds/RustServiceTableSeeder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index 862254132..0c5269a3b 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -104,7 +104,7 @@ EOF; 'startup' => null, 'script_install' => $script, 'script_entry' => 'bash', - 'script_container' => 'ubuntu:latest', + 'script_container' => 'ubuntu:16.04', ]); } @@ -160,7 +160,7 @@ EOF; 'default_value' => 'Powered by Pterodactyl', 'user_viewable' => 1, 'user_editable' => 1, - 'rules' => 'required', + 'rules' => 'required|string', ]); ServiceVariable::updateOrCreate([ From e26a7ac262157ea31cea463b85749634398f7349 Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sat, 8 Jul 2017 21:17:36 -0500 Subject: [PATCH 06/16] Created a GMOD Service Option (#542) --- database/seeds/SourceServiceTableSeeder.php | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/database/seeds/SourceServiceTableSeeder.php b/database/seeds/SourceServiceTableSeeder.php index 040421420..f41d1a877 100644 --- a/database/seeds/SourceServiceTableSeeder.php +++ b/database/seeds/SourceServiceTableSeeder.php @@ -236,6 +236,50 @@ EOF; 'script_entry' => 'bash', 'script_container' => 'ubuntu:16.04', ]); + + $script = <<<'EOF' +#!/bin/bash +# Garry's Mod Installation Script +# +# Server Files: /mnt/server +apt -y update +apt -y --no-install-recommends install curl lib32gcc1 ca-certificates + +cd /tmp +curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz + +mkdir -p /mnt/server/steamcmd +tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd +cd /mnt/server/steamcmd + +# SteamCMD fails otherwise for some reason, even running as root. +# This is changed at the end of the install process anyways. +chown -R root:root /mnt + +export HOME=/mnt/server +./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 4020 +quit + +mkdir -p /mnt/server/.steam/sdk32 +cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so +EOF; + + $this->option['gmod'] = ServiceOption::updateOrCreate([ + 'service_id' => $this->service->id, + 'tag' => 'gmod', + ], [ + 'name' => 'Garrys Mod', + 'description' => 'Garrys Mod, is a sandbox physics game created by Garry Newman, and developed by his company, Facepunch Studios.', + 'docker_image' => 'quay.io/pterodactyl/core:source', + 'config_startup' => '{"done": "VAC secure mode is activated.", "userInteraction": []}', + 'config_files' => null, + 'config_logs' => '{"custom": true, "location": "logs/latest.log"}', + 'config_stop' => 'quit', + 'config_from' => $this->option['source']->id, + 'startup' => './srcds_run -game garrysmod -console -port {{SERVER_PORT}} +ip 0.0.0.0 +map {{SRCDS_MAP}} -strictportbind -norestart +sv_setsteamaccount {{STEAM_ACC}}', + 'script_install' => $script, + 'script_entry' => 'bash', + 'script_container' => 'ubuntu:16.04', + ]); } private function addVariables() @@ -244,6 +288,7 @@ EOF; $this->addTF2Variables(); $this->addArkVariables(); $this->addCSGOVariables(); + $this->addGMODVariables(); $this->addCustomVariables(); } @@ -391,6 +436,33 @@ EOF; ]); } + private function addGMODVariables() + { + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['gmod']->id, + 'env_variable' => 'SRCDS_MAP', + ], [ + 'name' => 'Map', + 'description' => 'The default map for the server.', + 'default_value' => 'gm_flatgrass', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string|alpha_dash', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['gmod']->id, + 'env_variable' => 'STEAM_ACC', + ], [ + 'name' => 'Steam Account Token', + 'description' => 'The Steam Account Token required for the server to be displayed publicly.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string|alpha_num|size:32', + ]); + } + private function addCustomVariables() { ServiceVariable::updateOrCreate([ From 56e6847bb4cf41429d3a9c93637b7d703f7d42b6 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 8 Jul 2017 21:20:07 -0500 Subject: [PATCH 07/16] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3dacb3e7..1e0f00e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ This file is a running track of new features and fixes to each version of the pa This project follows [Semantic Versioning](http://semver.org) guidelines. +## Unreleased +### Added +* Support for CS:GO as a default service option selection. +* Support for GMOD as a default service option selection. + ## v0.6.4 (Courageous Carniadactylus) ### Fixed * Fixed the console rendering on page load, I guess people don't like watching it load line-by-line for 10 minutes. Who would have guessed... From 7993202689a963381f14cb6d0a641c49fb0614e0 Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sat, 8 Jul 2017 21:40:14 -0500 Subject: [PATCH 08/16] Added a Forge Service Option --- .../seeds/MinecraftServiceTableSeeder.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/database/seeds/MinecraftServiceTableSeeder.php b/database/seeds/MinecraftServiceTableSeeder.php index c2ed986e3..76e0b1b39 100644 --- a/database/seeds/MinecraftServiceTableSeeder.php +++ b/database/seeds/MinecraftServiceTableSeeder.php @@ -243,6 +243,41 @@ EOF; 'startup' => null, 'script_install' => $script, ]); + + $script = <<<'EOF' +#!/bin/ash +# Forge Installation Script +# +# Server Files: /mnt/server +apk update +apk add curl openjdk8 + +FUCK_FORGE_NOT_HAVING_A_GOOD_WAY_TO_GET_VERSIONS=$(curl -sl http://files.minecraftforge.net/maven/net/minecraftforge/forge/ | grep -A1 Latest | grep -o -e '[1]\.[0-9][0-9] - [0-9][0-9]\.[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]') +LATEST_VERSION=$(echo $FUCK_FORGE_NOT_HAVING_A_GOOD_WAY_TO_GET_VERSIONS | sed 's/ //g') + +cd /mnt/server + +curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_VERSION/forge-$LATEST_VERSION-installer.jar -o installer.jar +curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_VERSION/forge-$LATEST_VERSION-universal.jar -o server.jar + +java -jar installer.jar --installServer +EOF; + + $this->option['forge'] = ServiceOption::updateOrCreate([ + 'service_id' => $this->service->id, + 'tag' => 'forge', + ], [ + 'name' => 'Forge Minecraft', + '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.', + 'docker_image' => 'quay.io/pterodactyl/core:java', + 'config_startup' => '{"done": ")! For help, type ", "userInteraction": [ "Go to eula.txt for more info."]}', + 'config_logs' => '{"custom": false, "location": "logs/latest.log"}', + 'config_files' => '{"server.properties":{"parser": "properties", "find":{"server-ip": "0.0.0.0", "enable-query": "true", "server-port": "{{server.build.default.port}}", "query.port": "{{server.build.default.port}}"}}}', + 'config_stop' => 'stop', + 'config_from' => null, + 'startup' => 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}', + 'script_install' => $script, + ]); } private function addVariables() @@ -251,6 +286,7 @@ EOF; $this->addSpigotVariables(); $this->addSpongeVariables(); $this->addBungeecordVariables(); + $this->addForgeVariables(); } private function addVanillaVariables() @@ -372,4 +408,20 @@ EOF; 'rules' => 'required|regex:/^([\w\d._-]+)(\.jar)$/', ]); } + + private function addForgeVariables() + { + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['forge']->id, + 'env_variable' => 'SERVER_JARFILE', + ], [ + 'name' => 'Server Jar File', + 'description' => 'The name of the Jarfile to use when running Forge Mod.', + 'default_value' => 'server.jar', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|regex:/^([\w\d._-]+)(\.jar)$/', + ]); + } + } From 23d6907c9cf16bf81375751a592d7e3313f3dca1 Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sat, 8 Jul 2017 21:41:39 -0500 Subject: [PATCH 09/16] Remove pesky space --- database/seeds/MinecraftServiceTableSeeder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/database/seeds/MinecraftServiceTableSeeder.php b/database/seeds/MinecraftServiceTableSeeder.php index 76e0b1b39..a441bc56a 100644 --- a/database/seeds/MinecraftServiceTableSeeder.php +++ b/database/seeds/MinecraftServiceTableSeeder.php @@ -423,5 +423,4 @@ EOF; 'rules' => 'required|regex:/^([\w\d._-]+)(\.jar)$/', ]); } - } From 501f4f9a83d2826762488badad0195fdca2831dd Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sat, 8 Jul 2017 22:04:14 -0500 Subject: [PATCH 10/16] Renamed funny variable --- database/seeds/MinecraftServiceTableSeeder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/seeds/MinecraftServiceTableSeeder.php b/database/seeds/MinecraftServiceTableSeeder.php index a441bc56a..ba207dfde 100644 --- a/database/seeds/MinecraftServiceTableSeeder.php +++ b/database/seeds/MinecraftServiceTableSeeder.php @@ -252,8 +252,8 @@ EOF; apk update apk add curl openjdk8 -FUCK_FORGE_NOT_HAVING_A_GOOD_WAY_TO_GET_VERSIONS=$(curl -sl http://files.minecraftforge.net/maven/net/minecraftforge/forge/ | grep -A1 Latest | grep -o -e '[1]\.[0-9][0-9] - [0-9][0-9]\.[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]') -LATEST_VERSION=$(echo $FUCK_FORGE_NOT_HAVING_A_GOOD_WAY_TO_GET_VERSIONS | sed 's/ //g') +GET_VERSIONS=$(curl -sl http://files.minecraftforge.net/maven/net/minecraftforge/forge/ | grep -A1 Latest | grep -o -e '[1]\.[0-9][0-9] - [0-9][0-9]\.[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]') +LATEST_VERSION=$(echo $GET_VERSIONS | sed 's/ //g') cd /mnt/server From 63deed91939537c69476d70054ee998cd2a96110 Mon Sep 17 00:00:00 2001 From: Polarcraft Date: Sun, 9 Jul 2017 20:01:45 -0500 Subject: [PATCH 11/16] Quick Fix With this fix, I removed the installation of Java 8 from the container and set the script container to be java8. --- database/seeds/MinecraftServiceTableSeeder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/seeds/MinecraftServiceTableSeeder.php b/database/seeds/MinecraftServiceTableSeeder.php index ba207dfde..74d777f42 100644 --- a/database/seeds/MinecraftServiceTableSeeder.php +++ b/database/seeds/MinecraftServiceTableSeeder.php @@ -250,7 +250,7 @@ EOF; # # Server Files: /mnt/server apk update -apk add curl openjdk8 +apk add curl GET_VERSIONS=$(curl -sl http://files.minecraftforge.net/maven/net/minecraftforge/forge/ | grep -A1 Latest | grep -o -e '[1]\.[0-9][0-9] - [0-9][0-9]\.[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]') LATEST_VERSION=$(echo $GET_VERSIONS | sed 's/ //g') @@ -261,6 +261,7 @@ curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_ curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_VERSION/forge-$LATEST_VERSION-universal.jar -o server.jar java -jar installer.jar --installServer +rm -rf installer.jar EOF; $this->option['forge'] = ServiceOption::updateOrCreate([ @@ -277,6 +278,7 @@ EOF; 'config_from' => null, 'startup' => 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}', 'script_install' => $script, + 'script_container' => 'frolvlad/alpine-oraclejdk8:cleaned', ]); } From ee0211eaddf8f5ee8826321fde2b781bc28319f7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 9 Jul 2017 21:20:09 -0400 Subject: [PATCH 12/16] Change docker container to quay.io/pterodactyl/core:rust --- database/seeds/RustServiceTableSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index 0c5269a3b..ebba95136 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -95,7 +95,7 @@ EOF; ], [ 'name' => 'Vanilla', 'description' => 'Vanilla Rust server.', - 'docker_image' => 'tenten8401/pterodactyl-rust', + 'docker_image' => 'quay.io/pterodactyl/core:rust', 'config_startup' => '{"done": "Server startup complete", "userInteraction": []}', 'config_files' => '{}', 'config_logs' => '{"custom": false, "location": "latest.log"}', From 4957c95189a4c57ad5f2e658cd5971042fa42472 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 9 Jul 2017 22:05:08 -0400 Subject: [PATCH 13/16] OxideMod support --- database/seeds/RustServiceTableSeeder.php | 194 ++++++++++++++++++++-- 1 file changed, 182 insertions(+), 12 deletions(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index ebba95136..d44440730 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -106,27 +106,62 @@ EOF; 'script_entry' => 'bash', 'script_container' => 'ubuntu:16.04', ]); + + + $script = <<<'EOF' +apt update +apt -y --no-install-recommends install curl unzip lib32gcc1 ca-certificates + +cd /tmp +curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz + +mkdir -p /mnt/server/steam +tar -xzvf steamcmd.tar.gz -C /mnt/server/steam +cd /mnt/server/steam + +chown -R root:root /mnt + +export HOME=/mnt/server +./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 258550 +quit + +cd /mnt/server +curl https://dl.bintray.com/oxidemod/builds/Oxide-Rust.zip > oxide.zip +unzip oxide.zip +rm oxide.zip +echo "This file is used to determine whether the server is an OxideMod server or not. +Do not delete this file or you may loose OxideMod auto updating from the server." > OXIDE_FLAG + +mkdir -p /mnt/server/.steam/sdk32 +cp -v /mnt/server/steam/linux32/steamclient.so /mnt/server/.steam/sdk32/steamclient.so +EOF; + + $this->option['rustoxide'] = ServiceOption::updateOrCreate([ + 'service_id' => $this->service->id, + 'tag' => 'rustoxide', + ], [ + 'name' => 'OxideMod', + 'description' => 'OxideMod Rust server.', + 'docker_image' => 'quay.io/pterodactyl/core:rust', + 'config_startup' => '{"done": "Server startup complete", "userInteraction": []}', + 'config_files' => '{}', + 'config_logs' => '{"custom": false, "location": "latest.log"}', + 'config_stop' => 'quit', + 'config_from' => null, + 'startup' => null, + 'script_install' => $script, + 'script_entry' => 'bash', + 'script_container' => 'ubuntu:16.04', + ]); } private function addVariables() { $this->addVanillaVariables(); + $this->addOxideVariables(); } private function addVanillaVariables() { - ServiceVariable::updateOrCreate([ - 'option_id' => $this->option['rustvanilla']->id, - 'env_variable' => 'LD_LIBRARY_PATH', - ], [ - 'name' => 'LD_LIBRARY_PATH', - 'description' => 'A fix for Rust not starting.', - 'default_value' => './RustDedicated_Data/Plugins/x86_64', - 'user_viewable' => 0, - 'user_editable' => 0, - 'rules' => 'required', - ]); - ServiceVariable::updateOrCreate([ 'option_id' => $this->option['rustvanilla']->id, 'env_variable' => 'HOSTNAME', @@ -259,4 +294,139 @@ EOF; 'rules' => 'present', ]); } + + private function addOxideVariables() + { + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'HOSTNAME', + ], [ + 'name' => 'Server Name', + 'description' => 'The name of your server in the public server list.', + 'default_value' => 'A Rust Server', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'LEVEL', + ], [ + 'name' => 'Level', + 'description' => 'The world file for Rust to use.', + 'default_value' => 'Procedural Map', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'DESCRIPTION', + ], [ + 'name' => 'Description', + 'description' => 'The description under your server title. Commonly used for rules & info.', + 'default_value' => 'Powered by Pterodactyl', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|string', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'URL', + ], [ + 'name' => 'URL', + 'description' => 'The URL for your server. This is what comes up when clicking the "Visit Website" button.', + 'default_value' => 'http://pterodactyl.io', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'url', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'WORLD_SIZE', + ], [ + 'name' => 'World Size', + 'description' => 'The world size for a procedural map.', + 'default_value' => '3000', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'SEED', + ], [ + 'name' => 'World Seed', + 'description' => 'The seed for a procedural map.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'present', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'MAX_PLAYERS', + ], [ + 'name' => 'Max Players', + 'description' => 'The maximum amount of players allowed in the server at once.', + 'default_value' => '40', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'SERVER_IMG', + ], [ + 'name' => 'Server Header Image', + 'description' => 'The header image for the top of your server listing.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'url', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'RCON_PORT', + ], [ + 'name' => 'RCON Port', + 'description' => 'Port for RCON connections.', + 'default_value' => '8401', + 'user_viewable' => 1, + 'user_editable' => 0, + 'rules' => 'required|integer', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'RCON_PASS', + ], [ + 'name' => 'RCON Password', + 'description' => 'Remote console access password.', + 'default_value' => 'CHANGEME', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'required', + ]); + + ServiceVariable::updateOrCreate([ + 'option_id' => $this->option['rustoxide']->id, + 'env_variable' => 'ADDITIONAL_ARGS', + ], [ + 'name' => 'Additional Arguments', + 'description' => 'Add additional startup parameters to the server.', + 'default_value' => '', + 'user_viewable' => 1, + 'user_editable' => 1, + 'rules' => 'present', + ]); + } } From c746baf41616486443f364cb683a865e4c80587c Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 9 Jul 2017 22:06:14 -0400 Subject: [PATCH 14/16] Remove pesky newline for StyleCI --- database/seeds/RustServiceTableSeeder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index d44440730..2805cb556 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -107,7 +107,6 @@ EOF; 'script_container' => 'ubuntu:16.04', ]); - $script = <<<'EOF' apt update apt -y --no-install-recommends install curl unzip lib32gcc1 ca-certificates From 093114e5c281b3bd2541e0177d5b993a8697c774 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 10 Jul 2017 10:34:26 -0400 Subject: [PATCH 15/16] Absolute paths in install script --- database/seeds/RustServiceTableSeeder.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/database/seeds/RustServiceTableSeeder.php b/database/seeds/RustServiceTableSeeder.php index 2805cb556..681d97178 100644 --- a/database/seeds/RustServiceTableSeeder.php +++ b/database/seeds/RustServiceTableSeeder.php @@ -123,12 +123,11 @@ chown -R root:root /mnt export HOME=/mnt/server ./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 258550 +quit -cd /mnt/server -curl https://dl.bintray.com/oxidemod/builds/Oxide-Rust.zip > oxide.zip -unzip oxide.zip -rm oxide.zip +curl "https://dl.bintray.com/oxidemod/builds/Oxide-Rust.zip" > /mnt/server/oxide.zip +unzip -o /mnt/server/oxide.zip -d /mnt/server +rm /mnt/server/oxide.zip echo "This file is used to determine whether the server is an OxideMod server or not. -Do not delete this file or you may loose OxideMod auto updating from the server." > OXIDE_FLAG +Do not delete this file or you may loose OxideMod auto updating from the server." > /mnt/server/OXIDE_FLAG mkdir -p /mnt/server/.steam/sdk32 cp -v /mnt/server/steam/linux32/steamclient.so /mnt/server/.steam/sdk32/steamclient.so From 265817bda8d646ec10a1190dc8dd17845cf7083d Mon Sep 17 00:00:00 2001 From: "Michael (Parker) Parker" Date: Mon, 10 Jul 2017 20:19:08 -0400 Subject: [PATCH 16/16] latest TS3 Updating to latest TS3 server --- database/seeds/VoiceServiceTableSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/VoiceServiceTableSeeder.php b/database/seeds/VoiceServiceTableSeeder.php index 010302c95..1b3a05548 100644 --- a/database/seeds/VoiceServiceTableSeeder.php +++ b/database/seeds/VoiceServiceTableSeeder.php @@ -187,7 +187,7 @@ EOF; ], [ 'name' => 'Server Version', 'description' => 'The version of Teamspeak 3 to use when running the server.', - 'default_value' => '3.0.13.6', + 'default_value' => '3.0.13.7', 'user_viewable' => 1, 'user_editable' => 1, 'rules' => 'required|regex:/^([0-9_\.-]{5,10})$/',