mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 14:53:45 +02:00
Merge branch 'release/v0.7.17'
This commit is contained in:
@@ -3,6 +3,12 @@ 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.
|
This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
|
|
||||||
|
## v0.7.17 (Derelict Dermodactylus)
|
||||||
|
### Fixed
|
||||||
|
* Limited accounts to 5 API keys at a time.
|
||||||
|
* Fixes database passwords not being generated with the proper requirements for some MySQL setups.
|
||||||
|
* Hostnames that are not FQDNs/IP addresses can now be used for connecting to a MySQL host.
|
||||||
|
|
||||||
## v0.7.16 (Derelict Dermodactylus)
|
## v0.7.16 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fixed the /api/application/servers endpoint erroring when including subusers or egg
|
* Fixed the /api/application/servers endpoint erroring when including subusers or egg
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
|
Copyright (c) 2015 - 2020 Dane Everitt <dane@daneeveritt.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
35
app/Helpers/Utilities.php
Normal file
35
app/Helpers/Utilities.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Pterodactyl\Helpers;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class Utilities
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Generates a random string and injects special characters into it, in addition to
|
||||||
|
* the randomness of the alpha-numeric default response.
|
||||||
|
*
|
||||||
|
* @param int $length
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function randomStringWithSpecialCharacters(int $length = 16): string
|
||||||
|
{
|
||||||
|
$string = str_random($length);
|
||||||
|
// Given a random string of characters, randomly loop through the characters and replace some
|
||||||
|
// with special characters to avoid issues with MySQL password requirements on some servers.
|
||||||
|
try {
|
||||||
|
for ($i = 0; $i < random_int(2, 6); $i++) {
|
||||||
|
$character = ['!', '@', '=', '.', '+', '^'][random_int(0, 5)];
|
||||||
|
|
||||||
|
$string = substr_replace($string, $character, random_int(0, $length - 1), 1);
|
||||||
|
}
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
// Just log the error and hope for the best at this point.
|
||||||
|
Log::error($exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Pterodactyl\Models\ApiKey;
|
use Pterodactyl\Models\ApiKey;
|
||||||
use Prologue\Alerts\AlertsMessageBag;
|
use Prologue\Alerts\AlertsMessageBag;
|
||||||
|
use Pterodactyl\Exceptions\DisplayException;
|
||||||
use Pterodactyl\Http\Controllers\Controller;
|
use Pterodactyl\Http\Controllers\Controller;
|
||||||
use Pterodactyl\Services\Api\KeyCreationService;
|
use Pterodactyl\Services\Api\KeyCreationService;
|
||||||
use Pterodactyl\Http\Requests\Base\StoreAccountKeyRequest;
|
use Pterodactyl\Http\Requests\Base\StoreAccountKeyRequest;
|
||||||
@@ -76,10 +77,17 @@ class AccountKeyController extends Controller
|
|||||||
* @param \Pterodactyl\Http\Requests\Base\StoreAccountKeyRequest $request
|
* @param \Pterodactyl\Http\Requests\Base\StoreAccountKeyRequest $request
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*
|
*
|
||||||
|
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||||
*/
|
*/
|
||||||
public function store(StoreAccountKeyRequest $request)
|
public function store(StoreAccountKeyRequest $request)
|
||||||
{
|
{
|
||||||
|
if ($this->repository->findCountWhere(['user_id' => $request->user()->id]) >= 5) {
|
||||||
|
throw new DisplayException(
|
||||||
|
'Cannot assign more than 5 API keys to an account.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$this->keyService->setKeyType(ApiKey::TYPE_ACCOUNT)->handle([
|
$this->keyService->setKeyType(ApiKey::TYPE_ACCOUNT)->handle([
|
||||||
'user_id' => $request->user()->id,
|
'user_id' => $request->user()->id,
|
||||||
'allowed_ips' => $request->input('allowed_ips'),
|
'allowed_ips' => $request->input('allowed_ips'),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class DatabaseHost extends Model implements CleansAttributes, ValidableContract
|
|||||||
*/
|
*/
|
||||||
protected static $dataIntegrityRules = [
|
protected static $dataIntegrityRules = [
|
||||||
'name' => 'string|max:255',
|
'name' => 'string|max:255',
|
||||||
'host' => 'ip|unique:database_hosts,host',
|
'host' => 'unique:database_hosts,host',
|
||||||
'port' => 'numeric|between:1,65535',
|
'port' => 'numeric|between:1,65535',
|
||||||
'username' => 'string|max:32',
|
'username' => 'string|max:32',
|
||||||
'password' => 'nullable|string',
|
'password' => 'nullable|string',
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace Pterodactyl\Services\Databases;
|
namespace Pterodactyl\Services\Databases;
|
||||||
|
|
||||||
use Pterodactyl\Models\Database;
|
use Pterodactyl\Models\Database;
|
||||||
|
use Pterodactyl\Helpers\Utilities;
|
||||||
use Illuminate\Database\DatabaseManager;
|
use Illuminate\Database\DatabaseManager;
|
||||||
use Illuminate\Contracts\Encryption\Encrypter;
|
use Illuminate\Contracts\Encryption\Encrypter;
|
||||||
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
||||||
@@ -69,7 +70,9 @@ class DatabaseManagementService
|
|||||||
$data['server_id'] = $server;
|
$data['server_id'] = $server;
|
||||||
$data['database'] = sprintf('s%d_%s', $server, $data['database']);
|
$data['database'] = sprintf('s%d_%s', $server, $data['database']);
|
||||||
$data['username'] = sprintf('u%d_%s', $server, str_random(10));
|
$data['username'] = sprintf('u%d_%s', $server, str_random(10));
|
||||||
$data['password'] = $this->encrypter->encrypt(str_random(24));
|
$data['password'] = $this->encrypter->encrypt(
|
||||||
|
Utilities::randomStringWithSpecialCharacters(24)
|
||||||
|
);
|
||||||
|
|
||||||
$this->database->beginTransaction();
|
$this->database->beginTransaction();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
namespace Pterodactyl\Services\Databases;
|
namespace Pterodactyl\Services\Databases;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use Pterodactyl\Models\Database;
|
use Pterodactyl\Models\Database;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Pterodactyl\Helpers\Utilities;
|
||||||
use Illuminate\Database\ConnectionInterface;
|
use Illuminate\Database\ConnectionInterface;
|
||||||
use Illuminate\Contracts\Encryption\Encrypter;
|
use Illuminate\Contracts\Encryption\Encrypter;
|
||||||
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
||||||
@@ -62,19 +61,7 @@ class DatabasePasswordService
|
|||||||
*/
|
*/
|
||||||
public function handle(Database $database): string
|
public function handle(Database $database): string
|
||||||
{
|
{
|
||||||
$password = str_random(24);
|
$password = Utilities::randomStringWithSpecialCharacters(24);
|
||||||
// Given a random string of characters, randomly loop through the characters and replace some
|
|
||||||
// with special characters to avoid issues with MySQL password requirements on some servers.
|
|
||||||
try {
|
|
||||||
for ($i = 0; $i < random_int(2, 6); $i++) {
|
|
||||||
$character = ['!', '@', '=', '.', '+', '^'][random_int(0, 5)];
|
|
||||||
|
|
||||||
$password = substr_replace($password, $character, random_int(0, 23), 1);
|
|
||||||
}
|
|
||||||
} catch (Exception $exception) {
|
|
||||||
// Just log the error and hope for the best at this point.
|
|
||||||
Log::error($exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->connection->transaction(function () use ($database, $password) {
|
$this->connection->transaction(function () use ($database, $password) {
|
||||||
$this->dynamic->set('dynamic', $database->database_host_id);
|
$this->dynamic->set('dynamic', $database->database_host_id);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ return [
|
|||||||
| change this value if you are not maintaining your own internal versions.
|
| change this value if you are not maintaining your own internal versions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'version' => '0.7.16',
|
'version' => '0.7.17',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -45,14 +45,14 @@
|
|||||||
<a href="{{ $version->getDiscord() }}"><button class="btn btn-warning" style="width:100%;"><i class="fa fa-fw fa-support"></i> Get Help <small>(via Discord)</small></button></a>
|
<a href="{{ $version->getDiscord() }}"><button class="btn btn-warning" style="width:100%;"><i class="fa fa-fw fa-support"></i> Get Help <small>(via Discord)</small></button></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 text-center">
|
<div class="col-xs-6 col-sm-3 text-center">
|
||||||
<a href="https://docs.pterodactyl.io"><button class="btn btn-primary" style="width:100%;"><i class="fa fa-fw fa-link"></i> Documentation</button></a>
|
<a href="https://pterodactyl.io/project/introduction.html"><button class="btn btn-primary" style="width:100%;"><i class="fa fa-fw fa-link"></i> Documentation</button></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix visible-xs-block"> </div>
|
<div class="clearfix visible-xs-block"> </div>
|
||||||
<div class="col-xs-6 col-sm-3 text-center">
|
<div class="col-xs-6 col-sm-3 text-center">
|
||||||
<a href="https://github.com/Pterodactyl/Panel"><button class="btn btn-primary" style="width:100%;"><i class="fa fa-fw fa-support"></i> Github</button></a>
|
<a href="https://github.com/Pterodactyl/Panel"><button class="btn btn-primary" style="width:100%;"><i class="fa fa-fw fa-support"></i> Github</button></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 text-center">
|
<div class="col-xs-6 col-sm-3 text-center">
|
||||||
<a href="https://donorbox.org/pterodactyl"><button class="btn btn-success" style="width:100%;"><i class="fa fa-fw fa-money"></i> Support the Project</button></a>
|
<a href="https://www.paypal.me/PterodactylSoftware"><button class="btn btn-success" style="width:100%;"><i class="fa fa-fw fa-money"></i> Support the Project</button></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
@extends('layouts.master')
|
@extends('layouts.master')
|
||||||
|
|
||||||
@section('title')
|
@section('title')
|
||||||
@lang('server.schedules.new.header')
|
@lang('server.schedule.new.header')
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
|
|||||||
Reference in New Issue
Block a user