Fix missing HASHIDS_SALT setting in app setup command, closes #724

This commit is contained in:
Dane Everitt 2017-11-05 12:58:25 -06:00
parent 4898d4f9d2
commit a4cf06ba77
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 8 additions and 3 deletions

View file

@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* `[beta.1]` — Fixes a CORS header issue due to a wrong API endpoint being provided in the administrative node listing.
* `[beta.1]` — Fixes bug that would prevent root admins from accessing servers they were not set as the owner of.
* `[beta.1]` — Fixes wrong URL redirect being provided when creating a subuser.
* `[beta.1]` — Fixes missing check in environment setup that would leave the Hashids salt empty.
## v0.7.0-beta.1 (Derelict Dermodactylus)
### Added

View file

@ -72,6 +72,10 @@ class AppSettingsCommand extends Command
*/
public function handle()
{
if (empty($this->config->get('hashids.salt')) || $this->option('--new-salt')) {
$this->variables['HASHIDS_SALT'] = str_random(20);
}
$this->output->comment(trans('command/messages.environment.app.author_help'));
$this->variables['APP_SERVICE_AUTHOR'] = $this->option('author') ?? $this->ask(
trans('command/messages.environment.app.author'), $this->config->get('pterodactyl.service.author', 'unknown@unknown.com')

View file

@ -69,7 +69,7 @@ class ScheduleCreationFormRequest extends ServerFormRequest
{
$restructured = [];
foreach (array_get($this->all(), 'tasks', []) as $key => $values) {
for ($i = 0; $i < count($values); $i++) {
for ($i = 0; $i < count($values); ++$i) {
$restructured[$i][$key] = $values[$i];
}
}

View file

@ -31,7 +31,7 @@ class MacroServiceProvider extends ServiceProvider
$i = 0;
while (($size / 1024) > 0.9) {
$size = $size / 1024;
$i++;
++$i;
}
return round($size, ($i < 2) ? 0 : $precision) . ' ' . $units[$i];

View file

@ -20,7 +20,7 @@ if (! function_exists('human_readable')) {
$i = 0;
while (($path / 1024) > 0.9) {
$path = $path / 1024;
$i++;
++$i;
}
return round($path, $precision) . ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][$i];