Skip to content

Commit d6be162

Browse files
pteroca-comksroga
andauthored
v0.4.2 (#43)
* [task-200] Web configuration wizard - part 1 * [task-200] Web configuration wizard - part 2 * [task-200] Web configuration wizard - part 3 * [task-200] Web configuration wizard - part 4 * [task-201] Catch missing user client api key when viewing manage server page * [task-202] Fix logging in prod environment * [task-199] Show more detailed errors during creating account process * [task-200] Web configuration wizard - part 5 * [task-200] Web configuration wizard - part 6 * [task-200] Web configuration wizard - part 7 * v0.4.2 * [v0.4.2] Added migration description --------- Co-authored-by: Konrad Sroga <[email protected]>
1 parent 19f91eb commit d6be162

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1783
-31
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
---
44

5+
## [0.4.2] - 2025-03-16
6+
7+
### Added
8+
- Introduced a web wizard for the initial setup. The CLI setup remains available as an alternative.
9+
- Added a CLI notification when attempting to create a user with an email address that already exists in Pterodactyl.
10+
11+
### Changed
12+
- The Pterodactyl Client API Key is no longer required to access server management pages.
13+
14+
### Fixed
15+
- Resolved an issue with logging in the production environment.
16+
17+
---
18+
519
## [0.4.1] - 2025-03-10
620

721
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pteroca/panel",
33
"description": "PteroCA.com is a free, open-source client area and management panel designed specifically for Pterodactyl server users and hosting providers. The platform simplifies and automates server management with a user-friendly interface and robust billing features.",
4-
"version": "0.4.1",
4+
"version": "0.4.2",
55
"type": "project",
66
"license": "MIT",
77
"minimum-stability": "stable",

config/packages/monolog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ when@prod:
4848
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
4949
nested:
5050
type: stream
51-
path: php://stderr
51+
path: "%kernel.logs_dir%/%kernel.environment%.log"
5252
level: debug
5353
formatter: monolog.formatter.json
5454
console:

config/packages/twig.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
twig:
22
file_name_pattern: '*.twig'
3+
paths:
4+
'%kernel.project_dir%/src/Core/Resources/templates': core_templates
35

46
when@test:
57
twig:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
final class Version20250311193917 extends AbstractMigration
11+
{
12+
public function getDescription(): string
13+
{
14+
return 'Add is_configured setting';
15+
}
16+
17+
public function up(Schema $schema): void
18+
{
19+
$this->addSql('INSERT INTO setting (name, value, type, context) VALUES (\'is_configured\', \'0\', \'boolean\', \'hidden_settings\')');
20+
21+
}
22+
23+
public function down(Schema $schema): void
24+
{
25+
$this->addSql('DELETE FROM setting WHERE name = \'is_configured\'');
26+
}
27+
}

public/assets/theme/default/css/panel.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,31 @@ input#command {
206206

207207
.logo-compact {
208208
color: #FFFFFF;
209+
}
210+
211+
.configuration-wrapper {
212+
background: #FFFFFF;
213+
border-radius: 10px;
214+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
215+
padding: 20px;
216+
}
217+
218+
.configuration-wrapper .configuration-title,
219+
.configuration-wrapper .configuration-subtitle {
220+
font-size: 1.5rem;
221+
font-weight: 600;
222+
text-align: center;
223+
padding-bottom: 1.5rem;
224+
}
225+
226+
.configuration-wrapper .configuration-subtitle {
227+
font-size: 1rem;
228+
}
229+
230+
.page-configurator {
231+
background: rgb(89, 134, 165) !important;
232+
display: flex;
233+
justify-content: center;
234+
align-items: center;
235+
height: 100vh;
209236
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
namespace App\Core\Controller;
4+
5+
use App\Core\Service\System\WebConfigurator\WebConfiguratorService;
6+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7+
use Symfony\Component\HttpFoundation\JsonResponse;
8+
use Symfony\Component\HttpFoundation\Request;
9+
use Symfony\Component\HttpFoundation\Response;
10+
use Symfony\Component\Routing\Annotation\Route;
11+
12+
class FirstConfigurationController extends AbstractController
13+
{
14+
public function __construct(
15+
private readonly WebConfiguratorService $webConfiguratorService,
16+
) {}
17+
18+
#[Route('/first-configuration', name: 'first_configuration')]
19+
public function index(
20+
Request $request,
21+
): Response
22+
{
23+
$this->validateConfiguratorAccess();
24+
25+
return $this->render(
26+
'@core_templates/configurator/configurator.html.twig',
27+
$this->webConfiguratorService->getDataForFirstConfiguration($request),
28+
);
29+
}
30+
31+
#[Route('/first-configuration/validate-step', name: 'first_configuration_validate_step', methods: ['POST'])]
32+
public function validateStep(
33+
Request $request,
34+
): JsonResponse
35+
{
36+
$this->validateConfiguratorAccess();
37+
38+
$isStepValidated = $this->webConfiguratorService->validateStep($request->request->all());
39+
$responseStatus = $isStepValidated->isVerificationSuccessful ? Response::HTTP_OK : Response::HTTP_BAD_REQUEST;
40+
41+
return new JsonResponse(
42+
data: [
43+
'message' => $isStepValidated->message,
44+
],
45+
status: $responseStatus,
46+
);
47+
}
48+
49+
#[Route('/first-configuration/finish', name: 'first_configuration_finish', methods: ['POST'])]
50+
public function finishConfiguration(
51+
Request $request,
52+
): JsonResponse
53+
{
54+
$this->validateConfiguratorAccess();
55+
56+
$isSuccessfulFinished = $this->webConfiguratorService->finishConfiguration($request->request->all());
57+
$responseStatus = $isSuccessfulFinished->isVerificationSuccessful ? Response::HTTP_OK : Response::HTTP_BAD_REQUEST;
58+
59+
return new JsonResponse(
60+
data: $isSuccessfulFinished->message,
61+
status: $responseStatus
62+
);
63+
}
64+
65+
private function validateConfiguratorAccess(): void
66+
{
67+
$isConfiguratorEnabled = $this->webConfiguratorService->isConfiguratorEnabled();
68+
69+
if (!$isConfiguratorEnabled || $this->getUser()) {
70+
throw $this->createNotFoundException();
71+
}
72+
}
73+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Core\DTO\Action\Result;
4+
5+
class ConfiguratorVerificationResult
6+
{
7+
public function __construct(
8+
public bool $isVerificationSuccessful,
9+
public string $message = '',
10+
) {}
11+
}

src/Core/DTO/ServerDataDTO.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public function __construct(
1010
public ServerDetailsDTO $serverDetails,
1111
public array $pterodactylServer,
1212
public array $dockerImages,
13-
public array $pterodactylClientServer,
14-
public array $pterodactylClientAccount,
13+
public ?array $pterodactylClientServer,
14+
public ?array $pterodactylClientAccount,
1515
public array $productEggConfiguration,
1616
public ?array $availableNestEggs,
1717
public bool $hasConfigurableOptions,

src/Core/Enum/LanguageEnum.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Core\Enum;
4+
5+
enum LanguageEnum: string
6+
{
7+
case English = 'en';
8+
case Polski = 'pl';
9+
case Español = 'es';
10+
case Français = 'fr';
11+
case Deutsch = 'de';
12+
case Italiano = 'it';
13+
case Português = 'pt';
14+
case Русский = 'ru';
15+
case 中文 = 'cn';
16+
case Українська = 'ua';
17+
case हिन्दी = 'hi';
18+
}

0 commit comments

Comments
 (0)