Skip to content

Commit b69ebb0

Browse files
committed
Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop
2 parents 48c39ab + bec6c70 commit b69ebb0

File tree

23 files changed

+1022
-576
lines changed

23 files changed

+1022
-576
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ What more are you waiting for? Make game servers a first class citizen on your p
1313
![Image](https://cdn.pterodactyl.io/site-assets/mockup-macbook-grey.png)
1414

1515
## Support & Documentation
16-
Support for using Pterodactyl can be found on our [Documentation Website](https://pterodactyl.io/project/introduction.html), [Guides Website](https://guides.pterodactyl.io), or via our [Discord Chat](https://discord.gg/QRDZvVm).
16+
Support for using Pterodactyl can be found on our [Documentation Website](https://pterodactyl.io/project/introduction.html), [Guides Website](https://pterodactyl.io/community/about.html), or via our [Discord Chat](https://discord.gg/QRDZvVm).
1717

1818
### Supported Games
1919
We support a huge variety of games by utilizing Docker containers to isolate each instance, giving you the power to host your games across the world without having to bloat each physical machine with additional dependencies.

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class AppSettingsCommand extends Command
6868
{--redis-host= : Redis host to use for connections.}
6969
{--redis-pass= : Password used to connect to redis.}
7070
{--redis-port= : Port to connect to redis over.}
71-
{--disable-settings-ui}';
71+
{--settings-ui= : Enable or disable the settings UI.}';
7272

7373
/**
7474
* @var array
@@ -138,8 +138,8 @@ public function handle()
138138
array_key_exists($selected, self::ALLOWED_QUEUE_DRIVERS) ? $selected : null
139139
);
140140

141-
if ($this->option('disable-settings-ui')) {
142-
$this->variables['APP_ENVIRONMENT_ONLY'] = 'true';
141+
if (! is_null($this->option('settings-ui'))) {
142+
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->option('settings-ui') == 'true' ? 'false' : 'true';
143143
} else {
144144
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm(trans('command/messages.environment.app.settings'), true) ? 'false' : 'true';
145145
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* This software is licensed under the terms of the MIT license.
7+
* https://opensource.org/licenses/MIT
8+
*/
9+
10+
namespace Pterodactyl\Console\Commands\Server;
11+
12+
use Webmozart\Assert\Assert;
13+
use Illuminate\Console\Command;
14+
use GuzzleHttp\Exception\RequestException;
15+
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
16+
use Pterodactyl\Services\Servers\ServerConfigurationStructureService;
17+
use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface;
18+
19+
class BulkReinstallActionCommand extends Command
20+
{
21+
/**
22+
* @var \Pterodactyl\Services\Servers\ServerConfigurationStructureService
23+
*/
24+
protected $configurationStructureService;
25+
26+
/**
27+
* @var \Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface
28+
*/
29+
protected $daemonRepository;
30+
31+
/**
32+
* @var string
33+
*/
34+
protected $description = 'Reinstall a single server, all servers on a node, or all servers on the panel.';
35+
36+
/**
37+
* @var \Pterodactyl\Contracts\Repository\ServerRepositoryInterface
38+
*/
39+
protected $repository;
40+
41+
/**
42+
* @var string
43+
*/
44+
protected $signature = 'p:server:reinstall
45+
{server? : The ID of the server to reinstall.}
46+
{--node= : ID of the node to reinstall all servers on. Ignored if server is passed.}';
47+
48+
/**
49+
* BulkReinstallActionCommand constructor.
50+
*
51+
* @param \Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface $daemonRepository
52+
* @param \Pterodactyl\Services\Servers\ServerConfigurationStructureService $configurationStructureService
53+
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $repository
54+
*/
55+
public function __construct(
56+
DaemonServerRepositoryInterface $daemonRepository,
57+
ServerConfigurationStructureService $configurationStructureService,
58+
ServerRepositoryInterface $repository
59+
) {
60+
parent::__construct();
61+
62+
$this->configurationStructureService = $configurationStructureService;
63+
$this->daemonRepository = $daemonRepository;
64+
$this->repository = $repository;
65+
}
66+
67+
/**
68+
* Handle command execution.
69+
*/
70+
public function handle()
71+
{
72+
$servers = $this->getServersToProcess();
73+
74+
if (! $this->confirm(trans('command/messages.server.reinstall.confirm'))) {
75+
return;
76+
}
77+
78+
$bar = $this->output->createProgressBar(count($servers));
79+
80+
$servers->each(function ($server) use ($bar) {
81+
$bar->clear();
82+
83+
try {
84+
$this->daemonRepository->setServer($server)->reinstall();
85+
} catch (RequestException $exception) {
86+
$this->output->error(trans('command/messages.server.reinstall.failed', [
87+
'name' => $server->name,
88+
'id' => $server->id,
89+
'node' => $server->node->name,
90+
'message' => $exception->getMessage(),
91+
]));
92+
}
93+
94+
$bar->advance();
95+
$bar->display();
96+
});
97+
98+
$this->line('');
99+
}
100+
101+
/**
102+
* Return the servers to be reinstalled.
103+
*
104+
* @return \Illuminate\Database\Eloquent\Collection
105+
*/
106+
private function getServersToProcess()
107+
{
108+
Assert::nullOrIntegerish($this->argument('server'), 'Value passed in server argument must be null or an integer, received %s.');
109+
Assert::nullOrIntegerish($this->option('node'), 'Value passed in node option must be null or integer, received %s.');
110+
111+
return $this->repository->getDataForReinstall($this->argument('server'), $this->option('node'));
112+
}
113+
}

app/Contracts/Repository/ServerRepositoryInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public function loadEggRelations(Server $server, bool $refresh = false): Server;
3636
*/
3737
public function getDataForRebuild(int $server = null, int $node = null): Collection;
3838

39+
/**
40+
* Return a collection of servers with their associated data for reinstall operations.
41+
*
42+
* @param int|null $server
43+
* @param int|null $node
44+
* @return \Illuminate\Support\Collection
45+
*/
46+
public function getDataForReinstall(int $server = null, int $node = null): Collection;
47+
3948
/**
4049
* Return a server model and all variables associated with the server.
4150
*

app/Repositories/Eloquent/ServerRepository.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,26 @@ public function getDataForRebuild(int $server = null, int $node = null): Collect
7676
return $instance->get($this->getColumns());
7777
}
7878

79+
/**
80+
* Return a collection of servers with their associated data for reinstall operations.
81+
*
82+
* @param int|null $server
83+
* @param int|null $node
84+
* @return \Illuminate\Support\Collection
85+
*/
86+
public function getDataForReinstall(int $server = null, int $node = null): Collection
87+
{
88+
$instance = $this->getBuilder()->with(['allocation', 'allocations', 'pack', 'egg', 'node']);
89+
90+
if (! is_null($server) && is_null($node)) {
91+
$instance = $instance->where('id', '=', $server);
92+
} elseif (is_null($server) && ! is_null($node)) {
93+
$instance = $instance->where('node_id', '=', $node);
94+
}
95+
96+
return $instance->get($this->getColumns());
97+
}
98+
7999
/**
80100
* Return a server model and all variables associated with the server.
81101
*

database/seeds/eggs/minecraft/egg-forge-minecraft.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"meta": {
44
"version": "PTDL_v1"
55
},
6-
"exported_at": "2019-02-07T07:47:35-05:00",
6+
"exported_at": "2019-02-10T22:57:27+01:00",
77
"name": "Forge Minecraft",
88
"author": "support@pterodactyl.io",
99
"description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.",
@@ -17,9 +17,9 @@
1717
},
1818
"scripts": {
1919
"installation": {
20-
"script": "#!\/bin\/ash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napk update\r\napk add curl\r\n\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n FORGE_VERSION=$(echo $(curl -sSl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/ | grep -A2 Latest | grep small) | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nelse\r\n FORGE_VERSION=$(echo $(curl -sl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A2 Latest | grep small) | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"\\nDownloading Forge Version $FORGE_VERSION\\n\"\r\ncurl -sS http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-installer.jar -o installer.jar\r\ncurl -sS http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-universal.jar -o $SERVER_JARFILE\r\n\r\necho -e \"\\nInstalling forge server usint the installer jar file.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\necho -e \"\\nDeleting installer jar file and cleaning up.\\n\"\r\nrm -rf installer.jar",
21-
"container": "openjdk:8-alpine",
22-
"entrypoint": "ash"
20+
"script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl\r\n\r\n#Fetching version\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n echo \"Fetching latest\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nelif [[ ! \"$MC_VERSION\" =~ - ]]; then\r\n echo \"Fetching latest from version $MC_VERSION\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nfi\r\n\r\n#Checking if forge version valid\r\nif [[ ! \"$MC_VERSION\" =~ [1].[0-9]*.[0-9]*-[0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then\r\n echo \"!!! Invalid forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Go into main direction\r\ncd \/mnt\/server\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version \\\"$MC_VERSION\\\"\"\r\ncurl -o installer.jar -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-installer.jar\r\ncurl -o $SERVER_JARFILE -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-universal.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ] || [ ! -f .\/$SERVER_JARFILE ]; then\r\n echo \"!!! Error by downloading forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar",
21+
"container": "openjdk:8",
22+
"entrypoint": "bash"
2323
}
2424
},
2525
"variables": [
@@ -33,8 +33,8 @@
3333
"rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/"
3434
},
3535
{
36-
"name": "Minecraft version",
37-
"description": "The version of minecraft that you want to run. Example (1.10.2).",
36+
"name": "Forge version",
37+
"description": "The version of forge that you want to run.\r\nExamples:\r\n- 1.12.2\r\n- 1.12.2-14.23.5.2810",
3838
"env_variable": "MC_VERSION",
3939
"default_value": "latest",
4040
"user_viewable": 1,

resources/lang/en/command/messages.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
],
4343
'server' => [
4444
'rebuild_failed' => 'Rebuild request for ":name" (#:id) on node ":node" failed with error: :message',
45+
'reinstall' => [
46+
'failed' => 'Reinstall request for ":name" (#:id) on node ":node" failed with error: :message',
47+
'confirm' => 'You are about to reinstall against a group of servers. Do you wish to continue?',
48+
],
4549
'power' => [
4650
'confirm' => 'You are about to perform a :action against :count servers. Do you wish to continue?',
4751
'action_failed' => 'Power action request for ":name" (#:id) on node ":node" failed with error: :message',

resources/lang/fr/admin/nests.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* This software is licensed under the terms of the MIT license.
7+
* https://opensource.org/licenses/MIT
8+
*/
9+
10+
return [
11+
'notices' => [
12+
'created' => 'Un nouveau nid avec le nom :name a été créé avec succès.',
13+
'deleted' => 'Suppression réussie du nid demandé sur le Panel.',
14+
'updated' => 'Mise à jour réussie des options de configuration du nid.',
15+
],
16+
'eggs' => [
17+
'notices' => [
18+
'imported' => 'Importation avec succès de cet oeuf et ses variables associées.',
19+
'updated_via_import' => 'Cet oeuf a été mis à jour en utilisant le fichier fourni.',
20+
'deleted' => 'Suppression réussie de l\'oeuf demandé sur le panel.',
21+
'updated' => 'La configuration de l\'oeuf a été mise à jour avec succès.',
22+
'script_updated' => 'Le script d\'installation de l\'oeuf a été mis à jour et s\'exécutera dès que les serveurs seront installés.',
23+
'egg_created' => 'Un nouvel oeuf a été pondu avec succès. Vous devrez redémarrer tous les démons en cours d\'exécution pour appliquer ce nouvel oeuf.',
24+
],
25+
],
26+
'variables' => [
27+
'notices' => [
28+
'variable_deleted' => 'La variable ":variable" a été supprimé et ne sera plus disponible pour les serveurs une fois reconstruit.',
29+
'variable_updated' => 'La variable ":variable" a été mis à jour. Vous devrez reconstruire tous les serveurs utilisant cette variable afin d\'appliquer les modifications.',
30+
'variable_created' => 'Une nouvelle variable a été créée et affectée à cet oeuf avec succès.',
31+
],
32+
],
33+
];

resources/lang/fr/admin/node.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* This software is licensed under the terms of the MIT license.
7+
* https://opensource.org/licenses/MIT
8+
*/
9+
10+
return [
11+
'validation' => [
12+
'fqdn_not_resolvable' => 'Le nom de domaine complet ou l\'adresse IP fournie ne correspond pas à une adresse IP valide.',
13+
'fqdn_required_for_ssl' => 'Un nom de domaine pleinement qualifié qui résout en une adresse IP publique est nécessaire pour utiliser le SSL pour ce nœud.',
14+
],
15+
'notices' => [
16+
'allocations_added' => 'Les allocations ont été ajoutées avec succès à ce nœud.',
17+
'node_deleted' => 'Le nœud a été supprimé avec succès du panel.',
18+
'location_required' => 'Vous devez avoir configuré au moins un emplacement avant de pouvoir ajouter un nœud à ce panel.',
19+
'node_created' => 'Nouveau nœud créé avec succès. Vous pouvez configurer automatiquement le démon sur cette machine en visitant l\'onglet \'Configuration\'. <strong>Avant de pouvoir ajouter des serveurs, vous devez d\'abord allouer au moins une adresse IP et un port. </strong>',
20+
'node_updated' => 'Les informations de nœud ont été mises à jour. Si des paramètres de démon ont été modifiés, vous devrez le redémarrer pour que ces modifications prennent effet.',
21+
'unallocated_deleted' => 'Suppresion de tous les ports non alloués pour l\'adresse <code>:ip</code>.',
22+
],
23+
];

resources/lang/fr/admin/pack.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* This software is licensed under the terms of the MIT license.
7+
* https://opensource.org/licenses/MIT
8+
*/
9+
10+
return [
11+
'notices' => [
12+
'pack_updated' => 'Le pack a été mis à jour avec succès.',
13+
'pack_deleted' => 'Suppression réussie du pack ":name" du système.',
14+
'pack_created' => 'Un nouveau pack a été créé avec succès sur le système et est désormais disponible pour le déploiement sur les serveurs.',
15+
],
16+
];

0 commit comments

Comments
 (0)