Skip to content

Commit 3fe5d16

Browse files
committed
Add skip scripting option
1 parent c8f1335 commit 3fe5d16

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/Http/Controllers/Daemon/OptionController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ public function details(Request $request, $server)
4141

4242
return response()->json([
4343
'scripts' => [
44-
'install' => str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_install),
45-
// 'upgrade' => str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_upgrade),
44+
'install' => (! $server->option->script_install) ? null : str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_install),
4645
'privileged' => $server->option->script_is_privileged,
4746
],
4847
'env' => $environment->merge([

app/Repositories/ServerRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public function create(array $data)
103103
'startup' => 'string',
104104
'auto_deploy' => 'sometimes|required|accepted',
105105
'custom_id' => 'sometimes|required|numeric|unique:servers,id',
106+
'skip_scripting' => 'sometimes|required|boolean',
106107
]);
107108

108109
$validator->sometimes('node_id', 'required|numeric|min:1|exists:nodes,id', function ($input) {
@@ -326,6 +327,7 @@ public function create(array $data)
326327
'type' => $service->folder,
327328
'option' => $option->tag,
328329
'pack' => (isset($pack)) ? $pack->uuid : null,
330+
'skip_scripting' => isset($data['skip_scripting']),
329331
],
330332
'keys' => [
331333
(string) $server->daemonSecret => $this->daemonPermissions,

resources/themes/pterodactyl/admin/servers/new.blade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@
212212
<select name="pack_id" id="pPackId" class="form-control"></select>
213213
<p class="small text-muted no-margin">Select a service pack to be automatically installed on this server when first created.</p>
214214
</div>
215+
<div class="form-group col-xs-12">
216+
<div class="checkbox checkbox-primary no-margin-bottom">
217+
<input id="pSkipScripting" name="skip_scripting" type="checkbox" value="1" />
218+
<label for="pSkipScripting" class="strong">Skip Service Option Install Script</label>
219+
</div>
220+
<p class="small text-muted no-margin">If the selected <code>Option</code> 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.</p>
221+
</div>
215222
</div>
216223
</div>
217224
</div>

0 commit comments

Comments
 (0)