Skip to content

Commit 8e0edb6

Browse files
committed
Merge branch 'development' into vectors
2 parents bb08f62 + 20db372 commit 8e0edb6

File tree

780 files changed

+13570
-5251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

780 files changed

+13570
-5251
lines changed

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ DB_DATABASE=database_database
2626
DB_USERNAME=database_username
2727
DB_PASSWORD=database_user_password
2828

29+
# Storage system to use
30+
# By default files are stored on the local filesystem, with images being placed in
31+
# public web space so they can be efficiently served directly by the web-server.
32+
# For other options with different security levels & considerations, refer to:
33+
# https://www.bookstackapp.com/docs/admin/upload-config/
34+
STORAGE_TYPE=local
35+
2936
# Mail system to use
3037
# Can be 'smtp' or 'sendmail'
3138
MAIL_DRIVER=smtp

.env.example.complete

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ APP_LANG=en
3636
# APP_LANG will be used if such a header is not provided.
3737
APP_AUTO_LANG_PUBLIC=true
3838

39-
# Application timezone
40-
# Used where dates are displayed such as on exported content.
39+
# Application timezones
40+
# The first option is used to determine what timezone is used for date storage.
41+
# Leaving that as "UTC" is advised.
42+
# The second option is used to set the timezone which will be used for date
43+
# formatting and display. This defaults to the "APP_TIMEZONE" value.
4144
# Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
4245
APP_TIMEZONE=UTC
46+
APP_DISPLAY_TIMEZONE=UTC
4347

4448
# Application theme
4549
# Used to specific a themes/<APP_THEME> folder where BookStack UI

.github/translators.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Alexander Predl (Harveyhase68) :: German
177177
Rem (Rem9000) :: Dutch
178178
Michał Stelmach (stelmach-web) :: Polish
179179
arniom :: French
180-
REMOVED_USER :: French; Dutch; Portuguese, Brazilian; Portuguese; Turkish;
180+
REMOVED_USER :: French; German; Dutch; Portuguese, Brazilian; Portuguese; Turkish;
181181
林祖年 (contagion) :: Chinese Traditional
182182
Siamak Guodarzi (siamakgoudarzi88) :: Persian
183183
Lis Maestrelo (lismtrl) :: Portuguese, Brazilian
@@ -222,7 +222,7 @@ SmokingCrop :: Dutch
222222
Maciej Lebiest (Szwendacz) :: Polish
223223
DiscordDigital :: German; German Informal
224224
Gábor Marton (dodver) :: Hungarian
225-
Jasell :: Swedish
225+
Jakob Åsell (Jasell) :: Swedish
226226
Ghost_chu (ghostchu) :: Chinese Simplified
227227
Ravid Shachar (ravidshachar) :: Hebrew
228228
Helga Guchshenskaya (guchshenskaya) :: Russian
@@ -503,3 +503,21 @@ Firr (FirrV) :: Russian
503503
João Faro (FaroJoaoFaro) :: Portuguese
504504
Danilo dos Santos Barbosa (bozochegou) :: Portuguese, Brazilian
505505
Chris (furesoft) :: German
506+
Silvia Isern (eiendragon) :: Catalan
507+
Dennis Kron Pedersen (ahjdp) :: Danish
508+
iamwhoiamwhoami :: Swedish
509+
Grogui :: French
510+
MrCharlesIII :: Arabic
511+
David Olsen (dawin) :: Danish
512+
ltnzr :: French
513+
Frank Holler (holler.frank) :: German; German Informal
514+
Korab Arifi (korabidev) :: Albanian
515+
Petr Husák (petrhusak) :: Czech
516+
Bernardo Maia (bernardo.bmaia2) :: Portuguese, Brazilian
517+
Amr (amr3k) :: Arabic
518+
Tahsin Ahmed (tahsinahmed2012) :: Bengali
519+
bojan_che :: Serbian (Cyrillic)
520+
setiawan setiawan (culture.setiawan) :: Indonesian
521+
Donald Mac Kenzie (kiuman) :: Norwegian Bokmal
522+
Gabriel Silver (GabrielBSilver) :: Hebrew
523+
Tomas Darius Davainis (Tomasdd) :: Lithuanian

.github/workflows/test-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4', '8.5']
2020
steps:
2121
- uses: actions/checkout@v4
2222

.github/workflows/test-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4', '8.5']
2020
steps:
2121
- uses: actions/checkout@v4
2222

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2025, Dan Brown and the BookStack project contributors.
3+
Copyright (c) 2015-2026, Dan Brown and the BookStack project contributors.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

app/Access/Controllers/OidcController.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99

