Skip to content

Commit 4957c95

Browse files
committed
OxideMod support
1 parent ee0211e commit 4957c95

File tree

1 file changed

+182
-12
lines changed

1 file changed

+182
-12
lines changed

database/seeds/RustServiceTableSeeder.php

Lines changed: 182 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,62 @@ private function addCoreOptions()
106106
'script_entry' => 'bash',
107107
'script_container' => 'ubuntu:16.04',
108108
]);
109+
110+
111+
$script = <<<'EOF'
112+
apt update
113+
apt -y --no-install-recommends install curl unzip lib32gcc1 ca-certificates
114+
115+
cd /tmp
116+
curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
117+
118+
mkdir -p /mnt/server/steam
119+
tar -xzvf steamcmd.tar.gz -C /mnt/server/steam
120+
cd /mnt/server/steam
121+
122+
chown -R root:root /mnt
123+
124+
export HOME=/mnt/server
125+
./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 258550 +quit
126+
127+
cd /mnt/server
128+
curl https://dl.bintray.com/oxidemod/builds/Oxide-Rust.zip > oxide.zip
129+
unzip oxide.zip
130+
rm oxide.zip
131+
echo "This file is used to determine whether the server is an OxideMod server or not.
132+
Do not delete this file or you may loose OxideMod auto updating from the server." > OXIDE_FLAG
133+
134+
mkdir -p /mnt/server/.steam/sdk32
135+
cp -v /mnt/server/steam/linux32/steamclient.so /mnt/server/.steam/sdk32/steamclient.so
136+
EOF;
137+
138+
$this->option['rustoxide'] = ServiceOption::updateOrCreate([
139+
'service_id' => $this->service->id,
140+
'tag' => 'rustoxide',
141+
], [
142+
'name' => 'OxideMod',
143+
'description' => 'OxideMod Rust server.',
144+
'docker_image' => 'quay.io/pterodactyl/core:rust',
145+
'config_startup' => '{"done": "Server startup complete", "userInteraction": []}',
146+
'config_files' => '{}',
147+
'config_logs' => '{"custom": false, "location": "latest.log"}',
148+
'config_stop' => 'quit',
149+
'config_from' => null,
150+
'startup' => null,
151+
'script_install' => $script,
152+
'script_entry' => 'bash',
153+
'script_container' => 'ubuntu:16.04',
154+
]);
109155
}
110156

111157
private function addVariables()
112158
{
113159
$this->addVanillaVariables();
160+
$this->addOxideVariables();
114161
}
115162

