mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-05-04 18:08:46 +03:00
Compare commits
1 Commits
v25.11.2
...
McTom234/o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
743657dbac |
1
.github/translators.txt
vendored
1
.github/translators.txt
vendored
@@ -511,4 +511,3 @@ MrCharlesIII :: Arabic
|
||||
David Olsen (dawin) :: Danish
|
||||
ltnzr :: French
|
||||
Frank Holler (holler.frank) :: German; German Informal
|
||||
Korab Arifi (korabidev) :: Albanian
|
||||
|
||||
2
.github/workflows/test-migrations.yml
vendored
2
.github/workflows/test-migrations.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['8.2', '8.3', '8.4', '8.5']
|
||||
php: ['8.2', '8.3', '8.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
2
.github/workflows/test-php.yml
vendored
2
.github/workflows/test-php.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['8.2', '8.3', '8.4', '8.5']
|
||||
php: ['8.2', '8.3', '8.4']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -8,10 +8,10 @@ Homestead.yaml
|
||||
.idea
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/public/dist/*.map
|
||||
/public/dist
|
||||
/public/plugins
|
||||
/public/css/*.map
|
||||
/public/js/*.map
|
||||
/public/css
|
||||
/public/js
|
||||
/public/bower
|
||||
/public/build/
|
||||
/public/favicon.ico
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace BookStack\Access\Oidc;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use phpseclib3\Crypt\Common\PublicKey;
|
||||
use phpseclib3\Crypt\PublicKeyLoader;
|
||||
use phpseclib3\Crypt\RSA;
|
||||
@@ -63,8 +64,9 @@ class OidcJwtSigningKey
|
||||
// 'alg' is optional for a JWK, but we will still attempt to validate if
|
||||
// it exists otherwise presume it will be compatible.
|
||||
$alg = $jwk['alg'] ?? null;
|
||||
if ($jwk['kty'] !== 'RSA' || !(is_null($alg) || $alg === 'RS256')) {
|
||||
throw new OidcInvalidKeyException("Only RS256 keys are currently supported. Found key using {$alg}");
|
||||
$algorithm = OidcJwtSigningKeyAlgorithm::tryFrom($alg ?? OidcJwtSigningKeyAlgorithm::RS256->value);
|
||||
if ($jwk['kty'] !== 'RSA' || $algorithm === null) {
|
||||
throw new OidcInvalidKeyException("Only " . OidcJwtSigningKeyAlgorithm::getSupportedAlgorithms() . " keys are currently supported. Found key using {$alg}");
|
||||
}
|
||||
|
||||
// 'use' is optional for a JWK but we assume 'sig' where no value exists since that's what
|
||||
@@ -97,7 +99,16 @@ class OidcJwtSigningKey
|
||||
throw new OidcInvalidKeyException('Key loaded from file path is not an RSA key as expected');
|
||||
}
|
||||
|
||||
$this->key = $key->withPadding(RSA::SIGNATURE_PKCS1);
|
||||
// apply key-algorithm depending hash
|
||||
$key = match ($algorithm) {
|
||||
OidcJwtSigningKeyAlgorithm::RS256 => $key->withHash('sha256'),
|
||||
OidcJwtSigningKeyAlgorithm::RS512 => $key->withHash('sha512'),
|
||||
};
|
||||
// apply key-algorithm depending padding
|
||||
$this->key = match ($algorithm) {
|
||||
OidcJwtSigningKeyAlgorithm::RS256,
|
||||
OidcJwtSigningKeyAlgorithm::RS512 => $key->withPadding(RSA::SIGNATURE_PKCS1),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
16
app/Access/Oidc/OidcJwtSigningKeyAlgorithm.php
Normal file
16
app/Access/Oidc/OidcJwtSigningKeyAlgorithm.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Access\Oidc;
|
||||
|
||||
use UnitEnum;
|
||||
|
||||
enum OidcJwtSigningKeyAlgorithm: string
|
||||
{
|
||||
case RS256 = 'RS256';
|
||||
case RS512 = 'RS512';
|
||||
|
||||
public static function getSupportedAlgorithms(): string
|
||||
{
|
||||
return join(',', array_map(static fn (UnitEnum $enum) => $enum->value, self::cases()));
|
||||
}
|
||||
}
|
||||
@@ -119,8 +119,8 @@ class OidcJwtWithClaims implements ProvidesClaims
|
||||
*/
|
||||
protected function validateTokenSignature(): void
|
||||
{
|
||||
if ($this->header['alg'] !== 'RS256') {
|
||||
throw new OidcInvalidTokenException("Only RS256 signature validation is supported. Token reports using {$this->header['alg']}");
|
||||
if (OidcJwtSigningKeyAlgorithm::tryFrom($this->header['alg']) === null) {
|
||||
throw new OidcInvalidTokenException("Only " . OidcJwtSigningKeyAlgorithm::getSupportedAlgorithms() . " signature validation is supported. Token reports using {$this->header['alg']}");
|
||||
}
|
||||
|
||||
$parsedKeys = array_map(function ($key) {
|
||||
|
||||
@@ -158,10 +158,10 @@ class OidcProviderSettings
|
||||
protected function filterKeys(array $keys): array
|
||||
{
|
||||
return array_filter($keys, function (array $key) {
|
||||
$alg = $key['alg'] ?? 'RS256';
|
||||
$alg = $key['alg'] ?? OidcJwtSigningKeyAlgorithm::RS256->value;
|
||||
$use = $key['use'] ?? 'sig';
|
||||
|
||||
return $key['kty'] === 'RSA' && $use === 'sig' && $alg === 'RS256';
|
||||
return $key['kty'] === 'RSA' && $use === 'sig' && OidcJwtSigningKeyAlgorithm::tryFrom($alg) !== null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,8 @@ class Book extends Entity implements HasDescriptionInterface, HasCoverInterface,
|
||||
*/
|
||||
public function chapters(): HasMany
|
||||
{
|
||||
return $this->hasMany(Chapter::class);
|
||||
return $this->hasMany(Chapter::class)
|
||||
->where('type', '=', 'chapter');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,12 +15,11 @@ class EntityScope implements Scope
|
||||
public function apply(Builder $builder, Model $model): void
|
||||
{
|
||||
$builder = $builder->where('type', '=', $model->getMorphClass());
|
||||
$table = $model->getTable();
|
||||
if ($model instanceof Page) {
|
||||
$builder->leftJoin('entity_page_data', 'entity_page_data.page_id', '=', "{$table}.id");
|
||||
$builder->leftJoin('entity_page_data', 'entity_page_data.page_id', '=', 'entities.id');
|
||||
} else {
|
||||
$builder->leftJoin('entity_container_data', function (JoinClause $join) use ($model, $table) {
|
||||
$join->on('entity_container_data.entity_id', '=', "{$table}.id")
|
||||
$builder->leftJoin('entity_container_data', function (JoinClause $join) use ($model) {
|
||||
$join->on('entity_container_data.entity_id', '=', 'entities.id')
|
||||
->where('entity_container_data.entity_type', '=', $model->getMorphClass());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ use BookStack\Exports\ZipExports\Models\ZipExportPage;
|
||||
use BookStack\Permissions\Permission;
|
||||
use BookStack\Uploads\Attachment;
|
||||
use BookStack\Uploads\Image;
|
||||
use BookStack\Uploads\ImageService;
|
||||
|
||||
class ZipExportReferences
|
||||
{
|
||||
@@ -34,7 +33,6 @@ class ZipExportReferences
|
||||
|
||||
public function __construct(
|
||||
protected ZipReferenceParser $parser,
|
||||
protected ImageService $imageService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -135,17 +133,10 @@ class ZipExportReferences
|
||||
return "[[bsexport:image:{$model->id}]]";
|
||||
}
|
||||
|
||||
// Get the page which we'll reference this image upon
|
||||
// Find and include images if in visibility
|
||||
$page = $model->getPage();
|
||||
$pageExportModel = null;
|
||||
if ($page && isset($this->pages[$page->id])) {
|
||||
$pageExportModel = $this->pages[$page->id];
|
||||
} elseif ($exportModel instanceof ZipExportPage) {
|
||||
$pageExportModel = $exportModel;
|
||||
}
|
||||
|
||||
// Add the image to the export if it's accessible or just return the existing reference if already added
|
||||
if (isset($this->images[$model->id]) || ($pageExportModel && $this->imageService->imageAccessible($model))) {
|
||||
$pageExportModel = $this->pages[$page->id] ?? ($exportModel instanceof ZipExportPage ? $exportModel : null);
|
||||
if (isset($this->images[$model->id]) || ($page && $pageExportModel && userCan(Permission::PageView, $page))) {
|
||||
if (!isset($this->images[$model->id])) {
|
||||
$exportImage = ZipExportImage::fromModel($model, $files);
|
||||
$this->images[$model->id] = $exportImage;
|
||||
@@ -153,7 +144,6 @@ class ZipExportReferences
|
||||
}
|
||||
return "[[bsexport:image:{$model->id}]]";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class SearchIndex
|
||||
$termMap = $this->textToTermCountMap($text);
|
||||
|
||||
foreach ($termMap as $term => $count) {
|
||||
$termMap[$term] = intval($count * $scoreAdjustment);
|
||||
$termMap[$term] = floor($count * $scoreAdjustment);
|
||||
}
|
||||
|
||||
return $termMap;
|
||||
|
||||
@@ -13,14 +13,14 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $url
|
||||
* @property string $path
|
||||
* @property string $type
|
||||
* @property int|null $uploaded_to
|
||||
* @property int $created_by
|
||||
* @property int $updated_by
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $url
|
||||
* @property string $path
|
||||
* @property string $type
|
||||
* @property int $uploaded_to
|
||||
* @property int $created_by
|
||||
* @property int $updated_by
|
||||
*/
|
||||
class Image extends Model implements OwnableInterface
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ class ImageService
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy an image along with its revisions, thumbnails, and remaining folders.
|
||||
* Destroy an image along with its revisions, thumbnails and remaining folders.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -252,7 +252,16 @@ class ImageService
|
||||
{
|
||||
$disk = $this->storage->getDisk('gallery');
|
||||
|
||||
return $disk->usingSecureImages() && $this->pathAccessible($imagePath);
|
||||
if ($this->storage->usingSecureRestrictedImages() && !$this->checkUserHasAccessToRelationOfImageAtPath($imagePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check local_secure is active
|
||||
return $disk->usingSecureImages()
|
||||
// Check the image file exists
|
||||
&& $disk->exists($imagePath)
|
||||
// Check the file is likely an image file
|
||||
&& str_starts_with($disk->mimeType($imagePath), 'image/');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,40 +269,16 @@ class ImageService
|
||||
*/
|
||||
public function pathAccessible(string $imagePath): bool
|
||||
{
|
||||
$disk = $this->storage->getDisk('gallery');
|
||||
|
||||
if ($this->storage->usingSecureRestrictedImages() && !$this->checkUserHasAccessToRelationOfImageAtPath($imagePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->storage->usingSecureImages() && user()->isGuest()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->imageFileExists($imagePath, 'gallery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given image should be accessible to the current user.
|
||||
*/
|
||||
public function imageAccessible(Image $image): bool
|
||||
{
|
||||
if ($this->storage->usingSecureRestrictedImages() && !$this->checkUserHasAccessToRelationOfImage($image)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->storage->usingSecureImages() && user()->isGuest()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->imageFileExists($image->path, $image->type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given image path exists for the given image type and that it is likely an image file.
|
||||
*/
|
||||
protected function imageFileExists(string $imagePath, string $imageType): bool
|
||||
{
|
||||
$disk = $this->storage->getDisk($imageType);
|
||||
return $disk->exists($imagePath) && str_starts_with($disk->mimeType($imagePath), 'image/');
|
||||
// Check local_secure is active
|
||||
return $disk->exists($imagePath)
|
||||
// Check the file is likely an image file
|
||||
&& str_starts_with($disk->mimeType($imagePath), 'image/');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,11 +307,6 @@ class ImageService
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->checkUserHasAccessToRelationOfImage($image);
|
||||
}
|
||||
|
||||
protected function checkUserHasAccessToRelationOfImage(Image $image): bool
|
||||
{
|
||||
$imageType = $image->type;
|
||||
|
||||
// Allow user or system (logo) images
|
||||
|
||||
@@ -34,15 +34,6 @@ class ImageStorage
|
||||
return config('filesystems.images') === 'local_secure_restricted';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if "local secure" (Fetched behind auth, either with or without permissions enforced)
|
||||
* is currently active in the instance.
|
||||
*/
|
||||
public function usingSecureImages(): bool
|
||||
{
|
||||
return config('filesystems.images') === 'local_secure' || $this->usingSecureRestrictedImages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up an image file name to be both URL and storage safe.
|
||||
*/
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
"@php artisan view:clear"
|
||||
],
|
||||
"refresh-test-database": [
|
||||
"@putenv APP_TIMEZONE=UTC",
|
||||
"@php artisan migrate:refresh --database=mysql_testing",
|
||||
"@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"
|
||||
]
|
||||
|
||||
161
composer.lock
generated
161
composer.lock
generated
@@ -62,16 +62,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.360.0",
|
||||
"version": "3.359.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "a21055795be59f3d7c5ca6e4d52a80930dcf8c20"
|
||||
"reference": "a5be7ed5efd25d70a74275daeff896b896d9c286"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a21055795be59f3d7c5ca6e4d52a80930dcf8c20",
|
||||
"reference": "a21055795be59f3d7c5ca6e4d52a80930dcf8c20",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a5be7ed5efd25d70a74275daeff896b896d9c286",
|
||||
"reference": "a5be7ed5efd25d70a74275daeff896b896d9c286",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -153,22 +153,22 @@
|
||||
"support": {
|
||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.360.0"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.359.8"
|
||||
},
|
||||
"time": "2025-11-17T19:46:19+00:00"
|
||||
"time": "2025-11-07T19:48:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
"version": "v3.0.2",
|
||||
"version": "v3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Bacon/BaconQrCode.git",
|
||||
"reference": "fe259c55425b8178f77fb6d1f84ba2473e21ed55"
|
||||
"reference": "f9cc1f52b5a463062251d666761178dbdb6b544f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/fe259c55425b8178f77fb6d1f84ba2473e21ed55",
|
||||
"reference": "fe259c55425b8178f77fb6d1f84ba2473e21ed55",
|
||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f9cc1f52b5a463062251d666761178dbdb6b544f",
|
||||
"reference": "f9cc1f52b5a463062251d666761178dbdb6b544f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -178,9 +178,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phly/keep-a-changelog": "^2.12",
|
||||
"phpunit/phpunit": "^10.5.11 || ^11.0.4",
|
||||
"phpunit/phpunit": "^10.5.11 || 11.0.4",
|
||||
"spatie/phpunit-snapshot-assertions": "^5.1.5",
|
||||
"spatie/pixelmatch-php": "^1.2.0",
|
||||
"squizlabs/php_codesniffer": "^3.9"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -208,9 +207,9 @@
|
||||
"homepage": "https://github.com/Bacon/BaconQrCode",
|
||||
"support": {
|
||||
"issues": "https://github.com/Bacon/BaconQrCode/issues",
|
||||
"source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.2"
|
||||
"source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.1"
|
||||
},
|
||||
"time": "2025-11-16T22:59:48+00:00"
|
||||
"time": "2024-10-01T13:55:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "brick/math",
|
||||
@@ -1739,16 +1738,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.39.0",
|
||||
"version": "v12.37.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "1a6176129ef28eaf42b6b4a6250025120c3d8dac"
|
||||
"reference": "3c3c4ad30f5b528b164a7c09aa4ad03118c4c125"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/1a6176129ef28eaf42b6b4a6250025120c3d8dac",
|
||||
"reference": "1a6176129ef28eaf42b6b4a6250025120c3d8dac",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/3c3c4ad30f5b528b164a7c09aa4ad03118c4c125",
|
||||
"reference": "3c3c4ad30f5b528b164a7c09aa4ad03118c4c125",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1866,7 +1865,7 @@
|
||||
"phpstan/phpstan": "^2.0",
|
||||
"phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1",
|
||||
"predis/predis": "^2.3|^3.0",
|
||||
"resend/resend-php": "^0.10.0|^1.0",
|
||||
"resend/resend-php": "^0.10.0",
|
||||
"symfony/cache": "^7.2.0",
|
||||
"symfony/http-client": "^7.2.0",
|
||||
"symfony/psr-http-message-bridge": "^7.2.0",
|
||||
@@ -1900,7 +1899,7 @@
|
||||
"predis/predis": "Required to use the predis connector (^2.3|^3.0).",
|
||||
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
|
||||
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
|
||||
"resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0|^1.0).",
|
||||
"resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).",
|
||||
"symfony/cache": "Required to PSR-6 cache bridge (^7.2).",
|
||||
"symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).",
|
||||
"symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).",
|
||||
@@ -1954,7 +1953,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-11-18T15:16:10+00:00"
|
||||
"time": "2025-11-04T15:39:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
@@ -2405,16 +2404,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
"version": "3.30.2",
|
||||
"version": "3.30.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem.git",
|
||||
"reference": "5966a8ba23e62bdb518dd9e0e665c2dbd4b5b277"
|
||||
"reference": "c139fd65c1f796b926f4aec0df37f6caa959a8da"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/5966a8ba23e62bdb518dd9e0e665c2dbd4b5b277",
|
||||
"reference": "5966a8ba23e62bdb518dd9e0e665c2dbd4b5b277",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c139fd65c1f796b926f4aec0df37f6caa959a8da",
|
||||
"reference": "c139fd65c1f796b926f4aec0df37f6caa959a8da",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2482,9 +2481,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/thephpleague/flysystem/issues",
|
||||
"source": "https://github.com/thephpleague/flysystem/tree/3.30.2"
|
||||
"source": "https://github.com/thephpleague/flysystem/tree/3.30.1"
|
||||
},
|
||||
"time": "2025-11-10T17:13:11+00:00"
|
||||
"time": "2025-10-20T15:35:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem-aws-s3-v3",
|
||||
@@ -2543,16 +2542,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem-local",
|
||||
"version": "3.30.2",
|
||||
"version": "3.30.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem-local.git",
|
||||
"reference": "ab4f9d0d672f601b102936aa728801dd1a11968d"
|
||||
"reference": "6691915f77c7fb69adfb87dcd550052dc184ee10"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/ab4f9d0d672f601b102936aa728801dd1a11968d",
|
||||
"reference": "ab4f9d0d672f601b102936aa728801dd1a11968d",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/6691915f77c7fb69adfb87dcd550052dc184ee10",
|
||||
"reference": "6691915f77c7fb69adfb87dcd550052dc184ee10",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2586,9 +2585,9 @@
|
||||
"local"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/thephpleague/flysystem-local/tree/3.30.2"
|
||||
"source": "https://github.com/thephpleague/flysystem-local/tree/3.30.0"
|
||||
},
|
||||
"time": "2025-11-10T11:23:37+00:00"
|
||||
"time": "2025-05-21T10:34:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/html-to-markdown",
|
||||
@@ -2878,38 +2877,33 @@
|
||||
},
|
||||
{
|
||||
"name": "league/uri",
|
||||
"version": "7.6.0",
|
||||
"version": "7.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/uri.git",
|
||||
"reference": "f625804987a0a9112d954f9209d91fec52182344"
|
||||
"reference": "81fb5145d2644324614cc532b28efd0215bda430"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri/zipball/f625804987a0a9112d954f9209d91fec52182344",
|
||||
"reference": "f625804987a0a9112d954f9209d91fec52182344",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri/zipball/81fb5145d2644324614cc532b28efd0215bda430",
|
||||
"reference": "81fb5145d2644324614cc532b28efd0215bda430",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/uri-interfaces": "^7.6",
|
||||
"php": "^8.1",
|
||||
"psr/http-factory": "^1"
|
||||
"league/uri-interfaces": "^7.5",
|
||||
"php": "^8.1"
|
||||
},
|
||||
"conflict": {
|
||||
"league/uri-schemes": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "to improve IPV4 host parsing",
|
||||
"ext-dom": "to convert the URI into an HTML anchor tag",
|
||||
"ext-fileinfo": "to create Data URI from file contennts",
|
||||
"ext-gmp": "to improve IPV4 host parsing",
|
||||
"ext-intl": "to handle IDN host with the best performance",
|
||||
"ext-uri": "to use the PHP native URI class",
|
||||
"jeremykendall/php-domain-parser": "to resolve Public Suffix and Top Level Domain",
|
||||
"league/uri-components": "Needed to easily manipulate URI objects components",
|
||||
"league/uri-polyfill": "Needed to backport the PHP URI extension for older versions of PHP",
|
||||
"php-64bit": "to improve IPV4 host parsing",
|
||||
"rowbot/url": "to handle WHATWG URL",
|
||||
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -2937,7 +2931,6 @@
|
||||
"description": "URI manipulation library",
|
||||
"homepage": "https://uri.thephpleague.com",
|
||||
"keywords": [
|
||||
"URN",
|
||||
"data-uri",
|
||||
"file-uri",
|
||||
"ftp",
|
||||
@@ -2950,11 +2943,9 @@
|
||||
"psr-7",
|
||||
"query-string",
|
||||
"querystring",
|
||||
"rfc2141",
|
||||
"rfc3986",
|
||||
"rfc3987",
|
||||
"rfc6570",
|
||||
"rfc8141",
|
||||
"uri",
|
||||
"uri-template",
|
||||
"url",
|
||||
@@ -2964,7 +2955,7 @@
|
||||
"docs": "https://uri.thephpleague.com",
|
||||
"forum": "https://thephpleague.slack.com",
|
||||
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||
"source": "https://github.com/thephpleague/uri/tree/7.6.0"
|
||||
"source": "https://github.com/thephpleague/uri/tree/7.5.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2972,25 +2963,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-18T12:17:23+00:00"
|
||||
"time": "2024-12-08T08:40:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/uri-interfaces",
|
||||
"version": "7.6.0",
|
||||
"version": "7.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/uri-interfaces.git",
|
||||
"reference": "ccbfb51c0445298e7e0b7f4481b942f589665368"
|
||||
"reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/ccbfb51c0445298e7e0b7f4481b942f589665368",
|
||||
"reference": "ccbfb51c0445298e7e0b7f4481b942f589665368",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/08cfc6c4f3d811584fb09c37e2849e6a7f9b0742",
|
||||
"reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-filter": "*",
|
||||
"php": "^8.1",
|
||||
"psr/http-factory": "^1",
|
||||
"psr/http-message": "^1.1 || ^2.0"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -2998,7 +2990,6 @@
|
||||
"ext-gmp": "to improve IPV4 host parsing",
|
||||
"ext-intl": "to handle IDN host with the best performance",
|
||||
"php-64bit": "to improve IPV4 host parsing",
|
||||
"rowbot/url": "to handle WHATWG URL",
|
||||
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -3023,7 +3014,7 @@
|
||||
"homepage": "https://nyamsprod.com"
|
||||
}
|
||||
],
|
||||
"description": "Common tools for parsing and resolving RFC3987/RFC3986 URI",
|
||||
"description": "Common interfaces and classes for URI representation and interaction",
|
||||
"homepage": "https://uri.thephpleague.com",
|
||||
"keywords": [
|
||||
"data-uri",
|
||||
@@ -3048,7 +3039,7 @@
|
||||
"docs": "https://uri.thephpleague.com",
|
||||
"forum": "https://thephpleague.slack.com",
|
||||
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.6.0"
|
||||
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3056,7 +3047,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-18T12:17:23+00:00"
|
||||
"time": "2024-12-08T08:18:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "masterminds/html5",
|
||||
@@ -5965,16 +5956,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v7.3.7",
|
||||
"version": "v7.3.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "db488a62f98f7a81d5746f05eea63a74e55bb7c4"
|
||||
"reference": "6379e490d6ecfc5c4224ff3a754b90495ecd135c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/db488a62f98f7a81d5746f05eea63a74e55bb7c4",
|
||||
"reference": "db488a62f98f7a81d5746f05eea63a74e55bb7c4",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/6379e490d6ecfc5c4224ff3a754b90495ecd135c",
|
||||
"reference": "6379e490d6ecfc5c4224ff3a754b90495ecd135c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -6024,7 +6015,7 @@
|
||||
"description": "Defines an object-oriented layer for the HTTP specification",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/http-foundation/tree/v7.3.7"
|
||||
"source": "https://github.com/symfony/http-foundation/tree/v7.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6044,20 +6035,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-08T16:41:12+00:00"
|
||||
"time": "2025-11-06T11:05:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v7.3.7",
|
||||
"version": "v7.3.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-kernel.git",
|
||||
"reference": "10b8e9b748ea95fa4539c208e2487c435d3c87ce"
|
||||
"reference": "f9a34dc0196677250e3609c2fac9de9e1551a262"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/10b8e9b748ea95fa4539c208e2487c435d3c87ce",
|
||||
"reference": "10b8e9b748ea95fa4539c208e2487c435d3c87ce",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/f9a34dc0196677250e3609c2fac9de9e1551a262",
|
||||
"reference": "f9a34dc0196677250e3609c2fac9de9e1551a262",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -6142,7 +6133,7 @@
|
||||
"description": "Provides a structured process for converting a Request into a Response",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/http-kernel/tree/v7.3.7"
|
||||
"source": "https://github.com/symfony/http-kernel/tree/v7.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6162,7 +6153,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-12T11:38:40+00:00"
|
||||
"time": "2025-11-06T20:58:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/mailer",
|
||||
@@ -8804,11 +8795,11 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.1.32",
|
||||
"version": "2.1.31",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e126cad1e30a99b137b8ed75a85a676450ebb227",
|
||||
"reference": "e126cad1e30a99b137b8ed75a85a676450ebb227",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ead89849d879fe203ce9292c6ef5e7e76f867b96",
|
||||
"reference": "ead89849d879fe203ce9292c6ef5e7e76f867b96",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -8853,7 +8844,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-11T15:18:17+00:00"
|
||||
"time": "2025-10-10T14:14:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -9192,16 +9183,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "11.5.44",
|
||||
"version": "11.5.43",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "c346885c95423eda3f65d85a194aaa24873cda82"
|
||||
"reference": "c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c346885c95423eda3f65d85a194aaa24873cda82",
|
||||
"reference": "c346885c95423eda3f65d85a194aaa24873cda82",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924",
|
||||
"reference": "c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -9273,7 +9264,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.44"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.43"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -9297,7 +9288,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-13T07:17:35+00:00"
|
||||
"time": "2025-10-30T08:39:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
@@ -10533,16 +10524,16 @@
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
"version": "1.3.1",
|
||||
"version": "1.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/theseer/tokenizer.git",
|
||||
"reference": "b7489ce515e168639d17feec34b8847c326b0b3c"
|
||||
"reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c",
|
||||
"reference": "b7489ce515e168639d17feec34b8847c326b0b3c",
|
||||
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
|
||||
"reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -10571,7 +10562,7 @@
|
||||
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
|
||||
"support": {
|
||||
"issues": "https://github.com/theseer/tokenizer/issues",
|
||||
"source": "https://github.com/theseer/tokenizer/tree/1.3.1"
|
||||
"source": "https://github.com/theseer/tokenizer/tree/1.2.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -10579,7 +10570,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-17T20:03:58+00:00"
|
||||
"time": "2024-03-03T12:36:25+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@@ -13,6 +13,7 @@ use BookStack\Search\SearchIndex;
|
||||
use BookStack\Users\Models\Role;
|
||||
use BookStack\Users\Models\User;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -22,8 +23,10 @@ class DummyContentSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(): void
|
||||
public function run()
|
||||
{
|
||||
// Create an editor user
|
||||
$editorUser = User::factory()->create();
|
||||
|
||||
@@ -1 +1 @@
|
||||
a75aa1a640d312e5e6a52f63b121daf5bca1e4ad11aaf9a162c8f91e8e2e00ed
|
||||
22e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
# Install additional dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
wget \
|
||||
zip \
|
||||
unzip \
|
||||
php \
|
||||
php-bcmath php-curl php-mbstring php-gd php-xml php-zip php-mysql php-ldap \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Take branch as an argument so we can choose which BookStack
|
||||
# branch to test against
|
||||
ARG BRANCH=development
|
||||
|
||||
# Download BookStack & install PHP deps
|
||||
RUN mkdir -p /var/www && \
|
||||
git clone https://github.com/bookstackapp/bookstack.git --branch "$BRANCH" --single-branch /var/www/bookstack && \
|
||||
cd /var/www/bookstack && \
|
||||
wget https://raw.githubusercontent.com/composer/getcomposer.org/f3108f64b4e1c1ce6eb462b159956461592b3e3e/web/installer -O - -q | php -- --quiet --filename=composer && \
|
||||
php composer install
|
||||
|
||||
# Set the BookStack dir as the default working dir
|
||||
WORKDIR /var/www/bookstack
|
||||
|
||||
# Set the default action as running php
|
||||
ENTRYPOINT ["/bin/php"]
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
BRANCH=${1:-development}
|
||||
|
||||
# Build the container with a known name
|
||||
docker build --build-arg BRANCH="$BRANCH" -t bookstack:db-testing .
|
||||
if [ $? -eq 1 ]; then
|
||||
echo "Failed to build app container for testing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# List of database containers to test against
|
||||
containers=(
|
||||
"mysql:5.7"
|
||||
"mysql:8.0"
|
||||
"mysql:8.4"
|
||||
"mysql:9.5"
|
||||
"mariadb:10.2"
|
||||
"mariadb:10.6"
|
||||
"mariadb:10.11"
|
||||
"mariadb:11.4"
|
||||
"mariadb:11.8"
|
||||
"mariadb:12.0"
|
||||
)
|
||||
|
||||
# Pre-clean-up from prior runs
|
||||
docker stop bs-dbtest-db
|
||||
docker network rm bs-dbtest-net
|
||||
|
||||
# Cycle over each database image
|
||||
for img in "${containers[@]}"; do
|
||||
echo "Starting tests with $img..."
|
||||
docker network create bs-dbtest-net
|
||||
docker run -d --rm --name "bs-dbtest-db" \
|
||||
-e MYSQL_DATABASE=bookstack-test \
|
||||
-e MYSQL_USER=bookstack \
|
||||
-e MYSQL_PASSWORD=bookstack \
|
||||
-e MYSQL_ROOT_PASSWORD=password \
|
||||
--network=bs-dbtest-net \
|
||||
"$img"
|
||||
sleep 20
|
||||
APP_RUN='docker run -it --rm --network=bs-dbtest-net -e TEST_DATABASE_URL="mysql://bookstack:bookstack@bs-dbtest-db:3306" bookstack:db-testing'
|
||||
$APP_RUN artisan migrate --force --database=mysql_testing
|
||||
$APP_RUN artisan db:seed --force --class=DummyContentSeeder --database=mysql_testing
|
||||
$APP_RUN vendor/bin/phpunit
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "$img - Success"
|
||||
else
|
||||
echo "$img - Error"
|
||||
read -p "Stop script? [y/N] " ans
|
||||
[[ $ans == [yY] ]] && exit 0
|
||||
fi
|
||||
|
||||
docker stop "bs-dbtest-db"
|
||||
docker network rm bs-dbtest-net
|
||||
done
|
||||
|
||||
@@ -7,7 +7,7 @@ When it's time for a release the `development` branch is merged into release wit
|
||||
|
||||
## Building CSS & JavaScript Assets
|
||||
|
||||
This project uses SASS for CSS development which is built, along with the JavaScript, using a range of npm scripts. The below npm commands can be used to install the dependencies & run the build tasks:
|
||||
This project uses SASS for CSS development and this is built, along with the JavaScript, using a range of npm scripts. The below npm commands can be used to install the dependencies & run the build tasks:
|
||||
|
||||
``` bash
|
||||
# Install NPM Dependencies
|
||||
@@ -113,4 +113,4 @@ docker-compose run app php vendor/bin/phpunit
|
||||
### Debugging
|
||||
|
||||
The docker-compose setup ships with Xdebug, which you can listen to on port 9090.
|
||||
NB: For some editors like Visual Studio Code, you might need to map your workspace folder to the /app folder within the docker container for this to work.
|
||||
NB : For some editors like Visual Studio Code, you might need to map your workspace folder to the /app folder within the docker container for this to work.
|
||||
|
||||
@@ -4,7 +4,7 @@ BookStack has many test cases defined within the `tests/` directory of the app.
|
||||
|
||||
## Setup
|
||||
|
||||
The application tests are mostly functional, rather than unit tests, meaning they simulate user actions and system components, and therefore these require use of the database. To avoid potential conflicts within your development environment, the tests use a separate database. This is defined via a specific `mysql_testing` database connection in our configuration, and expects to use the following database access details:
|
||||
The application tests are mostly functional, rather than unit tests, meaning they simulate user actions and system components and therefore these require use of the database. To avoid potential conflicts within your development environment, the tests use a separate database. This is defined via a specific `mysql_testing` database connection in our configuration, and expects to use the following database access details:
|
||||
|
||||
- Host: `127.0.0.1`
|
||||
- Username: `bookstack-test`
|
||||
|
||||
@@ -13,7 +13,7 @@ Link: http://aws.amazon.com/sdkforphp
|
||||
bacon/bacon-qr-code
|
||||
License: BSD-2-Clause
|
||||
License File: vendor/bacon/bacon-qr-code/LICENSE
|
||||
Copyright: Copyright (c) 2017-present, Ben Scholzen 'DASPRiD'
|
||||
Copyright: Copyright (c) 2017, Ben Scholzen 'DASPRiD'
|
||||
All rights reserved.
|
||||
Source: https://github.com/Bacon/BaconQrCode.git
|
||||
Link: https://github.com/Bacon/BaconQrCode
|
||||
|
||||
@@ -89,8 +89,8 @@ return [
|
||||
'homepage' => 'Homepage',
|
||||
'header_menu_expand' => 'Expand Header Menu',
|
||||
'profile_menu' => 'Profile Menu',
|
||||
'view_profile' => 'Shiko profilin',
|
||||
'edit_profile' => 'Ndrysho profilin',
|
||||
'view_profile' => 'View Profile',
|
||||
'edit_profile' => 'Edit Profile',
|
||||
'dark_mode' => 'Dark Mode',
|
||||
'light_mode' => 'Light Mode',
|
||||
'global_search' => 'Global Search',
|
||||
|
||||
33
public/dist/app.js
vendored
33
public/dist/app.js
vendored
File diff suppressed because one or more lines are too long
32
public/dist/code.js
vendored
32
public/dist/code.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/export-styles.css
vendored
1
public/dist/export-styles.css
vendored
File diff suppressed because one or more lines are too long
3
public/dist/legacy-modes.js
vendored
3
public/dist/legacy-modes.js
vendored
File diff suppressed because one or more lines are too long
28
public/dist/markdown.js
vendored
28
public/dist/markdown.js
vendored
File diff suppressed because one or more lines are too long
1
public/dist/styles.css
vendored
1
public/dist/styles.css
vendored
File diff suppressed because one or more lines are too long
32
public/dist/wysiwyg.js
vendored
32
public/dist/wysiwyg.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Activity;
|
||||
namespace Activity;
|
||||
|
||||
use BookStack\Activity\Models\Comment;
|
||||
use BookStack\Permissions\Permission;
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Models\Book;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EntityQueryTest extends TestCase
|
||||
{
|
||||
public function test_basic_entity_query_has_join_and_type_applied()
|
||||
{
|
||||
$query = Book::query();
|
||||
$expected = 'select * from `entities` left join `entity_container_data` on `entity_container_data`.`entity_id` = `entities`.`id` and `entity_container_data`.`entity_type` = ? where `type` = ? and `entities`.`deleted_at` is null';
|
||||
$this->assertEquals($expected, $query->toSql());
|
||||
$this->assertEquals(['book', 'book'], $query->getBindings());
|
||||
}
|
||||
|
||||
public function test_joins_in_sub_queries_use_alias_names()
|
||||
{
|
||||
$query = Book::query()->whereHas('chapters', function (Builder $query) {
|
||||
$query->where('name', '=', 'a');
|
||||
});
|
||||
|
||||
// Probably from type limits on relation where not needed?
|
||||
$expected = 'select * from `entities` left join `entity_container_data` on `entity_container_data`.`entity_id` = `entities`.`id` and `entity_container_data`.`entity_type` = ? where exists (select * from `entities` as `laravel_reserved_%d` left join `entity_container_data` on `entity_container_data`.`entity_id` = `laravel_reserved_%d`.`id` and `entity_container_data`.`entity_type` = ? where `entities`.`id` = `laravel_reserved_%d`.`book_id` and `name` = ? and `type` = ? and `laravel_reserved_%d`.`deleted_at` is null) and `type` = ? and `entities`.`deleted_at` is null';
|
||||
$this->assertStringMatchesFormat($expected, $query->toSql());
|
||||
$this->assertEquals(['book', 'chapter', 'a', 'chapter', 'book'], $query->getBindings());
|
||||
}
|
||||
|
||||
public function test_book_chapter_relation_applies_type_condition()
|
||||
{
|
||||
$book = $this->entities->book();
|
||||
$query = $book->chapters();
|
||||
$expected = 'select * from `entities` left join `entity_container_data` on `entity_container_data`.`entity_id` = `entities`.`id` and `entity_container_data`.`entity_type` = ? where `entities`.`book_id` = ? and `entities`.`book_id` is not null and `type` = ? and `entities`.`deleted_at` is null';
|
||||
$this->assertEquals($expected, $query->toSql());
|
||||
$this->assertEquals(['chapter', $book->id, 'chapter'], $query->getBindings());
|
||||
|
||||
$query = Book::query()->whereHas('chapters');
|
||||
$expected = 'select * from `entities` left join `entity_container_data` on `entity_container_data`.`entity_id` = `entities`.`id` and `entity_container_data`.`entity_type` = ? where exists (select * from `entities` as `laravel_reserved_%d` left join `entity_container_data` on `entity_container_data`.`entity_id` = `laravel_reserved_%d`.`id` and `entity_container_data`.`entity_type` = ? where `entities`.`id` = `laravel_reserved_%d`.`book_id` and `type` = ? and `laravel_reserved_%d`.`deleted_at` is null) and `type` = ? and `entities`.`deleted_at` is null';
|
||||
$this->assertStringMatchesFormat($expected, $query->toSql());
|
||||
$this->assertEquals(['book', 'chapter', 'chapter', 'book'], $query->getBindings());
|
||||
}
|
||||
}
|
||||
@@ -374,54 +374,6 @@ class ZipExportTest extends TestCase
|
||||
$this->assertStringContainsString("<a href=\"{$ref}\">Original URL</a><a href=\"{$ref}\">Storage URL</a>", $pageData['html']);
|
||||
}
|
||||
|
||||
public function test_orphaned_images_can_be_used_on_default_local_storage()
|
||||
{
|
||||
$this->asEditor();
|
||||
$page = $this->entities->page();
|
||||
$result = $this->files->uploadGalleryImageToPage($this, $page);
|
||||
$displayThumb = $result['response']->thumbs->gallery ?? '';
|
||||
$page->html = '<p><img src="' . $displayThumb . '" alt="My image"></p>';
|
||||
$page->save();
|
||||
|
||||
$image = Image::findOrFail($result['response']->id);
|
||||
$image->uploaded_to = null;
|
||||
$image->save();
|
||||
|
||||
$zipResp = $this->asEditor()->get($page->getUrl("/export/zip"));
|
||||
$zipResp->assertOk();
|
||||
$zip = ZipTestHelper::extractFromZipResponse($zipResp);
|
||||
$pageData = $zip->data['page'];
|
||||
|
||||
$this->assertCount(1, $pageData['images']);
|
||||
$imageData = $pageData['images'][0];
|
||||
$this->assertEquals($image->id, $imageData['id']);
|
||||
|
||||
$this->assertEquals('<p><img src="[[bsexport:image:' . $imageData['id'] . ']]" alt="My image"></p>', $pageData['html']);
|
||||
}
|
||||
|
||||
public function test_orphaned_images_cannot_be_used_on_local_secure_restricted()
|
||||
{
|
||||
config()->set('filesystems.images', 'local_secure_restricted');
|
||||
|
||||
$this->asEditor();
|
||||
$page = $this->entities->page();
|
||||
$result = $this->files->uploadGalleryImageToPage($this, $page);
|
||||
$displayThumb = $result['response']->thumbs->gallery ?? '';
|
||||
$page->html = '<p><img src="' . $displayThumb . '" alt="My image"></p>';
|
||||
$page->save();
|
||||
|
||||
$image = Image::findOrFail($result['response']->id);
|
||||
$image->uploaded_to = null;
|
||||
$image->save();
|
||||
|
||||
$zipResp = $this->asEditor()->get($page->getUrl("/export/zip"));
|
||||
$zipResp->assertOk();
|
||||
$zip = ZipTestHelper::extractFromZipResponse($zipResp);
|
||||
$pageData = $zip->data['page'];
|
||||
|
||||
$this->assertCount(0, $pageData['images']);
|
||||
}
|
||||
|
||||
public function test_cross_reference_links_external_to_export_are_not_converted()
|
||||
{
|
||||
$page = $this->entities->page();
|
||||
|
||||
@@ -73,10 +73,6 @@ class ImageTest extends TestCase
|
||||
|
||||
public function test_image_display_thumbnail_generation_for_animated_avif_images_uses_original_file()
|
||||
{
|
||||
if (! function_exists('imageavif')) {
|
||||
$this->markTestSkipped('imageavif() is not available');
|
||||
}
|
||||
|
||||
$page = $this->entities->page();
|
||||
$admin = $this->users->admin();
|
||||
$this->actingAs($admin);
|
||||
|
||||
Reference in New Issue
Block a user