Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d990d753ce | |||
| 425bab096d | |||
| 338fc88095 | |||
| 0a724cc49a |
@@ -69,8 +69,6 @@ jobs:
|
||||
php artisan migrate --force
|
||||
php artisan passport:install --no-interaction
|
||||
chmod -R 777 storage bootstrap/cache
|
||||
chmod 600 storage/oauth-private.key
|
||||
chmod 660 storage/oauth-public.key
|
||||
|
||||
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
||||
env:
|
||||
|
||||
@@ -67,8 +67,6 @@ jobs:
|
||||
php artisan migrate --force
|
||||
php artisan passport:install --no-interaction
|
||||
chmod -R 777 storage bootstrap/cache
|
||||
chmod 600 storage/oauth-private.key
|
||||
chmod 660 storage/oauth-public.key
|
||||
|
||||
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
||||
env:
|
||||
|
||||
@@ -56,10 +56,7 @@ jobs:
|
||||
run: php artisan passport:keys
|
||||
|
||||
- name: Directory Permissions
|
||||
run: |
|
||||
chmod -R 777 storage bootstrap/cache
|
||||
chmod 600 storage/oauth-private.key
|
||||
chmod 660 storage/oauth-public.key
|
||||
run: chmod -R 777 storage bootstrap/cache
|
||||
|
||||
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
||||
env:
|
||||
|
||||
@@ -166,17 +166,7 @@ class ProfileController extends Controller
|
||||
|
||||
$tokens = $this->tokenRepository->forUser(auth()->user()->getAuthIdentifier());
|
||||
$token_values = $tokens->load('client')->filter(function ($token) {
|
||||
if ($token->revoked || ! $token->client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$client = $token->client;
|
||||
|
||||
if (method_exists($client, 'hasGrantType')) {
|
||||
return $client->hasGrantType('personal_access');
|
||||
}
|
||||
|
||||
return in_array('personal_access', (array) ($client->grant_types ?? []), true);
|
||||
return $token->client->personal_access_client && ! $token->revoked;
|
||||
})->values();
|
||||
|
||||
return response()->json(Helper::formatStandardApiResponse('success', $token_values, null));
|
||||
|
||||
@@ -265,4 +265,6 @@ class SetupController extends Controller
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -46,7 +46,7 @@
|
||||
"laravel-notification-channels/microsoft-teams": "^1.2",
|
||||
"laravel/framework": "^11.0",
|
||||
"laravel/helpers": "^1.4",
|
||||
"laravel/passport": "^13.0",
|
||||
"laravel/passport": "^12.0",
|
||||
"laravel/slack-notification-channel": "^3.4",
|
||||
"laravel/socialite": "^5.6",
|
||||
"laravel/tinker": "^2.6",
|
||||
@@ -125,7 +125,8 @@
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi",
|
||||
"@php artisan vendor:publish --force --tag=livewire:assets --ansi"
|
||||
"@php artisan vendor:publish --force --tag=livewire:assets --ansi",
|
||||
"@php fix-permissions.php"
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"php artisan key:generate"
|
||||
|
||||
Generated
+548
-792
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
||||
|
||||
|
||||
$icon = '';
|
||||
$files = [
|
||||
'storage/oauth-private.key' => '660',
|
||||
'storage/oauth-public.key' => '660',
|
||||
];
|
||||
|
||||
echo "\n";
|
||||
|
||||
// Normalize key permissions for Passport 13 (covers both fresh installs and upgrades)
|
||||
if (PHP_OS_FAMILY !== 'Windows') {
|
||||
|
||||
foreach ($files as $file => $permission) {
|
||||
if (file_exists($file)) {
|
||||
try {
|
||||
@chmod($file, $permission);
|
||||
$messages[]['success'] = "Permissions updated to ".$permission." on ".$file." \n";
|
||||
} catch (Exception $e) {
|
||||
$messages[]['error'] = "Could not change permissions for ".$file.". Please manually change the permissions on this file to ".$permission.". See the documentation: https://snipe-it.readme.io/docs/debugging-permissions#linuxosx \n";
|
||||
}
|
||||
} else {
|
||||
$messages[]['info'] = "The file ".$file." was not found and may not have been created yet. \n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($messages) > 0) {
|
||||
|
||||
for($x = 0; $x < count($messages); $x++) {
|
||||
|
||||
foreach ($messages[$x] as $type => $message) {
|
||||
if ($type === 'error') {
|
||||
echo " \e[0;97;41m ERROR \e[0m ";
|
||||
} elseif ($type === 'info') {
|
||||
echo " \e[0;97;44m INFO \e[0m ";
|
||||
} elseif ($type === 'success') {
|
||||
echo " \e[0;97;42m SUCCESS \e[0m ";
|
||||
}
|
||||
echo $message;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
echo " \e[0;97;44m INFO \e[0m Windows OS detected, so OAuth key permissions could not be set. If you have problems with API calls or tables loading in your Snipe-IT application, see the documentation on how to correct them: https://snipe-it.readme.io/docs/debugging-permissions#windows \n";
|
||||
exit();
|
||||
@@ -612,13 +612,6 @@ if ((!file_exists('storage/oauth-public.key')) || (!file_exists('storage/oauth-p
|
||||
echo $success_icon." OAuth keys detected. Skipping passport install.\n\n";
|
||||
}
|
||||
|
||||
// Normalize key permissions for Passport 13 (covers both fresh installs and upgrades)
|
||||
if (PHP_OS !== 'WINNT') {
|
||||
if (file_exists('storage/oauth-private.key')) chmod('storage/oauth-private.key', 0600);
|
||||
if (file_exists('storage/oauth-public.key')) chmod('storage/oauth-public.key', 0660);
|
||||
echo $success_icon." OAuth key permissions normalized.\n\n";
|
||||
}
|
||||
|
||||
|
||||
echo "\e[95m--------------------------------------------------------\n";
|
||||
echo "STEP 11: Taking application out of maintenance mode:\n";
|
||||
|
||||
Reference in New Issue
Block a user