Merge branch '1.0-develop' into develop
This commit is contained in:
commit
ae27a8a65c
10 changed files with 79 additions and 19 deletions
|
@ -43,7 +43,8 @@ class AppSettingsCommand extends Command
|
||||||
{--redis-host= : Redis host to use for connections.}
|
{--redis-host= : Redis host to use for connections.}
|
||||||
{--redis-pass= : Password used to connect to redis.}
|
{--redis-pass= : Password used to connect to redis.}
|
||||||
{--redis-port= : Port to connect to redis over.}
|
{--redis-port= : Port to connect to redis over.}
|
||||||
{--settings-ui= : Enable or disable the settings UI.}';
|
{--settings-ui= : Enable or disable the settings UI.}
|
||||||
|
{--telemetry= : Enable or disable anonymous telemetry.}';
|
||||||
|
|
||||||
protected array $variables = [];
|
protected array $variables = [];
|
||||||
|
|
||||||
|
@ -118,6 +119,12 @@ class AppSettingsCommand extends Command
|
||||||
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm('Enable UI based settings editor?', true) ? 'false' : 'true';
|
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm('Enable UI based settings editor?', true) ? 'false' : 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->output->comment('Please reference https://pterodactyl.io/panel/1.0/additional_configuration.html#telemetry for more detailed information regarding telemetry data and collection.');
|
||||||
|
$this->variables['PTERODACTYL_TELEMETRY_ENABLED'] = $this->option('telemetry') ?? $this->confirm(
|
||||||
|
'Enable sending anonymous telemetry data?',
|
||||||
|
config('pterodactyl.telemetry.enabled', true)
|
||||||
|
) ? 'true' : 'false';
|
||||||
|
|
||||||
// Make sure session cookies are set as "secure" when using HTTPS
|
// Make sure session cookies are set as "secure" when using HTTPS
|
||||||
if (str_starts_with($this->variables['APP_URL'], 'https://')) {
|
if (str_starts_with($this->variables['APP_URL'], 'https://')) {
|
||||||
$this->variables['SESSION_SECURE_COOKIE'] = 'true';
|
$this->variables['SESSION_SECURE_COOKIE'] = 'true';
|
||||||
|
|
|
@ -56,10 +56,10 @@ class Kernel extends ConsoleKernel
|
||||||
{
|
{
|
||||||
$settingsRepository = app()->make(SettingsRepository::class);
|
$settingsRepository = app()->make(SettingsRepository::class);
|
||||||
|
|
||||||
$uuid = $settingsRepository->get('app:uuid');
|
$uuid = $settingsRepository->get('app:telemetry:uuid');
|
||||||
if (is_null($uuid)) {
|
if (is_null($uuid)) {
|
||||||
$uuid = Uuid::uuid4()->toString();
|
$uuid = Uuid::uuid4()->toString();
|
||||||
$settingsRepository->set('app:uuid', $uuid);
|
$settingsRepository->set('app:telemetry:uuid', $uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate a fixed time to run the data push at, this will be the same time every day.
|
// Calculate a fixed time to run the data push at, this will be the same time every day.
|
||||||
|
|
|
@ -11,6 +11,7 @@ use Illuminate\Database\ConnectionInterface;
|
||||||
use Pterodactyl\Http\Controllers\Controller;
|
use Pterodactyl\Http\Controllers\Controller;
|
||||||
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
||||||
use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
use Pterodactyl\Repositories\Wings\DaemonServerRepository;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||||
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
||||||
|
|
||||||
class ServerTransferController extends Controller
|
class ServerTransferController extends Controller
|
||||||
|
@ -33,8 +34,12 @@ class ServerTransferController extends Controller
|
||||||
public function failure(string $uuid): JsonResponse
|
public function failure(string $uuid): JsonResponse
|
||||||
{
|
{
|
||||||
$server = $this->repository->getByUuid($uuid);
|
$server = $this->repository->getByUuid($uuid);
|
||||||
|
$transfer = $server->transfer;
|
||||||
|
if (is_null($transfer)) {
|
||||||
|
throw new ConflictHttpException('Server is not being transferred.');
|
||||||
|
}
|
||||||
|
|
||||||
return $this->processFailedTransfer($server->transfer);
|
return $this->processFailedTransfer($transfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +51,9 @@ class ServerTransferController extends Controller
|
||||||
{
|
{
|
||||||
$server = $this->repository->getByUuid($uuid);
|
$server = $this->repository->getByUuid($uuid);
|
||||||
$transfer = $server->transfer;
|
$transfer = $server->transfer;
|
||||||
|
if (is_null($transfer)) {
|
||||||
|
throw new ConflictHttpException('Server is not being transferred.');
|
||||||
|
}
|
||||||
|
|
||||||
/** @var \Pterodactyl\Models\Server $server */
|
/** @var \Pterodactyl\Models\Server $server */
|
||||||
$server = $this->connection->transaction(function () use ($server, $transfer) {
|
$server = $this->connection->transaction(function () use ($server, $transfer) {
|
||||||
|
|
|
@ -51,10 +51,10 @@ class TelemetryCollectionService
|
||||||
*/
|
*/
|
||||||
public function collect(): array
|
public function collect(): array
|
||||||
{
|
{
|
||||||
$uuid = $this->settingsRepository->get('app:uuid');
|
$uuid = $this->settingsRepository->get('app:telemetry:uuid');
|
||||||
if (is_null($uuid)) {
|
if (is_null($uuid)) {
|
||||||
$uuid = Uuid::uuid4()->toString();
|
$uuid = Uuid::uuid4()->toString();
|
||||||
$this->settingsRepository->set('app:uuid', $uuid);
|
$this->settingsRepository->set('app:telemetry:uuid', $uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$nodes = Node::all()->map(function ($node) {
|
$nodes = Node::all()->map(function ($node) {
|
||||||
|
@ -115,9 +115,11 @@ class TelemetryCollectionService
|
||||||
'backup' => [
|
'backup' => [
|
||||||
'type' => config('backups.default'),
|
'type' => config('backups.default'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'type' => config('cache.default'),
|
'type' => config('cache.default'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'database' => [
|
'database' => [
|
||||||
'type' => config('database.default'),
|
'type' => config('database.default'),
|
||||||
'version' => DB::getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION),
|
'version' => DB::getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION),
|
||||||
|
@ -138,7 +140,10 @@ class TelemetryCollectionService
|
||||||
|
|
||||||
'eggs' => [
|
'eggs' => [
|
||||||
'count' => Egg::count(),
|
'count' => Egg::count(),
|
||||||
'ids' => Egg::pluck('uuid')->toArray(),
|
'server_usage' => Egg::all()
|
||||||
|
->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()])
|
||||||
|
->filter(fn (int $count) => $count > 0)
|
||||||
|
->toArray(),
|
||||||
],
|
],
|
||||||
|
|
||||||
'locations' => [
|
'locations' => [
|
||||||
|
@ -151,6 +156,10 @@ class TelemetryCollectionService
|
||||||
|
|
||||||
'nests' => [
|
'nests' => [
|
||||||
'count' => Nest::count(),
|
'count' => Nest::count(),
|
||||||
|
'server_usage' => Nest::all()
|
||||||
|
->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())])
|
||||||
|
->filter(fn (int $count) => $count > 0)
|
||||||
|
->toArray(),
|
||||||
],
|
],
|
||||||
|
|
||||||
'nodes' => [
|
'nodes' => [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
// The number of days ellapsed before old activity log entries are deleted.
|
// The number of days elapsed before old activity log entries are deleted.
|
||||||
'prune_days' => env('APP_ACTIVITY_PRUNE_DAYS', 90),
|
'prune_days' => env('APP_ACTIVITY_PRUNE_DAYS', 90),
|
||||||
|
|
||||||
// If set to true activity log entries generated by an admin user that is not also
|
// If set to true activity log entries generated by an admin user that is not also
|
||||||
|
|
|
@ -187,6 +187,6 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'telemetry' => [
|
'telemetry' => [
|
||||||
'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', false),
|
'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', true),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"ghcr.io\/pterodactyl\/yolks:debian"
|
"ghcr.io\/pterodactyl\/yolks:debian"
|
||||||
],
|
],
|
||||||
"file_denylist": [],
|
"file_denylist": [],
|
||||||
"startup": ".\/ts3server default_voice_port={{SERVER_PORT}} query_port={{QUERY_PORT}} filetransfer_ip=0.0.0.0 filetransfer_port={{FILE_TRANSFER}} license_accepted=1",
|
"startup": ".\/ts3server default_voice_port={{SERVER_PORT}} query_port={{QUERY_PORT}} filetransfer_ip=0.0.0.0 filetransfer_port={{FILE_TRANSFER}} query_http_port={{QUERY_HTTP}} query_ssh_port={{QUERY_SSH}} query_protocols={{QUERY_PROTOCOLS_VAR}} license_accepted=1",
|
||||||
"config": {
|
"config": {
|
||||||
"files": "{}",
|
"files": "{}",
|
||||||
"startup": "{\r\n \"done\": \"listening on 0.0.0.0:\"\r\n}",
|
"startup": "{\r\n \"done\": \"listening on 0.0.0.0:\"\r\n}",
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"installation": {
|
"installation": {
|
||||||
"script": "#!\/bin\/ash\r\n# TS3 Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\nif [ -z ${TS_VERSION} ] || [ ${TS_VERSION} == latest ]; then\r\n TS_VERSION=$(curl -sSL https:\/\/teamspeak.com\/versions\/server.json | jq -r '.linux.x86_64.version')\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"getting files from http:\/\/files.teamspeak-services.com\/releases\/server\/${TS_VERSION}\/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2\" \r\ncurl -L http:\/\/files.teamspeak-services.com\/releases\/server\/${TS_VERSION}\/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2 | tar -xvj --strip-components=1",
|
"script": "#!\/bin\/ash\r\n# TS3 Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\nif [ -z ${TS_VERSION} ] || [ ${TS_VERSION} == latest ]; then\r\n TS_VERSION=$(curl -sSL https:\/\/teamspeak.com\/versions\/server.json | jq -r '.linux.x86_64.version')\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"getting files from http:\/\/files.teamspeak-services.com\/releases\/server\/${TS_VERSION}\/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2\" \r\ncurl -L http:\/\/files.teamspeak-services.com\/releases\/server\/${TS_VERSION}\/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2 | tar -xvj --strip-components=1\r\ncp .\/redist\/libmariadb.so.2 .\/",
|
||||||
"container": "ghcr.io\/pterodactyl\/installers:alpine",
|
"container": "ghcr.io\/pterodactyl\/installers:alpine",
|
||||||
"entrypoint": "ash"
|
"entrypoint": "ash"
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,8 @@
|
||||||
"default_value": "latest",
|
"default_value": "latest",
|
||||||
"user_viewable": true,
|
"user_viewable": true,
|
||||||
"user_editable": true,
|
"user_editable": true,
|
||||||
"rules": "required|string|max:6"
|
"rules": "required|string|max:6",
|
||||||
|
"field_type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "File Transfer Port",
|
"name": "File Transfer Port",
|
||||||
|
@ -44,7 +45,8 @@
|
||||||
"default_value": "30033",
|
"default_value": "30033",
|
||||||
"user_viewable": true,
|
"user_viewable": true,
|
||||||
"user_editable": false,
|
"user_editable": false,
|
||||||
"rules": "required|integer|between:1,65535"
|
"rules": "required|integer|between:1025,65535",
|
||||||
|
"field_type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Query Port",
|
"name": "Query Port",
|
||||||
|
@ -53,7 +55,38 @@
|
||||||
"default_value": "10011",
|
"default_value": "10011",
|
||||||
"user_viewable": true,
|
"user_viewable": true,
|
||||||
"user_editable": false,
|
"user_editable": false,
|
||||||
"rules": "required|integer|between:1,65535"
|
"rules": "required|integer|between:1025,65535",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Query Protocols",
|
||||||
|
"description": "Comma separated list of protocols that can be used to connect to the ServerQuery | \r\nPossible values are raw, ssh and http | \r\nE.g.: raw,ssh,http",
|
||||||
|
"env_variable": "QUERY_PROTOCOLS_VAR",
|
||||||
|
"default_value": "raw,http,ssh",
|
||||||
|
"user_viewable": true,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "required|string|max:12",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Query SSH Port",
|
||||||
|
"description": "TCP Port opened for ServerQuery connections using SSH",
|
||||||
|
"env_variable": "QUERY_SSH",
|
||||||
|
"default_value": "10022",
|
||||||
|
"user_viewable": true,
|
||||||
|
"user_editable": false,
|
||||||
|
"rules": "required|integer|between:1025,65535",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Query HTTP Port",
|
||||||
|
"description": "TCP Port opened for ServerQuery connections using http",
|
||||||
|
"env_variable": "QUERY_HTTP",
|
||||||
|
"default_value": "10080",
|
||||||
|
"user_viewable": true,
|
||||||
|
"user_editable": false,
|
||||||
|
"rules": "required|integer|between:1025,65535",
|
||||||
|
"field_type": "text"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,10 @@ Route::group(['prefix' => '/servers/{uuid}'], function () {
|
||||||
Route::get('/install', [Remote\Servers\ServerInstallController::class, 'index']);
|
Route::get('/install', [Remote\Servers\ServerInstallController::class, 'index']);
|
||||||
Route::post('/install', [Remote\Servers\ServerInstallController::class, 'store']);
|
Route::post('/install', [Remote\Servers\ServerInstallController::class, 'store']);
|
||||||
|
|
||||||
Route::post('/archive', [Remote\Servers\ServerTransferController::class, 'archive']);
|
|
||||||
Route::get('/transfer/failure', [Remote\Servers\ServerTransferController::class, 'failure']);
|
Route::get('/transfer/failure', [Remote\Servers\ServerTransferController::class, 'failure']);
|
||||||
Route::get('/transfer/success', [Remote\Servers\ServerTransferController::class, 'success']);
|
Route::get('/transfer/success', [Remote\Servers\ServerTransferController::class, 'success']);
|
||||||
|
Route::post('/transfer/failure', [Remote\Servers\ServerTransferController::class, 'failure']);
|
||||||
|
Route::post('/transfer/success', [Remote\Servers\ServerTransferController::class, 'success']);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(['prefix' => '/backups'], function () {
|
Route::group(['prefix' => '/backups'], function () {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
use Pterodactyl\Http\Controllers\Auth;
|
use Pterodactyl\Http\Controllers\Auth;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11,7 +12,7 @@ use Pterodactyl\Http\Controllers\Auth;
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// These routes are defined so that we can continue to reference them programatically.
|
// These routes are defined so that we can continue to reference them programmatically.
|
||||||
// They all route to the same controller function which passes off to React.
|
// They all route to the same controller function which passes off to React.
|
||||||
Route::get('/login', [Auth\LoginController::class, 'index'])->name('auth.login');
|
Route::get('/login', [Auth\LoginController::class, 'index'])->name('auth.login');
|
||||||
Route::get('/password', [Auth\LoginController::class, 'index'])->name('auth.forgot-password');
|
Route::get('/password', [Auth\LoginController::class, 'index'])->name('auth.forgot-password');
|
||||||
|
@ -38,12 +39,12 @@ Route::middleware(['throttle:authentication'])->group(function () {
|
||||||
// is created).
|
// is created).
|
||||||
Route::post('/password/reset', Auth\ResetPasswordController::class)->name('auth.reset-password');
|
Route::post('/password/reset', Auth\ResetPasswordController::class)->name('auth.reset-password');
|
||||||
|
|
||||||
// Remove the guest middleware and apply the authenticated middleware to this endpoint
|
// Remove the guest middleware and apply the authenticated middleware to this endpoint,
|
||||||
// so it cannot be used unless you're already logged in.
|
// so it cannot be used unless you're already logged in.
|
||||||
Route::post('/logout', [Auth\LoginController::class, 'logout'])
|
Route::post('/logout', [Auth\LoginController::class, 'logout'])
|
||||||
->withoutMiddleware('guest')
|
->withoutMiddleware('guest')
|
||||||
->middleware('auth')
|
->middleware('auth')
|
||||||
->name('auth.logout');
|
->name('auth.logout');
|
||||||
|
|
||||||
// Catch any other combinations of routes and pass them off to the Vuejs component.
|
// Catch any other combinations of routes and pass them off to the React component.
|
||||||
Route::fallback([Auth\LoginController::class, 'index']);
|
Route::fallback([Auth\LoginController::class, 'index']);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
use Pterodactyl\Http\Controllers\Base;
|
use Pterodactyl\Http\Controllers\Base;
|
||||||
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
|
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue