parent
b04a47a4a4
commit
68e9100e57
7 changed files with 81 additions and 3 deletions
|
@ -73,7 +73,7 @@ class EggController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(EggFormRequest $request): RedirectResponse
|
public function store(EggFormRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$data = $request->normalize();
|
$data = $request->validated();
|
||||||
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
||||||
|
|
||||||
$egg = $this->creationService->handle($data);
|
$egg = $this->creationService->handle($data);
|
||||||
|
@ -106,7 +106,7 @@ class EggController extends Controller
|
||||||
*/
|
*/
|
||||||
public function update(EggFormRequest $request, Egg $egg): RedirectResponse
|
public function update(EggFormRequest $request, Egg $egg): RedirectResponse
|
||||||
{
|
{
|
||||||
$data = $request->normalize();
|
$data = $request->validated();
|
||||||
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
$data['docker_images'] = $this->normalizeDockerImages($data['docker_images'] ?? null);
|
||||||
|
|
||||||
$this->updateService->handle($egg, $data);
|
$this->updateService->handle($egg, $data);
|
||||||
|
|
|
@ -22,6 +22,7 @@ class EggFormRequest extends AdminFormRequest
|
||||||
'name' => 'required|string|max:191',
|
'name' => 'required|string|max:191',
|
||||||
'description' => 'nullable|string',
|
'description' => 'nullable|string',
|
||||||
'docker_images' => 'required|string',
|
'docker_images' => 'required|string',
|
||||||
|
'force_outgoing_ip' => 'sometimes|boolean',
|
||||||
'file_denylist' => 'array',
|
'file_denylist' => 'array',
|
||||||
'startup' => 'required|string',
|
'startup' => 'required|string',
|
||||||
'config_from' => 'sometimes|bail|nullable|numeric',
|
'config_from' => 'sometimes|bail|nullable|numeric',
|
||||||
|
@ -47,4 +48,13 @@ class EggFormRequest extends AdminFormRequest
|
||||||
return (int) $this->input('config_from') !== 0;
|
return (int) $this->input('config_from') !== 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function validated(): array
|
||||||
|
{
|
||||||
|
$data = parent::validated();
|
||||||
|
|
||||||
|
return array_merge($data, [
|
||||||
|
'force_outgoing_ip' => array_get($data, 'force_outgoing_ip', false),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,9 @@ namespace Pterodactyl\Models;
|
||||||
* @property string|null $description
|
* @property string|null $description
|
||||||
* @property array|null $features
|
* @property array|null $features
|
||||||
* @property string $docker_image -- deprecated, use $docker_images
|
* @property string $docker_image -- deprecated, use $docker_images
|
||||||
* @property string $update_url
|
|
||||||
* @property array<string, string> $docker_images
|
* @property array<string, string> $docker_images
|
||||||
|
* @property string $update_url
|
||||||
|
* @property bool $force_outgoing_ip
|
||||||
* @property array|null $file_denylist
|
* @property array|null $file_denylist
|
||||||
* @property string|null $config_files
|
* @property string|null $config_files
|
||||||
* @property string|null $config_startup
|
* @property string|null $config_startup
|
||||||
|
@ -84,6 +85,7 @@ class Egg extends Model
|
||||||
'description',
|
'description',
|
||||||
'features',
|
'features',
|
||||||
'docker_images',
|
'docker_images',
|
||||||
|
'force_outgoing_ip',
|
||||||
'file_denylist',
|
'file_denylist',
|
||||||
'config_files',
|
'config_files',
|
||||||
'config_startup',
|
'config_startup',
|
||||||
|
@ -107,6 +109,7 @@ class Egg extends Model
|
||||||
'nest_id' => 'integer',
|
'nest_id' => 'integer',
|
||||||
'config_from' => 'integer',
|
'config_from' => 'integer',
|
||||||
'script_is_privileged' => 'boolean',
|
'script_is_privileged' => 'boolean',
|
||||||
|
'force_outgoing_ip' => 'boolean',
|
||||||
'copy_script_from' => 'integer',
|
'copy_script_from' => 'integer',
|
||||||
'features' => 'array',
|
'features' => 'array',
|
||||||
'docker_images' => 'array',
|
'docker_images' => 'array',
|
||||||
|
@ -134,6 +137,7 @@ class Egg extends Model
|
||||||
'config_logs' => 'required_without:config_from|nullable|json',
|
'config_logs' => 'required_without:config_from|nullable|json',
|
||||||
'config_files' => 'required_without:config_from|nullable|json',
|
'config_files' => 'required_without:config_from|nullable|json',
|
||||||
'update_url' => 'sometimes|nullable|string',
|
'update_url' => 'sometimes|nullable|string',
|
||||||
|
'force_outgoing_ip' => 'sometimes|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -73,6 +73,7 @@ class ServerConfigurationStructureService
|
||||||
'requires_rebuild' => false,
|
'requires_rebuild' => false,
|
||||||
],
|
],
|
||||||
'allocations' => [
|
'allocations' => [
|
||||||
|
'force_outgoing_ip' => $server->egg->force_outgoing_ip,
|
||||||
'default' => [
|
'default' => [
|
||||||
'ip' => $server->allocation->ip,
|
'ip' => $server->allocation->ip,
|
||||||
'port' => $server->allocation->port,
|
'port' => $server->allocation->port,
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddForceOutgoingIpColumnToEggsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('eggs', function (Blueprint $table) {
|
||||||
|
$table->boolean('force_outgoing_ip')->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('eggs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('force_outgoing_ip');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,6 +50,21 @@
|
||||||
<textarea id="pDescription" name="description" class="form-control" rows="8">{{ old('description') }}</textarea>
|
<textarea id="pDescription" name="description" class="form-control" rows="8">{{ old('description') }}</textarea>
|
||||||
<p class="text-muted small">A description of this Egg.</p>
|
<p class="text-muted small">A description of this Egg.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox checkbox-primary no-margin-bottom">
|
||||||
|
<input id="pForceOutgoingIp" name="force_outgoing_ip" type="checkbox" value="1" {{ \Pterodactyl\Helpers\Utilities::checked('force_outgoing_ip', 0) }} />
|
||||||
|
<label for="pForceOutgoingIp" class="strong">Force Outgoing IP</label>
|
||||||
|
<p class="text-muted small">
|
||||||
|
Forces all outgoing network traffic to have its Source IP NATed to the IP of the server's primary allocation IP.
|
||||||
|
Required for certain games to work properly when the Node has multiple public IP addresses.
|
||||||
|
<br>
|
||||||
|
<strong>
|
||||||
|
Enabling this option will disable internal networking for any servers using this egg,
|
||||||
|
causing them to be unable to internally access other servers on the same node.
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -91,6 +91,22 @@
|
||||||
followed by a pipe character, and then the image URL. Example: <code>Display Name|ghcr.io/my/egg</code>
|
followed by a pipe character, and then the image URL. Example: <code>Display Name|ghcr.io/my/egg</code>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox checkbox-primary no-margin-bottom">
|
||||||
|
<input id="pForceOutgoingIp" name="force_outgoing_ip" type="checkbox" value="1" @if($egg->force_outgoing_ip) checked @endif />
|
||||||
|
<label for="pForceOutgoingIp" class="strong">Force Outgoing IP</label>
|
||||||
|
<p class="text-muted small">
|
||||||
|
Forces all outgoing network traffic to have its Source IP NATed to the IP of the server's primary allocation IP.
|
||||||
|
Required for certain games to work properly when the Node has multiple public IP addresses.
|
||||||
|
<br>
|
||||||
|
<strong>
|
||||||
|
Enabling this option will disable internal networking for any servers using this egg,
|
||||||
|
causing them to be unable to internally access other servers on the same node.
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
Loading…
Reference in a new issue