116163
private function addVanillaVariables()
117164
{
118-
ServiceVariable::updateOrCreate([
119-
'option_id' => $this->option['rustvanilla']->id,
120-
'env_variable' => 'LD_LIBRARY_PATH',
121-
], [
122-
'name' => 'LD_LIBRARY_PATH',
123-
'description' => 'A fix for Rust not starting.',
124-
'default_value' => './RustDedicated_Data/Plugins/x86_64',
125-
'user_viewable' => 0,
126-
'user_editable' => 0,
127-
'rules' => 'required',
128-
]);
129-
130165
ServiceVariable::updateOrCreate([
131166
'option_id' => $this->option['rustvanilla']->id,
132167
'env_variable' => 'HOSTNAME',
@@ -259,4 +294,139 @@ private function addVanillaVariables()
259294
'rules' => 'present',
260295
]);
261296
}
297+
298+
private function addOxideVariables()
299+
{
300+
ServiceVariable::updateOrCreate([
301+
'option_id' => $this->option['rustoxide']->id,
302+
'env_variable' => 'HOSTNAME',
303+
], [
304+
'name' => 'Server Name',
305+
'description' => 'The name of your server in the public server list.',
306+
'default_value' => 'A Rust Server',
307+
'user_viewable' => 1,
308+
'user_editable' => 1,
309+
'rules' => 'required|string',
310+
]);
311+
312+
ServiceVariable::updateOrCreate([
313+
'option_id' => $this->option['rustoxide']->id,
314+
'env_variable' => 'LEVEL',
315+
], [
316+
'name' => 'Level',
317+
'description' => 'The world file for Rust to use.',
318+
'default_value' => 'Procedural Map',
319+
'user_viewable' => 1,
320+
'user_editable' => 1,
321+
'rules' => 'required|string',
322+
]);
323+
324+
ServiceVariable::updateOrCreate([
325+
'option_id' => $this->option['rustoxide']->id,
326+
'env_variable' => 'DESCRIPTION',
327+
], [
328+
'name' => 'Description',
329+
'description' => 'The description under your server title. Commonly used for rules & info.',
330+
'default_value' => 'Powered by Pterodactyl',
331+
'user_viewable' => 1,
332+
'user_editable' => 1,
333+
'rules' => 'required|string',
334+
]);
335+
336+
ServiceVariable::updateOrCreate([
337+
'option_id' => $this->option['rustoxide']->id,
338+
'env_variable' => 'URL',
339+
], [
340+
'name' => 'URL',
341+
'description' => 'The URL for your server. This is what comes up when clicking the "Visit Website" button.',
342+
'default_value' => 'http://pterodactyl.io',
343+
'user_viewable' => 1,
344+
'user_editable' => 1,
345+
'rules' => 'url',
346+
]);
347+
348+
ServiceVariable::updateOrCreate([
349+
'option_id' => $this->option['rustoxide']->id,
350+
'env_variable' => 'WORLD_SIZE',
351+
], [
352+
'name' => 'World Size',
353+
'description' => 'The world size for a procedural map.',
354+
'default_value' => '3000',
355+
'user_viewable' => 1,
356+
'user_editable' => 1,
357+
'rules' => 'required|integer',
358+
]);
359+
360+
ServiceVariable::updateOrCreate([
361+
'option_id' => $this->option['rustoxide']->id,
362+
'env_variable' => 'SEED',
363+
], [
364+
'name' => 'World Seed',
365+
'description' => 'The seed for a procedural map.',
366+
'default_value' => '',
367+
'user_viewable' => 1,
368+
'user_editable' => 1,
369+
'rules' => 'present',
370+
]);
371+
372+
ServiceVariable::updateOrCreate([
373+
'option_id' => $this->option['rustoxide']->id,
374+
'env_variable' => 'MAX_PLAYERS',
375+
], [
376+
'name' => 'Max Players',
377+
'description' => 'The maximum amount of players allowed in the server at once.',
378+
'default_value' => '40',
379+
'user_viewable' => 1,
380+
'user_editable' => 1,
381+
'rules' => 'required|integer',
382+
]);
383+
384+
ServiceVariable::updateOrCreate([
385+
'option_id' => $this->option['rustoxide']->id,
386+
'env_variable' => 'SERVER_IMG',
387+
], [
388+
'name' => 'Server Header Image',
389+
'description' => 'The header image for the top of your server listing.',
390+
'default_value' => '',
391+
'user_viewable' => 1,
392+
'user_editable' => 1,
393+
'rules' => 'url',
394+
]);
395+
396+
ServiceVariable::updateOrCreate([
397+
'option_id' => $this->option['rustoxide']->id,
398+
'env_variable' => 'RCON_PORT',
399+
], [
400+
'name' => 'RCON Port',
401+
'description' => 'Port for RCON connections.',
402+
'default_value' => '8401',
403+
'user_viewable' => 1,
404+
'user_editable' => 0,
405+
'rules' => 'required|integer',
406+
]);
407+
408+
ServiceVariable::updateOrCreate([
409+
'option_id' => $this->option['rustoxide']->id,
410+
'env_variable' => 'RCON_PASS',
411+
], [
412+
'name' => 'RCON Password',
413+
'description' => 'Remote console access password.',
414+
'default_value' => 'CHANGEME',
415+
'user_viewable' => 1,
416+
'user_editable' => 1,
417+
'rules' => 'required',
418+
]);
419+
420+
ServiceVariable::updateOrCreate([
421+
'option_id' => $this->option['rustoxide']->id,
422+
'env_variable' => 'ADDITIONAL_ARGS',
423+
], [
424+
'name' => 'Additional Arguments',
425+
'description' => 'Add additional startup parameters to the server.',
426+
'default_value' => '',
427+
'user_viewable' => 1,
428+
'user_editable' => 1,
429+
'rules' => 'present',
430+
]);
431+
}
262432
}

0 commit comments

Comments
 (0)