]> BookStack Code Mirror - website/blob - content/blog/bookstack-release-v23-05.md
e1768d37acfbfde427fb27f6df0897e86128af5e
[website] / content / blog / bookstack-release-v23-05.md
1 +++
2 categories = ["Releases"]
3 tags = ["Releases"]
4 title = "BookStack Release v23.05"
5 date = 2023-05-02T11:00:00Z
6 author = "Dan Brown"
7 image = "/images/blog-cover-images/bird-ray-hennessy.jpg"
8 slug = "bookstack-release-v23-05"
9 draft = false
10 +++
11
12 BookStack v23.05 releases today, sneaking into the start of May with a
13 bunch of additions, updates and changes including a new command line tool
14 to help with admin operations. 
15
16 * [Update instructions](https://www.bookstackapp.com/docs/admin/updates)
17 * [GitHub release page](https://github.com/BookStackApp/BookStack/releases/tag/v23.05)
18
19 **Upgrade Notices**
20
21 TODO - Add to updates page
22 TODO - Check docs changes
23
24 - **Page Include Tags** - Nesting is now allowed for [include tags](https://www.bookstackapp.com/docs/user/reusing-page-content/#include-tags), up to 3 levels of depth. You may now see more content loaded for pages which previously had unparsed nested include tags.
25 - **SAML2** - SAML2 Single LogOut (SLO) requests will now include a "session_index" for the current user. This technically brings BookStack's implementation closer to the spec, and is not expected to cause issues, but if using SLO it may be wise to check your identity provider behavior remains the same as before during logout.
26 - **Custom Code Block Themes** - Due to a change of library, the way custom code block themes has significantly changed, as no longer uses the "window.CodeTheme" method previously used. Refer to our ["Changing Code Block Themes"](https://www.bookstackapp.com/docs/admin/visual-customisation/#changing-code-block-themes) documentation for further information.
27 - **Editor Event - editor-markdown::setup** - This event no longer contains "codeMirrorInstance" in the event data. It instead has a "cmEditorView" property. [See the event docs for more details](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/javascript-public-events.md#editor-markdownsetup).
28 - **Editor Event - editor-markdown-cm::pre-init** - This event has been renamed to "editor-markdown-cm6::pre-init" and no longer contains "config" in the event data. It instead has a "editorViewConfig" property. [See the event docs for more details](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/javascript-public-events.md#editor-markdown-cm6pre-init).
29 - **Upload Timeouts** - The use of "window.uploadTimeout" has been removed as a way to control upload timeouts. This would previously only be used in certain cases. Instead, if required, timeouts can usually be enforced at the web-server level.
30
31 TODO - Video Link
32
33 ### New System CLI (Early Alpha)
34
35 When it comes to managing a BookStack instance, backup and restore has always been a point of contention.
36 Ultimately, the method of backup can depend on preference, hosting and environment.
37 Our documentation provided a generic set of commands & actions to achieve backup & restore, but while some found these simple and scriptable, 
38 some found the process overwhelming and complicated.
39
40 To help with backup, restore, and other tasks, with this release I'm introducing the BookStack System CLI.
41 This is a new CLI tool, included within the BookStack app files, that can perform the following commands:
42
43 - **Init** - Setup a fresh BookStack installation within a folder.
44 - **Backup** - Creates a backup of an existing BookStack installation to a single ZIP file.
45 - **Restore** - Restore a backup ZIP into an instance of BookStack.
46 - **Update** - Update an existing BookStack installation to the latest version.
47
48 This CLI is technically managed as [a new separate project](https://github.com/BookStackApp/system-cli) and is actually self-contained
49 and independent of the BookStack codebase, meaning it can be downloaded and be used alone without an existing working BookStack install.
50
51 Here's a demo of using the CLI to take a backup, and restoring that backup into a new instance created by the CLI:
52
53 [![asciicast](https://asciinema.org/a/whALf4oAkhBU3VeuOAjpmGEGz.svg)](https://asciinema.org/a/whALf4oAkhBU3VeuOAjpmGEGz)
54
55 To support backups, a new `<bookstack_install_dir>/storage/backups` folder has been added to act as the default backup output location, but alternatively the output zip can be provided when running the command if a custom path is preferred.
56
57 It should be noted this new CLI **should be considered an early alpha** implementation, with the likelihood to run into bugs relatively high.
58 Some known issues (mostly due to MySQL variance) are [documented in the project readme](https://github.com/BookStackApp/system-cli#known-issues).
59 The CLI is written in PHP, and made to be platform abstract. So far i've been testing this across a range of unix-based systems but this kind of CLI is still very environment dependant so it may be a while before things mature.
60 Behaviour, Output, options and the CLI name may change over time as I gain feedback from people using this.
61
62 In the longer-term vision, I may integrate this CLI with the BookStack interface, so that things like backups can be managed from in-app, but that brings its own complications and I'd like to see the CLI mature first.
63
64 ### New File Upload Handling & Attachment Manager Simplification
65
66 File upload handling has been revamped in a few key areas, specifically the image manager and attachment manager UIs, found when editing a page.
67 The new experience switches out our previous usage of the [dropzone.js](https://www.dropzone.dev/) library with a much more lightweight 
68 custom implementation to provide a more "BookStack" integrated feel, which we'll be able to better utilize in the future:
69
70 ![A screenshot of the BookStack image manager, showing a failed upload containing an error message in red text](/images/2023/05/image-upload-error.png)
71
72 This new format for image uploads has the added benefit of now showing errors in a clearer and more accessible format.
73
74 To support these changes the areas in which they are used have received some attention.
75 The styles of the image manager have been tidied and tightened to provide a cleaner user experience.
76 The attachment management panel has had a more extensive overhaul, replacing the previous tabbed-based interface
77 with a simpler layout that requires less clicks for common upload actions.
78
79 ![A view of the attachments area of BookStack with an example uploaded file of a cat](/images/2023/05/attachment-upload.png)
80
81 ### Code Block Updating to CodeMirror 6
82
83 Within BookStack all code syntax highlighting and code editing, including that of the Markdown page editor, is assisted by the popular [CodeMirror](https://codemirror.net/) JavaScript library. 
84 After being released last year, I started work to upgrade from CodeMirror 5 to 6 in August of last year, but quickly found this update was essentially a rebuild of the library requiring a lot of work on the BookStack side of things.
85 This release cycle I put my head down and spent a lot of time on this so that, as of BookStack v23.05, all such code blocks are now using CodeMirror 6.
86
87 ![A simple code block within page content, display code syntax highlighting](/images/2023/05/codemirror-6-block.png)
88
89 This will hopefully not impact most users, while it should bring us better mobile support while keeping us up-to-date on our libraries.
90 This does have some significant impacts to those that had applied customizations, since it changes some of the "Editor Events" we previously had,
91 while also significantly changing (and unfortunately complicating) the way custom code themes are applied. 
92 See the upgrade notices at the top of the blogpost for more details.
93
94 ### API Updates - Image Gallery & Content Permissions
95
96 This release brings two new sets of endpoints to the API, helping to fill gaps and empower our API users to achieve all actions possible via the UI.
97
98 ![List of the image gallery and content permission API endpoints](/images/2023/05/image-permissions-api-endpoints.png)
99
100 The first set are image gallery APIs, which allow the management of page content images much like within the image manager when editing pages. 
101 This will be welcome to those that have wanted to handle images in a much more granular way via the API, outside of using the base64-encoded-in-content approach.
102
103 The second set are content permissions APIs, allowing handling of all controls you'd usually see when viewing the "Permissions" for a single Shelf/Book/Chapter/Page within the user interface. Those wanting to set custom permissions on API-created content should be happy to see these added.
104
105 ### Nested Include Tags
106
107 From very early on BookStack has had the ability to dynamically include the whole content, or parts of content, from other pages
108 using [page include tags](https://www.bookstackapp.com/docs/user/reusing-page-content/#include-tags).
109 These have only ever worked at a single layer though, so "nested" tags within the included content would not then be subsequently parsed.
110
111 Within this release, this behaviour has been changed so that nested include tags will be parsed.
112 This works up to three levels of content, with the limit being there to prevent performance and recursion issues.
113
114 Thanks to [@jasonF1000](https://github.com/BookStackApp/BookStack/pull/4192) for helping to contribute this feature.
115
116 ### Clojure Code Syntax Highlighting
117
118 Another new coding language gets highlighting support in this release, with
119 the lucky language being clojure:
120
121 ![BookStack WYSIWYG code editor showing Clojure syntax highlighting](/images/2023/05/clojure-code-syntax.png)
122
123 ### OIDC ID Token Logical Theme Event
124
125 A new `OIDC_ID_TOKEN_PRE_VALIDATE` event has been added to the [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md). This allows the customization of incoming OIDC ID token data which can be useful to perform any changes required
126 that are outside the scope of what the standard and/or BookStack supports.
127
128 As an arbitrary example, the below would prefix "Sir" to the names of those that have a name ending in "Chuckle":
129
130 ```php
131 Theme::listen(ThemeEvents::OIDC_ID_TOKEN_PRE_VALIDATE, function (array $idTokenData, array $accessTokenData) {
132     $currentName = $idTokenData['name'];
133     if (str_ends_with($currentName, 'Chuckle')) {
134         return array_merge($idTokenData, [
135             'name' => 'Sir ' . $currentName,
136         ]);
137     }
138 });
139 ```
140
141 ### JavaScript Codebase & Public (Editor) Events
142
143 With all the JavaScript focused work performed for this release, there's been some general
144 clean-up and alignment performed to keep things tidied and maintained.
145
146 First of all, I've added [ESLint](https://eslint.org/) to standardise the formatting and code style
147 across the whole BookStack JavaScript codebase which helps ensure consistency while potentially
148 spotting or preventing issues.
149
150 Secondly, the custom public JavaScript events (Which we previously called "Editor Events") have been 
151 properly documented within a [developer doc markdown file within the repo](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/javascript-public-events.md), providing details of each event along with an example.
152 In addition to providing detail for developers, this helps us track the public API we're providing so it's easier
153 for us to track and advise of breaking changes.
154
155 ### Disable SMTP SSL Verification Option
156
157 Many using BookStack in private/local networks would configure the system to send mail via a SMTP
158 server that used a self/privately-signed certificate, and this could cause BookStack to throw an error
159 since the certificate was not signed by a commonly known authority.
160
161 While it's often possible to work around this, by adding the custom certificate authority to the system's 
162 trusted store, this could be a tricky process in some environments. 
163 As an alternative, the below option can now added to your `.env`:
164
165 ```bash
166 MAIL_VERIFY_SSL=false
167 ```
168
169 With this option set to `false`, all levels of SSL/TLS certificate verification will be ignored during SMTP email sending.
170 This can make you more vulnerable to [MITM attacks](https://en.wikipedia.org/wiki/Man-in-the-middle_attack), so should only be used where necessary on private networks.
171
172 Thanks to [@vincentbernat](https://github.com/BookStackApp/BookStack/pull/4126) for helping to contribute this feature.
173
174 ### Translations
175
176 Another release means another update the translation content within BookStack from the following
177 remarkable roster of folks that have provided translation text since the original v23.02 release:
178
179 - Name - *Lang*
180
181
182 ### Next Steps
183
184 Within this release cycle I though a lot more about multi-language support within BookStack, 
185 but ran into significant doubts about it about it being worthwhile to make significant content changes to support this
186 due to the complexity it'd add, especially as such a change would likely only benefit the larger, more resourceful 
187 BookStack users while having a development impact for everyone. 
188 I wanted to think about potential alternative options that don't require so much foundational change, so I posted
189 a question [within the issue thread](https://github.com/BookStackApp/BookStack/issues/569#issuecomment-1501145217)
190 to gain feedback to help explore what exactly people are lacking right now. 
191 If you have a need to support multi-lingual content within BookStack, I've welcome your response to that.
192
193 Right now there's fair demand in regards to features surrounding comments and notifications, both areas untouched
194 in quite a while apart from the addition of webhooks.
195 I'd like to spend some time in these areas. Notifications in general is very complex topic, at least when you consider
196 the levels of preferences and control that people may desire/need. 
197 It may be the case I tackle some minor issues in these areas, to help form questions and ideas that I can take to the 
198 wider community to help establish a path forward to the more significant features here.
199
200 The image upload work in this release reminded me that the image manager is a little old.
201 While I neatened a few parts for v23.05, it's still very much non-mobile-friendly and I don't think it's very screen-reader accessible either, so I'd like to overhaul things a tad to bring them up to standards.
202
203 ### Other Updates
204
205 If you missed it, it's worth checking out the [March Project Update](/blog/project-update-march-23/) post
206 where I shared many of the non-release-specific project updates for the month which included
207 new hacks and API scripts.
208
209 ### Full List of Changes
210
211 **Released in v23.05**
212
213 * Added system CLI for admin operations. ([#4206](https://github.com/BookStackApp/BookStack/pull/4206), [#3149](https://github.com/BookStackApp/BookStack/issues/3149))
214 * Added image gallery API Endpoints. ([#4103](https://github.com/BookStackApp/BookStack/pull/4103))
215 * Added content permission API endpoints. ([#2702](https://github.com/BookStackApp/BookStack/issues/2702), [#4099](https://github.com/BookStackApp/BookStack/pull/4099))
216 * Added new logical theme event to customize OIDC ID token data. ([#4200](https://github.com/BookStackApp/BookStack/issues/4200))
217 * Added Clojure syntax highlighting for code blocks. ([#4112](https://github.com/BookStackApp/BookStack/issues/4112))
218 * Added option to disable SSL verification with SMTP email sending. Thanks to [@vincentbernat](https://github.com/BookStackApp/BookStack/pull/4126). ([#4126](https://github.com/BookStackApp/BookStack/pull/4126), [#3166](https://github.com/BookStackApp/BookStack/issues/3166))
219 * Added support for three-levels of nested include tags. Thanks to [@jasonF1000](https://github.com/BookStackApp/BookStack/pull/4192). ([#4192](https://github.com/BookStackApp/BookStack/pull/4192), [#2845](https://github.com/BookStackApp/BookStack/issues/2845))
220 * Added detailed documentation for public JS events. ([#4179](https://github.com/BookStackApp/BookStack/issues/4179))
221 * Added standard JS codebase formatting via ESLint. ([#4181](https://github.com/BookStackApp/BookStack/pull/4181), [#4180](https://github.com/BookStackApp/BookStack/issues/4180))
222 * Updated code blocks & markdown editor to CodeMirror 6. ([#3617](https://github.com/BookStackApp/BookStack/pull/3617), https://github.com/BookStackApp/BookStack/issues/3518))
223 * Updated file upload handling for images and attachments. ([#4193](https://github.com/BookStackApp/BookStack/pull/4193))
224 * Updated SAML2 SLO requests to include a session index. ([#3936](https://github.com/BookStackApp/BookStack/issues/3936))
225 * Updated translations with latest Crowdin changes. ([#4163](https://github.com/BookStackApp/BookStack/pull/4163))
226 * Fixed audit log type filter leading to wrong location. ([#4201](https://github.com/BookStackApp/BookStack/issues/4201))
227 * Fixed large videos within content escaping content area. Thanks to [@chopin2712](https://github.com/BookStackApp/BookStack/pull/4204). ([#4204](https://github.com/BookStackApp/BookStack/pull/4204))
228 * Fixed missing WKHTMLTOPDF in .env.example.complete file. Thanks to [@7nohe](https://github.com/BookStackApp/BookStack/pull/4145). ([#4145](https://github.com/BookStackApp/BookStack/pull/4145))
229 * Fixed not being able to search for terms containing backslashes . Thanks to [@esakkiraja100116](https://github.com/BookStackApp/BookStack/pull/4202). ([#4202](https://github.com/BookStackApp/BookStack/pull/4202), [#4175](https://github.com/BookStackApp/BookStack/issues/4175))
230 * Fixed timestamp in API docs example chapter response. Thanks to [@tigsikram](https://github.com/BookStackApp/BookStack/pull/4191). ([#4191](https://github.com/BookStackApp/BookStack/pull/4191))
231
232 **Released in v23.02.3**
233
234 * Fixed issue where user delete fails when no "migration" user is selected. ([#4162](https://github.com/BookStackApp/BookStack/issues/4162))
235 * Fixed tag selection via mouse on Safari. ([#4139](https://github.com/BookStackApp/BookStack/issues/4139))
236 * Updated translations with latest Crowdin changes. ([#4131](https://github.com/BookStackApp/BookStack/pull/4131))
237
238 **Released in v23.02.2**
239
240 * Fixed role deletion failing when submitting with empty migration role. ([#4128](https://github.com/BookStackApp/BookStack/issues/4128))
241 * Fixed ownership migration upon user delete not working. ([#4124](https://github.com/BookStackApp/BookStack/issues/4124))
242 * Updated translations with latest Crowdin changes. ([#4074](https://github.com/BookStackApp/BookStack/pull/4074))
243
244 **Released in v23.02.1**
245
246 * Fixed an issue with language loading in certain scenarios. ([#4068](https://github.com/BookStackApp/BookStack/issues/4068))
247 * Updated translations with latest Crowdin changes. ([#4066](https://github.com/BookStackApp/BookStack/pull/4066))
248
249 ----
250
251 <span style="font-size: 0.8em;opacity:0.9;">Header Image Credits: <span>Photo by <a href="https://unsplash.com/@rayhennessy?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Ray Hennessy</a> on <a href="https://unsplash.com/photos/Hk6W46UGWRg?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></span></span>