Update demon routes to use /v1/
This commit is contained in:
parent
15d38ce823
commit
b1834307d5
25 changed files with 55 additions and 67 deletions
|
@ -30,6 +30,8 @@ use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Foundation\Testing\HttpException;
|
use Illuminate\Foundation\Testing\HttpException;
|
||||||
use League\Fractal\Serializer\JsonApiSerializer;
|
use League\Fractal\Serializer\JsonApiSerializer;
|
||||||
use Pterodactyl\Transformers\Daemon\ApiKeyTransformer;
|
use Pterodactyl\Transformers\Daemon\ApiKeyTransformer;
|
||||||
|
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface;
|
use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface;
|
||||||
|
|
||||||
class ValidateKeyController extends Controller
|
class ValidateKeyController extends Controller
|
||||||
|
@ -81,7 +83,11 @@ class ValidateKeyController extends Controller
|
||||||
throw new HttpException(501);
|
throw new HttpException(501);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$key = $this->daemonKeyRepository->getKeyWithServer($token);
|
$key = $this->daemonKeyRepository->getKeyWithServer($token);
|
||||||
|
} catch (RecordNotFoundException $exception) {
|
||||||
|
throw new NotFoundHttpException;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->fractal->item($key, $this->app->make(ApiKeyTransformer::class), 'server')
|
return $this->fractal->item($key, $this->app->make(ApiKeyTransformer::class), 'server')
|
||||||
->serializeWith(JsonApiSerializer::class)
|
->serializeWith(JsonApiSerializer::class)
|
||||||
|
|
|
@ -194,7 +194,6 @@ class OptionController extends Controller
|
||||||
$this->optionUpdateService->handle($option, $request->all());
|
$this->optionUpdateService->handle($option, $request->all());
|
||||||
$this->alert->success(trans('admin/services.options.notices.option_updated'))->flash();
|
$this->alert->success(trans('admin/services.options.notices.option_updated'))->flash();
|
||||||
} catch (NoParentConfigurationFoundException $exception) {
|
} catch (NoParentConfigurationFoundException $exception) {
|
||||||
dd('hodor');
|
|
||||||
$this->alert->danger($exception->getMessage())->flash();
|
$this->alert->danger($exception->getMessage())->flash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class DownloadController extends Controller
|
||||||
$this->cache->tags(['Server:Downloads'])->put($token, ['server' => $server->uuid, 'path' => $file], 5);
|
$this->cache->tags(['Server:Downloads'])->put($token, ['server' => $server->uuid, 'path' => $file], 5);
|
||||||
|
|
||||||
return redirect(sprintf(
|
return redirect(sprintf(
|
||||||
'%s://%s:%s/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, $token
|
'%s://%s:%s/v1/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, $token
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
namespace Pterodactyl\Models;
|
namespace Pterodactyl\Models;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
|
||||||
use Sofa\Eloquence\Eloquence;
|
use Sofa\Eloquence\Eloquence;
|
||||||
use Sofa\Eloquence\Validable;
|
use Sofa\Eloquence\Validable;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
@ -126,22 +125,6 @@ class Node extends Model implements CleansAttributes, ValidableContract
|
||||||
'daemonListen' => 8080,
|
'daemonListen' => 8080,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* Return an instance of the Guzzle client for this specific node.
|
|
||||||
*
|
|
||||||
* @param array $headers
|
|
||||||
* @return \GuzzleHttp\Client
|
|
||||||
*/
|
|
||||||
public function guzzleClient($headers = [])
|
|
||||||
{
|
|
||||||
return new Client([
|
|
||||||
'base_uri' => sprintf('%s://%s:%s/', $this->scheme, $this->fqdn, $this->daemonListen),
|
|
||||||
'timeout' => config('pterodactyl.guzzle.timeout'),
|
|
||||||
'connect_timeout' => config('pterodactyl.guzzle.connect_timeout'),
|
|
||||||
'headers' => $headers,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the configuration in JSON format.
|
* Returns the configuration in JSON format.
|
||||||
*
|
*
|
||||||
|
|
|
@ -141,7 +141,7 @@ class BaseRepository implements BaseRepositoryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Client([
|
return new Client([
|
||||||
'base_uri' => sprintf('%s://%s:%s/', $this->getNode()->scheme, $this->getNode()->fqdn, $this->getNode()->daemonListen),
|
'base_uri' => sprintf('%s://%s:%s/v1/', $this->getNode()->scheme, $this->getNode()->fqdn, $this->getNode()->daemonListen),
|
||||||
'timeout' => $this->config->get('pterodactyl.guzzle.timeout'),
|
'timeout' => $this->config->get('pterodactyl.guzzle.timeout'),
|
||||||
'connect_timeout' => $this->config->get('pterodactyl.guzzle.connect_timeout'),
|
'connect_timeout' => $this->config->get('pterodactyl.guzzle.connect_timeout'),
|
||||||
'headers' => $headers,
|
'headers' => $headers,
|
||||||
|
|
|
@ -21,7 +21,7 @@ class CommandRepository extends BaseRepository implements CommandRepositoryInter
|
||||||
{
|
{
|
||||||
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
|
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/server/command', [
|
return $this->getHttpClient()->request('POST', 'server/command', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'command' => $command,
|
'command' => $command,
|
||||||
],
|
],
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ConfigurationRepository extends BaseRepository implements ConfigurationRep
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->getHttpClient()->request('PATCH', '/config', [
|
return $this->getHttpClient()->request('PATCH', 'config', [
|
||||||
'json' => array_merge($structure, $overrides),
|
'json' => array_merge($structure, $overrides),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/file/stat/%s',
|
'server/file/stat/%s',
|
||||||
rawurlencode($file['dirname'] . $file['basename'])
|
rawurlencode($file['dirname'] . $file['basename'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/file/f/%s',
|
'server/file/f/%s',
|
||||||
rawurlencode($file['dirname'] . $file['basename'])
|
rawurlencode($file['dirname'] . $file['basename'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file = pathinfo($path);
|
$file = pathinfo($path);
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/server/file/save', [
|
return $this->getHttpClient()->request('POST', 'server/file/save', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'path' => rawurlencode($file['dirname'] . $file['basename']),
|
'path' => rawurlencode($file['dirname'] . $file['basename']),
|
||||||
'content' => $content,
|
'content' => $content,
|
||||||
|
@ -74,7 +74,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
Assert::string($path, 'First argument passed to getDirectory must be a string, received %s.');
|
Assert::string($path, 'First argument passed to getDirectory must be a string, received %s.');
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/directory/%s',
|
'server/directory/%s',
|
||||||
rawurlencode($path)
|
rawurlencode($path)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class PowerRepository extends BaseRepository implements PowerRepositoryInterface
|
||||||
case self::SIGNAL_STOP:
|
case self::SIGNAL_STOP:
|
||||||
case self::SIGNAL_RESTART:
|
case self::SIGNAL_RESTART:
|
||||||
case self::SIGNAL_KILL:
|
case self::SIGNAL_KILL:
|
||||||
return $this->getHttpClient()->request('PUT', '/server/power', [
|
return $this->getHttpClient()->request('PUT', 'server/power', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'action' => $signal,
|
'action' => $signal,
|
||||||
],
|
],
|
||||||
|
|
|
@ -63,7 +63,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
array_set($data, $key, $value);
|
array_set($data, $key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/servers', [
|
return $this->getHttpClient()->request('POST', 'servers', [
|
||||||
'json' => $data,
|
'json' => $data,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function update(array $data)
|
public function update(array $data)
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('PATCH', '/server', [
|
return $this->getHttpClient()->request('PATCH', 'server', [
|
||||||
'json' => $data,
|
'json' => $data,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -86,10 +86,10 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
Assert::nullOrIsArray($data, 'First argument passed to reinstall must be null or an array, received %s.');
|
Assert::nullOrIsArray($data, 'First argument passed to reinstall must be null or an array, received %s.');
|
||||||
|
|
||||||
if (is_null($data)) {
|
if (is_null($data)) {
|
||||||
return $this->getHttpClient()->request('POST', '/server/reinstall');
|
return $this->getHttpClient()->request('POST', 'server/reinstall');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/server/reinstall', [
|
return $this->getHttpClient()->request('POST', 'server/reinstall', [
|
||||||
'json' => $data,
|
'json' => $data,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function rebuild()
|
public function rebuild()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/rebuild');
|
return $this->getHttpClient()->request('POST', 'server/rebuild');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +107,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function suspend()
|
public function suspend()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/suspend');
|
return $this->getHttpClient()->request('POST', 'server/suspend');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,7 +115,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function unsuspend()
|
public function unsuspend()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/unsuspend');
|
return $this->getHttpClient()->request('POST', 'server/unsuspend');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,7 +123,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('DELETE', '/servers');
|
return $this->getHttpClient()->request('DELETE', 'servers');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +131,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function details()
|
public function details()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('GET', '/server');
|
return $this->getHttpClient()->request('GET', 'server');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,6 +141,6 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
{
|
{
|
||||||
Assert::stringNotEmpty($key, 'First argument passed to revokeAccessKey must be a non-empty string, received %s.');
|
Assert::stringNotEmpty($key, 'First argument passed to revokeAccessKey must be a non-empty string, received %s.');
|
||||||
|
|
||||||
return $this->getHttpClient()->request('DELETE', '/keys/' . $key);
|
return $this->getHttpClient()->request('DELETE', 'keys/' . $key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class CommandRepository extends BaseRepository implements CommandRepositoryInter
|
||||||
{
|
{
|
||||||
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
|
Assert::stringNotEmpty($command, 'First argument passed to send must be a non-empty string, received %s.');
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/command', [
|
return $this->getHttpClient()->request('POST', 'server/' . $this->getAccessServer() . '/command', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'command' => $command,
|
'command' => $command,
|
||||||
],
|
],
|
||||||
|
|
|
@ -25,7 +25,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/' . $this->getAccessServer() . '/file/stat/%s',
|
'server/' . $this->getAccessServer() . '/file/stat/%s',
|
||||||
rawurlencode($file['dirname'] . $file['basename'])
|
rawurlencode($file['dirname'] . $file['basename'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/' . $this->getAccessServer() . '/file/f/%s',
|
'server/' . $this->getAccessServer() . '/file/f/%s',
|
||||||
rawurlencode($file['dirname'] . $file['basename'])
|
rawurlencode($file['dirname'] . $file['basename'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
$file = pathinfo($path);
|
$file = pathinfo($path);
|
||||||
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
$file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';
|
||||||
|
|
||||||
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/file/save', [
|
return $this->getHttpClient()->request('POST', 'server/' . $this->getAccessServer() . '/file/save', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'path' => rawurlencode($file['dirname'] . $file['basename']),
|
'path' => rawurlencode($file['dirname'] . $file['basename']),
|
||||||
'content' => $content,
|
'content' => $content,
|
||||||
|
@ -77,7 +77,7 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface
|
||||||
Assert::string($path, 'First argument passed to getDirectory must be a string, received %s.');
|
Assert::string($path, 'First argument passed to getDirectory must be a string, received %s.');
|
||||||
|
|
||||||
$response = $this->getHttpClient()->request('GET', sprintf(
|
$response = $this->getHttpClient()->request('GET', sprintf(
|
||||||
'/server/' . $this->getAccessServer() . '/directory/%s',
|
'server/' . $this->getAccessServer() . '/directory/%s',
|
||||||
rawurlencode($path)
|
rawurlencode($path)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class PowerRepository extends BaseRepository implements PowerRepositoryInterface
|
||||||
case self::SIGNAL_STOP:
|
case self::SIGNAL_STOP:
|
||||||
case self::SIGNAL_RESTART:
|
case self::SIGNAL_RESTART:
|
||||||
case self::SIGNAL_KILL:
|
case self::SIGNAL_KILL:
|
||||||
return $this->getHttpClient()->request('PUT', '/server/' . $this->getAccessServer() . '/power', [
|
return $this->getHttpClient()->request('PUT', 'server/' . $this->getAccessServer() . '/power', [
|
||||||
'json' => [
|
'json' => [
|
||||||
'action' => $signal,
|
'action' => $signal,
|
||||||
],
|
],
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function rebuild()
|
public function rebuild()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/rebuild');
|
return $this->getHttpClient()->request('POST', 'server/' . $this->getAccessServer() . '/rebuild');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function suspend()
|
public function suspend()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/suspend');
|
return $this->getHttpClient()->request('POST', 'server/' . $this->getAccessServer() . '/suspend');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +59,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function unsuspend()
|
public function unsuspend()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('POST', '/server/' . $this->getAccessServer() . '/unsuspend');
|
return $this->getHttpClient()->request('POST', 'server/' . $this->getAccessServer() . '/unsuspend');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,7 +67,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('DELETE', '/server/' . $this->getAccessServer());
|
return $this->getHttpClient()->request('DELETE', 'server/' . $this->getAccessServer());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +75,7 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
||||||
*/
|
*/
|
||||||
public function details()
|
public function details()
|
||||||
{
|
{
|
||||||
return $this->getHttpClient()->request('GET', '/server/' . $this->getAccessServer());
|
return $this->getHttpClient()->request('GET', 'server/' . $this->getAccessServer());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -107,7 +107,7 @@ return [
|
||||||
| Configuration for support of the new Golang based daemon.
|
| Configuration for support of the new Golang based daemon.
|
||||||
*/
|
*/
|
||||||
'daemon' => [
|
'daemon' => [
|
||||||
'use_new_daemon' => env('APP_USE_NEW_DAEMON', false),
|
'use_new_daemon' => (bool) env('APP_USE_NEW_DAEMON', false),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
var notifySocketError = false;
|
var notifySocketError = false;
|
||||||
// Main Socket Object
|
// Main Socket Object
|
||||||
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/stats/', {
|
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/v1/stats/', {
|
||||||
'query': 'token=' + Pterodactyl.node.daemonSecret,
|
'query': 'token=' + Pterodactyl.node.daemonSecret,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -62,7 +62,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/folder`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/folder`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
path: val,
|
path: val,
|
||||||
|
@ -107,7 +107,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/move`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/move`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
from: `${currentPath}${currentName}`,
|
from: `${currentPath}${currentName}`,
|
||||||
|
@ -175,7 +175,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/rename`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/rename`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
from: `${currentPath}${currentName}`,
|
from: `${currentPath}${currentName}`,
|
||||||
|
@ -240,7 +240,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/copy`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/copy`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
from: `${currentPath}${currentName}`,
|
from: `${currentPath}${currentName}`,
|
||||||
|
@ -298,7 +298,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/delete`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/delete`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
items: [`${delPath}${delName}`]
|
items: [`${delPath}${delName}`]
|
||||||
|
@ -403,7 +403,7 @@ class ActionsClass {
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
},
|
},
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/delete`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/delete`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
items: selectedItems
|
items: selectedItems
|
||||||
|
@ -456,7 +456,7 @@ class ActionsClass {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/decompress`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/decompress`,
|
||||||
headers: {
|
headers: {
|
||||||
'X-Access-Token': Pterodactyl.server.daemonSecret,
|
'X-Access-Token': Pterodactyl.server.daemonSecret,
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
|
@ -490,7 +490,7 @@ class ActionsClass {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/compress`,
|
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/compress`,
|
||||||
headers: {
|
headers: {
|
||||||
'X-Access-Token': Pterodactyl.server.daemonSecret,
|
'X-Access-Token': Pterodactyl.server.daemonSecret,
|
||||||
'X-Access-Server': Pterodactyl.server.uuid,
|
'X-Access-Server': Pterodactyl.server.uuid,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
(function initUploader() {
|
(function initUploader() {
|
||||||
var notifyUploadSocketError = false;
|
var notifyUploadSocketError = false;
|
||||||
uploadSocket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/upload/' + Pterodactyl.server.uuid, {
|
uploadSocket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/v1/upload/' + Pterodactyl.server.uuid, {
|
||||||
'query': 'token=' + Pterodactyl.server.daemonSecret,
|
'query': 'token=' + Pterodactyl.server.daemonSecret,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ var Server = (function () {
|
||||||
|
|
||||||
var notifySocketError = false;
|
var notifySocketError = false;
|
||||||
|
|
||||||
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/ws/' + Pterodactyl.server.uuid, {
|
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/v1/ws/' + Pterodactyl.server.uuid, {
|
||||||
'query': 'token=' + Pterodactyl.server.daemonSecret,
|
'query': 'token=' + Pterodactyl.server.daemonSecret,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
(function getInformation() {
|
(function getInformation() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}',
|
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/v1',
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
headers: {
|
headers: {
|
||||||
'X-Access-Token': '{{ $node->daemonSecret }}'
|
'X-Access-Token': '{{ $node->daemonSecret }}'
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||||
'X-Access-Server': '{{ $server->uuid }}'
|
'X-Access-Server': '{{ $server->uuid }}'
|
||||||
},
|
},
|
||||||
url: '{{ $server->node->scheme }}://{{ $server->node->fqdn }}:{{ $server->node->daemonListen }}/server',
|
url: '{{ $server->node->scheme }}://{{ $server->node->fqdn }}:{{ $server->node->daemonListen }}/v1/server',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ class DownloadControllerTest extends TestCase
|
||||||
$response = $this->controller->index('1234', '/my/file.txt');
|
$response = $this->controller->index('1234', '/my/file.txt');
|
||||||
$this->assertIsRedirectResponse($response);
|
$this->assertIsRedirectResponse($response);
|
||||||
$this->assertRedirectUrlEquals(sprintf(
|
$this->assertRedirectUrlEquals(sprintf(
|
||||||
'%s://%s:%s/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, 'randomString'
|
'%s://%s:%s/v1/server/file/download/%s', $server->node->scheme, $server->node->fqdn, $server->node->daemonListen, 'randomString'
|
||||||
), $response);
|
), $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue