1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-04-21 07:22:20 +02:00

Upgrade dependencies, correct files after v1 merge

This commit is contained in:
Kovah 2024-02-06 09:50:10 +01:00
parent 274eca2ff0
commit 5272399b5b
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B
11 changed files with 2093 additions and 2038 deletions

View File

@ -8,8 +8,6 @@ use App\Models\LinkList;
use App\Models\Tag;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Http;
use Masterminds\HTML5;
class FetchController extends Controller

View File

@ -64,8 +64,8 @@ class Kernel extends HttpKernel
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class,
];
}

View File

@ -4,42 +4,53 @@
"license": "GPL-3.0-or-later",
"type": "project",
"require": {
"php": "^8.0 | ^8.1 | ^8.2",
"php": "^8.1 | ^8.2 | ^8.3",
"ext-pdo": "*",
"ext-ftp": "*",
"ext-dom": "*",
"composer/semver": "^3.3.1",
"doctrine/dbal": "^3.7.0",
"guzzlehttp/guzzle": "^7.0.1",
"doctrine/dbal": "^3.7",
"guzzlehttp/guzzle": "^7.0",
"kovah/laravel-html-meta": "^2.0",
"laracasts/flash": "^3.1",
"laravel/fortify": "^1.7",
"laravel/framework": "^9.0",
"laravel/sanctum": "^v3.3.1",
"laravel/framework": "^v10.43",
"laravel/sanctum": "^v3.3",
"league/csv": "^9.6",
"league/flysystem-aws-s3-v3": "^3.0.13",
"league/flysystem-aws-s3-v3": "^3.0",
"league/flysystem-ftp": "^3.0",
"league/flysystem-sftp-v3": "^3.0",
"masterminds/html5": "^2.8",
"owen-it/laravel-auditing": "^13.0",
"predis/predis": "^v2.2",
"rap2hpoutre/laravel-log-viewer": "^2.2",
"sentry/sentry-laravel": "^3.8.0",
"shaarli/netscape-bookmark-parser": "^v4.0.0",
"sentry/sentry-laravel": "^4.2.0",
"shaarli/netscape-bookmark-parser": "dev-master",
"spatie/laravel-activitylog": "^4.5",
"spatie/laravel-backup": "^8.1.2",
"spatie/laravel-permission": "^5.5",
"spatie/laravel-settings": "^2.7.0",
"spatie/laravel-permission": "^6.3.0",
"spatie/laravel-settings": "^3.2.3",
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.6",
"spatie/laravel-ignition": "^1.2.2",
"spatie/laravel-ignition": "^2.4",
"fakerphp/faker": "^1.12",
"laravel/tinker": "^2.2.0",
"laravel/tinker": "^2.2",
"mockery/mockery": "^1.3",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^10.0",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.5"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/Kovah/netscape-bookmark-parser"
}
],
"autoload": {
"files": [
"app/Helper/functions.php"

3830
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -72,6 +72,11 @@ return [
],
'column_names' => [
/*
* Change this if you want to name the related pivots other than defaults
*/
'role_pivot_key' => null, //default 'role_id',
'permission_pivot_key' => null, //default 'permission_id',
/*
* Change this if you want to name the related model primary key other than
@ -82,16 +87,79 @@ return [
*/
'model_morph_key' => 'model_id',
/*
* Change this if you want to use the teams feature and your related model's
* foreign key is other than `team_id`.
*/
'team_foreign_key' => 'team_id',
],
/*
* When set to true, the required permission/role names are added to the exception
* message. This could be considered an information leak in some contexts, so
* the default setting is false here for optimum safety.
* When set to true, the method for checking permissions will be registered on the gate.
* Set this to false if you want to implement custom logic for checking permissions.
*/
'register_permission_check_method' => true,
/*
* When set to true, Laravel\Octane\Events\OperationTerminated event listener will be registered
* this will refresh permissions on every TickTerminated, TaskTerminated and RequestTerminated
* NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it.
*/
'register_octane_reset_listener' => false,
/*
* Teams Feature.
* When set to true the package implements teams using the 'team_foreign_key'.
* If you want the migrations to register the 'team_foreign_key', you must
* set this to true before doing the migration.
* If you already did the migration then you must make a new migration to also
* add 'team_foreign_key' to 'roles', 'model_has_roles', and 'model_has_permissions'
* (view the latest version of this package's migration file)
*/
'teams' => false,
/*
* Passport Client Credentials Grant
* When set to true the package will use Passports Client to check permissions
*/
'use_passport_client_credentials' => false,
/*
* When set to true, the required permission names are added to exception messages.
* This could be considered an information leak in some contexts, so the default
* setting is false here for optimum safety.
*/
'display_permission_in_exception' => false,
/*
* When set to true, the required role names are added to exception messages.
* This could be considered an information leak in some contexts, so the default
* setting is false here for optimum safety.
*/
'display_role_in_exception' => false,
/*
* By default wildcard permission lookups are disabled.
* See documentation to understand supported syntax.
*/
'enable_wildcard_permission' => false,
/*
* The class to use for interpreting wildcard permissions.
* If you need to modify delimiters, override the class and specify its name here.
*/
// 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class,
/* Cache-specific settings */
'cache' => [
/*
@ -102,22 +170,11 @@ return [
'expiration_time' => \DateInterval::createFromDateString('24 hours'),
/*
* The key to use when tagging and prefixing entries in the cache.
* The cache key used to store all permissions.
*/
'key' => 'spatie.permission.cache',
/*
* When checking for a permission against a model by passing a Permission
* instance to the check, this key determines what attribute on the
* Permissions model is used to cache against.
*
* Ideally, this should match your preferred way of checking permissions, eg:
* `$user->can('view-posts')` would be 'name'.
*/
'model_key' => 'name',
/*
* You may optionally indicate a specific cache driver to use for permission and
* role caching using any of the `store` drivers listed in the cache.php config

View File

@ -8,7 +8,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use OwenIt\Auditing\Models\Audit;
class CreateAuditsTable extends Migration
return new class extends Migration
{
public function up(): void
{
@ -124,4 +124,4 @@ class CreateAuditsTable extends Migration
return [$old, $new];
}
}
};

View File

@ -0,0 +1,145 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
// Delete old unused tables from v5
Schema::dropIfExists('model_has_permissions');
Schema::dropIfExists('model_has_roles');
Schema::dropIfExists('role_has_permissions');
Schema::dropIfExists('roles');
Schema::dropIfExists('permissions');
$teams = config('permission.teams');
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');
$pivotRole = $columnNames['role_pivot_key'] ?? 'role_id';
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
if (empty($tableNames)) {
throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
}
if ($teams && empty($columnNames['team_foreign_key'] ?? null)) {
throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
}
Schema::create($tableNames['permissions'], function (Blueprint $table) {
$table->bigIncrements('id'); // permission id
$table->string('name'); // For MySQL 8.0 use string('name', 125);
$table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
$table->timestamps();
$table->unique(['name', 'guard_name']);
});
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
$table->bigIncrements('id'); // role id
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
}
$table->string('name'); // For MySQL 8.0 use string('name', 125);
$table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
$table->timestamps();
if ($teams || config('permission.testing')) {
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
} else {
$table->unique(['name', 'guard_name']);
}
});
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
$table->unsignedBigInteger($pivotPermission);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
} else {
$table->primary([$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
}
});
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
$table->unsignedBigInteger($pivotRole);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
} else {
$table->primary([$pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
}
});
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
$table->unsignedBigInteger($pivotPermission);
$table->unsignedBigInteger($pivotRole);
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
$table->primary([$pivotPermission, $pivotRole], 'role_has_permissions_permission_id_role_id_primary');
});
app('cache')
->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
->forget(config('permission.cache.key'));
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$tableNames = config('permission.table_names');
if (empty($tableNames)) {
throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
}
Schema::drop($tableNames['role_has_permissions']);
Schema::drop($tableNames['model_has_roles']);
Schema::drop($tableNames['model_has_permissions']);
Schema::drop($tableNames['roles']);
Schema::drop($tableNames['permissions']);
}
};

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateActivityLogTable extends Migration
return new class extends Migration
{
public function up()
{
@ -27,4 +27,4 @@ class CreateActivityLogTable extends Migration
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
}
};

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingsTable extends Migration
return new class extends Migration
{
public function up()
{
@ -13,12 +13,14 @@ class CreateSettingsTable extends Migration
Schema::create('settings', function (Blueprint $table): void {
$table->id();
$table->string('group')->index();
$table->string('group');
$table->string('name');
$table->boolean('locked')->default(false);
$table->json('payload');
$table->timestamps();
$table->unique(['group', 'name']);
});
}
@ -27,4 +29,4 @@ class CreateSettingsTable extends Migration
Schema::drop('settings');
Schema::rename('old_settings', 'settings');
}
}
};

View File

@ -15,7 +15,7 @@ use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
class MigrateUserData extends Migration
return new class extends Migration
{
private bool $guestAccessEnabled = false;
@ -157,4 +157,4 @@ class MigrateUserData extends Migration
DB::table('users')->where('email', 'system@localhost')->update(['id' => 0]);
}
}
};

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUserInvitations extends Migration
return new class extends Migration
{
public function up()
{
@ -25,4 +25,4 @@ class AddUserInvitations extends Migration
{
Schema::dropIfExists('user_invitations');
}
}
};