Skip to content

Commit a4cf06b

Browse files
committed
Fix missing HASHIDS_SALT setting in app setup command, closes pterodactyl#724
1 parent 4898d4f commit a4cf06b

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
88
* `[beta.1]` — Fixes a CORS header issue due to a wrong API endpoint being provided in the administrative node listing.
99
* `[beta.1]` — Fixes bug that would prevent root admins from accessing servers they were not set as the owner of.
1010
* `[beta.1]` — Fixes wrong URL redirect being provided when creating a subuser.
11+
* `[beta.1]` — Fixes missing check in environment setup that would leave the Hashids salt empty.
1112

1213
## v0.7.0-beta.1 (Derelict Dermodactylus)
1314
### Added

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ public function __construct(ConfigRepository $config, Kernel $command)
7272
*/
7373
public function handle()
7474
{
75+
if (empty($this->config->get('hashids.salt')) || $this->option('--new-salt')) {
76+
$this->variables['HASHIDS_SALT'] = str_random(20);
77+
}
78+
7579
$this->output->comment(trans('command/messages.environment.app.author_help'));
7680
$this->variables['APP_SERVICE_AUTHOR'] = $this->option('author') ?? $this->ask(
7781
trans('command/messages.environment.app.author'), $this->config->get('pterodactyl.service.author', 'unknown@unknown.com')

app/Http/Requests/Server/ScheduleCreationFormRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getTasks()
6969
{
7070
$restructured = [];
7171
foreach (array_get($this->all(), 'tasks', []) as $key => $values) {
72-
for ($i = 0; $i < count($values); $i++) {
72+
for ($i = 0; $i < count($values); ++$i) {
7373
$restructured[$i][$key] = $values[$i];
7474
}
7575
}

app/Providers/MacroServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function boot()
3131
$i = 0;
3232
while (($size / 1024) > 0.9) {
3333
$size = $size / 1024;
34-
$i++;
34+
++$i;
3535
}
3636

3737
return round($size, ($i < 2) ? 0 : $precision) . ' ' . $units[$i];

app/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function human_readable($path, $precision = 2)
2020
$i = 0;
2121
while (($path / 1024) > 0.9) {
2222
$path = $path / 1024;
23-
$i++;
23+
++$i;
2424
}
2525

2626
return round($path, $precision) . ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][$i];

0 commit comments

Comments
 (0)