diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bbceffb4..894ed60f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ 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. +### v0.7.0-beta.5 (Derelict Dermodactylus) +### Fixed +* `[beta.4]` — Fixes some bad search and replace action that happened previously and was throwing errors when validating user permissions. +* `[beta.4]` — Fixes behavior of variable validation to not break the page when no rules are provided. +* `[beta.4]` — Fix bug preventing the editing of files in the file manager. + +### Added +* Added support for editing symlinked files on the Panel. + ## v0.7.0-beta.4 (Derelict Dermodactylus) ### Fixed * `[beta.3]` — Fixes a bug with the default environment file that was causing an inability to perform a fresh install when running package discovery. diff --git a/README.md b/README.md index f586b3317..c74fa7945 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,3 @@ particles.js — [license](https://github.com/VincentGarreau/particles.js/blob/m ### Additional License Information 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. - -Some images used within Pterodactyl are Copyright (c) their respective owners. - -`/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/) - -`/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/) diff --git a/app/Contracts/Repository/Daemon/FileRepositoryInterface.php b/app/Contracts/Repository/Daemon/FileRepositoryInterface.php index aba7af0ea..8573daf61 100644 --- a/app/Contracts/Repository/Daemon/FileRepositoryInterface.php +++ b/app/Contracts/Repository/Daemon/FileRepositoryInterface.php @@ -21,11 +21,11 @@ interface FileRepositoryInterface extends BaseRepositoryInterface * Return the contents of a given file if it can be edited in the Panel. * * @param string $path - * @return \stdClass + * @return string * * @throws \GuzzleHttp\Exception\RequestException */ - public function getContent(string $path): stdClass; + public function getContent(string $path): string; /** * Save new contents to a given file. diff --git a/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php b/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php index 621fbd772..f39cdd00c 100644 --- a/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php +++ b/app/Http/Requests/Admin/Egg/EggVariableFormRequest.php @@ -1,11 +1,4 @@ . - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ namespace Pterodactyl\Http\Requests\Admin\Egg; @@ -15,6 +8,8 @@ use Pterodactyl\Http\Requests\Admin\AdminFormRequest; class EggVariableFormRequest extends AdminFormRequest { /** + * Define rules for validation of this request. + * * @return array */ public function rules() @@ -23,7 +18,7 @@ class EggVariableFormRequest extends AdminFormRequest 'name' => 'required|string|min:1|max:255', 'description' => 'sometimes|nullable|string', 'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES, - 'default_value' => 'string', + 'default_value' => 'nullable|string', 'options' => 'sometimes|required|array', 'rules' => 'bail|required|string', ]; @@ -41,6 +36,13 @@ class EggVariableFormRequest extends AdminFormRequest $rules = $this->input('rules', $this->route()->parameter('egg')->rules); } + // If rules is not a string it is already violating the rule defined above + // so just skip the addition of default value rules since this request + // will fail anyways. + if (! is_string($rules)) { + return; + } + $validator->addRules(['default_value' => $rules]); } } diff --git a/app/Http/Requests/Server/UpdateFileContentsFormRequest.php b/app/Http/Requests/Server/UpdateFileContentsFormRequest.php index da316cc22..0ebaa25b6 100644 --- a/app/Http/Requests/Server/UpdateFileContentsFormRequest.php +++ b/app/Http/Requests/Server/UpdateFileContentsFormRequest.php @@ -86,7 +86,7 @@ class UpdateFileContentsFormRequest extends ServerFormRequest } } - if (! $stats->file || ! in_array($stats->mime, $config->get('pterodactyl.files.editable'))) { + if ((! $stats->file && ! $stats->symlink) || ! in_array($stats->mime, $config->get('pterodactyl.files.editable'))) { throw new FileTypeNotEditableException(trans('server.files.exceptions.invalid_mime')); } diff --git a/app/Policies/ServerPolicy.php b/app/Policies/ServerPolicy.php index 8891fa87f..9b4db6f05 100644 --- a/app/Policies/ServerPolicy.php +++ b/app/Policies/ServerPolicy.php @@ -32,7 +32,7 @@ class ServerPolicy })->values(); }); - return $permissions->setSearchTerm($permission, true) !== false; + return $permissions->search($permission, true) !== false; } /** diff --git a/app/Repositories/Daemon/FileRepository.php b/app/Repositories/Daemon/FileRepository.php index 2f702d13d..8350e402f 100644 --- a/app/Repositories/Daemon/FileRepository.php +++ b/app/Repositories/Daemon/FileRepository.php @@ -33,11 +33,11 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface * Return the contents of a given file if it can be edited in the Panel. * * @param string $path - * @return \stdClass + * @return string * * @throws \GuzzleHttp\Exception\RequestException */ - public function getContent(string $path): stdClass + public function getContent(string $path): string { $file = pathinfo($path); $file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/'; diff --git a/app/Repositories/Eloquent/NodeRepository.php b/app/Repositories/Eloquent/NodeRepository.php index ed0dce003..61d93927e 100644 --- a/app/Repositories/Eloquent/NodeRepository.php +++ b/app/Repositories/Eloquent/NodeRepository.php @@ -65,7 +65,7 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa $instance = $this->getBuilder()->with('location')->withCount('servers'); if ($this->hasSearchTerm()) { - $instance->setSearchTerm($this->getSearchTerm()); + $instance->search($this->getSearchTerm()); } return $instance->paginate(25, $this->getColumns()); diff --git a/public/themes/pterodactyl/css/pterodactyl.css b/public/themes/pterodactyl/css/pterodactyl.css index 572b3b634..58003a338 100644 --- a/public/themes/pterodactyl/css/pterodactyl.css +++ b/public/themes/pterodactyl/css/pterodactyl.css @@ -456,3 +456,11 @@ label.control-label > span.field-optional:before { .pagination > li > a, .pagination > li > span { padding: 3px 10px !important; } + +body.sidebar-collapse .main-header .logo { + overflow: hidden; + text-indent: 100%; + background-image: url('/favicons/favicon-32x32.png'); + background-repeat: no-repeat; + background-position: center; +} diff --git a/resources/themes/pterodactyl/admin/eggs/variables.blade.php b/resources/themes/pterodactyl/admin/eggs/variables.blade.php index 5ceeda675..bd18e05cf 100644 --- a/resources/themes/pterodactyl/admin/eggs/variables.blade.php +++ b/resources/themes/pterodactyl/admin/eggs/variables.blade.php @@ -99,25 +99,25 @@