HOTFIX: Icons Upload ,Server overview 500, Installer APP_KEY overwrite

HOTFIX: Icons Upload and Server overview 500
This commit is contained in:
Dennis 2022-02-07 15:53:51 +01:00 committed by GitHub
commit 5f6ac6ce8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 26 additions and 45 deletions

1
.gitignore vendored
View file

@ -22,3 +22,4 @@ storage/invoices.zip
storage/app/public/logo.png
*vscode
- Kopie.env
public/install/logs.txt

View file

@ -241,7 +241,7 @@ class Pterodactyl
* @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");

View file

@ -42,6 +42,9 @@ class System
->withInput();
}
// update Icons from request
$this->updateIcons($request);
$values = [
"SETTINGS::SYSTEM:REGISTER_IP_CHECK" => "register-ip-check",
@ -70,4 +73,20 @@ class System
}
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');
}
}
}

View file

@ -40,47 +40,4 @@ class SettingsController extends Controller
'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 '<button data-content="' . __("Edit") . '" data-toggle="popover" data-trigger="hover" data-placement="top" onclick="configuration.parse(\'' . $setting->key . '\',\'' . $setting->value . '\',\'' . $setting->type . '\')" data-content="Edit" data-trigger="hover" data-toggle="tooltip" class="btn btn-sm btn-info mr-1"><i class="fas fa-pen"></i></button> ';
})
->editColumn('created_at', function (Settings $setting) {
return $setting->created_at ? $setting->created_at->diffForHumans() : '';
})
->rawColumns(['actions'])
->make();
}
}

0
bin/test.sh Executable file → Normal file
View file

0
bootstrap/cache/.gitignore vendored Executable file → Normal file
View file

0
config/trustedproxy.php Executable file → Normal file
View file

View file

@ -71,7 +71,11 @@ if (isset($_POST['feedDB'])) {
#$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!");

0
storage/app/.gitignore vendored Executable file → Normal file
View file

0
storage/app/public/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/cache/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/cache/data/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/sessions/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/testing/.gitignore vendored Executable file → Normal file
View file

0
storage/framework/views/.gitignore vendored Executable file → Normal file
View file

0
storage/logs/.gitignore vendored Executable file → Normal file
View file