Skip to content

Commit 8dcab92

Browse files
committed
Merge branch 'develop' into feature/api-v1
2 parents 17f6f3e + c369151 commit 8dcab92

File tree

10 files changed

+41
-28
lines changed

10 files changed

+41
-28
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
### v0.7.0-beta.5 (Derelict Dermodactylus)
7+
### Fixed
8+
* `[beta.4]` — Fixes some bad search and replace action that happened previously and was throwing errors when validating user permissions.
9+
* `[beta.4]` — Fixes behavior of variable validation to not break the page when no rules are provided.
10+
* `[beta.4]` — Fix bug preventing the editing of files in the file manager.
11+
12+
### Added
13+
* Added support for editing symlinked files on the Panel.
14+
615
## v0.7.0-beta.4 (Derelict Dermodactylus)
716
### Fixed
817
* `[beta.3]` — Fixes a bug with the default environment file that was causing an inability to perform a fresh install when running package discovery.

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,3 @@ particles.js — [license](https://github.com/VincentGarreau/particles.js/blob/m
7575

7676
### Additional License Information
7777
Some Javascript and CSS used within the panel is licensed under a `MIT` or `Apache 2.0`. Please check their respective header files for more information.
78-
79-
Some images used within Pterodactyl are Copyright (c) their respective owners.
80-
81-
`/public/themes/default/images/403.jpg` is licensed under a [CC BY 2.0](http://creativecommons.org/licenses/by/2.0/) by [BigTallGuy](http://flickr.com/photos/bigtallguy/)
82-
83-
`/public/themes/default/images/404.jpg` is licensed under a [CC BY-SA 2.0](http://creativecommons.org/licenses/by-sa/2.0/) by [nicsuzor](http://flickr.com/photos/nicsuzor/)

app/Contracts/Repository/Daemon/FileRepositoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public function getFileStat(string $path): stdClass;
2121
* Return the contents of a given file if it can be edited in the Panel.
2222
*
2323
* @param string $path
24-
* @return \stdClass
24+
* @return string
2525
*
2626
* @throws \GuzzleHttp\Exception\RequestException
2727
*/
28-
public function getContent(string $path): stdClass;
28+
public function getContent(string $path): string;
2929

3030
/**
3131
* Save new contents to a given file.

app/Http/Requests/Admin/Egg/EggVariableFormRequest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Http\Requests\Admin\Egg;
114

@@ -15,6 +8,8 @@
158
class EggVariableFormRequest extends AdminFormRequest
169
{
1710
/**
11+
* Define rules for validation of this request.
12+
*
1813
* @return array
1914
*/
2015
public function rules()
@@ -23,7 +18,7 @@ public function rules()
2318
'name' => 'required|string|min:1|max:255',
2419
'description' => 'sometimes|nullable|string',
2520
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES,
26-
'default_value' => 'string',
21+
'default_value' => 'nullable|string',
2722
'options' => 'sometimes|required|array',
2823
'rules' => 'bail|required|string',
2924
];
@@ -41,6 +36,13 @@ public function withValidator($validator)
4136
$rules = $this->input('rules', $this->route()->parameter('egg')->rules);
4237
}
4338

39+
// If rules is not a string it is already violating the rule defined above
40+
// so just skip the addition of default value rules since this request
41+
// will fail anyways.
42+
if (! is_string($rules)) {
43+
return;
44+
}
45+
4446
$validator->addRules(['default_value' => $rules]);
4547
}
4648
}

app/Http/Requests/Server/UpdateFileContentsFormRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private function checkFileCanBeEdited($server, $token)
8686
}
8787
}
8888

89-
if (! $stats->file || ! in_array($stats->mime, $config->get('pterodactyl.files.editable'))) {
89+
if ((! $stats->file && ! $stats->symlink) || ! in_array($stats->mime, $config->get('pterodactyl.files.editable'))) {
9090
throw new FileTypeNotEditableException(trans('server.files.exceptions.invalid_mime'));
9191
}
9292

app/Policies/ServerPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function checkPermission(User $user, Server $server, $permission)
3232
})->values();
3333
});
3434

