Fix up node autodeployment
This commit is contained in:
parent
fc31d6347e
commit
fda88940f7
6 changed files with 119 additions and 20 deletions
|
@ -9,7 +9,6 @@
|
|||
|
||||
namespace Pterodactyl\Http\Controllers\Admin;
|
||||
|
||||
use Cake\Chronos\Chronos;
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Illuminate\Http\Response;
|
||||
|
@ -300,18 +299,4 @@ class NodesController extends Controller
|
|||
|
||||
return redirect()->route('admin.nodes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configuration token to auto-deploy a node.
|
||||
*
|
||||
* @param \Pterodactyl\Models\Node $node
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function setToken(Node $node)
|
||||
{
|
||||
$token = bin2hex(random_bytes(16));
|
||||
$this->cache->put('Node:Configuration:' . $token, $node->id, Chronos::now()->addMinutes(5));
|
||||
|
||||
return response()->json(['token' => $token]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue