From 6e30f79de98d035128adef48f2522eb4e6dfe72d Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Sun, 8 Dec 2019 18:31:31 -0500 Subject: [PATCH 01/27] Update Install scripts Update steamcmd install scripts to use new install script Update steamcmd install image to Ubuntu 18.04 Add extra ARK variables --- .../egg-ark--survival-evolved.json | 70 ++++++++++++++++--- ...egg-counter--strike--global-offensive.json | 8 +-- .../egg-custom-source-engine-game.json | 8 +-- .../eggs/source-engine/egg-garrys-mod.json | 8 +-- .../eggs/source-engine/egg-insurgency.json | 8 +-- .../source-engine/egg-team-fortress2.json | 6 +- 6 files changed, 81 insertions(+), 27 deletions(-) diff --git a/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json b/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json index 35028b20c..1017fefb4 100644 --- a/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json +++ b/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json @@ -3,26 +3,35 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2019-02-13T12:30:54-05:00", + "exported_at": "2018-10-29T20:51:32+01:00", "name": "Ark: Survival Evolved", - "author": "support@pterodactyl.io", + "author": "dev@shepper.fr", "description": "As a man or woman stranded, naked, freezing, and starving on the unforgiving shores of a mysterious island called ARK, use your skill and cunning to kill or tame and ride the plethora of leviathan dinosaurs and other primeval creatures roaming the land. Hunt, harvest resources, craft items, grow crops, research technologies, and build shelters to withstand the elements and store valuables, all while teaming up with (or preying upon) hundreds of other players to survive, dominate... and escape! \u2014 Gamepedia: ARK", "image": "quay.io\/pterodactyl\/core:source", - "startup": ".\/ShooterGame\/Binaries\/Linux\/ShooterGameServer {{SERVER_MAP}}?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}", + "startup": "\"cd ShooterGame\/Binaries\/Linux && .\/ShooterGameServer {{SERVER_MAP}}?listen?SessionName='{{SESSION_NAME}}'?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}?RCONPort={{RCON_PORT}}?QueryPort={{QUERY_PORT}}?RCONEnabled={{ENABLE_RCON}} -server -log\"", "config": { "files": "{}", "startup": "{\r\n \"done\": \"Setting breakpad minidump AppID = 346110\",\r\n \"userInteraction\": []\r\n}", "logs": "{\r\n \"custom\": true,\r\n \"location\": \"logs\/latest.log\"\r\n}", - "stop": "quit" + "stop": "^C" }, "scripts": { "installation": { - "script": "#!\/bin\/bash\n# ARK: Installation Script\n#\n# Server Files: \/mnt\/server\napt -y update\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\n\ncd \/tmp\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\n\nmkdir -p \/mnt\/server\/steamcmd\nmkdir -p \/mnt\/server\/Engine\/Binaries\/ThirdParty\/SteamCMD\/Linux\n\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/Engine\/Binaries\/ThirdParty\/SteamCMD\/Linux\n\ncd \/mnt\/server\/steamcmd\n\n# SteamCMD fails otherwise for some reason, even running as root.\n# This is changed at the end of the install process anyways.\nchown -R root:root \/mnt\n\nexport HOME=\/mnt\/server\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update 376030 +quit\n\nmkdir -p \/mnt\/server\/.steam\/sdk32\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so", + "script": "#!\/bin\/bash\r\n# ARK: Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\ncd \/tmp\r\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\r\n\r\nmkdir -p \/mnt\/server\/steamcmd\r\nmkdir -p \/mnt\/server\/Engine\/Binaries\/ThirdParty\/SteamCMD\/Linux\r\n\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/Engine\/Binaries\/ThirdParty\/SteamCMD\/Linux\r\n\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\n\r\nexport HOME=\/mnt\/server\r\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update 376030 +quit\r\n\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\ncd \/mnt\/server\/Engine\/Binaries\/ThirdParty\/SteamCMD\/Linux\r\n\r\nln -sf ..\/..\/..\/..\/..\/Steam\/steamapps steamapps\r\n\r\ncd \/mnt\/server", "container": "ubuntu:16.04", "entrypoint": "bash" } }, "variables": [ + { + "name": "Server Name", + "description": "ARK server name", + "env_variable": "SESSION_NAME", + "default_value": "ARK SERVER", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|string|max:128" + }, { "name": "Server Password", "description": "If specified, players must provide this password to join the server.", @@ -39,7 +48,43 @@ "default_value": "", "user_viewable": 1, "user_editable": 1, - "rules": "nullable|alpha_dash|between:1,100" + "rules": "nullable|alpha_dash|between:1,100" + }, + { + "name": "Server Port", + "description": "ARK server port used by client.", + "env_variable": "PORT", + "default_value": "7777", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|numeric" + }, + { + "name": "Use Rcon", + "description": "Enable or disable rcon system. (true or false)", + "env_variable": "ENABLE_RCON", + "default_value": "false", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|string|max:5" + }, + { + "name": "Rcon Port", + "description": "ARK rcon port used by rcon tools.", + "env_variable": "RCON_PORT", + "default_value": "27020", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|numeric" + }, + { + "name": "Query Port", + "description": "ARK query port used by steam server browser and ark client server browser.", + "env_variable": "QUERY_PORT", + "default_value": "27015", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|numeric" }, { "name": "Maximum Players", @@ -50,9 +95,18 @@ "user_editable": 1, "rules": "required|numeric|digits_between:1,4" }, + { + "name": "App ID", + "description": "ARK steam app id for auto updates. Leave blank to avoid auto update.", + "env_variable": "SRCDS_APPID", + "default_value": "376030", + "user_viewable": 1, + "user_editable": 0, + "rules": "nullable|numeric" + }, { "name": "Server Map", - "description": "Available Maps: TheIsland, TheCenter, Ragnarok, ScorchedEarth_P, Aberration_P", + "description": "Available Maps: TheIsland, TheCenter, Ragnarok, ScorchedEarth_P, Aberration_P, Extinction", "env_variable": "SERVER_MAP", "default_value": "TheIsland", "user_viewable": 1, @@ -60,4 +114,4 @@ "rules": "required|string|max:20" } ] -} \ No newline at end of file +} diff --git a/database/seeds/eggs/source-engine/egg-counter--strike--global-offensive.json b/database/seeds/eggs/source-engine/egg-counter--strike--global-offensive.json index ad9210256..191aa99ed 100644 --- a/database/seeds/eggs/source-engine/egg-counter--strike--global-offensive.json +++ b/database/seeds/eggs/source-engine/egg-counter--strike--global-offensive.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2018-06-19T07:46:06-04:00", + "exported_at": "2019-12-08T10:52:19-05:00", "name": "Counter-Strike: Global Offensive", "author": "support@pterodactyl.io", "description": "Counter-Strike: Global Offensive is a multiplayer first-person shooter video game developed by Hidden Path Entertainment and Valve Corporation.", @@ -17,8 +17,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\n# CSGO Installation Script\n#\n# Server Files: \/mnt\/server\napt -y update\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\n\ncd \/tmp\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\n\nmkdir -p \/mnt\/server\/steamcmd\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\ncd \/mnt\/server\/steamcmd\n\n# SteamCMD fails otherwise for some reason, even running as root.\n# This is changed at the end of the install process anyways.\nchown -R root:root \/mnt\n\nexport HOME=\/mnt\/server\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update 740 +quit\n\nmkdir -p \/mnt\/server\/.steam\/sdk32\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so", - "container": "ubuntu:16.04", + "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ubuntu:18.04'\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\n## just in case someone removed the defaults.\r\nif [ \"${STEAM_USER}\" == \"\" ]; then\r\n STEAM_USER=anonymous\r\n STEAM_PASS=\"\"\r\n STEAM_AUTH=\"\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so", + "container": "ubuntu:18.04", "entrypoint": "bash" } }, @@ -51,4 +51,4 @@ "rules": "required|string|max:20" } ] -} +} \ No newline at end of file diff --git a/database/seeds/eggs/source-engine/egg-custom-source-engine-game.json b/database/seeds/eggs/source-engine/egg-custom-source-engine-game.json index 7a7b40bd0..aae3b3f35 100644 --- a/database/seeds/eggs/source-engine/egg-custom-source-engine-game.json +++ b/database/seeds/eggs/source-engine/egg-custom-source-engine-game.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2018-01-21T16:59:45-06:00", + "exported_at": "2019-12-08T10:54:26-05:00", "name": "Custom Source Engine Game", "author": "support@pterodactyl.io", "description": "This option allows modifying the startup arguments and other details to run a custom SRCDS based game on the panel.", @@ -17,8 +17,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\n# SRCDS Base Installation Script\n#\n# Server Files: \/mnt\/server\napt -y update\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\n\ncd \/tmp\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\n\nmkdir -p \/mnt\/server\/steamcmd\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\ncd \/mnt\/server\/steamcmd\n\n# SteamCMD fails otherwise for some reason, even running as root.\n# This is changed at the end of the install process anyways.\nchown -R root:root \/mnt\n\nexport HOME=\/mnt\/server\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} +quit\n\nmkdir -p \/mnt\/server\/.steam\/sdk32\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so", - "container": "ubuntu:16.04", + "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ubuntu:18.04'\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\n## just in case someone removed the defaults.\r\nif [ \"${STEAM_USER}\" == \"\" ]; then\r\n STEAM_USER=anonymous\r\n STEAM_PASS=\"\"\r\n STEAM_AUTH=\"\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so", + "container": "ubuntu:18.04", "entrypoint": "bash" } }, @@ -51,4 +51,4 @@ "rules": "required|string|alpha_dash" } ] -} +} \ No newline at end of file diff --git a/database/seeds/eggs/source-engine/egg-garrys-mod.json b/database/seeds/eggs/source-engine/egg-garrys-mod.json index 3b134b0dd..17940e8fb 100644 --- a/database/seeds/eggs/source-engine/egg-garrys-mod.json +++ b/database/seeds/eggs/source-engine/egg-garrys-mod.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2019-02-16T14:20:52-05:00", + "exported_at": "2019-12-08T10:56:42-05:00", "name": "Garrys Mod", "author": "support@pterodactyl.io", "description": "Garrys Mod, is a sandbox physics game created by Garry Newman, and developed by his company, Facepunch Studios.", @@ -17,8 +17,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Garry's Mod Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\ncd \/tmp\r\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\r\n\r\nmkdir -p \/mnt\/server\/steamcmd\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\n\r\nexport HOME=\/mnt\/server\r\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update 4020 +quit\r\n\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n# Creating needed default files for the game\r\ncd \/mnt\/server\/garrysmod\/lua\/autorun\/server\r\necho '\r\n-- Docs: https:\/\/wiki.garrysmod.com\/page\/resource\/AddWorkshop\r\n-- Place the ID of the workshop addon you want to be downloaded to people who join your server, not the collection ID\r\n-- Use https:\/\/beta.configcreator.com\/create\/gmod\/resources.lua to easily create a list based on your collection ID\r\n\r\nresource.AddWorkshop( \"\" )\r\n' > workshop.lua\r\n\r\ncd \/mnt\/server\/garrysmod\/cfg\r\necho '\r\n\/\/ Please do not set RCon in here, use the startup parameters.\r\n\r\nhostname\t\t\"New Gmod Server\"\r\nsv_password\t\t\"\"\r\nsv_loadingurl \"\"\r\n\r\n\/\/ Steam Server List Settings\r\nsv_region \"255\"\r\nsv_lan \"0\"\r\nsv_max_queries_sec_global \"30000\"\r\nsv_max_queries_window \"45\"\r\nsv_max_queries_sec \"5\"\r\n\r\n\/\/ Server Limits\r\nsbox_maxprops\t\t100\r\nsbox_maxragdolls\t5\r\nsbox_maxnpcs\t\t10\r\nsbox_maxballoons\t10\r\nsbox_maxeffects\t\t10\r\nsbox_maxdynamite\t10\r\nsbox_maxlamps\t\t10\r\nsbox_maxthrusters\t10\r\nsbox_maxwheels\t\t10\r\nsbox_maxhoverballs\t10\r\nsbox_maxvehicles\t20\r\nsbox_maxbuttons\t\t10\r\nsbox_maxsents\t\t20\r\nsbox_maxemitters\t5\r\nsbox_godmode\t\t0\r\nsbox_noclip\t\t 0\r\n\r\n\/\/ Network Settings - Please keep these set to default.\r\n\r\nsv_minrate\t\t75000\r\nsv_maxrate\t\t0\r\ngmod_physiterations\t2\r\nnet_splitpacket_maxrate\t45000\r\ndecalfrequency\t\t12 \r\n\r\n\/\/ Execute Ban Files - Please do not edit\r\nexec banned_ip.cfg \r\nexec banned_user.cfg \r\n\r\n\/\/ Add custom lines under here\r\n' > server.cfg", - "container": "ubuntu:16.04", + "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ubuntu:18.04'\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\n## just in case someone removed the defaults.\r\nif [ \"${STEAM_USER}\" == \"\" ]; then\r\n STEAM_USER=anonymous\r\n STEAM_PASS=\"\"\r\n STEAM_AUTH=\"\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so\r\n\r\n# Creating needed default files for the game\r\ncd \/mnt\/server\/garrysmod\/lua\/autorun\/server\r\necho '\r\n-- Docs: https:\/\/wiki.garrysmod.com\/page\/resource\/AddWorkshop\r\n-- Place the ID of the workshop addon you want to be downloaded to people who join your server, not the collection ID\r\n-- Use https:\/\/beta.configcreator.com\/create\/gmod\/resources.lua to easily create a list based on your collection ID\r\n\r\nresource.AddWorkshop( \"\" )\r\n' > workshop.lua\r\n\r\ncd \/mnt\/server\/garrysmod\/cfg\r\necho '\r\n\/\/ Please do not set RCon in here, use the startup parameters.\r\n\r\nhostname\t\t\"New Gmod Server\"\r\nsv_password\t\t\"\"\r\nsv_loadingurl \"\"\r\n\r\n\/\/ Steam Server List Settings\r\nsv_region \"255\"\r\nsv_lan \"0\"\r\nsv_max_queries_sec_global \"30000\"\r\nsv_max_queries_window \"45\"\r\nsv_max_queries_sec \"5\"\r\n\r\n\/\/ Server Limits\r\nsbox_maxprops\t\t100\r\nsbox_maxragdolls\t5\r\nsbox_maxnpcs\t\t10\r\nsbox_maxballoons\t10\r\nsbox_maxeffects\t\t10\r\nsbox_maxdynamite\t10\r\nsbox_maxlamps\t\t10\r\nsbox_maxthrusters\t10\r\nsbox_maxwheels\t\t10\r\nsbox_maxhoverballs\t10\r\nsbox_maxvehicles\t20\r\nsbox_maxbuttons\t\t10\r\nsbox_maxsents\t\t20\r\nsbox_maxemitters\t5\r\nsbox_godmode\t\t0\r\nsbox_noclip\t\t 0\r\n\r\n\/\/ Network Settings - Please keep these set to default.\r\n\r\nsv_minrate\t\t75000\r\nsv_maxrate\t\t0\r\ngmod_physiterations\t2\r\nnet_splitpacket_maxrate\t45000\r\ndecalfrequency\t\t12 \r\n\r\n\/\/ Execute Ban Files - Please do not edit\r\nexec banned_ip.cfg \r\nexec banned_user.cfg \r\n\r\n\/\/ Add custom lines under here\r\n' > server.cfg", + "container": "ubuntu:18.04", "entrypoint": "bash" } }, @@ -87,4 +87,4 @@ "rules": "required|integer|max:100" } ] -} +} \ No newline at end of file diff --git a/database/seeds/eggs/source-engine/egg-insurgency.json b/database/seeds/eggs/source-engine/egg-insurgency.json index 950743fdd..7f0c76be2 100644 --- a/database/seeds/eggs/source-engine/egg-insurgency.json +++ b/database/seeds/eggs/source-engine/egg-insurgency.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2018-01-21T16:59:48-06:00", + "exported_at": "2019-12-08T10:57:32-05:00", "name": "Insurgency", "author": "support@pterodactyl.io", "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.", @@ -17,8 +17,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\n# SRCDS Base Installation Script\n#\n# Server Files: \/mnt\/server\napt -y update\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\n\ncd \/tmp\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\n\nmkdir -p \/mnt\/server\/steamcmd\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\ncd \/mnt\/server\/steamcmd\n\n# SteamCMD fails otherwise for some reason, even running as root.\n# This is changed at the end of the install process anyways.\nchown -R root:root \/mnt\n\nexport HOME=\/mnt\/server\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} +quit\n\nmkdir -p \/mnt\/server\/.steam\/sdk32\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so", - "container": "ubuntu:16.04", + "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ubuntu:18.04'\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\n## just in case someone removed the defaults.\r\nif [ \"${STEAM_USER}\" == \"\" ]; then\r\n STEAM_USER=anonymous\r\n STEAM_PASS=\"\"\r\n STEAM_AUTH=\"\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so", + "container": "ubuntu:18.04", "entrypoint": "bash" } }, @@ -51,4 +51,4 @@ "rules": "required|regex:\/^(\\w{1,20})$\/" } ] -} +} \ No newline at end of file diff --git a/database/seeds/eggs/source-engine/egg-team-fortress2.json b/database/seeds/eggs/source-engine/egg-team-fortress2.json index ae443370c..159e7bf9b 100644 --- a/database/seeds/eggs/source-engine/egg-team-fortress2.json +++ b/database/seeds/eggs/source-engine/egg-team-fortress2.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2018-01-21T16:59:45-06:00", + "exported_at": "2019-12-08T10:58:48-05:00", "name": "Team Fortress 2", "author": "support@pterodactyl.io", "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.", @@ -17,8 +17,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\n# SRCDS Base Installation Script\n#\n# Server Files: \/mnt\/server\napt -y update\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\n\ncd \/tmp\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\n\nmkdir -p \/mnt\/server\/steamcmd\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\ncd \/mnt\/server\/steamcmd\n\n# SteamCMD fails otherwise for some reason, even running as root.\n# This is changed at the end of the install process anyways.\nchown -R root:root \/mnt\n\nexport HOME=\/mnt\/server\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} +quit\n\nmkdir -p \/mnt\/server\/.steam\/sdk32\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so", - "container": "ubuntu:16.04", + "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ubuntu:18.04'\r\napt -y update\r\napt -y --no-install-recommends install curl lib32gcc1 ca-certificates\r\n\r\n## just in case someone removed the defaults.\r\nif [ \"${STEAM_USER}\" == \"\" ]; then\r\n STEAM_USER=anonymous\r\n STEAM_PASS=\"\"\r\n STEAM_AUTH=\"\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so", + "container": "ubuntu:18.04", "entrypoint": "bash" } }, From 6cf338c1a5cdc899463e8a0550ea32500d94676e Mon Sep 17 00:00:00 2001 From: "Michael (Parker) Parker" Date: Mon, 9 Dec 2019 13:19:55 -0500 Subject: [PATCH 02/27] fix server author. --- .../seeds/eggs/source-engine/egg-ark--survival-evolved.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json b/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json index 1017fefb4..e86a89a9a 100644 --- a/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json +++ b/database/seeds/eggs/source-engine/egg-ark--survival-evolved.json @@ -5,7 +5,7 @@ }, "exported_at": "2018-10-29T20:51:32+01:00", "name": "Ark: Survival Evolved", - "author": "dev@shepper.fr", + "author": "support@pterodactyl.io", "description": "As a man or woman stranded, naked, freezing, and starving on the unforgiving shores of a mysterious island called ARK, use your skill and cunning to kill or tame and ride the plethora of leviathan dinosaurs and other primeval creatures roaming the land. Hunt, harvest resources, craft items, grow crops, research technologies, and build shelters to withstand the elements and store valuables, all while teaming up with (or preying upon) hundreds of other players to survive, dominate... and escape! \u2014 Gamepedia: ARK", "image": "quay.io\/pterodactyl\/core:source", "startup": "\"cd ShooterGame\/Binaries\/Linux && .\/ShooterGameServer {{SERVER_MAP}}?listen?SessionName='{{SESSION_NAME}}'?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}?RCONPort={{RCON_PORT}}?QueryPort={{QUERY_PORT}}?RCONEnabled={{ENABLE_RCON}} -server -log\"", From fb96d9468ed2152253db2e667f39dec3790270a9 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 11 Apr 2020 12:35:27 -0600 Subject: [PATCH 03/27] Prevent primary allocation from being an additional allocation at the same time when creating a server --- .../themes/pterodactyl/js/admin/new-server.js | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js index 5a7393b4f..3da41da0f 100644 --- a/public/themes/pterodactyl/js/admin/new-server.js +++ b/public/themes/pterodactyl/js/admin/new-server.js @@ -21,18 +21,23 @@ $(document).ready(function() { $('#pNestId').select2({ placeholder: 'Select a Nest', }).change(); + $('#pEggId').select2({ placeholder: 'Select a Nest Egg', }); + $('#pPackId').select2({ placeholder: 'Select a Service Pack', }); + $('#pNodeId').select2({ placeholder: 'Select a Node', }).change(); + $('#pAllocation').select2({ placeholder: 'Select a Default Allocation', }); + $('#pAllocationAdditional').select2({ placeholder: 'Select Additional Allocations', }); @@ -97,10 +102,8 @@ $('#pNodeId').on('change', function () { data: v.allocations, placeholder: 'Select a Default Allocation', }); - $('#pAllocationAdditional').html('').select2({ - data: v.allocations, - placeholder: 'Select Additional Allocations', - }) + + updateAdditionalAllocations(); } }); }); @@ -154,3 +157,31 @@ $('#pEggId').on('change', function (event) { $('#appendVariablesTo').append(dataAppend); }); }); + +$('#pAllocation').on('change', function () { + updateAdditionalAllocations(); +}); + +function updateAdditionalAllocations() { + let currentAllocation = $('#pAllocation').val(); + let currentNode = $('#pNodeId').val(); + + $.each(Pterodactyl.nodeData, function (i, v) { + if (v.id == currentNode) { + let allocations = []; + + for (let i = 0; i < v.allocations.length; i++) { + const allocation = v.allocations[i]; + + if (allocation.id != currentAllocation) { + allocations.push(allocation); + } + } + + $('#pAllocationAdditional').html('').select2({ + data: allocations, + placeholder: 'Select Additional Allocations', + }); + } + }); +} From b5e50719acd05b3abb7daa5687a397eb6095e350 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 11 Apr 2020 13:56:03 -0600 Subject: [PATCH 04/27] Remove old Theme::js calls in blade layouts. Persist checkboxes, Server Owner, Node, Default Allocation, and Additional Allocations on servers/new.blade.php --- .../Repository/UserRepositoryInterface.php | 8 ++ app/Helpers/Utilities.php | 12 ++ app/Http/Controllers/Admin/UserController.php | 7 +- app/Repositories/Eloquent/UserRepository.php | 18 +++ .../themes/pterodactyl/js/admin/new-server.js | 91 ++++++------ resources/views/admin/servers/new.blade.php | 132 ++++++++++++++---- resources/views/layouts/admin.blade.php | 6 +- resources/views/layouts/auth.blade.php | 2 +- resources/views/layouts/master.blade.php | 6 +- 9 files changed, 209 insertions(+), 73 deletions(-) diff --git a/app/Contracts/Repository/UserRepositoryInterface.php b/app/Contracts/Repository/UserRepositoryInterface.php index 41649f48b..f5ba47b4b 100644 --- a/app/Contracts/Repository/UserRepositoryInterface.php +++ b/app/Contracts/Repository/UserRepositoryInterface.php @@ -22,4 +22,12 @@ interface UserRepositoryInterface extends RepositoryInterface, SearchableInterfa * @return \Illuminate\Support\Collection */ public function filterUsersByQuery(?string $query): Collection; + + /** + * Returns a user with the given id in a format that can be used for dropdowns. + * + * @param int $id + * @return \Pterodactyl\Models\Model + */ + public function filterById(int $id): \Pterodactyl\Models\Model; } diff --git a/app/Helpers/Utilities.php b/app/Helpers/Utilities.php index 2a0689124..d900425d9 100644 --- a/app/Helpers/Utilities.php +++ b/app/Helpers/Utilities.php @@ -6,6 +6,7 @@ use Exception; use Carbon\Carbon; use Cron\CronExpression; use Illuminate\Support\Facades\Log; +use Illuminate\Support\ViewErrorBag; class Utilities { @@ -50,4 +51,15 @@ class Utilities sprintf('%s %s %s * %s', $minute, $hour, $dayOfMonth, $dayOfWeek) )->getNextRunDate()); } + + public static function checked($name, $default) + { + $errors = session('errors'); + + if (isset($errors) && $errors instanceof ViewErrorBag && $errors->any()) { + return old($name) ? 'checked' : ''; + } + + return ($default) ? 'checked' : ''; + } } diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 14b3b594f..18e7e3b43 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -177,10 +177,15 @@ class UserController extends Controller * Get a JSON response of users on the system. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection|\Pterodactyl\Models\Model */ public function json(Request $request) { + // Handle single user requests. + if ($request->query('user_id')) { + return $this->repository->filterById($request->input('user_id')); + } + return $this->repository->filterUsersByQuery($request->input('q')); } } diff --git a/app/Repositories/Eloquent/UserRepository.php b/app/Repositories/Eloquent/UserRepository.php index 1ed6c5b74..b6468b5bb 100644 --- a/app/Repositories/Eloquent/UserRepository.php +++ b/app/Repositories/Eloquent/UserRepository.php @@ -54,4 +54,22 @@ class UserRepository extends EloquentRepository implements UserRepositoryInterfa return $item; }); } + + /** + * Returns a user with the given id in a format that can be used for dropdowns. + * + * @param int $id + * @return \Pterodactyl\Models\Model + */ + public function filterById(int $id): \Pterodactyl\Models\Model + { + $this->setColumns([ + 'id', 'email', 'username', 'name_first', 'name_last', + ]); + + $model = $this->getBuilder()->findOrFail($id, $this->getColumns())->getModel(); + $model->md5 = md5(strtolower($model->email)); + + return $model; + } } diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js index 3da41da0f..cf8766356 100644 --- a/public/themes/pterodactyl/js/admin/new-server.js +++ b/public/themes/pterodactyl/js/admin/new-server.js @@ -41,47 +41,6 @@ $(document).ready(function() { $('#pAllocationAdditional').select2({ placeholder: 'Select Additional Allocations', }); - - $('#pUserId').select2({ - ajax: { - url: '/admin/users/accounts.json', - dataType: 'json', - delay: 250, - data: function (params) { - return { - q: params.term, // search term - page: params.page, - }; - }, - processResults: function (data, params) { - return { results: data }; - }, - cache: true, - }, - escapeMarkup: function (markup) { return markup; }, - minimumInputLength: 2, - templateResult: function (data) { - if (data.loading) return data.text; - - return '
\ - User Image \ - \ - ' + data.name_first + ' ' + data.name_last +' \ - \ - ' + data.email + ' - ' + data.username + ' \ -
'; - }, - templateSelection: function (data) { - return '
\ - \ - User Image \ - \ - \ - ' + data.name_first + ' ' + data.name_last + ' (' + data.email + ') \ - \ -
'; - } - }); }); var lastActiveBox = null; @@ -185,3 +144,53 @@ function updateAdditionalAllocations() { } }); } + +function initUserIdSelect(data) { + $('#pUserId').select2({ + ajax: { + url: '/admin/users/accounts.json', + dataType: 'json', + delay: 250, + + data: function (params) { + return { + q: params.term, // search term + page: params.page, + }; + }, + + processResults: function (data, params) { + return { results: data }; + }, + + cache: true, + }, + + data: data, + escapeMarkup: function (markup) { return markup; }, + minimumInputLength: 2, + + templateResult: function (data) { + if (data.loading) return data.text; + + return '
\ + User Image \ + \ + ' + data.name_first + ' ' + data.name_last +' \ + \ + ' + data.email + ' - ' + data.username + ' \ +
'; + }, + + templateSelection: function (data) { + return '
\ + \ + User Image \ + \ + \ + ' + data.name_first + ' ' + data.name_last + ' (' + data.email + ') \ + \ +
'; + } + }); +} diff --git a/resources/views/admin/servers/new.blade.php b/resources/views/admin/servers/new.blade.php index 7aa4477e9..59011aa46 100644 --- a/resources/views/admin/servers/new.blade.php +++ b/resources/views/admin/servers/new.blade.php @@ -26,6 +26,7 @@

Core Details

+
@@ -33,20 +34,23 @@

Character limits: a-z A-Z 0-9 _ - . and [Space] (max 200 characters).

+
- +
+
- - + +

A brief description of this server.

+
- +
@@ -55,6 +59,7 @@
+
@@ -62,6 +67,7 @@

Allocation Management

+
@@ -78,22 +84,26 @@ @endforeach +

The node which this server will be deployed to.

+
- +

The main allocation that will be assigned to this server.

+
- +

Additional allocations to assign to this server on creation.

+
@@ -101,18 +111,20 @@

Application Feature Limits

+
- +
- +

The total number of databases a user is allowed to create for this server. Leave blank to allow unlimited.

+
- +
- +

The total number of allocations a user is allowed to create for this server. Leave blank to allow unlimited.

@@ -126,71 +138,90 @@

Resource Management

+
+
- + %
-

If you do not want to limit CPU usage, set the value to 0. To determine a value, take the number of physical cores and multiply it by 100. For example, on a quad core system (4 * 100 = 400) there is 400% available. To limit a server to using half of a single core, you would set the value to 50. To allow a server to use up to two physical cores, set the value to 200. BlockIO should be a value between 10 and 1000. Please see this documentation for more information about it.

+ +

If you do not want to limit CPU usage, set the value to 0. To determine a value, take the number of physical cores and multiply it by 100. For example, on a quad core system (4 * 100 = 400) there is 400% available. To limit a server to using half of a single core, you would set the value to 50. To allow a server to use up to two physical cores, set the value to 200. BlockIO should be a value between 10 and 1000. Please see this documentation for more information about it.

+
+
- +
+

Advanced: Enter the specific CPU cores that this process can run on, or leave blank to allow all cores. This can be a single number, or a comma seperated list. Example: 0, 0-1,3, or 0,1,3,4.

+
+
- + MB
+
+
- + MB
+ +
+
- - MB + + MB
+
+
- +
-

Advanced: The IO performance of this server relative to other running containers on the system. Value should be between 10 and 1000.

+ +

Advanced: The IO performance of this server relative to other running containers on the system. Value should be between 10 and 1000.

+

Nest Configuration

+
- @foreach($nests as $nest) @endforeach +

Select the Nest that this server will be grouped under.

+
- +

Select the Egg that will define how this server should operate.

+
- +

Select a data pack to be automatically installed on this server when first created.

+
- +
+

If the selected Egg has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.

+

Docker Configuration

+
@@ -236,23 +274,28 @@
+

Startup Configuration

+
- +

The following data substitutes are available for the startup command: @{{SERVER_MEMORY}}, @{{SERVER_IP}}, and @{{SERVER_PORT}}. They will be replaced with the allocated memory, server IP, and server port respectively.

+

Service Variables

+
+ @section('footer-scripts') - {!! Theme::js('js/keyboard.polyfill.js') !!} - + {{--{!! Theme::js('js/keyboard.polyfill.js') !!} + --}} {!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!} {!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!} @@ -185,7 +185,7 @@ {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!} {!! Theme::js('vendor/select2/select2.full.min.js?t={cache-version}') !!} {!! Theme::js('js/admin/functions.js?t={cache-version}') !!} - {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} + {{-- {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} --}} @if(Auth::user()->root_admin) + {{--{!! Theme::js('js/keyboard.polyfill.js?t={cache-version}') !!} + --}} {!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!} {!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!} @@ -284,7 +284,7 @@ {!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!} {!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!} {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!} - {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} + {{-- {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} --}} @if(Auth::user()->root_admin) @endsection From a7dab697115713ee45728a36296b31edf5d31fc8 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 11 Apr 2020 14:46:30 -0600 Subject: [PATCH 07/27] Persist service variables --- .../themes/pterodactyl/js/admin/new-server.js | 7 +++ resources/views/admin/servers/new.blade.php | 48 +++++++++++++------ 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js index d52502f33..3e0718a46 100644 --- a/public/themes/pterodactyl/js/admin/new-server.js +++ b/public/themes/pterodactyl/js/admin/new-server.js @@ -101,8 +101,11 @@ $('#pEggId').on('change', function (event) { ), }); + const variableIds = {}; $('#appendVariablesTo').html(''); $.each(_.get(objectChain, 'variables', []), function (i, item) { + variableIds[item.env_variable] = 'var_ref_' + item.id; + let isRequired = (item.required === 1) ? 'Required ' : ''; let dataAppend = ' \
\ @@ -115,6 +118,10 @@ $('#pEggId').on('change', function (event) { '; $('#appendVariablesTo').append(dataAppend); }); + + // If you receive a warning on this line, it should be fine to ignore. this function is + // defined in "resources/views/admin/servers/new.blade.php" near the bottom of the file. + serviceVariablesUpdated($('#pEggId').val(), variableIds); }); $('#pAllocation').on('change', function () { diff --git a/resources/views/admin/servers/new.blade.php b/resources/views/admin/servers/new.blade.php index b3418347e..1d61f1a50 100644 --- a/resources/views/admin/servers/new.blade.php +++ b/resources/views/admin/servers/new.blade.php @@ -309,11 +309,31 @@ @section('footer-scripts') @parent {!! Theme::js('vendor/lodash/lodash.js') !!} + + + {!! Theme::js('js/admin/new-server.js') !!} @endsection From 4d833af5f4190d565b4a84d68824e30ef464df18 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 11 Apr 2020 14:49:40 -0600 Subject: [PATCH 08/27] Fix script paths in layouts --- resources/views/layouts/admin.blade.php | 6 +++--- resources/views/layouts/auth.blade.php | 2 +- resources/views/layouts/master.blade.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php index 6559c89d2..551d83860 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/layouts/admin.blade.php @@ -173,8 +173,8 @@
@section('footer-scripts') - {{--{!! Theme::js('js/keyboard.polyfill.js') !!} - --}} + + {!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!} {!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!} @@ -185,7 +185,7 @@ {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!} {!! Theme::js('vendor/select2/select2.full.min.js?t={cache-version}') !!} {!! Theme::js('js/admin/functions.js?t={cache-version}') !!} - {{-- {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} --}} + @if(Auth::user()->root_admin) {!! Theme::js('vendor/particlesjs/particles.min.js?t={cache-version}') !!} --}} + + {!! Theme::js('vendor/jquery/jquery.min.js?t={cache-version}') !!} {!! Theme::js('vendor/sweetalert/sweetalert.min.js?t={cache-version}') !!} @@ -284,7 +284,7 @@ {!! Theme::js('vendor/adminlte/app.min.js?t={cache-version}') !!} {!! Theme::js('vendor/socketio/socket.io.v203.min.js?t={cache-version}') !!} {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js?t={cache-version}') !!} - {{-- {!! Theme::js('js/autocomplete.js?t={cache-version}') !!} --}} + @if(Auth::user()->root_admin)