]> BookStack Code Mirror - website/blob - content/blog/2024/bookstack-release-v24-02.md
26c1ff23d6e0b13ac848d7029084bbd9c651d4b1
[website] / content / blog / 2024 / bookstack-release-v24-02.md
1 +++
2 categories = ["Releases"]
3 tags = ["Releases"]
4 title = "BookStack Release v24.02"
5 date = 2024-02-29T12:10:00Z
6 author = "Dan Brown"
7 image = "/images/blog-cover-images/cc-by-sa-2/burnieside-steven-brown.jpg"
8 slug = "bookstack-release-v24-02"
9 draft = false
10 +++
11
12 For our first feature release of 2024 we have a variety enhancements to enjoy!
13 Many of these build upon the work from the previous release, while many others address some 
14 common pain-points in BookStack.
15
16 * [Update instructions](/docs/admin/updates)
17 * [GitHub release page](https://github.com/BookStackApp/BookStack/releases/tag/v24.02)
18
19 **Upgrade Notices**
20
21 - **Security** - The v23.12 branch of BookStack recently had a security release, which you can find details of in our [v23.12.3 blogpost](/blog/bookstack-release-v23-12-3/).
22 - **Comments** - The ability to use markdown content in comments has been removed in this release, replaced by a WYSIWYG editor. Markdown in comments was a fairly hidden feature though so was not commonly utilised. Existing markdown comments will remain although formatting may be lost if old markdown comments are edited.
23 - **Commands** - The "Regenerate Comment Content" command has been removed in this release since this action is now redundant.
24 - **OIDC Authentication** - Proof Key for Code Exchange (PKCE) support has been added to BookStack OIDC authentication. This should not affect existing OIDC use but you may want to enforce PKCE to be required for BookStack on your authentication system, if supported, for extra security.
25
26 TODO - Video
27 <!-- {{<pt 4gCUZhHumJDLTtSbGQzXzU>}} -->
28
29 ### Simple WYSIWYG comment editor
30
31 Last feature release [we added](https://www.bookstackapp.com/blog/bookstack-release-v23-12/#wysiwyg-editor-for-descriptions)
32 a simple WYSIWYG editor for shelf, book & chapter descriptions.
33 In this release we bring this new editor to comments:
34
35 ![View of the "New Comment" section shown when viewing a page, with a simple WYSIWYG editor that includes 5 formatting buttons, and within that is some example text reflecting bold, italic and linked text.](/images/2024/02/comment-wysiwyg-input.png)
36
37 Formatting in comments was previously possible via markdown but this was little known and not really
38 intuitive for the mixed-skill environment we target, so this should make things much more accessible.
39 This does mean some previously supported markdown formats can now longer be used, but those old comments 
40 will still retain their formatting, unless edited in which case they might lose unsupported formatting 
41 when loaded into the editor.
42
43 ### Default Page Templates for Chapters
44
45 Building on the default page template option we added to books [in the last release](/blog/bookstack-release-v23-12/#default-template-for-new-book-pages),
46 the same functionality has now been carried across for chapters,
47 so it's now possible to set a default page template at the chapter level which
48 will be used as the default content for new pages, when a page is created
49 within that specific chapter:
50
51 ![View of the "Edit Chapter" page in BookStack, focused on a "Default Page Template" section containing an input that shows the value "#92, Cat Profile Template"](/images/2024/02/chapter-default-page-template.png)
52
53 New pages will use the chapter-level template if set, or otherwise look to
54 use the book-level template if set there.
55
56 A shout-out to [@Man-in-Black](https://github.com/BookStackApp/BookStack/pull/4750) for developing
57 out the implementation for this feature.
58
59 ### WYSIWYG Table Improvements
60
61 Tables are a fairly complex type of content supported by our WYSIWYG editor, especially
62 with all the options and variations that can apply to them. It's easy for sizing & formatting
63 to go wrong, or become somewhat "stuck", while it's difficult to reset these kinds of options.
64 In this release, we've focused on a whole range of improvements to make it easier to handle 
65 these kinds of scenarios.
66
67 ![View of the "table" toolbar button dropdown with new "Clear table formatting" and "Resize to contents" actions shown](/images/2024/02/table-added-actions.png)
68
69 Within the table toolbar menu, there are now a couple of extra options: A "Clear table formatting" option
70 makes it easy to reset all sizing and formatting across the whole table in a single click.
71 A "Resize to contents" option resets all fixed sizes across the tables, allowing it to automatically scale 
72 back to the contents. 
73
74 Multi-table-cell selection has been enhanced, so that clear-formatting & text-direction controls
75 will now properly apply across the whole selection range. We've also addressed an issue with
76 scrollbars clogging up the view when such selections are performed in certain browsers.
77
78 Lastly, enabling a header row has been made easier. Previously, this required navigating multiple
79 levels of menus but instead you'll now see a "Toggle header row" button in the table toolbar
80 when focused within the first table row:
81
82 ![View of the BookStack page WYSIWYG editor. A table has been added describing various cats. The table is selected with a toolbar shown above it. The cursor is hovering over a "Row header" button which is currently active, reflecting the different shading of the top row of the table](/images/2024/02/table-header-row-toggle.png)
83
84 ### Improved Video Attachment Support
85
86 While we don't have video-specific media management in BookStack, some users would upload videos
87 via attachments then embed them into the page, which had the advantage that access to videos would
88 be controlled by access to the page they're uploaded to. 
89 While this could work, video ideally needs to be served in a way that can be streamed, otherwise
90 the browser would attempt to download the whole video in one go, and things like timeline scrubbing
91 would not work. 
92
93 In this release we've added "Range request" support that allows browsers to fetch video in a 
94 stream-supporting manner, while still being behind BookStack's permission control management.
95 Going further, to help the process of embedding, adding an attachment link 
96 (or drag and dropping the attachment into the editor) for a video will directly insert that as a
97 video embed rather than a standard link:
98
99 <video muted controls src="/images/2024/02/bookstack-video-attachment-drag-drop.mp4"></video>
100
101 *Note: Stream support can depend on configured storage. When S3 storage is used, attachments will be streamed from BookStack to the user, but BookStack may still need to download the whole attachment file from the upstream storage system on request.*
102
103 ### OIDC Authentication PKCE Support
104
105 Proof Key for Code Exchange (PKCE) is a mechanism that can be added to the OAuth/OIDC authentication flow
106 to help protect against a range of potential attacks via an extra layer of checks upon the credentials
107 gained & used by a client application like BookStack.
108
109 In v24.02 we now support PKCE for the the OIDC authentication flow. This is active by default, and will be used
110 on all OIDC login flows without any additional BookStack configuration needed.
111 OIDC authentication systems that support PKCE will be able to detect and use this for extra security.
112 Some authentication systems also provide the option to make PKCE mandatory, which if provided you may
113 want to enable to harden security further in this area.
114
115 ### Auth Pre-Register Logical Theme Event
116
117 A new `AUTH_PRE_REGISTER` event is now available for use via the
118 [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md).
119 This event runs just before a user is created through any self-registration events
120 (including auto-registration events for third-party/saml/ldap/oidc authentication)
121 and its return value can be used to indicate if the registration should be allowed.
122 A `false` return value will stop the registration, and return the user to the login screen.
123 Here's an example use of this logical theme event:
124
125 ```php
126 <?php
127
128 use BookStack\Theming\ThemeEvents;
129 use BookStack\Facades\Theme;
130
131 Theme::listen(ThemeEvents::AUTH_PRE_REGISTER, function (string $authSystem, array $userData) {
132     return str_starts_with($userData['email'], 'barry');
133 });
134 ```
135
136 This arbitrary example will only allow registration if the user's email address begins with 'barry'.
137 There's a lot of better ways this could be used though, to add custom logic that BookStack does not support 
138 by default. For example, you could cross-reference the user against a file, you could check against an external API,
139 or even force disable this kind of registration completely by simply returning `false`.
140
141 ### Back-end changes
142
143 There have been some significant changes this release cycle in regards to how the majority
144 of data is queried out from the database. This was mostly a code & data organisation
145 change but some performance optimization was performed alongside these changes.
146
147 There have also been changes made to how redirects & session history tracking are performed
148 which should help avoid some edge cases where users could be redirected to 
149 unexpected places, like to uploaded images.
150
151 ### Translations
152
153 A big thanks again to all our terrific tireless translators who provide their time to help
154 translate text for the BookStack interface. Here's those that have contributed since 
155 the initial v23.12 release:
156
157 - Name - *Language - x words*
158
159 TODO
160
161 *\* Word counts are those tracked by Crowdin, indicating original EN words translated.*
162
163 ### Next Steps
164
165 Our next release will be focused on updating the framework used by BookStack, from Laravel 9
166 to Laravel 10. This will require an update of requirements, specifically to the minimum
167 PHP version, which will jump from PHP 8.0 to PHP 8.1. Therefore we'll also be dedicating 
168 effort to updating our install scripts & guidance, to support this change.
169
170 Upon that, I'd like to address the options provided for PDF rendering.
171 Right now we provide DOMPDF by default, which works great via just PHP and is license-compatible
172 for BookStack, while we also document a way to use WKHTMLtoPDF which offers more advanced
173 rendering but has security & technical considerations. WKHTMLtoPDF is no longer
174 maintained nor developed, and is dropping out of operating system software repositories,
175 so it's time to look at filling that gap.
176 My current idea is to support a generic, command-calling-based interface which can then be 
177 configured for a variety of PDF rendering solutions, with some guidance in the BookStack
178 docs to make this easy to configure.
179
180 ### Full List of Changes
181
182 **Released in v24.02**
183
184 * Added simple WYSIWYG comment editor inputs. ([#4815](https://github.com/BookStackApp/BookStack/pull/4815), [#3018](https://github.com/BookStackApp/BookStack/issues/3018))
185 * Added default page templates for chapters. Thanks to [@Man-in-Black](https://github.com/BookStackApp/BookStack/pull/4750). ([#4750](https://github.com/BookStackApp/BookStack/pull/4750), [#4764](https://github.com/BookStackApp/BookStack/issues/4764))
186 * Added PKCE support for OIDC. ([#4804](https://github.com/BookStackApp/BookStack/pull/4804), [#4734](https://github.com/BookStackApp/BookStack/issues/4734))
187 * Added "Clear table formatting" & "Resize to contents" WYSIWYG table options. ([#4845](https://github.com/BookStackApp/BookStack/issues/4845))
188 * Added "Toggle header row" button to table toolbar in WYSWIYG editor. ([#985](https://github.com/BookStackApp/BookStack/issues/985))
189 * Added attachment serving range request support. ([#4758](https://github.com/BookStackApp/BookStack/pull/4758), [#3274](https://github.com/BookStackApp/BookStack/issues/3274))
190 * Added new `AUTH_PRE_REGISTER` logical theme event. ([#4833](https://github.com/BookStackApp/BookStack/issues/4833))
191 * Updated app entity loading to be more efficient and avoid global addSelects. ([#4827](https://github.com/BookStackApp/BookStack/pull/4827), [#4823](https://github.com/BookStackApp/BookStack/issues/4823))
192 * Updated book/shelf cover image wording to make sizing in usage clearer. ([#4748](https://github.com/BookStackApp/BookStack/issues/4748))
193 * Updated PWA manifest to allow landscape use. Thanks to [@shashinma](https://github.com/BookStackApp/BookStack/pull/4828). ([#4828](https://github.com/BookStackApp/BookStack/pull/4828))
194 * Updated redirect handling to reduce chance of redirecting to images. ([#4863](https://github.com/BookStackApp/BookStack/issues/4863))
195 * Updated some EN text for consistency/readability. ([#4794](https://github.com/BookStackApp/BookStack/pull/4794))
196 * Updated WYSIWYG editor with improved cell selection formatting clearing. ([#4850](https://github.com/BookStackApp/BookStack/pull/4850))
197 * Updated WYSIWYG text direction & alignment controls to work more reliably on complex structures. ([#4843](https://github.com/BookStackApp/BookStack/issues/4843))
198 * Fixed breadcrumb dropdowns being partially out of view on mobile screen sizes. ([#4824](https://github.com/BookStackApp/BookStack/issues/4824))
199 * Fixed description WYSIWYG not respecting RTL text. ([#4810](https://github.com/BookStackApp/BookStack/issues/4810))
200 * Fixed header bar collapse on smaller screen sizes when no name or logo is used. ([#4841](https://github.com/BookStackApp/BookStack/issues/4841))
201 * Fixed incorrect pagination display in RTL layout. ([#4808](https://github.com/BookStackApp/BookStack/issues/4808))
202 * Fixed JavaScript error logged on WYSIWYG editor load due to how custom styles were imported. ([#4814](https://github.com/BookStackApp/BookStack/issues/4814))
203 * Fixed scrollbars showing on WYSIWYG table cell range selection in some browsers. ([#4844](https://github.com/BookStackApp/BookStack/issues/4844))
204 * Fixed WYSIWYG code block text direction controls not being respected. ([#4809](https://github.com/BookStackApp/BookStack/issues/4809))
205
206 **Released in v23.12.3**
207
208 * Updated PHP dependencies, primarily to update php-svg-lib package.
209
210 **Released in v23.12.2**
211
212 * Fixed attachment list ctrl-click not opening attachments inline. ([#4782](https://github.com/BookStackApp/BookStack/issues/4782))
213 * Updated translations with latest Crowdin changes. ([#4779](https://github.com/BookStackApp/BookStack/pull/4779))
214 * Fixed entity selector popup pre-fill not searching term as expected. ([#4778](https://github.com/BookStackApp/BookStack/issues/4778))
215
216 **Released in v23.12.1**
217
218 * Fixed chapter API missing expected "book_slug" field. ([#4765](https://github.com/BookStackApp/BookStack/issues/4765))
219 * Updated translations with latest Crowdin changes. ([#4747](https://github.com/BookStackApp/BookStack/pull/4747))
220
221 ----
222
223 <span style="font-size: 0.8em;opacity:0.9;">Header Image Credits: <span>Photo by <a href="https://www.geograph.org.uk/photo/7714511">Steven Brown (CC-BY-SA-2)</a> - Image Modified</span></span>