35-
return $permissions->setSearchTerm($permission, true) !== false;
35+
return $permissions->search($permission, true) !== false;
3636
}
3737

3838
/**

app/Repositories/Daemon/FileRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ public function getFileStat(string $path): stdClass
3333
* Return the contents of a given file if it can be edited in the Panel.
3434
*
3535
* @param string $path
36-
* @return \stdClass
36+
* @return string
3737
*
3838
* @throws \GuzzleHttp\Exception\RequestException
3939
*/
40-
public function getContent(string $path): stdClass
40+
public function getContent(string $path): string
4141
{
4242
$file = pathinfo($path);
4343
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';

app/Repositories/Eloquent/NodeRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getNodeListingData(): LengthAwarePaginator
6565
$instance = $this->getBuilder()->with('location')->withCount('servers');
6666

6767
if ($this->hasSearchTerm()) {
68-
$instance->setSearchTerm($this->getSearchTerm());
68+
$instance->search($this->getSearchTerm());
6969
}
7070

7171
return $instance->paginate(25, $this->getColumns());

public/themes/pterodactyl/css/pterodactyl.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,11 @@ label.control-label > span.field-optional:before {
456456
.pagination > li > a, .pagination > li > span {
457457
padding: 3px 10px !important;
458458
}
459+
460+
body.sidebar-collapse .main-header .logo {
461+
overflow: hidden;
462+
text-indent: 100%;
463+
background-image: url('/favicons/favicon-32x32.png');
464+
background-repeat: no-repeat;
465+
background-position: center;
466+
}

resources/themes/pterodactyl/admin/eggs/variables.blade.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,40 +99,40 @@
9999
<div class="modal-content">
100100
<div class="modal-header">
101101
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
102-
<h4 class="modal-title">Create New Option Variable</h4>
102+
<h4 class="modal-title">Create New Egg Variable</h4>
103103
</div>
104104
<form action="{{ route('admin.nests.egg.variables', $egg->id) }}" method="POST">
105105
<div class="modal-body">
106106
<div class="form-group">
107-
<label class="form-label">Name</label>
107+
<label class="control-label">Name <span class="field-required"></span></label>
108108
<input type="text" name="name" class="form-control" />
109109
</div>
110110
<div class="form-group">
111-
<label class="form-label">Description</label>
111+
<label class="control-label">Description</label>
112112
<textarea name="description" class="form-control" rows="3"></textarea>
113113
</div>
114114
<div class="row">
115115
<div class="form-group col-md-6">
116-
<label class="form-label">Environment Variable</label>
116+
<label class="control-label">Environment Variable <span class="field-required"></span></label>
117117
<input type="text" name="env_variable" class="form-control" />
118118
</div>
119119
<div class="form-group col-md-6">
120-
<label class="form-label">Default Value</label>
120+
<label class="control-label">Default Value</label>
121121
<input type="text" name="default_value" class="form-control" />
122122
</div>
123123
<div class="col-xs-12">
124124
<p class="text-muted small">This variable can be accessed in the statup command by entering <code>@{{environment variable value}}</code>.</p>
125125
</div>
126126
</div>
127127
<div class="form-group">
128-
<label class="form-label">Permissions</label>
128+
<label class="control-label">Permissions</label>
129129
<select name="options[]" class="pOptions form-control" multiple>
130130
<option value="user_viewable">Users Can View</option>
131131
<option value="user_editable">Users Can Edit</option>
132132
</select>
133133
</div>
134134
<div class="form-group">
135-
<label class="form-label">Input Rules</label>
135+
<label class="control-label">Input Rules <span class="field-required"></span></label>
136136
<input type="text" name="rules" class="form-control" value="required|string|max:20" placeholder="required|string|max:20" />
137137
<p class="text-muted small">These rules are defined using standard Laravel Framework validation rules.</p>
138138
</div>

0 commit comments

Comments
 (0)