diff --git a/.gitignore b/.gitignore index efbbccdcf..0826a5ebe 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .env .vagrant/* .vscode/* +storage/framework/* composer.lock @@ -15,5 +16,4 @@ yarn.lock node_modules _ide_helper_models.php - _ide_helper.php diff --git a/app/Http/Controllers/Admin/NodesController.php b/app/Http/Controllers/Admin/NodesController.php index 4bb08c52f..cbf3ff6ce 100644 --- a/app/Http/Controllers/Admin/NodesController.php +++ b/app/Http/Controllers/Admin/NodesController.php @@ -82,11 +82,16 @@ class NodesController extends Controller { try { $repo = new NodeRepository; - $node = $repo->create($request->intersect([ - 'name', 'location_id', 'public', 'fqdn', 'scheme', 'memory', - 'memory_overallocate', 'disk', 'disk_overallocate', - 'daemonBase', 'daemonSFTP', 'daemonListen', - ])); + $node = $repo->create(array_merge( + $request->only([ + 'public', 'disk_overallocate', 'memory_overallocate', + ]), + $request->intersect([ + 'name', 'location_id', 'fqdn', + 'scheme', 'memory', 'disk', + 'daemonBase', 'daemonSFTP', 'daemonListen', + ]) + )); Alert::success('Successfully created new node that can be configured automatically on your remote machine by visiting the configuration tab. Before you can add any servers you need to first assign some IP addresses and ports.')->flash(); return redirect()->route('admin.nodes.view', $node->id); @@ -213,12 +218,16 @@ class NodesController extends Controller $repo = new NodeRepository; try { - $repo->update($id, $request->intersect([ - 'name', 'location_id', 'public', 'fqdn', 'scheme', 'memory', - 'memory_overallocate', 'disk', 'disk_overallocate', 'upload_size', - 'daemonSFTP', 'daemonListen', 'reset_secret', - ])); - + $node = $repo->update($id, array_merge( + $request->only([ + 'public', 'disk_overallocate', 'memory_overallocate', + ]), + $request->intersect([ + 'name', 'location_id', 'fqdn', + 'scheme', 'memory', 'disk', 'upload_size', + 'reset_secret', 'daemonSFTP', 'daemonListen', + ]) + )); Alert::success('Successfully updated this node\'s information. If you changed any daemon settings you will need to restart it now.')->flash(); } catch (DisplayValidationException $ex) { return redirect()->route('admin.nodes.view.settings', $id)->withErrors(json_decode($ex->getMessage()))->withInput(); diff --git a/resources/themes/pterodactyl/admin/nodes/new.blade.php b/resources/themes/pterodactyl/admin/nodes/new.blade.php new file mode 100644 index 000000000..eb58e32fa --- /dev/null +++ b/resources/themes/pterodactyl/admin/nodes/new.blade.php @@ -0,0 +1,171 @@ +{{-- Copyright (c) 2015 - 2017 Dane Everitt --}} + +{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} +{{-- of this software and associated documentation files (the "Software"), to deal --}} +{{-- in the Software without restriction, including without limitation the rights --}} +{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} +{{-- copies of the Software, and to permit persons to whom the Software is --}} +{{-- furnished to do so, subject to the following conditions: --}} + +{{-- The above copyright notice and this permission notice shall be included in all --}} +{{-- copies or substantial portions of the Software. --}} + +{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} +{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} +{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} +{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} +{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} +{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} +{{-- SOFTWARE. --}} +@extends('layouts.admin') + +@section('title') + Nodes → New +@endsection + +@section('content-header') +

New NodeCreate a new local or remote node for servers to be installed to.

+ +@endsection + +@section('content') +
+
+
+
+
+

Basic Details

+
+
+
+ + +

Character limits: a-zA-Z0-9_.- and [Space] (min 1, max 100 characters).

+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+

By setting a node to private you will be denying the ability to auto-deploy to this node. +

+
+ + +

Please enter domain name (e.g node.example.com) to be used for connecting to the daemon. An IP address may be used only if you are not using SSL for this node.

+
+
+ +
+
+ + +
+
+ + +
+
+

SSL should only be disabled if this node is assigned an IP address as the FQDN and not an actual FQDN. Disabling SSL could allow a malicious user to intercept traffic between the panel and the daemon potentially exposing sensitive information.

+
+
+ + +

Enter the directory where server files should be stored. If you use OVH you should check your partition scheme. You may need to use /home/daemon-data to have enough space.

+
+
+
+
+
+
+
+

Configuration

+
+
+
+
+ +
+ + MB +
+
+
+ +
+ + % +
+
+
+

Enter the total amount of memory avaliable for new servers. If you would like to allow overallocation of memory enter the percentage that you want to allow. To disable checking for overallocation enter -1 into the field. Entering 0 will prevent creating new servers if it would put the node over the limit.

+
+
+
+
+ +
+ + MB +
+
+
+ +
+ + % +
+
+
+

Enter the total amount of disk space avaliable for new servers. If you would like to allow overallocation of disk space enter the percentage that you want to allow. To disable checking for overallocation enter -1 into the field. Entering 0 will prevent creating new servers if it would put the node over the limit.

+
+
+
+
+ + +
+
+ + +
+
+

The daemon runs its own SFTP management container and does not use the SSHd process on the main physical server. Do not use the same port that you have assigned for your physcial server's SSH process. If you will be running the daemon behind CloudFlare® you should set the daemon port to 8443 to allow websocket proxying over SSL.

+
+
+
+ +
+
+
+
+@endsection + +@section('footer-scripts') + @parent + +@endsection