diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index b823ace8a..53671ccd3 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -30,10 +30,10 @@ body: validations: required: false - type: textarea - id: controlpanel-logs + id: ctrlpanel-logs attributes: - label: Controlpanel Logs - description: Please copy and paste your laravel-log output. You may also provide a link to it using the following command `tail -n 100 /var/www/controlpanel/storage/logs/laravel.log | nc pteropaste.com 99` + label: CtrlPanel Logs + description: Please copy and paste your laravel-log output. You may also provide a link to it using the following command `tail -n 100 /var/www/ctrlpanel/storage/logs/laravel.log | nc pteropaste.com 99` render: Shell - type: textarea id: additional-info diff --git a/.github/SECURITY.md b/.github/SECURITY.md index d53e5a6eb..ef6b07aa9 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -11,9 +11,7 @@ At this time, we only accept vulnerability reports through GitHub Advisories. We kindly ask that you do not submit reports via other third-party bug bounty platforms, as they will be disregarded. ## Supported Versions - - Latests -### ControlPanel Versions - -We strongly recommend using or upgrading to the latest version of ControlPanel to ensure you have access to the latest security fixes and enhancements. +### CtrlPanel Versions +We strongly recommend using or upgrading to the latest version of CtrlPanel to ensure you have access to the latest security fixes and enhancements. diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 79f1e99fd..6c3f34aef 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -32,13 +32,15 @@ public function __construct() $this->middleware('guest'); } - protected function validateEmail(Request $request, GeneralSettings $general_settings) + protected function validateEmail(Request $request) { $this->validate($request, [ 'email' => ['required', 'string', 'email', 'max:255'], ]); - if ($general_settings->recaptcha_enabled) { + $recaptcha_enabled = app(GeneralSettings::class)->recaptcha_enabled; + + if ($recaptcha_enabled) { $this->validate($request, [ 'g-recaptcha-response' => 'required|recaptcha', ]); diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 5f3d94dc1..4e7e09e56 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -7,14 +7,19 @@ use App\Models\Pterodactyl\Location; use App\Models\Pterodactyl\Node; use App\Models\Product; +use App\Models\User; +use App\Notifications\DynamicNotification; use App\Settings\PterodactylSettings; use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Notification; +use Illuminate\Support\Facades\RateLimiter; class ProductController extends Controller -{ +{ private $pterodactyl; public function __construct(PterodactylSettings $ptero_settings) @@ -93,34 +98,60 @@ public function getLocationsBasedOnEgg(Request $request, Egg $egg) } }); + if($locations->isEmpty()){ + // Rate limit the node full notification to 1 attempt per 30 minutes + RateLimiter::attempt( + key: 'nodes-full-warning', + maxAttempts: 1, + callback: function() { + // get admin role and check users + $users = User::query()->where('role', '=', '1')->get(); + Notification::send($users,new DynamicNotification(['mail'],[], + mail: (new MailMessage)->subject('Attention! All of the nodes are full!')->greeting('Attention!')->line('All nodes are full, please add more nodes'))); + }, + decaySeconds: 5 + ); + } + return $locations; } /** - * @param Node $node + * @param Int $location * @param Egg $egg * @return Collection|JsonResponse */ - public function getProductsBasedOnNode(Egg $egg, Node $node) + public function getProductsBasedOnLocation(Egg $egg, Int $location) { - if (is_null($egg->id) || is_null($node->id)) { - return response()->json('node and egg id is required', '400'); + if (is_null($egg->id) || is_null($location)) { + return response()->json('location and egg id is required', '400'); } + // Get all nodes in this location + $nodes = Node::query() + ->where('location_id', '=', $location) + ->get(); + $products = Product::query() ->where('disabled', '=', false) - ->whereHas('nodes', function (Builder $builder) use ($node) { - $builder->where('id', '=', $node->id); + ->whereHas('nodes', function (Builder $builder) use ($nodes) { + $builder->whereIn('id', $nodes->map(function ($node) { + return $node->id; + })); }) ->whereHas('eggs', function (Builder $builder) use ($egg) { $builder->where('id', '=', $egg->id); }) ->get(); - $pteroNode = $this->pterodactyl->getNode($node->id); + // Instead of the old node check, we will check if the product fits in any given node in the location foreach ($products as $key => $product) { - if ($product->memory > ($pteroNode['memory'] * ($pteroNode['memory_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['memory'] || $product->disk > ($pteroNode['disk'] * ($pteroNode['disk_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['disk']) { - $product->doesNotFit = true; + $product->doesNotFit = false; + foreach ($nodes as $node) { + $pteroNode = $this->pterodactyl->getNode($node->id); + if ($product->memory > ($pteroNode['memory'] * ($pteroNode['memory_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['memory'] || $product->disk > ($pteroNode['disk'] * ($pteroNode['disk_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['disk']) { + $product->doesNotFit = true; + } } } diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index c52dc9316..f9f76e19f 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -123,6 +123,7 @@ public function create(UserSettings $user_settings, ServerSettings $server_setti 'server_creation_enabled' => $server_settings->creation_enabled, 'min_credits_to_make_server' => $user_settings->min_credits_to_make_server, 'credits_display_name' => $general_settings->credits_display_name, + 'location_description_enabled' => $server_settings->location_description_enabled, 'store_enabled' => $general_settings->store_enabled ]); } @@ -142,13 +143,10 @@ private function validateConfigurationRules(UserSettings $user_settings, ServerS $product = Product::findOrFail(FacadesRequest::input('product')); // Get node resource allocation info - $node = $product->nodes()->findOrFail(FacadesRequest::input('node')); - $nodeName = $node->name; - - // Check if node has enough memory and disk space - $checkResponse = $this->pterodactyl->checkNodeResources($node, $product->memory, $product->disk); - if ($checkResponse == false) { - return redirect()->route('servers.index')->with('error', __("The node '" . $nodeName . "' doesn't have the required memory or disk left to allocate this product.")); + $location = FacadesRequest::input('location'); + $availableNode = $this->getAvailableNode($location, $product); + if (!$availableNode) { + return redirect()->route('servers.index')->with('error', __("The chosen location doesn't have the required memory or disk left to allocate this product.")); } // Min. Credits @@ -180,7 +178,7 @@ private function validateConfigurationRules(UserSettings $user_settings, ServerS /** Store a newly created resource in storage. */ public function store(Request $request, UserSettings $user_settings, ServerSettings $server_settings, GeneralSettings $generalSettings) { - /** @var Node $node */ + /** @var Location $location */ /** @var Egg $egg */ /** @var Product $product */ $validate_configuration = $this->validateConfigurationRules($user_settings, $server_settings, $generalSettings); @@ -191,15 +189,23 @@ public function store(Request $request, UserSettings $user_settings, ServerSetti $request->validate([ 'name' => 'required|max:191', - 'node' => 'required|exists:nodes,id', + 'location' => 'required|exists:locations,id', 'egg' => 'required|exists:eggs,id', 'product' => 'required|exists:products,id', ]); - //get required resources + // Get the product and egg $product = Product::query()->findOrFail($request->input('product')); $egg = $product->eggs()->findOrFail($request->input('egg')); - $node = $product->nodes()->findOrFail($request->input('node')); + + // Get an available node + $location = $request->input('location'); + $availableNode = $this->getAvailableNode($location, $product); + $node = Node::query()->find($availableNode); + + if(!$node) { + return redirect()->route('servers.index')->with('error', __("No nodes satisfying the requirements for automatic deployment on this location were found.")); + } $server = $request->user()->servers()->create([ 'name' => $request->input('name'), @@ -317,7 +323,7 @@ public function show(Server $server, ServerSettings $server_settings, GeneralSet }) ->get(); - // Set the each product eggs array to just contain the eggs name + // Set each product eggs array to just contain the eggs name foreach ($products as $product) { $product->eggs = $product->eggs->pluck('name')->toArray(); if ($product->memory - $currentProduct->memory > ($pteroNode['memory'] * ($pteroNode['memory_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['memory'] || $product->disk - $currentProduct->disk > ($pteroNode['disk'] * ($pteroNode['disk_overallocate'] + 100) / 100) - $pteroNode['allocated_resources']['disk']) { @@ -329,7 +335,8 @@ public function show(Server $server, ServerSettings $server_settings, GeneralSet 'server' => $server, 'products' => $products, 'server_enable_upgrade' => $server_settings->enable_upgrade, - 'credits_display_name' => $general_settings->credits_display_name + 'credits_display_name' => $general_settings->credits_display_name, + 'location_description_enabled' => $server_settings->location_description_enabled, ]); } @@ -357,8 +364,8 @@ public function upgrade(Server $server, Request $request) // Check if node has enough memory and disk space $requireMemory = $newProduct->memory - $oldProduct->memory; $requiredisk = $newProduct->disk - $oldProduct->disk; - $checkResponse = $this->pterodactyl->checkNodeResources($node, $requireMemory, $requiredisk); - if ($checkResponse == false) { + $nodeFree = $this->pterodactyl->checkNodeResources($node, $requireMemory, $requiredisk); + if (!$nodeFree) { return redirect()->route('servers.index')->with('error', __("The node '" . $nodeName . "' doesn't have the required memory or disk left to upgrade the server.")); } @@ -394,7 +401,7 @@ public function upgrade(Server $server, Request $request) // Remove the allocation property from the server object as it is not a column in the database unset($server->allocation); - // Update the server on controlpanel + // Update the server on CtrlPanel $server->update([ 'product_id' => $newProduct->id, 'updated_at' => now(), @@ -413,4 +420,30 @@ public function upgrade(Server $server, Request $request) return redirect()->route('servers.show', ['server' => $server->id])->with('error', __('Not Enough Balance for Upgrade')); } } + + /** + * @param string $location + * @param Product $product + * @return int | null Node ID + */ + private function getAvailableNode(string $location, Product $product) + { + $collection = Node::query()->where('location_id', $location)->get(); + + // loop through nodes and check if the node has enough resources + foreach ($collection as $node) { + // Check if the node has enough memory and disk space + $freeNode = $this->pterodactyl->checkNodeResources($node, $product->memory, $product->disk); + // Remove the node from the collection if it doesn't have enough resources + if (!$freeNode) { + $collection->forget($node['id']); + } + } + + if($collection->isEmpty()) { + return null; + } + + return $collection->first()['id']; + } } diff --git a/app/Models/Pterodactyl/Location.php b/app/Models/Pterodactyl/Location.php index 8d4bf7c10..ddb1f7155 100644 --- a/app/Models/Pterodactyl/Location.php +++ b/app/Models/Pterodactyl/Location.php @@ -53,7 +53,7 @@ public static function syncLocations() ], [ 'name' => $location['name'], - 'description' => $location['name'], + 'description' => $location['description'], ] ); } diff --git a/app/Settings/ServerSettings.php b/app/Settings/ServerSettings.php index 3a82ac3bc..8ed4547d1 100644 --- a/app/Settings/ServerSettings.php +++ b/app/Settings/ServerSettings.php @@ -9,6 +9,7 @@ class ServerSettings extends Settings public int $allocation_limit; public bool $creation_enabled; public bool $enable_upgrade; + public bool $location_description_enabled; public static function group(): string { @@ -25,6 +26,7 @@ public static function getValidations() 'allocation_limit' => 'required|integer|min:0', 'creation_enabled' => 'nullable|string', 'enable_upgrade' => 'nullable|string', + 'location_description_enabled' => 'nullable|string', ]; } @@ -52,6 +54,11 @@ public static function getOptionInputData() 'type' => 'boolean', 'description' => 'Enable the server upgrade feature.', ], + 'location_description_enabled' => [ + 'label' => 'Enable Location Description', + 'type' => 'boolean', + 'description' => 'Enable the location description field on the server creation page.', + ], ]; } } diff --git a/app/Traits/Invoiceable.php b/app/Traits/Invoiceable.php index 182333a58..3ee77c90e 100644 --- a/app/Traits/Invoiceable.php +++ b/app/Traits/Invoiceable.php @@ -54,7 +54,7 @@ public function createInvoice(Payment $payment, ShopProduct $shopProduct, Invoic $invoice = DailyInvoice::make() - ->template('controlpanel') + ->template('ctrlpanel') ->name(__("Invoice")) ->buyer($customer) ->seller($seller) diff --git a/database/migrations/2024_05_22_141233_update_description_servers_table.php b/database/migrations/2024_05_22_141233_update_description_servers_table.php new file mode 100644 index 000000000..e0964c529 --- /dev/null +++ b/database/migrations/2024_05_22_141233_update_description_servers_table.php @@ -0,0 +1,32 @@ +text('description')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('servers', function (Blueprint $table) { + $table->string('description')->nullable()->change(); + }); + } +}; diff --git a/database/migrations/2024_05_22_143551_update_description_locations_table.php b/database/migrations/2024_05_22_143551_update_description_locations_table.php new file mode 100644 index 000000000..e2b70688b --- /dev/null +++ b/database/migrations/2024_05_22_143551_update_description_locations_table.php @@ -0,0 +1,32 @@ +text('description')->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('locations', function (Blueprint $table) { + $table->string('description')->change(); + }); + } +}; diff --git a/database/settings/2024_05_22_152306_add_location_settings_table.php b/database/settings/2024_05_22_152306_add_location_settings_table.php new file mode 100644 index 000000000..aaa01e040 --- /dev/null +++ b/database/settings/2024_05_22_152306_add_location_settings_table.php @@ -0,0 +1,16 @@ +migrator->add('server.location_description_enabled',false); + } + + public function down(): void + { + $this->migrator->delete('server.location_description_enabled'); + } +}; diff --git a/docker/README.md b/docker/README.md index 1581bd17a..d76483b7c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,9 +3,9 @@ cd into the project directory and run the following command: `sh bin/startdocker.sh` This should start building the images and start the containers. -After that you need to go into the controlpanel_php container and run some commands: +After that you need to go into the ctrlpanel_php container and run some commands: -Type `docker exec -it controlpanel_php ash` to go into the container and run the following commands: +Type `docker exec -it ctrlpanel_php ash` to go into the container and run the following commands: ```shell composer install @@ -17,7 +17,7 @@ php artisan migrate --seed --force ## Setting up testing environment -Create the .env.testing file to your needs. Then once done you need to go into your phpmyadmin to create a new database named __controlpanel_test__. +Create the .env.testing file to your needs. Then once done you need to go into your phpmyadmin to create a new database named __ctrlpanel_test__. Visit http://127.0.0.1:8080/ and create your database. Now you're ready to run the following commands which switches to the testing config, migrates the test database and seeds it. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 56c9e24de..d41e258bc 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,7 +8,7 @@ services: build: context: ../ dockerfile: docker/nginx/Dockerfile - container_name: controlpanel_nginx + container_name: ctrlpanel_nginx ports: - 80:80 volumes: @@ -21,14 +21,14 @@ services: mysql: image: mysql - container_name: controlpanel_mysql + container_name: ctrlpanel_mysql restart: unless-stopped tty: true ports: - "3306:3306" environment: - MYSQL_DATABASE: controlpanel - MYSQL_USER: controlpanel + MYSQL_DATABASE: ctrlpanel + MYSQL_USER: ctrlpanel MYSQL_PASSWORD: root MYSQL_ROOT_PASSWORD: root volumes: @@ -40,7 +40,7 @@ services: build: context: ../ dockerfile: docker/php/Dockerfile - container_name: controlpanel_php + container_name: ctrlpanel_php volumes: - "../:/var/www/html" networks: @@ -48,13 +48,13 @@ services: phpmyadmin: image: phpmyadmin/phpmyadmin - container_name: controlpanel_phpmyadmin + container_name: ctrlpanel_phpmyadmin depends_on: - mysql ports: - '8080:80' environment: - - PMA_HOST=controlpanel_mysql + - PMA_HOST=ctrlpanel_mysql - PMA_USER=root - PMA_PASSWORD=root - PMA_ARBITRARY=1 @@ -62,4 +62,4 @@ services: - laravel volumes: - mysql: \ No newline at end of file + mysql: diff --git a/lang/bg.json b/lang/bg.json index a5c070c57..1618b1ccd 100644 --- a/lang/bg.json +++ b/lang/bg.json @@ -126,7 +126,7 @@ "Support server": "Сървър за поддръжка", "Documentation": "Документация", "Github": "GitHub", - "Support ControlPanel": "Подкрепете Control Panel", + "Support CtrlPanel": "Подкрепете CtrlPanel", "Servers": "Сървъри", "Total": "Общо", "Payments": "Плащания", diff --git a/lang/bs.json b/lang/bs.json index fe4f110bb..79615b407 100644 --- a/lang/bs.json +++ b/lang/bs.json @@ -112,7 +112,7 @@ "Support server": "Support server", "Documentation": "Documentation", "Github": "Github", - "Support ControlPanel": "Support ControlPanel", + "Support CtrlPanel": "Support CtrlPanel", "Servers": "Servers", "Total": "Total", "Payments": "Payments", diff --git a/lang/cs.json b/lang/cs.json index a0074d402..146670294 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -126,7 +126,7 @@ "Support server": "Server podpory", "Documentation": "Dokumentace", "Github": "GitHub", - "Support ControlPanel": "Podpořit ControlPanel", + "Support CtrlPanel": "Podpořit CtrlPanel", "Servers": "Servery", "Total": "Celkem", "Payments": "Platby", diff --git a/lang/de.json b/lang/de.json index e9ab272d9..2460899a3 100644 --- a/lang/de.json +++ b/lang/de.json @@ -126,7 +126,7 @@ "Support server": "Discord Server", "Documentation": "Dokumentation", "Github": "Github", - "Support ControlPanel": "Unterstütze CtrlPanel.gg", + "Support CtrlPanel": "Unterstütze CtrlPanel.gg", "Servers": "Server", "Total": "Gesamt", "Payments": "Zahlungen", diff --git a/lang/en.json b/lang/en.json index 25f16da8b..9b9a0bdc9 100644 --- a/lang/en.json +++ b/lang/en.json @@ -71,7 +71,7 @@ "Change Status": "Change Status", "Profile updated": "Profile updated", "Server limit reached!": "Server limit reached!", - "The node '\" . $nodeName . \"' doesn't have the required memory or disk left to allocate this product.": "The node '\" . $nodeName . \"' doesn't have the required memory or disk left to allocate this product.", + "The chosen location doesn't have the required memory or disk left to allocate this product.": "The chosen location doesn't have the required memory or disk left to allocate this product.", "You are required to verify your email address before you can create a server.": "You are required to verify your email address before you can create a server.", "You are required to link your discord account before you can create a server.": "You are required to link your discord account before you can create a server.", "Server created": "Server created", @@ -145,7 +145,7 @@ "Support server": "Support server", "Documentation": "Documentation", "Github": "Github", - "Support ControlPanel": "Support ControlPanel", + "Support CtrlPanel": "Support CtrlPanel", "Servers": "Servers", "Total": "Total", "Payments": "Payments", @@ -166,7 +166,7 @@ "You reached the Pterodactyl perPage limit. Please make sure to set it higher than your server count.": "You reached the Pterodactyl perPage limit. Please make sure to set it higher than your server count.", "You can do that in settings.": "You can do that in settings.", "Note": "Note", - "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on ControlPanel. Try clicking the button below.": "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on ControlPanel. Try clicking the button below.", + "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on CtrlPanel. Try clicking the button below.": "If this error persists even after changing the limit, it might mean a server was deleted on Pterodactyl, but not on CtrlPanel. Try clicking the button below.", "Sync servers": "Sync servers", "Node": "Node", "Server count": "Server count", diff --git a/lang/es.json b/lang/es.json index 50ecfb4a4..f4c3121a0 100644 --- a/lang/es.json +++ b/lang/es.json @@ -126,7 +126,7 @@ "Support server": "Servidor de Ayuda", "Documentation": "Documentación", "Github": "GitHub", - "Support ControlPanel": "Apoya ControlPanel", + "Support CtrlPanel": "Apoya CtrlPanel", "Servers": "Servidores", "Total": "Total", "Payments": "Pagos", diff --git a/lang/fr.json b/lang/fr.json index 16e7150f3..8811187d7 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -126,7 +126,7 @@ "Support server": "Serveur de support", "Documentation": "Documentation", "Github": "Github", - "Support ControlPanel": "ControlPanel Support", + "Support CtrlPanel": "CtrlPanel Support", "Servers": "Serveurs", "Total": "Total", "Payments": "Paiments", diff --git a/lang/he.json b/lang/he.json index 4d09b0397..04af79956 100644 --- a/lang/he.json +++ b/lang/he.json @@ -126,7 +126,7 @@ "Support server": "שרת תמיכה", "Documentation": "מדריך", "Github": "Github/גיטאהב", - "Support ControlPanel": "תמיכת ControlPanel", + "Support CtrlPanel": "תמיכת CtrlPanel", "Servers": "שרתים", "Total": "בסך הכל", "Payments": "תשלומים", diff --git a/lang/hi.json b/lang/hi.json index c36b7d014..5b310de06 100644 --- a/lang/hi.json +++ b/lang/hi.json @@ -126,7 +126,7 @@ "Support server": "समर्थन सर्वर", "Documentation": "प्रलेखन", "Github": "गिटहब", - "Support ControlPanel": "समर्थन नियंत्रण पैनल", + "Support CtrlPanel": "CtrlPanel का समर्थन करें", "Servers": "सर्वरस", "Total": "कुल", "Payments": "भुगतान", diff --git a/lang/hu.json b/lang/hu.json index af3ac9622..2479fdb5b 100644 --- a/lang/hu.json +++ b/lang/hu.json @@ -126,7 +126,7 @@ "Support server": "Szerver támogatása", "Documentation": "Dokumentáció", "Github": "Github", - "Support ControlPanel": "ControlPanel támogatása", + "Support CtrlPanel": "CtrlPanel támogatása", "Servers": "Szerverek", "Total": "Összesen", "Payments": "Fizetések", diff --git a/lang/it.json b/lang/it.json index 1fce8de29..12f1c29f1 100644 --- a/lang/it.json +++ b/lang/it.json @@ -126,7 +126,7 @@ "Support server": "Server di supporto", "Documentation": "Documentazione", "Github": "GitHub", - "Support ControlPanel": "Supporta ControlPanel", + "Support CtrlPanel": "Supporta CtrlPanel", "Servers": "Servers", "Total": "Totale", "Payments": "Pagamenti", diff --git a/lang/nl.json b/lang/nl.json index 6db2f669d..8b1add000 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -126,7 +126,7 @@ "Support server": "Ondersteuningsserver", "Documentation": "Documentatie", "Github": "Github", - "Support ControlPanel": "Ondersteuning ControlPanel", + "Support CtrlPanel": "Ondersteuning CtrlPanel", "Servers": "Servers", "Total": "Totaal", "Payments": "Betalingen", diff --git a/lang/pl.json b/lang/pl.json index d14b00803..05e68bac1 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -126,7 +126,7 @@ "Support server": "Serwer pomocy", "Documentation": "Dokumentacja", "Github": "Github", - "Support ControlPanel": "Wesprzyj ControlPanel", + "Support CtrlPanel": "Wesprzyj CtrlPanel", "Servers": "Serwery", "Total": "Razem", "Payments": "Płatności", diff --git a/lang/pt.json b/lang/pt.json index 9083b97d4..e07ec430b 100644 --- a/lang/pt.json +++ b/lang/pt.json @@ -126,7 +126,7 @@ "Support server": "Servidor de suporte", "Documentation": "Documentação", "Github": "Github", - "Support ControlPanel": "Suporte para ControlPanel", + "Support CtrlPanel": "Suporte para CtrlPanel", "Servers": "Servidores", "Total": "Total", "Payments": "Pagamentos", diff --git a/lang/ro.json b/lang/ro.json index d9a949671..9aeb0f05b 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -126,7 +126,7 @@ "Support server": "Support server", "Documentation": "Documentation", "Github": "Github", - "Support ControlPanel": "Support ControlPanel", + "Support CtrlPanel": "Support CtrlPanel", "Servers": "Servers", "Total": "Total", "Payments": "Payments", diff --git a/lang/ru.json b/lang/ru.json index ec254e371..a9bfeb9f5 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -126,7 +126,7 @@ "Support server": "Сервер поддержки", "Documentation": "Документация", "Github": "GitHub", - "Support ControlPanel": "Поддержка панели управления", + "Support CtrlPanel": "Поддержка CtrlPanel", "Servers": "Серверы", "Total": "Всего", "Payments": "Оплаты", diff --git a/lang/sh.json b/lang/sh.json index c65182bb1..1809b0c01 100644 --- a/lang/sh.json +++ b/lang/sh.json @@ -112,7 +112,7 @@ "Support server": "Support server", "Documentation": "Documentation", "Github": "Github", - "Support ControlPanel": "Support ControlPanel", + "Support CtrlPanel": "Support CtrlPanel", "Servers": "Servers", "Total": "Total", "Payments": "Payments", diff --git a/lang/sk.json b/lang/sk.json index 2db59f349..99fa908e3 100644 --- a/lang/sk.json +++ b/lang/sk.json @@ -126,7 +126,7 @@ "Support server": "Server podpory", "Documentation": "Dokumentácia", "Github": "Github", - "Support ControlPanel": "Podporiť ControlPanel", + "Support CtrlPanel": "Podporiť CtrlPanel", "Servers": "Servery", "Total": "Celkom", "Payments": "Platby", diff --git a/lang/sr.json b/lang/sr.json index 50cab9924..65ecd37cc 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -126,7 +126,7 @@ "Support server": "Server za podršku", "Documentation": "Dokumentacija", "Github": "GitHub", - "Support ControlPanel": "Podrži ControlPanel", + "Support CtrlPanel": "Podrži CtrlPanel", "Servers": "Serveri", "Total": "Ukupno", "Payments": "Plaćanja", diff --git a/lang/sv.json b/lang/sv.json index 552f0def3..d26a47107 100644 --- a/lang/sv.json +++ b/lang/sv.json @@ -126,7 +126,7 @@ "Support server": "Stödservern", "Documentation": "Dokumentation", "Github": "Github", - "Support ControlPanel": "Support ControlPanel", + "Support CtrlPanel": "Support CtrlPanel", "Servers": "Servers", "Total": "Total", "Payments": "Payments", diff --git a/lang/tr.json b/lang/tr.json index f05ebe60e..1a31d925a 100644 --- a/lang/tr.json +++ b/lang/tr.json @@ -126,7 +126,7 @@ "Support server": "Destek sunucusu", "Documentation": "Dökümantasyon", "Github": "GitHub", - "Support ControlPanel": "ContrılPanel'i destekle", + "Support CtrlPanel": "CtrlPanel'i destekle", "Servers": "Sunucular", "Total": "Toplam", "Payments": "Ödemeler", diff --git a/lang/zh.json b/lang/zh.json index 58e00e356..c18dad757 100644 --- a/lang/zh.json +++ b/lang/zh.json @@ -126,7 +126,7 @@ "Support server": "支持服务器", "Documentation": "文档", "Github": "Github", - "Support ControlPanel": "支持我们", + "Support CtrlPanel": "支持我们", "Servers": "服务器", "Total": "总数", "Payments": "支付费用", diff --git a/package-lock.json b/package-lock.json index 89d691a53..95a8ff2b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "controlpanel", + "name": "CtrlPanel", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/phpunit.xml b/phpunit.xml index fc15f97bc..1c2c01844 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -22,7 +22,7 @@ - + diff --git a/public/images/controlpanel.png b/public/images/controlpanel.png deleted file mode 100644 index 63a4d3bf2..000000000 Binary files a/public/images/controlpanel.png and /dev/null differ diff --git a/public/images/controlpanel_logo.png b/public/images/ctrlpanel_logo.png similarity index 100% rename from public/images/controlpanel_logo.png rename to public/images/ctrlpanel_logo.png diff --git a/public/install/forms.php b/public/install/forms.php index 96f1dfa17..3ca18c010 100644 --- a/public/install/forms.php +++ b/public/install/forms.php @@ -87,7 +87,7 @@ header('LOCATION: index.php?step=3'); } catch (\Throwable $th) { wh_log('Feeding the Database failed', 'error'); - header("LOCATION: index.php?step=2.5&message=" . $th->getMessage() . "
Please check the installer.log file in /var/www/controlpanel/storage/logs !"); + header("LOCATION: index.php?step=2.5&message=" . $th->getMessage() . "
Please check the installer.log file in /var/www/ctrlpanel/storage/logs !"); } } diff --git a/public/install/functions.php b/public/install/functions.php index a5f2b0454..5e8b847aa 100644 --- a/public/install/functions.php +++ b/public/install/functions.php @@ -262,7 +262,7 @@ function wh_log(string $message, string $level = 'info', array $context = []): v $stream = new StreamHandler(dirname(__FILE__, 3) . '/storage/logs/installer.log', Logger::DEBUG); $stream->setFormatter($formatter); - $log = new Logger('ControlPanel'); + $log = new Logger('CtrlPanel'); $log->pushHandler($stream); switch (strtolower($level)) { diff --git a/public/install/index.php b/public/install/index.php index 6afd2e70c..ee36cc4dd 100644 --- a/public/install/index.php +++ b/public/install/index.php @@ -143,7 +143,7 @@ function cardStart($title, $subtitle = null)
- +
@@ -156,7 +156,7 @@ function cardStart($title, $subtitle = null)
- +
diff --git a/routes/web.php b/routes/web.php index c575ea981..444d9485b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -95,7 +95,7 @@ //routes made for server create page to fetch product info Route::get('/products/nodes/egg/{egg?}', [FrontProductController::class, 'getNodesBasedOnEgg'])->name('products.nodes.egg'); Route::get('/products/locations/egg/{egg?}', [FrontProductController::class, 'getLocationsBasedOnEgg'])->name('products.locations.egg'); - Route::get('/products/products/{egg?}/{node?}', [FrontProductController::class, 'getProductsBasedOnNode'])->name('products.products.node'); + Route::get('/products/products/{egg?}/{location?}', [FrontProductController::class, 'getProductsBasedOnLocation'])->name('products.products.location'); //payments Route::get('checkout/{shopProduct}', [PaymentController::class, 'checkOut'])->name('checkout'); diff --git a/themes/BlueInfinity/views/layouts/app.blade.php b/themes/BlueInfinity/views/layouts/app.blade.php index 376f1d920..e8c5650d8 100644 --- a/themes/BlueInfinity/views/layouts/app.blade.php +++ b/themes/BlueInfinity/views/layouts/app.blade.php @@ -6,7 +6,7 @@ - exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image"> + exists('logo.png') ? asset('storage/logo.png') : asset('images/ctrlpanel_logo.png') }}' property="og:image"> diff --git a/themes/BlueInfinity/views/layouts/main.blade.php b/themes/BlueInfinity/views/layouts/main.blade.php index b6549a7a0..785b42780 100644 --- a/themes/BlueInfinity/views/layouts/main.blade.php +++ b/themes/BlueInfinity/views/layouts/main.blade.php @@ -11,7 +11,7 @@ exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' + content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/ctrlpanel_logo.png') }}' property="og:image"> {{ config('app.name', 'Laravel') }} {{ __('Mark all as read') }} {{ config('app.name', 'Laravel') }} Logo {{ config('app.name', 'CtrlPanel.gg') }} diff --git a/themes/default/views/admin/settings/index.blade.php b/themes/default/views/admin/settings/index.blade.php index 799e426de..4d07a9e31 100644 --- a/themes/default/views/admin/settings/index.blade.php +++ b/themes/default/views/admin/settings/index.blade.php @@ -120,7 +120,7 @@ class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}">
{{ __('FavIcon') }} - ...
@@ -132,7 +132,7 @@ class="card-img-top" alt="...">
{{ __('Icon') }} - ...
@@ -144,7 +144,7 @@ class="form-control" name="icon" id="icon">
{{ __('Login-page Logo') }} - ... diff --git a/themes/default/views/layouts/app.blade.php b/themes/default/views/layouts/app.blade.php index 240eb2466..3f6b504f5 100644 --- a/themes/default/views/layouts/app.blade.php +++ b/themes/default/views/layouts/app.blade.php @@ -7,7 +7,7 @@ - exists('logo.png') ? asset('/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image"> + exists('logo.png') ? asset('/logo.png') : asset('images/ctrlpanel_logo.png') }}' property="og:image"> diff --git a/themes/default/views/layouts/main.blade.php b/themes/default/views/layouts/main.blade.php index 9631ef64d..66c79d6e7 100644 --- a/themes/default/views/layouts/main.blade.php +++ b/themes/default/views/layouts/main.blade.php @@ -11,7 +11,7 @@ exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' + content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/ctrlpanel_logo.png') }}' property="og:image"> {{ config('app.name', 'Laravel') }} {{ __('Mark all as read') }} {{ config('app.name', 'Laravel') }} Logo {{ config('app.name', 'CtrlPanel.gg') }} diff --git a/themes/default/views/servers/create.blade.php b/themes/default/views/servers/create.blade.php index 417dae942..64f80b95d 100644 --- a/themes/default/views/servers/create.blade.php +++ b/themes/default/views/servers/create.blade.php @@ -133,32 +133,32 @@ class="custom-select">
-
- - + + -
+
+
+ {{ __('There seem to be no nodes available for this specification. Admins have been notified. Please try again later of contact us.') }} +
-
+