From cebc026d25e647e56f37c0c89fcf6db062393fec Mon Sep 17 00:00:00 2001 From: IceToast Date: Mon, 7 Feb 2022 15:04:57 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=F0=9F=9A=91=EF=B8=8F=20Shoud=20fix?= =?UTF-8?q?=20500=20on=20server=20overview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Pterodactyl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Pterodactyl.php b/app/Classes/Pterodactyl.php index 4ffed33f0..1525d5f98 100644 --- a/app/Classes/Pterodactyl.php +++ b/app/Classes/Pterodactyl.php @@ -241,7 +241,7 @@ public function getUser(int $pterodactylId) * @param int $pterodactylId * @return mixed */ - public static function getServerAttributes(string $pterodactylId) + public static function getServerAttributes(int $pterodactylId) { try { $response = self::client()->get("/application/servers/{$pterodactylId}?include=egg,node,nest,location"); From e9e539c8c5ab76adcfc81e9f27494eccb6c97ea7 Mon Sep 17 00:00:00 2001 From: IceToast Date: Mon, 7 Feb 2022 15:30:47 +0100 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=F0=9F=9A=91=EF=B8=8F=20Icon=20uploa?= =?UTF-8?q?ding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/System.php | 19 ++++++++ .../Controllers/Admin/SettingsController.php | 43 ------------------- 2 files changed, 19 insertions(+), 43 deletions(-) diff --git a/app/Classes/Settings/System.php b/app/Classes/Settings/System.php index a9e32b085..66202ed68 100644 --- a/app/Classes/Settings/System.php +++ b/app/Classes/Settings/System.php @@ -42,6 +42,9 @@ public function updateSettings(Request $request) ->withInput(); } + // update Icons from request + $this->updateIcons($request); + $values = [ "SETTINGS::SYSTEM:REGISTER_IP_CHECK" => "register-ip-check", @@ -70,4 +73,20 @@ public function updateSettings(Request $request) } return redirect(route('admin.settings.index') . '#system')->with('success', __('System settings updated!')); } + + private function updateIcons(Request $request) + { + $request->validate([ + 'icon' => 'nullable|max:10000|mimes:jpg,png,jpeg', + 'favicon' => 'nullable|max:10000|mimes:ico', + ]); + + if ($request->hasFile('icon')) { + $request->file('icon')->storeAs('public', 'icon.png'); + } + + if ($request->hasFile('favicon')) { + $request->file('favicon')->storeAs('public', 'favicon.ico'); + } + } } diff --git a/app/Http/Controllers/Admin/SettingsController.php b/app/Http/Controllers/Admin/SettingsController.php index f4b8b4eeb..e1648eba8 100644 --- a/app/Http/Controllers/Admin/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsController.php @@ -40,47 +40,4 @@ public function index() 'tabListItems' => $tabListItems, ]); } - - - public function updatevalue(Request $request) - { - $setting = Settings::findOrFail($request->input('key')); - - $request->validate([ - 'key' => 'required|string|max:191', - 'value' => 'required|string|max:191', - ]); - - $setting->update($request->all()); - - return redirect()->route('admin.settings.index')->with('success', __('configuration has been updated!')); - } - - /** - * Remove the specified resource from storage. - * - * @param Settings $setting - * @return Response - */ - public function destroy(Settings $setting) - { - // - } - - public function datatable() - { - $query = Settings::where('key', 'like', '%SYSTEM%') - ->orWhere('key', 'like', '%USER%') - ->orWhere('key', 'like', '%SERVER%'); - - return datatables($query) - ->addColumn('actions', function (Settings $setting) { - return ' '; - }) - ->editColumn('created_at', function (Settings $setting) { - return $setting->created_at ? $setting->created_at->diffForHumans() : ''; - }) - ->rawColumns(['actions']) - ->make(); - } } From d3f7e1979b8d35391d8b3b1e1d4dae3f76ac33a8 Mon Sep 17 00:00:00 2001 From: 1Day Date: Mon, 7 Feb 2022 15:44:59 +0100 Subject: [PATCH 3/3] Dont overwrite APP_KEY if it already exists --- .gitignore | 1 + bin/test.sh | 0 bootstrap/cache/.gitignore | 0 config/trustedproxy.php | 0 public/install/forms.php | 6 +++++- storage/app/.gitignore | 0 storage/app/public/.gitignore | 0 storage/framework/.gitignore | 0 storage/framework/cache/.gitignore | 0 storage/framework/cache/data/.gitignore | 0 storage/framework/sessions/.gitignore | 0 storage/framework/testing/.gitignore | 0 storage/framework/views/.gitignore | 0 storage/logs/.gitignore | 0 14 files changed, 6 insertions(+), 1 deletion(-) mode change 100755 => 100644 bin/test.sh mode change 100755 => 100644 bootstrap/cache/.gitignore mode change 100755 => 100644 config/trustedproxy.php mode change 100755 => 100644 storage/app/.gitignore mode change 100755 => 100644 storage/app/public/.gitignore mode change 100755 => 100644 storage/framework/.gitignore mode change 100755 => 100644 storage/framework/cache/.gitignore mode change 100755 => 100644 storage/framework/cache/data/.gitignore mode change 100755 => 100644 storage/framework/sessions/.gitignore mode change 100755 => 100644 storage/framework/testing/.gitignore mode change 100755 => 100644 storage/framework/views/.gitignore mode change 100755 => 100644 storage/logs/.gitignore diff --git a/.gitignore b/.gitignore index 57290b7a1..4565559a7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ storage/invoices.zip storage/app/public/logo.png *vscode - Kopie.env +public/install/logs.txt diff --git a/bin/test.sh b/bin/test.sh old mode 100755 new mode 100644 diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100755 new mode 100644 diff --git a/config/trustedproxy.php b/config/trustedproxy.php old mode 100755 new mode 100644 diff --git a/public/install/forms.php b/public/install/forms.php index b6cba6ac4..8b6dbf015 100644 --- a/public/install/forms.php +++ b/public/install/forms.php @@ -71,7 +71,11 @@ #$logs .= run_console('composer install --no-dev --optimize-autoloader'); $logs .= run_console('php artisan migrate --seed --force'); $logs .= run_console('php artisan db:seed --class=ExampleItemsSeeder --force'); - $logs .= run_console('php artisan key:generate --force'); + if (strpos(getEnvironmentValue("APP_KEY"), 'base64') === false) { + $logs .= run_console('php artisan key:generate --force'); + }else{ + $logs .= "Key already exists. Skipping\n"; + } $logs .= run_console('php artisan storage:link'); $logsfile = fopen("logs.txt", "w") or die("Unable to open file!"); diff --git a/storage/app/.gitignore b/storage/app/.gitignore old mode 100755 new mode 100644 diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore old mode 100755 new mode 100644 diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore old mode 100755 new mode 100644 diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore old mode 100755 new mode 100644