1010
class OidcController extends Controller
1111
{
12-
protected OidcService $oidcService;
13-
14-
public function __construct(OidcService $oidcService)
15-
{
16-
$this->oidcService = $oidcService;
12+
public function __construct(
13+
protected OidcService $oidcService
14+
) {
1715
$this->middleware('guard:oidc');
1816
}
1917

@@ -30,7 +28,7 @@ public function login()
3028
return redirect('/login');
3129
}
3230

33-
session()->flash('oidc_state', $loginDetails['state']);
31+
session()->put('oidc_state', time() . ':' . $loginDetails['state']);
3432

3533
return redirect($loginDetails['url']);
3634
}
@@ -41,10 +39,16 @@ public function login()
4139
*/
4240
public function callback(Request $request)
4341
{
44-
$storedState = session()->pull('oidc_state');
4542
$responseState = $request->query('state');
43+
$splitState = explode(':', session()->pull('oidc_state', ':'), 2);
44+
if (count($splitState) !== 2) {
45+
$splitState = [null, null];
46+
}
47+
48+
[$storedStateTime, $storedState] = $splitState;
49+
$threeMinutesAgo = time() - 3 * 60;
4650

47-
if ($storedState !== $responseState) {
51+
if (!$storedState || $storedState !== $responseState || intval($storedStateTime) < $threeMinutesAgo) {
4852
$this->showErrorNotification(trans('errors.oidc_fail_authed', ['system' => config('oidc.name')]));
4953

5054
return redirect('/login');
@@ -62,7 +66,7 @@ public function callback(Request $request)
6266
}
6367

6468
/**
65-
* Log the user out then start the OIDC RP-initiated logout process.
69+
* Log the user out, then start the OIDC RP-initiated logout process.
6670
*/
6771
public function logout()
6872
{

app/Access/ExternalBaseUserProvider.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,18 @@
22

33
namespace BookStack\Access;
44

5+
use BookStack\Users\Models\User;
56
use Illuminate\Contracts\Auth\Authenticatable;
67
use Illuminate\Contracts\Auth\UserProvider;
7-
use Illuminate\Database\Eloquent\Model;
88

99
class ExternalBaseUserProvider implements UserProvider
1010
{
11-
public function __construct(
12-
protected string $model
13-
) {
14-
}
15-
16-
/**
17-
* Create a new instance of the model.
18-
*/
19-
public function createModel(): Model
20-
{
21-
$class = '\\' . ltrim($this->model, '\\');
22-
23-
return new $class();
24-
}
25-
2611
/**
2712
* Retrieve a user by their unique identifier.
2813
*/
2914
public function retrieveById(mixed $identifier): ?Authenticatable
3015
{
31-
return $this->createModel()->newQuery()->find($identifier);
16+
return User::query()->find($identifier);
3217
}
3318

3419
/**
@@ -59,10 +44,7 @@ public function updateRememberToken(Authenticatable $user, $token)
5944
*/
6045
public function retrieveByCredentials(array $credentials): ?Authenticatable
6146
{
62-
// Search current user base by looking up a uid
63-
$model = $this->createModel();
64-
65-
return $model->newQuery()
47+
return User::query()
6648
->where('external_auth_id', $credentials['external_auth_id'])
6749
->first();
6850
}

app/Access/Guards/AsyncExternalBaseSessionGuard.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,28 @@
33
namespace BookStack\Access\Guards;
44

55
/**
6-
* Saml2 Session Guard.
6+
* External Auth Session Guard.
77
*
8-
* The saml2 login process is async in nature meaning it does not fit very well
9-
* into the default laravel 'Guard' auth flow. Instead most of the logic is done
10-
* via the Saml2 controller & Saml2Service. This class provides a safer, thin
11-
* version of SessionGuard.
8+
* The login process for external auth (SAML2/OIDC) is async in nature, meaning it does not fit very well
9+
* into the default laravel 'Guard' auth flow. Instead, most of the logic is done via the relevant
10+
* controller and services. This class provides a safer, thin version of SessionGuard.
1211
*/
1312
class AsyncExternalBaseSessionGuard extends ExternalBaseSessionGuard
1413
{
1514
/**
1615
* Validate a user's credentials.
17-
*
18-
* @param array $credentials
19-
*
20-
* @return bool
2116
*/
22-
public function validate(array $credentials = [])
17+
public function validate(array $credentials = []): bool
2318
{
2419
return false;
2520
}
2621

2722
/**
2823
* Attempt to authenticate a user using the given credentials.
2924
*
30-
* @param array $credentials
3125
* @param bool $remember
32-
*
33-
* @return bool
3426
*/
35-
public function attempt(array $credentials = [], $remember = false)
27+
public function attempt(array $credentials = [], $remember = false): bool
3628
{
3729
return false;
3830
}

0 commit comments

Comments
 (0)