Compare commits

..

451 Commits

Author SHA1 Message Date
Dan Brown
ed4baed28c Updated version and assets for release v25.12.2 2026-01-24 13:57:12 +00:00
Dan Brown
90d011fc15 Merge branch 'development' into release 2026-01-24 13:54:51 +00:00
Dan Brown
805fd98c0f Updated version and assets for release v25.12.1 2025-12-30 17:19:10 +00:00
Dan Brown
fcbae16730 Merge branch 'development' into release 2025-12-30 17:18:06 +00:00
Dan Brown
7c3a4c7e85 Updated version and assets for release v25.12 2025-12-24 12:16:49 +00:00
Dan Brown
114fa802c0 Merge branch 'development' into release 2025-12-24 12:16:04 +00:00
Dan Brown
8fcd3b24b3 Updated version and assets for release v25.11.6 2025-12-09 21:01:26 +00:00
Dan Brown
ce703403c2 Merge branch 'v25-11' into release 2025-12-09 21:00:25 +00:00
Dan Brown
16110273ff Updated version and assets for release v25.11.5 2025-12-03 14:49:20 +00:00
Dan Brown
93bcbd168e Merge branch 'v25-11' into release 2025-12-03 14:32:56 +00:00
Dan Brown
46001d61d0 Updated version and assets for release v25.11.4 2025-11-25 22:23:36 +00:00
Dan Brown
8dd238ceae Updated version and assets for release v24.11.4 2025-11-25 21:48:32 +00:00
Dan Brown
bb7fd59de9 Merge branch 'v25-11' into release 2025-11-25 21:47:21 +00:00
Dan Brown
ad8fc95521 Updated version and assets for release v25.11.3 2025-11-21 14:02:09 +00:00
Dan Brown
cca066a258 Merge branch 'development' into release 2025-11-21 14:01:06 +00:00
Dan Brown
bbda5fd468 Updated version and assets for release v25.11.2 2025-11-19 15:10:15 +00:00
Dan Brown
8429cc93eb Merge branch 'development' into release 2025-11-19 15:09:02 +00:00
Dan Brown
fef61f054a Updated version and assets for release v25.11.1 2025-11-11 12:17:44 +00:00
Dan Brown
8082c95ec3 Merge branch 'development' into release 2025-11-11 12:15:16 +00:00
Dan Brown
fcabf478de Updated version and assets for release v25.11 2025-11-09 12:52:34 +00:00
Dan Brown
8de2c28497 Merge branch 'development' into release 2025-11-09 12:51:26 +00:00
Dan Brown
0838d5ea16 Updated version and assets for release v25.07.3 2025-10-05 15:38:50 +01:00
Dan Brown
449ac40114 Merge branch 'v25-07' into release 2025-10-05 15:37:20 +01:00
Dan Brown
3131050acd Updated version and assets for release v25.07.2 2025-08-28 17:41:48 +01:00
Dan Brown
c0d2874892 Merge branch 'development' into release 2025-08-28 17:39:31 +01:00
Dan Brown
5940a91809 Updated version and assets for release v25.07.1 2025-08-11 14:43:51 +01:00
Dan Brown
9a4651badb Merge branch 'development' into release 2025-08-11 14:43:13 +01:00
Dan Brown
92d15d9cf2 Updated version and assets for release v25.07 2025-07-30 09:46:37 +01:00
Dan Brown
b06147fef7 Merge branch 'development' into release 2025-07-30 09:45:40 +01:00
Dan Brown
841350a937 Updated version and assets for release v25.05.2 2025-07-07 15:01:24 +01:00
Dan Brown
12183bac07 Merge branch 'development' into release 2025-07-07 15:00:35 +01:00
Dan Brown
e65b4b63a2 Updated version and assets for release v25.05.1 2025-06-17 15:30:40 +01:00
Dan Brown
7cac3f4780 Merge branch 'development' into release 2025-06-17 15:29:46 +01:00
Dan Brown
92cd11d105 Updated version and assets for release v25.05 2025-05-31 14:27:44 +01:00
Dan Brown
13115ace84 Merge branch 'development' into release 2025-05-31 14:26:04 +01:00
Dan Brown
73f9834e6f Updated version and assets for release v25.02.5 2025-05-17 12:16:55 +01:00
Dan Brown
3afe855156 Merge branch 'development' into release 2025-05-17 12:14:51 +01:00
Dan Brown
bfde896f0b Updated version and assets for release v25.02.4 2025-05-08 16:01:45 +01:00
Dan Brown
1cdc0a7a3d Merge branch 'development' into release 2025-05-08 15:57:02 +01:00
Dan Brown
d19b86640b Updated version and assets for release v25.02.3 2025-05-05 18:32:39 +01:00
Dan Brown
2936ba609b Merge branch 'development' into release 2025-05-05 18:20:31 +01:00
Dan Brown
573a2dd22a Updated version and assets for release v25.02.2 2025-04-02 17:32:58 +01:00
Dan Brown
b55cc803d3 Merge branch 'development' into release 2025-04-02 17:31:14 +01:00
Dan Brown
304ade418e Updated version, assets, and checksums for release v25.02.1 2025-03-16 12:47:19 +00:00
Dan Brown
997931c42f Merge branch 'development' into release 2025-03-16 12:45:08 +00:00
Dan Brown
268e353431 Updated version and assets for release v25.02 2025-02-26 14:30:52 +00:00
Dan Brown
b491b5fbca Merge branch 'development' into release 2025-02-26 14:30:17 +00:00
Dan Brown
387c786768 Updated version and assets for release v24.12.1 2025-01-04 22:22:17 +00:00
Dan Brown
2641586a6f Merge branch 'development' into release 2025-01-04 22:22:04 +00:00
Dan Brown
6d2cd20e80 Updated version and assets for release v24.12 2024-12-23 11:55:23 +00:00
Dan Brown
b0c574356a Merge branch 'development' into release 2024-12-23 11:55:02 +00:00
Dan Brown
07e45a20e5 Updated version and assets for release v24.10.3 2024-11-29 13:50:41 +00:00
Dan Brown
14056c69e6 Updated version and assets for release v24.10.2 2024-11-29 13:47:24 +00:00
Dan Brown
fb9c840c46 Merge branch 'development' into release 2024-11-29 13:47:08 +00:00
Dan Brown
5fba4a5399 Updated version and assets for release v24.10.2 2024-11-13 12:03:15 +00:00
Dan Brown
c0b377050e Merge branch 'development' into release 2024-11-13 12:02:30 +00:00
Dan Brown
f3efb6441d Updated version and assets for release v24.10.1 2024-11-08 13:53:06 +00:00
Dan Brown
0cf313a21e Merge branch 'development' into release 2024-11-08 13:52:37 +00:00
Dan Brown
26aadffb20 Updated version and assets for release v24.10 2024-10-09 10:48:34 +01:00
Dan Brown
a5f48e3202 Merge branch 'development' into release 2024-10-09 10:46:07 +01:00
Dan Brown
b0dda6e6a7 Updated version and assets for release v24.05.4 2024-08-29 16:04:51 +01:00
Dan Brown
d4025d95e7 Merge branch 'development' into release 2024-08-29 16:04:37 +01:00
Dan Brown
d6021f4d22 Updated version and assets for release v24.05.3 2024-07-14 17:14:21 +01:00
Dan Brown
b9a3290731 Merge branch 'development' into release 2024-07-14 17:13:10 +01:00
Dan Brown
48f235ea5a Updated version and assets for release v24.05.2 2024-06-10 11:44:06 +01:00
Dan Brown
047771b9f4 Merge branch 'development' into release 2024-06-10 11:43:05 +01:00
Dan Brown
b5375114d3 Updated version and assets for release v24.05.1 2024-05-21 11:07:36 +01:00
Dan Brown
fc13e56cea Merge branch 'development' into release 2024-05-21 11:07:10 +01:00
Dan Brown
77fc37ac25 Updated version and assets for release v24.05 2024-05-11 15:49:29 +01:00
Dan Brown
3424351e84 Merge branch 'development' into release 2024-05-11 15:48:49 +01:00
Dan Brown
606f9d92d0 Updated version and assets for release v24.02.3 2024-04-05 15:20:08 +01:00
Dan Brown
a5e25abb9c Merge branch 'v24-02' into release 2024-04-05 15:19:34 +01:00
Dan Brown
b310e87e4c Updated version and assets for release v24.02.2 2024-03-11 14:30:48 +00:00
Dan Brown
425baf9d6e Merge branch 'development' into release 2024-03-10 18:46:05 +00:00
Dan Brown
825c369ad9 Updated version and assets for release v24.02 2024-02-28 13:35:36 +00:00
Dan Brown
10bab70438 Merge branch 'development' into release 2024-02-28 13:35:23 +00:00
Dan Brown
350e0b281b Updated version and assets for release v23.12.3 2024-02-26 12:05:02 +00:00
Dan Brown
08805ea3c8 Merge branch 'v23-12' into release 2024-02-26 12:04:25 +00:00
Dan Brown
9441e32c69 Updated version and assets for release v23.12.2 2024-01-24 10:37:20 +00:00
Dan Brown
530fc37067 Merge branch 'v23-12' into release 2024-01-24 10:36:52 +00:00
Dan Brown
369e499dce Updated version and assets for release v23.12.1 2024-01-16 12:16:06 +00:00
Dan Brown
655815de6d Merge branch 'development' into release 2024-01-16 12:15:50 +00:00
Dan Brown
457adc1fee Updated version and assets for release v23.12 2023-12-29 12:16:07 +00:00
Dan Brown
e86a90967e Merge branch 'development' into release 2023-12-29 12:15:34 +00:00
Dan Brown
5d08f7cf14 Updated version and assets for release v23.10.4 2023-11-20 14:19:46 +00:00
Dan Brown
8744eb2d62 Merge branch 'v23-10' into release 2023-11-20 14:02:23 +00:00
Dan Brown
d8383cfa80 Updated version and assets for release v23.10.2 2023-11-07 15:22:34 +00:00
Dan Brown
4626278447 Merge branch 'development' into release 2023-11-07 15:22:11 +00:00
Dan Brown
c61af9c22b Updated version and assets for release v23.10.1 2023-11-02 14:44:53 +00:00
Dan Brown
72521d0906 Merge branch 'development' into release 2023-11-02 14:35:49 +00:00
Dan Brown
7e44b195c5 Updated version and assets for release v23.10 2023-10-30 12:15:59 +00:00
Dan Brown
5b45eac5e1 Merge branch 'development' into release 2023-10-30 12:14:23 +00:00
Dan Brown
c1d30341e7 Updated version and assets for release v23.08.3 2023-09-15 13:49:40 +01:00
Dan Brown
80d2b4913b Merge branch 'v23-08' into release 2023-09-15 13:49:12 +01:00
Dan Brown
3f473528b1 Updated version and assets for release v23.08.2 2023-09-04 12:06:50 +01:00
Dan Brown
d0dcd4f61b Merge branch 'development' into release 2023-09-04 12:06:15 +01:00
Dan Brown
bde66a1396 Updated version and assets for release v23.08.1 2023-09-03 17:40:19 +01:00
Dan Brown
4de5a2d9bf Merge branch 'development' into release 2023-09-03 17:39:56 +01:00
Dan Brown
27bf4299cf Updated version and assets for release v23.08 2023-08-30 12:38:48 +01:00
Dan Brown
164f01bb25 Merge branch 'development' into release 2023-08-30 12:38:22 +01:00
Dan Brown
f563a005f5 Updated version and assets for release v23.06.2 2023-07-12 22:34:25 +01:00
Dan Brown
a14d8e30cc Merge branch 'development' into release 2023-07-12 22:34:15 +01:00
Dan Brown
a9194ffb63 Updated version and assets for release v23.06.1 2023-07-05 13:04:51 +01:00
Dan Brown
2f9c1b7127 Merge branch 'development' into release 2023-07-05 13:04:30 +01:00
Dan Brown
bbea76668b Updated version and assets for release v23.06 2023-06-30 11:06:19 +01:00
Dan Brown
becc630acf Merge branch 'development' into release 2023-06-30 11:05:57 +01:00
Dan Brown
4ac8ecad6b Updated version and assets for release v23.05.2 2023-05-23 12:36:46 +01:00
Dan Brown
903e88c700 Merge branch 'development' into release 2023-05-23 12:36:29 +01:00
Dan Brown
ed96aa820e Updated version and assets for release v23.05.1 2023-05-08 16:05:50 +01:00
Dan Brown
63ec079b7b Merge branch 'development' into release 2023-05-08 16:04:51 +01:00
Dan Brown
d485fcb3db Updated version and assets for release v23.05 2023-05-03 11:05:33 +01:00
Dan Brown
0f895668a4 Merge branch 'development' into release 2023-05-03 11:03:29 +01:00
Dan Brown
6c577ac3bf Updated version and assets for release v23.02.3 2023-04-07 18:07:32 +01:00
Dan Brown
31cc2423d2 Merge branch 'v23.02-branch' into release 2023-04-07 18:07:09 +01:00
Dan Brown
c9ed32e518 Updated version and assets for release v23.02.2 2023-03-25 12:27:32 +00:00
Dan Brown
6b4c3a0969 Merge branch 'v23.02-branch' into release 2023-03-25 12:27:05 +00:00
Dan Brown
2dad92d1bd Updated version and assets for release v23.02.1 2023-02-27 19:26:13 +00:00
Dan Brown
c1fb7ab7dc Merge branch 'development' into release 2023-02-27 19:23:33 +00:00
Dan Brown
98315f3899 Updated version and assets for release v23.02 2023-02-26 11:03:49 +00:00
Dan Brown
8c82aaabd6 Merge branch 'development' into release 2023-02-26 11:02:56 +00:00
Dan Brown
ce9b536b78 Updated version and assets for release v23.01.1 2023-02-02 12:29:26 +00:00
Dan Brown
d9c50e5bc1 Merge branch 'development' into release 2023-02-02 12:29:07 +00:00
Dan Brown
bf075f7dd8 Updated version and assets for release v23.01 2023-01-31 11:59:51 +00:00
Dan Brown
a4fd673285 Merge branch 'development' into release 2023-01-31 11:59:28 +00:00
Dan Brown
e794c977bc Updated version and assets for release v22.11.1 2022-12-16 23:49:14 +00:00
Dan Brown
0b088ef1d3 Merge branch 'development' into release 2022-12-16 23:48:35 +00:00
Dan Brown
bf6a6af683 Updated version and assets for release v22.11 2022-11-30 12:30:21 +00:00
Dan Brown
914790fd99 Merge branch 'development' into release 2022-11-30 12:29:52 +00:00
Dan Brown
edb0c6a9e8 Updated version and assets for release v22.10.2 2022-11-02 15:22:13 +00:00
Dan Brown
84049de696 Merge branch 'v22-10' into release 2022-11-02 15:19:33 +00:00
Dan Brown
da0531e63b Updated version and assets for release v22.10.1 2022-10-21 21:52:32 +01:00
Dan Brown
421dc75f4e Merge branch 'development' into release 2022-10-21 21:52:16 +01:00
Dan Brown
8ae91df038 Updated version and assets for release v22.10 2022-10-21 11:16:45 +01:00
Dan Brown
64b41dd626 Merge branch 'development' into release 2022-10-21 11:16:25 +01:00
Dan Brown
ebd6e4d3a2 Updated version and assets for release v22.09.1 2022-09-20 13:19:34 +01:00
Dan Brown
80374aea5c Merge branch 'development' into release 2022-09-20 13:19:03 +01:00
Dan Brown
2ac9efae7d Updated version and assets for release v22.09 2022-09-08 12:41:09 +01:00
Dan Brown
a11d565ba4 Merge branch 'development' into release 2022-09-08 12:40:57 +01:00
Dan Brown
1fdf854ea7 Updated version and assets for release v22.07.3 2022-08-11 15:17:06 +01:00
Dan Brown
e9c9792cb9 Merge branch 'development' into release 2022-08-11 15:16:34 +01:00
Dan Brown
5ae524c25a Updated version and assets for release v22.07.2 2022-08-09 13:55:52 +01:00
Dan Brown
0d7287fc8b Merge branch 'development' into release 2022-08-09 13:55:40 +01:00
Dan Brown
e77c96f6b7 Updated version and assets for release v22.07.1 2022-08-02 11:47:25 +01:00
Dan Brown
9b8a10dd3a Merge branch 'development' into release 2022-08-02 11:47:08 +01:00
Dan Brown
49200ca5ce Updated version and assets for release v22.07 2022-07-28 14:53:15 +01:00
Dan Brown
34aa4dbf10 Merge branch 'development' into release 2022-07-28 14:53:01 +01:00
Dan Brown
5ee79d16c9 Updated version and assets for release v22.06.2 2022-06-28 11:57:37 +01:00
Dan Brown
a1ea4006e0 Merge branch 'development' into release 2022-06-28 11:57:24 +01:00
Dan Brown
9078188939 Updated version and assets for release v22.06.1 2022-06-25 14:33:07 +01:00
Dan Brown
ed0aad1a7a Merge branch 'development' into release 2022-06-25 14:32:49 +01:00
Dan Brown
5c59cfb020 Updated version and assets for release v22.06 2022-06-24 11:50:56 +01:00
Dan Brown
3ca15ad68a Merge branch 'development' into release 2022-06-24 11:45:29 +01:00
Dan Brown
60014989f5 Updated version and assets for release v22.04.2 2022-05-09 16:10:16 +01:00
Dan Brown
57b10f195e Merge branch 'development' into release 2022-05-09 16:09:54 +01:00
Dan Brown
b1e95eb39f Updated version and assets for release v22.04.1 2022-05-04 21:26:58 +01:00
Dan Brown
b3da77b8f9 Merge branch 'development' into release 2022-05-04 21:26:31 +01:00
Dan Brown
1a345b74bb Updated version and assets for release v22.04 2022-04-29 15:55:32 +01:00
Dan Brown
8ffc3a4abf Merge branch 'development' into release 2022-04-29 15:55:05 +01:00
Dan Brown
7233c1c7b2 Updated version and assets for release v22.03.1 2022-03-30 19:37:07 +01:00
Dan Brown
1309a01131 Merge branch 'development' into release 2022-03-30 19:36:45 +01:00
Dan Brown
0333185b6d Updated version and assets for release v22.03 2022-03-30 13:49:17 +01:00
Dan Brown
83f89f64e8 Merge branch 'development' into release 2022-03-30 13:49:05 +01:00
Dan Brown
11a1a6fb16 Updated version and assets for release v22.02.3 2022-03-07 15:12:22 +00:00
Dan Brown
882c609296 Merge branch 'development' into release 2022-03-07 15:12:09 +00:00
Dan Brown
176a0dcd59 Updated version and assets for release v22.02.2 2022-03-01 22:45:41 +00:00
Dan Brown
94b0f70bfa Merge branch 'development' into release 2022-03-01 22:45:12 +00:00
Dan Brown
08b2a77d41 Updated version and assets for release v22.02.1 2022-02-27 17:46:06 +00:00
Dan Brown
3e8e9a23cf Merge branch 'development' into release 2022-02-27 17:45:49 +00:00
Dan Brown
58b83b64c8 Updated version and assets for release v22.02 2022-02-26 12:01:44 +00:00
Dan Brown
dfe4cde6ee Merge branch 'development' into release 2022-02-26 12:00:46 +00:00
Dan Brown
d11144d9e2 Updated version and assets for release v21.12.5 2022-02-06 15:49:23 +00:00
Dan Brown
f96b0ea5f3 Merge branch 'development' into release 2022-02-06 15:48:55 +00:00
Dan Brown
815f8d79ed Updated version and assets for release v21.12.4 2022-02-01 11:52:24 +00:00
Dan Brown
b62dab32e0 Merge branch 'development' into release 2022-02-01 11:51:48 +00:00
Dan Brown
262f863981 Updated version and assets for release v21.12.3 2022-01-24 22:49:42 +00:00
Dan Brown
a4c94390a1 Merge branch 'master' into release 2022-01-24 22:49:31 +00:00
Dan Brown
53f3cca85d Updated version and assets for release v21.12.2 2022-01-10 18:23:44 +00:00
Dan Brown
ed08bbcecc Merge branch 'master' into release 2022-01-10 18:23:19 +00:00
Dan Brown
de97ebf9b7 Updated version and assets for release v21.12.1 2022-01-06 12:20:37 +00:00
Dan Brown
f492a660a8 Merge branch 'master' into release 2022-01-06 12:20:26 +00:00
Dan Brown
09436836a5 Updated version and assets for release v21.12 2021-12-22 17:04:18 +00:00
Dan Brown
bb455d7788 Merge branch 'master' into release 2021-12-22 17:03:50 +00:00
Dan Brown
009212ab80 Updated version and assets for release v21.11.3 2021-12-15 14:08:37 +00:00
Dan Brown
ba9cb591c8 Merge branch 'master' into release 2021-12-15 14:08:17 +00:00
Dan Brown
d00ac2f34e Updated version and assets for release v21.11.2 2021-11-30 14:30:19 +00:00
Dan Brown
bd4dc6d463 Merge branch 'master' into release 2021-11-30 14:29:53 +00:00
Dan Brown
d91180a909 Updated version and assets for release v21.11.1 2021-11-23 20:44:36 +00:00
Dan Brown
bc2913a5cb Merge branch 'master' into release 2021-11-23 20:44:12 +00:00
Dan Brown
4802394562 Updated version and assets for release v21.11 2021-11-16 13:22:24 +00:00
Dan Brown
1755556468 Merge branch 'master' into release 2021-11-16 13:21:44 +00:00
Dan Brown
01cdbdb7ae Updated version and assets for release v21.10.3 2021-11-01 13:31:10 +00:00
Dan Brown
fc8bbf3eab Merge branch 'master' into release 2021-11-01 13:30:36 +00:00
Dan Brown
3cdab19319 Updated version and assets for release v21.10.2 2021-10-28 15:57:04 +01:00
Dan Brown
5661d20e87 Merge branch 'master' into release 2021-10-28 15:56:49 +01:00
Dan Brown
91f80123e8 Merge branch 'master' into release 2021-10-27 12:35:00 +01:00
Dan Brown
7a0636d0f8 Updated version and assets for release v21.10.1 2021-10-27 12:31:40 +01:00
Dan Brown
0fe5bdfbac Updated version and assets for release v21.10 2021-10-25 15:59:23 +01:00
Dan Brown
f88687e977 Merge branch 'master' into release 2021-10-25 15:58:59 +01:00
Dan Brown
68d437d05b Updated version and assets for release v21.08.6 2021-10-15 14:34:44 +01:00
Dan Brown
1e56aaea04 Merge branch 'master' into release 2021-10-15 14:34:23 +01:00
Dan Brown
dab170a6fe Updated version and assets for release v21.08.5 2021-10-08 22:25:36 +01:00
Dan Brown
a8de717d9b Merge branch 'master' into release 2021-10-08 22:25:05 +01:00
Dan Brown
78fe95b6fc Updated version and assets for release v21.08.4 2021-10-04 16:25:24 +01:00
Dan Brown
e0c24e41aa Merge branch 'master' into release 2021-10-04 16:24:54 +01:00
Dan Brown
fa8553839b Updated version and assets for release v21.08.3 2021-09-12 16:31:02 +01:00
Dan Brown
b8fcefc794 Merge branch 'master' into release 2021-09-12 16:30:35 +01:00
Dan Brown
88bcb68fcb Updated version and assets for release v21.08.2 2021-09-04 15:07:20 +01:00
Dan Brown
7c000553ae Merge branch 'master' into release 2021-09-04 15:06:33 +01:00
Dan Brown
391fa35c80 Updated version and assets for release v21.08.1 2021-09-02 21:13:09 +01:00
Dan Brown
c6773a8c9f Merge branch 'master' into release 2021-09-02 21:12:06 +01:00
Dan Brown
9b226e7d39 Updated version and assets for release v21.08 2021-08-31 22:07:53 +01:00
Dan Brown
9865446267 Merge branch 'master' into release 2021-08-31 22:07:23 +01:00
Dan Brown
926abbe776 Updated version and assets for release v21.05.4 2021-08-04 21:29:10 +01:00
Dan Brown
4fabef3a57 Merge branch 'v21.05.x' into release 2021-08-04 21:28:45 +01:00
Dan Brown
5ef4cd80c3 Updated version and assets for release v21.05.3 2021-07-03 11:59:52 +01:00
Dan Brown
e01f23583f Merge branch 'v21.05.x' into release 2021-07-03 11:59:21 +01:00
Dan Brown
7792cb3915 Updated version and assets for release v21.05.2 2021-06-13 14:26:34 +01:00
Dan Brown
be26253a18 Merge branch 'master' into release 2021-06-13 14:25:39 +01:00
Dan Brown
1bdd1f8189 Updated version for release v21.05.1 2021-06-04 23:09:42 +01:00
Dan Brown
fa62c79b17 Merge branch 'master' into release 2021-06-04 23:08:59 +01:00
Dan Brown
d7d8fa1e5b Updated version and assets for release v21.05 2021-05-30 16:17:56 +01:00
Dan Brown
18562f1e10 Merge branch 'master' into release 2021-05-30 16:17:44 +01:00
Dan Brown
86090a694f Updated version and assets for release v21.04.6 2021-05-24 13:06:03 +01:00
Dan Brown
1ee8287c73 Merge branch 'v21.04.x' into release 2021-05-24 13:05:34 +01:00
Dan Brown
8eb98cd591 Updated version and assets for release v21.04.5 2021-05-15 17:56:29 +01:00
Dan Brown
0f9ba21b05 Merge branch 'v21.04.x' into release 2021-05-15 17:56:03 +01:00
Dan Brown
834f8e7046 Updated version and assets for release v21.04.4 2021-05-09 14:46:05 +01:00
Dan Brown
32e3399334 Merge branch 'master' into release 2021-05-09 14:45:36 +01:00
Dan Brown
2d8698a218 Updated version and assets for release v21.04.3 2021-04-27 22:01:37 +01:00
Dan Brown
454fb883a2 Merge branch 'master' into release 2021-04-27 22:01:15 +01:00
Dan Brown
6f4a6ab8ea Updated version for release v21.04.2 2021-04-20 22:37:05 +01:00
Dan Brown
9c4b6f36f1 Merge branch 'master' into release 2021-04-20 22:36:35 +01:00
Dan Brown
78886b1e67 Updated version and assets for release v21.04.1 2021-04-19 22:26:19 +01:00
Dan Brown
d9debaf032 Merge branch 'master' into release 2021-04-19 22:25:29 +01:00
Dan Brown
d4360d6347 Updated version and assets for release v21.04 2021-04-09 21:18:32 +01:00
Dan Brown
175b1785c0 Merge branch 'master' into release 2021-04-09 21:18:09 +01:00
Dan Brown
c8740c0171 Updated version for release v0.31.8 2021-03-13 15:32:54 +00:00
Dan Brown
91ee895a74 Merge branch 'v0.31.x' into release 2021-03-13 15:32:06 +00:00
Dan Brown
a045e46571 Updated version for release v0.31.7 2021-03-02 21:19:17 +00:00
Dan Brown
44eaa65c3b Merge branch 'v0.31.x' into release 2021-03-02 21:18:31 +00:00
Dan Brown
0a22af7b14 Updated version for release v0.31.6 2021-02-06 14:41:19 +00:00
Dan Brown
b54702ab08 Merge branch 'v0.31.x' into release 2021-02-06 14:40:47 +00:00
Dan Brown
c4fdcfc5d1 Updated version for release v0.31.5 2021-02-02 20:58:06 +00:00
Dan Brown
cb8117e8df Merge branch 'v0.31.x' into release 2021-02-02 20:57:41 +00:00
Dan Brown
5a218d5056 Updated version and assets for release v0.31.4 2021-01-16 17:50:45 +00:00
Dan Brown
8dbc5cf9c6 Merge branch 'master' into release 2021-01-16 17:50:11 +00:00
Dan Brown
71e81615a3 Updated version for release v0.31.3 2021-01-10 23:29:58 +00:00
Dan Brown
611d37da04 Merge branch 'master' into release 2021-01-10 23:29:11 +00:00
Dan Brown
0e799a3857 Updated version and assets for release v0.31.2 2021-01-10 14:05:16 +00:00
Dan Brown
b91d6e2bfa Merge branch 'master' into release 2021-01-10 14:04:59 +00:00
Dan Brown
ea16ad7e94 Updated version and assets for release v0.31.1 2021-01-04 18:41:55 +00:00
Dan Brown
ba6eb54552 Merge branch 'master' into release 2021-01-04 18:41:26 +00:00
Dan Brown
f705e7683b Updated assets for release v0.31.0 again 2021-01-03 22:33:36 +00:00
Dan Brown
dc996adb20 Merge branch 'master' into release 2021-01-03 22:32:40 +00:00
Dan Brown
a64c638ccc Updated version and assets for release v0.31.0 2021-01-03 21:52:37 +00:00
Dan Brown
359c067279 Merge branch 'master' into release 2021-01-03 21:52:00 +00:00
Dan Brown
66a746e297 Updated version for release v0.30.7 2020-12-18 14:13:40 +00:00
Dan Brown
a4d43ee24b Merge branch 'v0.30.x' into release 2020-12-18 14:13:19 +00:00
Dan Brown
f7793a70a9 Updated version for release v0.30.6 2020-12-17 21:07:06 +00:00
Dan Brown
ceba3d31fb Merge branch 'v0.30.x' into release 2020-12-17 21:03:20 +00:00
Dan Brown
eecc08edde Updated version for release v0.30.5 2020-12-06 21:05:43 +00:00
Dan Brown
eb19aadc75 Merge branch 'v0.30.x' into release 2020-12-06 21:05:11 +00:00
Dan Brown
06c81e69b9 Updated version and assets for release v0.30.4 2020-10-31 16:52:33 +00:00
Dan Brown
3dc3d4a639 Merge branch 'master' into release 2020-10-31 16:51:54 +00:00
Dan Brown
94c59c1e3d Updated version and assets for release v0.30.3 2020-10-13 22:50:52 +01:00
Dan Brown
4d2205853a Merge branch 'master' into release 2020-10-13 22:50:30 +01:00
Dan Brown
751772b87a Updated version and assets for release v0.30.2 2020-09-30 22:44:58 +01:00
Dan Brown
76e30869e1 Merge branch 'master' into release 2020-09-30 22:44:17 +01:00
Dan Brown
3edc9fe9eb Updated version and assets for release v0.30.1 2020-09-26 17:51:37 +01:00
Dan Brown
616c62703e Merge branch 'master' into release 2020-09-26 17:50:25 +01:00
Dan Brown
ecd56917e7 Updated version and assets for release v0.30.0 2020-09-20 10:33:18 +01:00
Dan Brown
e22c9cae91 Merge branch 'master' into release 2020-09-20 10:30:10 +01:00
Dan Brown
29ddb6e1b9 Updated version and assets for release v0.29.3 2020-05-12 22:34:01 +01:00
Dan Brown
2ff90e2ff0 Merge branch 'master' into release 2020-05-12 22:33:27 +01:00
Dan Brown
04ecc128a2 Updated version and assets for release v0.29.2 2020-05-02 11:49:21 +01:00
Dan Brown
87d1d3423b Merge branch 'master' into release 2020-05-02 11:48:48 +01:00
Dan Brown
4818192a2a Updated version and assets for release v0.29.1 2020-04-28 12:30:31 +01:00
Dan Brown
965dd97f54 Merge branch 'master' into release 2020-04-28 12:30:09 +01:00
Dan Brown
195b74926c Updated version and assets for release v0.29.0 2020-04-13 16:10:23 +01:00
Dan Brown
2120db12b2 Merge branch 'master' into release 2020-04-13 16:10:11 +01:00
Dan Brown
ed563fef28 Updated version and assets for release v0.28.3 2020-03-14 22:31:42 +00:00
Dan Brown
0d31a8e3f1 Merge branch 'master' into release 2020-03-14 22:31:11 +00:00
Dan Brown
b8354b974b Updated version and assets for release v0.28.2 2020-02-15 22:36:08 +00:00
Dan Brown
034c1e289d Merge branch 'master' into release 2020-02-15 22:35:46 +00:00
Dan Brown
f31605a3de Updated version and assets for release v0.28.1 2020-02-15 22:08:06 +00:00
Dan Brown
e7cc75c74d Merge branch 'master' into release 2020-02-15 22:07:17 +00:00
Dan Brown
4b79d5e4e8 Updated version and assets for release v0.28.0 2020-02-03 22:44:45 +00:00
Dan Brown
34854915b3 Merge branch 'master' into release 2020-02-03 22:43:58 +00:00
Dan Brown
af6f34b529 Updated version and assets for release v0.27.5 2019-10-16 16:35:50 +01:00
Dan Brown
fb82a2b896 Merge branch 'patching-v0.27' into release 2019-10-16 16:35:10 +01:00
Dan Brown
5b464938b6 Updated version and assets for release v0.27.4 2019-09-07 13:30:08 +01:00
Dan Brown
81f954890d Merge branch 'patching-v0.27' into release 2019-09-07 13:29:53 +01:00
Dan Brown
0e2bbcec62 Updated version and assets for release v0.27.3 2019-09-03 21:50:12 +01:00
Dan Brown
fdd339f525 Merge branch 'master' into release 2019-09-03 21:49:46 +01:00
Dan Brown
8cf7d6a83d Updated version and assets for release v0.27.2 2019-09-01 12:12:23 +01:00
Dan Brown
58a5008718 Merge branch 'master' into release 2019-09-01 12:12:10 +01:00
Dan Brown
c44a8df55d Updated version and assets for release v0.27.1 2019-09-01 11:13:50 +01:00
Dan Brown
ff1494c519 Merge branch 'master' into release 2019-09-01 11:13:18 +01:00
Dan Brown
b8ce8fd852 Updated assets for release v0.27 2019-08-31 14:16:14 +01:00
Dan Brown
75e7454a5f Merge branch 'master' into release and set version 2019-08-31 14:15:18 +01:00
Dan Brown
2558ea8931 Updated version for release v0.26.4 2019-08-06 21:42:09 +01:00
Dan Brown
ac0f47a4b2 Merge branch 'v0.26' into release 2019-08-06 21:41:06 +01:00
Dan Brown
4f16129869 Updated version for release v0.26.3 2019-07-10 20:21:22 +01:00
Dan Brown
64a8037fdd Merge branch 'v0.26' into release 2019-07-10 20:19:54 +01:00
Dan Brown
7502ba1bc8 Updated version and assets for release v0.26.2 2019-05-27 13:48:20 +01:00
Dan Brown
33a04697ef Merge branch 'master' into release 2019-05-27 13:47:47 +01:00
Dan Brown
b70a5c0cdb Updated version and assets for release v0.26.1 2019-05-07 23:05:47 +01:00
Dan Brown
9443ae9f40 Merge branch 'master' into release 2019-05-07 23:05:10 +01:00
Dan Brown
220c2a4102 Updated version and assets for release v0.26.0 2019-05-06 18:58:56 +01:00
Dan Brown
e9914eb301 Merge branch 'master' into release 2019-05-06 18:57:58 +01:00
Dan Brown
934512d09c Updated version and assets for release v0.25.5 2019-03-24 19:45:17 +00:00
Dan Brown
9102c90986 Merge branch 'master' into release 2019-03-24 19:45:00 +00:00
Dan Brown
c3e74219c4 Updated version and assets for release v0.25.4 2019-03-21 19:46:19 +00:00
Dan Brown
13c9d7bc2d Merge branch 'master' into release 2019-03-21 19:43:48 +00:00
Dan Brown
119b539586 Updated version and assets for release v0.25.3 2019-03-21 00:03:26 +00:00
Dan Brown
29a5c180f0 Merge branch 'master' into release 2019-03-21 00:02:33 +00:00
Dan Brown
7906602291 Updated version and assets for release v0.25.2 2019-03-10 13:45:21 +00:00
Dan Brown
6dafe773ff Merge branch 'master' into release 2019-03-10 13:44:29 +00:00
Dan Brown
25bc28a1be Updated version and assets for release v0.25.1 2019-01-20 15:42:32 +00:00
Dan Brown
4c561c7fa0 Merge branch 'master' into release 2019-01-20 15:41:24 +00:00
Dan Brown
95b3e78573 Updated version and assets for release v0.25.0 2019-01-12 22:48:53 +00:00
Dan Brown
63a345bc93 Merge branch 'master' into release 2019-01-12 22:47:07 +00:00
Dan Brown
e093a172cb Updated assets and version for release v0.24.3 2018-11-27 21:52:20 +00:00
Dan Brown
4b01f8934b Merge branch 'master' into release 2018-11-27 21:51:32 +00:00
Dan Brown
bc116b45b5 Re-updated assets for release v0.24.2 2018-11-10 16:10:22 +00:00
Dan Brown
a059960b9e Merge branch 'master' into release 2018-11-10 16:09:14 +00:00
Dan Brown
7770966fed Updated assets for release v0.24.2 2018-11-10 16:01:55 +00:00
Dan Brown
d7adcf6c69 Merge branch 'master' into release 2018-11-10 16:01:01 +00:00
Dan Brown
04a364dcc3 Incremented version for v0.24.1 2018-09-24 16:34:16 +01:00
Dan Brown
db83ac7eaa Merge branch 'master' into release 2018-09-24 16:32:30 +01:00
Dan Brown
3ca9dddf61 Merge branch 'master' into release 2018-09-24 15:59:39 +01:00
Dan Brown
bf74f53ca7 Updated assets for release and incremented version 2018-09-24 12:18:27 +01:00
Dan Brown
9d67efb4a4 Merge branch 'master' into release 2018-09-24 12:08:21 +01:00
Dan Brown
3a39b9f440 Merge pull request #1022 from BookStackApp/revert-983-master
Revert "Update german translation"
2018-09-22 18:33:29 +01:00
Dan Brown
27f7aab375 Revert "Update german translation" 2018-09-22 18:33:15 +01:00
Dan Brown
337da0c467 Merge pull request #983 from vriic/master
Update german translation
2018-09-22 18:27:04 +01:00
Nikolai Nikolajevic
f56b3560c4 Update german translation 2018-08-23 16:17:46 +02:00
Dan Brown
02dfe11ce6 Increment version for release v0.23.2 2018-08-19 15:33:23 +01:00
Dan Brown
83d06beb70 Merge branch 'master' into release 2018-08-19 15:33:10 +01:00
Dan Brown
a8cfc059c8 Updated version for release v0.23.1 2018-08-12 14:22:53 +01:00
Dan Brown
1614b2bab0 Merge branch 'master' into release 2018-08-12 14:22:17 +01:00
Dan Brown
4bdec0d214 Updated version and assets for release v0.23 2018-07-29 20:28:49 +01:00
Dan Brown
6a7d7e7c2b Merge branch 'master' into release 2018-07-29 20:26:00 +01:00
Dan Brown
30d4674657 Updated assets for release v0.22 2018-05-28 14:19:14 +01:00
Dan Brown
9f961f95f8 Merge branch 'master' into release 2018-05-28 14:19:04 +01:00
Dan Brown
bab99a26ec Updated assets and version for v0.21 release 2018-04-22 20:21:22 +01:00
Dan Brown
9a7fecd269 Merge branch 'master' into release 2018-04-22 20:19:02 +01:00
Dan Brown
a8dc0d449b Updated the version because i'm such a plonker
And forgot to do this last release.
I wonder if there's a simple commit hook that could prevent the same two
versions twice in a row?
2018-03-30 15:41:46 +01:00
Dan Brown
a0381f76bf Merge branch 'v0.20' into release 2018-03-30 15:33:23 +01:00
Dan Brown
6102f66daa Updated assets for release v0.20.1 2018-03-25 16:58:14 +01:00
Dan Brown
c6134d162d Merge branch 'master' into release 2018-03-25 16:54:48 +01:00
Dan Brown
2046f9b9de Updated assets for release v0.20.0 2018-02-11 18:20:17 +00:00
Dan Brown
ac3ba594a4 Merge branch 'master' into release and updated version 2018-02-11 18:19:38 +00:00
Dan Brown
22df25a480 Updated assets and version for v0.19.0 2017-12-10 18:21:07 +00:00
Dan Brown
8b30c7f02e Merge branch 'master' into release 2017-12-10 18:19:20 +00:00
Dan Brown
757cdddc7c Updated version and JS for release v0.18.5 2017-11-11 18:33:04 +00:00
Dan Brown
df95e99680 Updated assets and version for release v0.18.4 2017-10-15 19:28:29 +01:00
Dan Brown
5a6d544db7 Merge branch 'master' into release 2017-10-15 19:27:50 +01:00
Dan Brown
16117d329c Merge branch 'master' into release, Updated version 2017-10-06 21:05:45 +01:00
Dan Brown
e90da18ada Updated assets and version for v0.18.2 release 2017-10-01 18:12:59 +01:00
Dan Brown
a08d80e1cc Merge branch 'master' into release 2017-10-01 18:12:07 +01:00
Dan Brown
6258175922 Updated assets and version for v0.18.1 release 2017-09-20 21:36:17 +01:00
Dan Brown
15736777a0 Merge branch 'master' into release 2017-09-20 21:35:33 +01:00
Dan Brown
75915e8a94 Updated assets for release v0.18 2017-09-10 17:07:57 +01:00
Dan Brown
9bde0ae4ea Merge branch 'master' into release 2017-09-10 17:05:05 +01:00
Dan Brown
0c802d1f86 Updated assets and version for release v0.17.4 2017-07-28 13:04:21 +01:00
Dan Brown
b7a96c6466 Merge branch 'master' into release 2017-07-28 13:03:36 +01:00
Dan Brown
4b645a82c7 Updated version for release 2017-07-22 17:27:01 +01:00
Dan Brown
d599b77b6f Merge branch 'master' into release 2017-07-22 17:26:44 +01:00
Dan Brown
26e93dc8c1 Updated assets and version for release v0.17.2 2017-07-22 16:49:07 +01:00
Dan Brown
a4c9a8491b Merge branch 'master' into release 2017-07-22 16:46:57 +01:00
Dan Brown
70ee636d87 Updated css and version for release 2017-07-10 20:52:32 +01:00
Dan Brown
b35f6dbb03 Merge branch 'master' into release 2017-07-10 20:51:25 +01:00
Dan Brown
67d9e24d8f Merge branch 'master' into release
Also updated assets, Version number
2017-07-02 22:52:26 +01:00
Dan Brown
3903fda6ca Incremented version 2017-06-04 15:38:49 +01:00
Dan Brown
441e46ebaa Merge branch 'v0.16' into release 2017-06-04 15:38:29 +01:00
Dan Brown
1f4260f359 Updated version for release v0.16.2 2017-05-07 19:35:51 +01:00
Dan Brown
dc0bf8ad4e Merge branch 'master' into release 2017-05-07 19:35:34 +01:00
Dan Brown
102e326e6a Updated JS and version for release v0.16.1 2017-04-30 19:51:23 +01:00
Dan Brown
2b25bf6f3b Merge branch 'master' into release 2017-04-30 19:50:29 +01:00
Dan Brown
f93280696d Updated assets for release v0.16 2017-04-23 20:42:28 +01:00
Dan Brown
1787391b07 Merge branch 'master' into release 2017-04-23 20:41:45 +01:00
Dan Brown
a74a8ee483 Updated version for v0.15.3 2017-03-23 22:22:16 +00:00
Dan Brown
7fa5405cb7 Merge branch 'master' into release 2017-03-23 22:21:04 +00:00
Dan Brown
6725ddcc41 Updated version for release v0.15.2 2017-03-05 15:50:52 +00:00
Dan Brown
bce941db3f Merge branch 'master' into release 2017-03-05 15:49:47 +00:00
Dan Brown
6d926048ec Updated to version v0.15.1 2017-02-27 16:59:10 +00:00
Dan Brown
5335c973b4 Merge branch 'master' into release 2017-02-27 16:58:20 +00:00
Dan Brown
15c3e5c96e Updated assets for release v0.15 2017-02-27 14:58:02 +00:00
Dan Brown
a5d5904969 Merge branch 'master' into release 2017-02-27 14:57:38 +00:00
Dan Brown
598758b991 Updated version for v0.14.3 2017-02-05 21:23:27 +00:00
Dan Brown
9926e23bc8 Merge branch 'v0.14' into release 2017-02-05 21:21:54 +00:00
Dan Brown
5d3264bc63 Updated assets for release v0.14.2 2017-02-01 22:27:04 +00:00
Dan Brown
d71f819f95 Merge branch 'v0.14' into release 2017-02-01 22:22:38 +00:00
Dan Brown
ee13509760 Updated version number 2017-01-23 22:28:31 +00:00
Dan Brown
82d7bb1f32 Merge branch 'master' into release 2017-01-23 22:28:02 +00:00
Dan Brown
cdfda508d8 Updated assets for release v0.14 2017-01-22 12:36:10 +00:00
Dan Brown
da941e584f Merge branch 'master' into release ready for v0.14 2017-01-22 12:31:27 +00:00
Dan Brown
65874d7b96 Updated assets for release v0.13.1 2016-11-27 19:42:33 +00:00
Dan Brown
ac9b8f405c Merge fixes from master for release v0.13.1 2016-11-27 19:41:12 +00:00
Dan Brown
8d1419a12e Update assets and version for release v0.13 2016-11-13 12:29:52 +00:00
Dan Brown
04f7a7d301 Merge branch 'master' into release 2016-11-13 12:26:56 +00:00
Dan Brown
c10d2a1493 Updated assets for release v0.12.2 2016-10-30 13:19:19 +00:00
Dan Brown
97bbf79ffd Merge branch 'v0.12' into release 2016-10-30 13:18:23 +00:00
Dan Brown
f7b01ae53d Updated assets for release v0.12.1 2016-09-06 20:50:15 +01:00
Dan Brown
d704e1dbba Merge branch 'master' into release 2016-09-06 20:49:15 +01:00
Dan Brown
ef2ff5e093 Updated assets for release v0.12 2016-09-05 19:49:42 +01:00
Dan Brown
7caed3b0db Merge branch 'master' into release 2016-09-05 19:35:21 +01:00
Dan Brown
45641d0754 Updated assets for release v0.11.2 2016-08-21 14:56:29 +01:00
Dan Brown
4b1d08ba99 Merge branch 'v0.11' into release 2016-08-21 14:55:11 +01:00
Dan Brown
160fa99ba4 Updated assets for release v0.11.1 2016-08-14 12:40:55 +01:00
Dan Brown
d2a5ab49ed Merge branch 'v0.11' into release 2016-08-14 12:37:48 +01:00
Dan Brown
c6404d8917 Updated assets for release v0.11 2016-07-03 10:56:16 +01:00
Dan Brown
7113807f12 Merge branch 'master' into release 2016-07-03 10:52:04 +01:00
Dan Brown
be711215e8 Updated assets for release v0.10 2016-05-22 15:12:47 +01:00
Dan Brown
7e3b404240 Merge branch 'master' into release for version v0.10 2016-05-22 15:11:50 +01:00
Dan Brown
e86901ca20 Updated assets for release v0.9.3 2016-05-03 21:13:02 +01:00
Dan Brown
bdfa61c8b2 Merge branch 'v0.9' into release 2016-05-03 21:11:01 +01:00
Dan Brown
2cc36787f5 Updated assets for release 0.9.2 2016-04-15 19:57:02 +01:00
Dan Brown
448ac61b48 Merge branch 'master' into release 2016-04-15 19:52:59 +01:00
Dan Brown
753f6394f7 Merge branch 'master' into release 2016-04-12 20:09:14 +01:00
Dan Brown
b1faf65934 Updated assets for release 0.9.0 2016-04-09 15:49:02 +01:00
Dan Brown
09f478bd74 Merge branch 'master' into release 2016-04-09 15:47:14 +01:00
Dan Brown
a0497feddd Updated assets for release 0.8.2 2016-03-30 21:44:30 +01:00
Dan Brown
789693bde9 Merge branch 'v0.8' into release 2016-03-30 21:32:46 +01:00
Dan Brown
1fe933e4ea Merge branch 'master' into release 2016-03-13 15:38:06 +00:00
Dan Brown
724b4b5a70 Updated assets for release 0.8.0 2016-03-13 15:15:14 +00:00
Dan Brown
1778a56146 Merge branch 'master' into release 2016-03-13 15:13:23 +00:00
Dan Brown
744865fcb2 Updated assets for release 0.7.6 2016-03-06 13:28:44 +00:00
Dan Brown
7f8c8b448d Merged branch master into release 2016-03-06 13:26:29 +00:00
Dan Brown
a67c53826d Updated assets for release 0.7.5 2016-02-25 21:24:09 +00:00
Dan Brown
14b131e850 Merge branch 'master' into release 2016-02-25 21:23:06 +00:00
Dan Brown
9b55a52b85 Updated assets for release 0.7.4 2016-02-11 22:35:01 +00:00
Dan Brown
db1d10e80f Merge branch 'master' into release 2016-02-11 22:29:29 +00:00
Dan Brown
1be576966f Updated assets for release 0.7.3 2016-02-08 20:47:33 +00:00
Dan Brown
b97e792c5f Merge branch 'master' into release 2016-02-08 20:45:48 +00:00
Dan Brown
8dec674cc3 Merge branch 'master' into release 2016-02-02 07:35:20 +00:00
Dan Brown
f784c03746 Merge branch 'master' into release 2016-02-01 18:31:04 +00:00
Dan Brown
148e172fe8 Updated assets for release 0.7 2016-01-31 18:03:55 +00:00
Dan Brown
56ae86646f Merge branch 'master' into release 2016-01-31 18:01:25 +00:00
Dan Brown
1d2b6fdfa2 Add updated assets 2016-01-02 14:50:59 +00:00
Dan Brown
4fc75beed4 Merge branch 'master' into release 2016-01-02 14:49:05 +00:00
Dan Brown
3b3bc0c4bf Updated compiled assets 2015-12-31 17:26:22 +00:00
Dan Brown
910faab88e Merge branch 'master' into release 2015-12-31 17:22:03 +00:00
Dan Brown
f184d763ad Added build folder to release 2015-12-16 17:53:53 +00:00
Dan Brown
a91d42634d Merge branch 'master' into release 2015-12-16 17:29:34 +00:00
Dan Brown
f517ef3616 Added new asset structure 2015-12-16 17:27:53 +00:00
Dan Brown
e99507ddcf Merge branch 'master' into release 2015-12-16 17:21:21 +00:00
Dan Brown
d2cacf1945 Release update 2015-12-01 21:30:21 +00:00
Dan Brown
448ac1405b Merge branch 'master' into release 2015-12-01 21:15:08 +00:00
Dan Brown
6ad21ce885 Added built assets for release 2015-11-30 21:59:34 +00:00
34 changed files with 688 additions and 2020 deletions

6
.gitignore vendored
View File

@@ -8,10 +8,10 @@ Homestead.yaml
.idea
npm-debug.log
yarn-error.log
/public/dist
/public/dist/*.map
/public/plugins
/public/css
/public/js
/public/css/*.map
/public/js/*.map
/public/bower
/public/build/
/public/favicon.ico

View File

@@ -4,8 +4,6 @@ namespace BookStack\App\Providers;
use BookStack\Theming\ThemeEvents;
use BookStack\Theming\ThemeService;
use BookStack\Theming\ThemeViews;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class ThemeServiceProvider extends ServiceProvider
@@ -26,23 +24,7 @@ class ThemeServiceProvider extends ServiceProvider
{
// Boot up the theme system
$themeService = $this->app->make(ThemeService::class);
$viewFactory = $this->app->make('view');
if (!$themeService->getTheme()) {
return;
}
$themeService->loadModules();
$themeService->readThemeActions();
$themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);
$themeViews = new ThemeViews();
$themeService->dispatch(ThemeEvents::THEME_REGISTER_VIEWS, $themeViews);
$themeViews->registerViewPathsForTheme($viewFactory->getFinder(), $themeService->getModules());
if ($themeViews->hasRegisteredViews()) {
$viewFactory->share('__themeViews', $themeViews);
Blade::directive('include', function ($expression) {
return "<?php echo \$__themeViews->handleViewInclude({$expression}, array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1])); ?>";
});
}
}
}

View File

@@ -81,7 +81,8 @@ function setting(?string $key = null, mixed $default = null): mixed
/**
* Get a path to a theme resource.
* Returns null if a theme is not configured, and therefore a full path is not available for use.
* Returns null if a theme is not configured and
* therefore a full path is not available for use.
*/
function theme_path(string $path = ''): ?string
{

View File

@@ -8,6 +8,12 @@
* Do not edit this file unless you're happy to maintain any changes yourself.
*/
// Join up possible view locations
$viewPaths = [realpath(base_path('resources/views'))];
if ($theme = env('APP_THEME', false)) {
array_unshift($viewPaths, base_path('themes/' . $theme));
}
return [
// App theme
@@ -20,7 +26,7 @@ return [
// Most templating systems load templates from disk. Here you may specify
// an array of paths that should be checked for your views. Of course
// the usual Laravel view path has already been registered for you.
'paths' => [realpath(base_path('resources/views'))],
'paths' => $viewPaths,
// Compiled View Path
// This option determines where all the compiled Blade templates will be

View File

@@ -1,305 +0,0 @@
<?php
namespace BookStack\Console\Commands;
use BookStack\Http\HttpRequestService;
use BookStack\Theming\ThemeModule;
use BookStack\Theming\ThemeModuleException;
use BookStack\Theming\ThemeModuleManager;
use BookStack\Theming\ThemeModuleZip;
use GuzzleHttp\Psr7\Request;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class InstallModuleCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'bookstack:install-module
{location : The URL or path of the module file}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Install a module to the currently configured theme';
protected array $cleanupActions = [];
/**
* Execute the console command.
*/
public function handle(): int
{
$location = $this->argument('location');
// Get the ZIP file containing the module files
$zipPath = $this->getPathToZip($location);
if (!$zipPath) {
$this->cleanup();
return 1;
}
// Validate module zip file (metadata, size, etc...) and get module instance
$zip = new ThemeModuleZip($zipPath);
$themeModule = $this->validateAndGetModuleInfoFromZip($zip);
if (!$themeModule) {
$this->cleanup();
return 1;
}
// Get the theme folder in use, attempting to create one if no active theme in use
$themeFolder = $this->getThemeFolder();
if (!$themeFolder) {
$this->cleanup();
return 1;
}
// Get the modules folder of the theme, attempting to create it if not existing,
// and create a new module manager instance.
$moduleFolder = $this->getModuleFolder($themeFolder);
if (!$moduleFolder) {
$this->cleanup();
return 1;
}
$manager = new ThemeModuleManager($moduleFolder);
// Handle existing modules with the same name
$exitingModulesWithName = $manager->getByName($themeModule->name);
$shouldContinue = $this->handleExistingModulesWithSameName($exitingModulesWithName, $manager);
if (!$shouldContinue) {
$this->cleanup();
return 1;
}
// Extract module ZIP into the theme modules folder
try {
$newModule = $manager->addFromZip($themeModule->name, $zip);
} catch (ThemeModuleException $exception) {
$this->error("ERROR: Failed to install module with error: {$exception->getMessage()}");
$this->cleanup();
return 1;
}
$this->info("Module \"{$newModule->name}\" ({$newModule->getVersion()}) successfully installed!");
$this->info("Install location: {$moduleFolder}/{$newModule->folderName}");
$this->cleanup();
return 0;
}
/**
* @param ThemeModule[] $existingModules
*/
protected function handleExistingModulesWithSameName(array $existingModules, ThemeModuleManager $manager): bool
{
if (count($existingModules) === 0) {
return true;
}
$this->warn("The following modules already exist with the same name:");
foreach ($existingModules as $folder => $module) {
$this->line("{$module->name} ({$folder}:{$module->getVersion()}) - {$module->description}");
}
$this->line('');
$choices = ['Cancel module install', 'Add alongside existing module'];
if (count($existingModules) === 1) {
$choices[] = 'Replace existing module';
}
$choice = $this->choice("What would you like to do?", $choices, 0, null, false);
if ($choice === 'Cancel module install') {
return false;
}
if ($choice === 'Replace existing module') {
$existingModuleFolder = array_key_first($existingModules);
$this->info("Replacing existing module in {$existingModuleFolder} folder");
$manager->deleteModuleFolder($existingModuleFolder);
}
return true;
}
protected function getModuleFolder(string $themeFolder): string|null
{
$path = $themeFolder . DIRECTORY_SEPARATOR . 'modules';
if (file_exists($path) && !is_dir($path)) {
$this->error("ERROR: Cannot create a modules folder, file already exists at {$path}");
return null;
}
if (!file_exists($path)) {
$created = mkdir($path, 0755, true);
if (!$created) {
$this->error("ERROR: Failed to create a modules folder at {$path}");
return null;
}
}
return $path;
}
protected function getThemeFolder(): string|null
{
$path = theme_path('');
if (!$path || !is_dir($path)) {
$shouldCreate = $this->confirm('No active theme folder found, would you like to create one?');
if (!$shouldCreate) {
return null;
}
$folder = 'custom';
while (file_exists(base_path("themes" . DIRECTORY_SEPARATOR . $folder))) {
$folder = 'custom-' . Str::random(4);
}
$path = base_path("themes/{$folder}");
$created = mkdir($path, 0755, true);
if (!$created) {
$this->error('Failed to create a theme folder to use. This may be a permissions issue. Try manually configuring an active theme');
return null;
}
$this->info("Created theme folder at {$path}");
$this->warn("You will need to set APP_THEME={$folder} in your BookStack env configuration to enable this theme!");
}
return $path;
}
protected function validateAndGetModuleInfoFromZip(ThemeModuleZip $zip): ThemeModule|null
{
if (!$zip->exists()) {
$this->error("ERROR: Cannot open ZIP file at {$zip->getPath()}");
return null;
}
if ($zip->getContentsSize() > (50 * 1024 * 1024)) {
$this->error("ERROR: Module ZIP file contents are too large. Maximum size is 50MB");
return null;
}
try {
$themeModule = $zip->getModuleInstance();
} catch (ThemeModuleException $exception) {
$this->error("ERROR: Failed to read module metadata with error: {$exception->getMessage()}");
return null;
}
return $themeModule;
}
protected function downloadModuleFile(string $location): string|null
{
$httpRequests = app()->make(HttpRequestService::class);
$client = $httpRequests->buildClient(30, ['stream' => true]);
$originalUrl = parse_url($location);
$currentLocation = $location;
$maxRedirects = 3;
$redirectCount = 0;
// Follow redirects up to 3 times for the same hostname
do {
$resp = $client->sendRequest(new Request('GET', $currentLocation));
$statusCode = $resp->getStatusCode();
if ($statusCode >= 300 && $statusCode < 400 && $redirectCount < $maxRedirects) {
$redirectLocation = $resp->getHeaderLine('Location');
if ($redirectLocation) {
$redirectUrl = parse_url($redirectLocation);
if (
($originalUrl['host'] ?? '') === ($redirectUrl['host'] ?? '')
&& ($originalUrl['scheme'] ?? '') === ($redirectUrl['scheme'] ?? '')
&& ($originalUrl['port'] ?? '') === ($redirectUrl['port'] ?? '')
) {
$currentLocation = $redirectLocation;
$redirectCount++;
continue;
}
}
}
break;
} while (true);
if ($resp->getStatusCode() >= 300) {
$this->error("ERROR: Failed to download module from {$location}");
$this->error("Download failed with status code {$resp->getStatusCode()}");
return null;
}
$tempFile = tempnam(sys_get_temp_dir(), 'bookstack_module_');
$fileHandle = fopen($tempFile, 'w');
$respBody = $resp->getBody();
$size = 0;
$maxSize = 50 * 1024 * 1024;
while (!$respBody->eof()) {
fwrite($fileHandle, $respBody->read(1024));
$size += 1024;
if ($size > $maxSize) {
fclose($fileHandle);
unlink($tempFile);
$this->error("ERROR: Module ZIP file is too large. Maximum size is 50MB");
return '';
}
}
fclose($fileHandle);
$this->cleanupActions[] = function () use ($tempFile) {
unlink($tempFile);
};
return $tempFile;
}
protected function getPathToZip(string $location): string|null
{
$lowerLocation = strtolower($location);
$isRemote = str_starts_with($lowerLocation, 'http://') || str_starts_with($lowerLocation, 'https://');
if ($isRemote) {
// Warning about fetching from source
$host = parse_url($location, PHP_URL_HOST);
$this->warn("This will download a module from {$host}. Modules can contain code which would have the ability to do anything on the BookStack host server.\nYou should only install modules from trusted sources.");
$trustHost = $this->confirm('Are you sure you trust this source?');
if (!$trustHost) {
return null;
}
// Check if the connection is http. If so, warn the user.
if (str_starts_with($lowerLocation, 'http://')) {
$this->warn("You are downloading a module from an insecure HTTP source.\nWe recommend only using HTTPS sources to avoid various security risks.");
if (!$this->confirm('Are you sure you want to continue without HTTPS?')) {
return null;
}
}
// Download ZIP and get its location
return $this->downloadModuleFile($location);
}
// Validate file and get full location
$zipPath = realpath($location);
if (!$zipPath || !is_file($zipPath)) {
$this->error("ERROR: Module file not found at {$location}");
return null;
}
return $zipPath;
}
protected function cleanup(): void
{
foreach ($this->cleanupActions as $action) {
$action();
}
}
}

View File

@@ -5,22 +5,21 @@ namespace BookStack\Theming;
use BookStack\Facades\Theme;
use BookStack\Http\Controller;
use BookStack\Util\FilePathNormalizer;
use Symfony\Component\HttpFoundation\StreamedResponse;
class ThemeController extends Controller
{
/**
* Serve a public file from the configured theme.
*/
public function publicFile(string $theme, string $path): StreamedResponse
public function publicFile(string $theme, string $path)
{
$cleanPath = FilePathNormalizer::normalize($path);
if ($theme !== Theme::getTheme() || !$cleanPath) {
abort(404);
}
$filePath = Theme::findFirstFile("public/{$cleanPath}");
if (!$filePath) {
$filePath = theme_path("public/{$cleanPath}");
if (!file_exists($filePath)) {
abort(404);
}

View File

@@ -134,16 +134,6 @@ class ThemeEvents
*/
const ROUTES_REGISTER_WEB_AUTH = 'routes_register_web_auth';
/**
* Theme register views event.
* Called by the theme system when a theme is active, so that custom view templates can be registered
* to be rendered in addition to existing app views.
*
* @param \BookStack\Theming\ThemeViews $themeViews
*/
const THEME_REGISTER_VIEWS = 'theme_register_views';
/**
* Web before middleware action.
* Runs before the request is handled but after all other middleware apart from those

View File

@@ -1,59 +0,0 @@
<?php
namespace BookStack\Theming;
readonly class ThemeModule
{
public function __construct(
public string $name,
public string $description,
public string $version,
public string $folderName,
) {
}
/**
* Create a ThemeModule instance from JSON data.
*
* @throws ThemeModuleException
*/
public static function fromJson(array $data, string $folderName): self
{
if (empty($data['name']) || !is_string($data['name'])) {
throw new ThemeModuleException("Module in folder \"{$folderName}\" is missing a valid 'name' property");
}
if (!isset($data['description']) || !is_string($data['description'])) {
throw new ThemeModuleException("Module in folder \"{$folderName}\" is missing a valid 'description' property");
}
if (!isset($data['version']) || !is_string($data['version'])) {
throw new ThemeModuleException("Module in folder \"{$folderName}\" is missing a valid 'version' property");
}
if (!preg_match('/^v?\d+\.\d+\.\d+(-.*)?$/', $data['version'])) {
throw new ThemeModuleException("Module in folder \"{$folderName}\" has an invalid 'version' format. Expected semantic version format like '1.0.0' or 'v1.0.0'");
}
return new self(
name: $data['name'],
description: $data['description'],
version: $data['version'],
folderName: $folderName,
);
}
/**
* Get a path for a file within this module.
*/
public function path($path = ''): string
{
$component = trim($path, '/');
return theme_path("modules/{$this->folderName}/{$component}");
}
public function getVersion(): string
{
return str_starts_with($this->version, 'v') ? $this->version : 'v' . $this->version;
}
}

View File

@@ -1,7 +0,0 @@
<?php
namespace BookStack\Theming;
class ThemeModuleException extends \Exception
{
}

View File

@@ -1,133 +0,0 @@
<?php
namespace BookStack\Theming;
use Illuminate\Support\Str;
class ThemeModuleManager
{
/** @var array<string, ThemeModule>|null */
protected array|null $loadedModules = null;
public function __construct(
protected string $modulesFolderPath
) {
}
/**
* @return array<string, ThemeModule>
*/
public function getByName(string $name): array
{
return array_filter($this->load(), fn(ThemeModule $module) => $module->name === $name);
}
public function deleteModuleFolder(string $moduleFolderName): void
{
$modules = $this->load();
$module = $modules[$moduleFolderName] ?? null;
if (!$module) {
return;
}
$moduleFolderPath = $module->path('');
if (!file_exists($moduleFolderPath)) {
return;
}
$this->deleteDirectoryRecursively($moduleFolderPath);
unset($this->loadedModules[$moduleFolderName]);
}
/**
* @throws ThemeModuleException
*/
public function addFromZip(string $name, ThemeModuleZip $zip): ThemeModule
{
$baseFolderName = Str::limit(Str::slug($name), 20);
$folderName = $baseFolderName;
while (!$baseFolderName || file_exists($this->modulesFolderPath . DIRECTORY_SEPARATOR . $folderName)) {
$folderName = ($baseFolderName ?: 'mod') . '-' . Str::random(4);
}
$folderPath = $this->modulesFolderPath . DIRECTORY_SEPARATOR . $folderName;
$zip->extractTo($folderPath);
$module = $this->loadFromFolder($folderName);
if (!$module) {
throw new ThemeModuleException("Failed to load module from zip file after extraction");
}
return $module;
}
protected function deleteDirectoryRecursively(string $path): void
{
$items = array_diff(scandir($path), ['.', '..']);
foreach ($items as $item) {
$itemPath = $path . DIRECTORY_SEPARATOR . $item;
if (is_dir($itemPath)) {
$this->deleteDirectoryRecursively($itemPath);
} else {
$deleted = unlink($itemPath);
if (!$deleted) {
throw new ThemeModuleException("Failed to delete file at \"{$itemPath}\"");
}
}
}
rmdir($path);
}
public function load(): array
{
if ($this->loadedModules !== null) {
return $this->loadedModules;
}
if (!is_dir($this->modulesFolderPath)) {
return [];
}
$subFolders = array_filter(scandir($this->modulesFolderPath), function ($item) {
return $item !== '.' && $item !== '..' && is_dir($this->modulesFolderPath . DIRECTORY_SEPARATOR . $item);
});
$modules = [];
foreach ($subFolders as $folderName) {
$module = $this->loadFromFolder($folderName);
if ($module) {
$modules[$folderName] = $module;
}
}
$this->loadedModules = $modules;
return $modules;
}
protected function loadFromFolder(string $folderName): ThemeModule|null
{
$moduleJsonFile = $this->modulesFolderPath . DIRECTORY_SEPARATOR . $folderName . DIRECTORY_SEPARATOR . 'bookstack-module.json';
if (!file_exists($moduleJsonFile)) {
return null;
}
try {
$jsonContent = file_get_contents($moduleJsonFile);
$jsonData = json_decode($jsonContent, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new ThemeModuleException("Invalid JSON in module file at \"{$moduleJsonFile}\": " . json_last_error_msg());
}
$module = ThemeModule::fromJson($jsonData, $folderName);
} catch (ThemeModuleException $exception) {
throw $exception;
} catch (\Exception $exception) {
throw new ThemeModuleException("Failed loading module from \"{$moduleJsonFile}\" with error: {$exception->getMessage()}");
}
return $module;
}
}

View File

@@ -1,98 +0,0 @@
<?php
namespace BookStack\Theming;
use ZipArchive;
readonly class ThemeModuleZip
{
public function __construct(
protected string $path
) {
}
public function extractTo(string $destinationPath): void
{
$zip = new ZipArchive();
$zip->open($this->path);
$zip->extractTo($destinationPath);
$zip->close();
}
/**
* Read the module's JSON metadata to read it into a ThemeModule instance.
* @throws ThemeModuleException
*/
public function getModuleInstance(): ThemeModule
{
$zip = new ZipArchive();
$open = $zip->open($this->path);
if ($open !== true) {
throw new ThemeModuleException("Unable to open zip file at {$this->path}");
}
$moduleJsonText = $zip->getFromName('bookstack-module.json');
$zip->close();
if ($moduleJsonText === false) {
throw new ThemeModuleException("bookstack-module.json not found within module ZIP at {$this->path}");
}
$moduleJson = json_decode($moduleJsonText, true);
if ($moduleJson === null) {
throw new ThemeModuleException("Could not read JSON from bookstack-module.json within module ZIP at {$this->path}");
}
return ThemeModule::fromJson($moduleJson, '_temp');
}
/**
* Get the path to the zip file.
*/
public function getPath(): string
{
return $this->path;
}
/**
* Check if the zip file exists and that it appears to be a valid zip file.
*/
public function exists(): bool
{
if (!file_exists($this->path)) {
return false;
}
$zip = new ZipArchive();
$open = $zip->open($this->path, ZipArchive::RDONLY);
if ($open === true) {
$zip->close();
return true;
}
return false;
}
/**
* Get the total size of the zip file contents when uncompressed.
*/
public function getContentsSize(): int
{
$zip = new ZipArchive();
if ($zip->open($this->path) !== true) {
return 0;
}
$totalSize = 0;
for ($i = 0; $i < $zip->numFiles; $i++) {
$stat = $zip->statIndex($i);
if ($stat !== false) {
$totalSize += $stat['size'];
}
}
$zip->close();
return $totalSize;
}
}

View File

@@ -6,7 +6,6 @@ use BookStack\Access\SocialDriverManager;
use BookStack\Exceptions\ThemeException;
use Illuminate\Console\Application;
use Illuminate\Console\Application as Artisan;
use Illuminate\View\FileViewFinder;
use Symfony\Component\Console\Command\Command;
class ThemeService
@@ -16,11 +15,6 @@ class ThemeService
*/
protected array $listeners = [];
/**
* @var array<string, ThemeModule>
*/
protected array $modules = [];
/**
* Get the currently configured theme.
* Returns an empty string if not configured.
@@ -82,71 +76,20 @@ class ThemeService
}
/**
* Read any actions from the 'functions.php' file of the active theme or its modules.
* Read any actions from the set theme path if the 'functions.php' file exists.
*/
public function readThemeActions(): void
{
$moduleFunctionFiles = array_map(function (ThemeModule $module): string {
return $module->path('functions.php');
}, $this->modules);
$allFunctionFiles = array_merge(array_values($moduleFunctionFiles), [theme_path('functions.php')]);
$filteredFunctionFiles = array_filter($allFunctionFiles, function (string $file): bool {
return $file && file_exists($file);
});
foreach ($filteredFunctionFiles as $functionFile) {
$themeActionsFile = theme_path('functions.php');
if ($themeActionsFile && file_exists($themeActionsFile)) {
try {
require $functionFile;
require $themeActionsFile;
} catch (\Error $exception) {
throw new ThemeException("Failed loading theme functions file at \"{$functionFile}\" with error: {$exception->getMessage()}");
throw new ThemeException("Failed loading theme functions file at \"{$themeActionsFile}\" with error: {$exception->getMessage()}");
}
}
}
/**
* Read the modules folder and load in any valid theme modules.
* @throws ThemeModuleException
*/
public function loadModules(): void
{
$modulesFolder = theme_path('modules');
if (!$modulesFolder) {
return;
}
$this->modules = (new ThemeModuleManager($modulesFolder))->load();
}
/**
* Get all loaded theme modules.
* @return array<string, ThemeModule>
*/
public function getModules(): array
{
return $this->modules;
}
/**
* Look for a specific file within the theme or its modules.
* Returns the first file found or null if not found.
*/
public function findFirstFile(string $path): ?string
{
$themePath = theme_path($path);
if (file_exists($themePath)) {
return $themePath;
}
foreach ($this->modules as $module) {
$customizedFile = $module->path($path);
if (file_exists($customizedFile)) {
return $customizedFile;
}
}
return null;
}
/**
* @see SocialDriverManager::addSocialDriver
*/

View File

@@ -1,104 +0,0 @@
<?php
namespace BookStack\Theming;
use BookStack\Exceptions\ThemeException;
use Illuminate\View\FileViewFinder;
class ThemeViews
{
/**
* @var array<string, array<string, int>>
*/
protected array $beforeViews = [];
/**
* @var array<string, array<string, int>>
*/
protected array $afterViews = [];
/**
* Register any extra paths for where we may expect views to be located
* with the provided FileViewFinder, to make custom views available for use.
* @param ThemeModule[] $modules
*/
public function registerViewPathsForTheme(FileViewFinder $finder, array $modules): void
{
foreach ($modules as $module) {
$moduleViewsPath = $module->path('views');
if (file_exists($moduleViewsPath) && is_dir($moduleViewsPath)) {
$finder->prependLocation($moduleViewsPath);
}
}
$finder->prependLocation(theme_path());
}
/**
* Provide the response for a blade template view include.
*/
public function handleViewInclude(string $viewPath, array $data = []): string
{
if (!$this->hasRegisteredViews()) {
return view()->make($viewPath, $data)->render();
}
$viewsContent = [
...$this->renderViewSets($this->beforeViews[$viewPath] ?? [], $data),
view()->make($viewPath, $data)->render(),
...$this->renderViewSets($this->afterViews[$viewPath] ?? [], $data),
];
return implode("\n", $viewsContent);
}
/**
* Register a custom view to be rendered before the given target view is included in the template system.
*/
public function renderBefore(string $targetView, string $localView, int $priority = 50): void
{
$this->registerAdjacentView($this->beforeViews, $targetView, $localView, $priority);
}
/**
* Register a custom view to be rendered after the given target view is included in the template system.
*/
public function renderAfter(string $targetView, string $localView, int $priority = 50): void
{
$this->registerAdjacentView($this->afterViews, $targetView, $localView, $priority);
}
public function hasRegisteredViews(): bool
{
return !empty($this->beforeViews) && !empty($this->afterViews);
}
protected function registerAdjacentView(array &$location, string $targetView, string $localView, int $priority = 50): void
{
$viewPath = theme_path($localView . '.blade.php');
if (!file_exists($viewPath)) {
throw new ThemeException("Expected registered view file at \"{$viewPath}\" does not exist");
}
if (!isset($location[$targetView])) {
$location[$targetView] = [];
}
$location[$targetView][$viewPath] = $priority;
}
/**
* @param array<string, int> $viewSet
* @return string[]
*/
protected function renderViewSets(array $viewSet, array $data): array
{
$paths = array_keys($viewSet);
usort($paths, function (string $a, string $b) use ($viewSet) {
return $viewSet[$a] <=> $viewSet[$b];
});
return array_map(function (string $viewPath) use ($data) {
return view()->file($viewPath, $data)->render();
}, $paths);
}
}

View File

@@ -2,7 +2,6 @@
namespace BookStack\Translation;
use BookStack\Facades\Theme;
use Illuminate\Translation\FileLoader as BaseLoader;
class FileLoader extends BaseLoader
@@ -13,6 +12,11 @@ class FileLoader extends BaseLoader
* Extends Laravel's translation FileLoader to look in multiple directories
* so that we can load in translation overrides from the theme file if wanted.
*
* Note: As of using Laravel 10, this may now be redundant since Laravel's
* file loader supports multiple paths. This needs further testing though
* to confirm if Laravel works how we expect, since we specifically need
* the theme folder to be able to partially override core lang files.
*
* @param string $locale
* @param string $group
* @param string|null $namespace
@@ -28,18 +32,9 @@ class FileLoader extends BaseLoader
if (is_null($namespace) || $namespace === '*') {
$themePath = theme_path('lang');
$themeTranslations = $themePath ? $this->loadPaths([$themePath], $locale, $group) : [];
$modules = Theme::getModules();
$moduleTranslations = [];
foreach ($modules as $module) {
$modulePath = $module->path('lang');
if (file_exists($modulePath)) {
$moduleTranslations = array_merge($moduleTranslations, $this->loadPaths([$modulePath], $locale, $group));
}
}
$originalTranslations = $this->loadPaths($this->paths, $locale, $group);
return array_merge($originalTranslations, $moduleTranslations, $themeTranslations);
return array_merge($originalTranslations, $themeTranslations);
}
return $this->loadNamespaced($locale, $group, $namespace);

View File

@@ -2,8 +2,6 @@
namespace BookStack\Util;
use BookStack\Facades\Theme;
class SvgIcon
{
public function __construct(
@@ -25,9 +23,12 @@ class SvgIcon
$attrString .= $attrName . '="' . $attr . '" ';
}
$defaultIconPath = resource_path('icons/' . $this->name . '.svg');
$iconPath = Theme::findFirstFile("icons/{$this->name}.svg") ?? $defaultIconPath;
if (!file_exists($iconPath)) {
$iconPath = resource_path('icons/' . $this->name . '.svg');
$themeIconPath = theme_path('icons/' . $this->name . '.svg');
if ($themeIconPath && file_exists($themeIconPath)) {
$iconPath = $themeIconPath;
} elseif (!file_exists($iconPath)) {
return '';
}

View File

@@ -1 +1 @@
22e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1
8c5c595184876ce12928f309aa3c9b571987c5e44c69c57c9cb17487f62bd709

View File

@@ -99,41 +99,6 @@ Theme::listen(ThemeEvents::APP_BOOT, function($app) {
});
```
## Custom View Registration Example
Using the logical theme system, you can register custom views to be rendered before/after other existing views, providing a flexible way to add content without needing to override and/or replicate existing content. This is done by listening to the `THEME_REGISTER_VIEWS`.
**Note:** You don't need to use this to override existing views, or register whole new main views to use, since that's done automatically based on their existence. This is just for advanced capabilities like inserting before/after existing views.
This event provides a `ThemeViews` instance which has the following methods made available:
- `renderBefore(string $targetView, string $localView, int $priority)`
- `renderAfter(string $targetView, string $localView, int $priority)`
The target view is the name of that which we want to insert our custom view relative to.
The local view is the name of the view we want to add and render.
The priority provides a suggestion to the ordering of view display, with lower numbers being shown first. This defaults to 50 if not provided.
Here's an example of this in use:
```php
<?php
use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;
use BookStack\Theming\ThemeViews;
Theme::listen(ThemeEvents::THEME_REGISTER_VIEWS, function (ThemeViews $themeViews) {
$themeViews->renderBefore('layouts.parts.header', 'welcome-banner', 4);
$themeViews->renderAfter('layouts.parts.header', 'information-alert');
$themeViews->renderAfter('layouts.parts.header', 'additions.password-notice', 20);
});
```
In this example, we're inserting custom views before and after the main header bar.
BookStack will look for a `welcome-banner.blade.php` file within our theme folder (or a theme module view folder) to render before the header. It'll look for the `information-alert.blade.php` and `additions/password-notice.blade.php` views to render afterwards.
The password notice will be shown above the information alert view, since it has a specified priority of 20, whereas the information alert view would default to a priority of 50.
## Custom Command Registration Example
The logical theme system supports adding custom [artisan commands](https://laravel.com/docs/8.x/artisan) to BookStack.

View File

@@ -1,68 +0,0 @@
# Theme System Modules
A theme system module is a collection of customizations using the [visual](visual-theme-system.md) and [logical](logical-theme-system.md) theme systems, provided along with some metadata, that can be installed alongside other modules within a theme. They can effectively be thought of as "plugins" or "extensions" that can be applied in addition to any customizations in the active theme.
### Module Location
Modules are contained within a folder themselves, which should be located inside a `modules` folder within a [BookStack theme folder](visual-theme-system.md#getting-started).
As an example, starting from the `themes/` top-level folder of a BookStack instance:
```txt
themes
└── my-theme
└── modules
├── module-a
│ └── bookstack-module.json
└── module-b
└── bookstack-module.json
```
### Module Format
A module exists as a folder in the location [as detailed above](#module-location).
The content within the module folder should then follow this format:
- `bookstack-module.json` - REQUIRED - A JSON file containing [the metadata](#module-json-metadata) for the module.
- `functions.php` - OPTIONAL - A PHP file containing code for the [logical theme system](logical-theme-system.md).
- `icons/` - OPTIONAL - A folder containing any icons to use as per [the visual theme system](visual-theme-system.md#customizing-icons).
- `lang/` - OPTIONAL - A folder containing any language files to use as per [the visual theme system](visual-theme-system.md#customizing-text-content).
- `public/` - OPTIONAL - A folder containing any files to expose into public web-space as per [the visual theme system](visual-theme-system.md#publicly-accessible-files).
- `views/` - OPTIONAL - A folder containing any view additions or overrides as per [the visual theme system](visual-theme-system.md#customizing-view-files).
You can create additional directories/files for your own needs within the module, but ideally name them something unique to prevent conflicts with the above structure.
### Module JSON Metadata
Modules are required to have a `bookstack-module.json` file in the top level directory of the module.
This must be a JSON file with the following properties:
- `name` - string - An (ideally unique) name for the module.
- `description` - string - A short description of the module.
- `version` - string - A string version number generally following [semantic versioning](https://semver.org/).
- Examples: `v0.4.0`, `4.3.12`, `v0.1.0-beta4`.
### Customization Order/Precedence
It's possible that multiple modules may override/customize the same content.
Right now, there's no assurance in regard to the order in which modules may be loaded.
Generally they will be used/searched in order of their module folder name, but this is not assured and should not be relied upon.
It's also possible that modules customize the same content as the configured theme.
In this scenario, the theme takes precedence. Modules are designed to be more portable and instance abstract, whereas the theme folder would typically be specific to the instance.
This allows the theme to be used to customize or override module content for the BookStack instance, without altering the module code itself.
### Module Best Practices
Here are some general best practices when it comes to creating modules:
- Use a unique name and clear description so the user can understand the purpose of the module.
- Increment the metadata version on change, keeping to [semver](https://semver.org/) to indicate compatibility of new versions.
- Where possible, prefer to [insert views before/after](logical-theme-system.md#custom-view-registration-example) instead of overriding existing views, to reduce likelihood of conflicts or update troubles.
### Distribution Format
Modules are expected to be distributed as a compressed ZIP file, where the ZIP contents follow that of a module folder.
BookStack provides a `php artisan bookstack:install-module` command which allows modules to be installed from these ZIP files, either from a local path or from a web URL.
Currently, there's a hardcoded total filesize limit of 50MB for module contents installed via this method.
There is not yet any direct update mechanism for modules, although this is something we may introduce in the future.

View File

@@ -4,7 +4,7 @@ BookStack allows visual customization via the theme system which enables you to
This is part of the theme system alongside the [logical theme system](./logical-theme-system.md).
**Note:** This theme system itself is maintained and supported, but usages of this system, including the files you are able to override, are not considered stable and may change upon any update. You should test any customizations made after updates.
**Note:** This theme system itself is maintained and supported but usages of this system, including the files you are able to override, are not considered stable and may change upon any update. You should test any customizations made after updates.
## Getting Started
@@ -18,9 +18,6 @@ You'll need to tell BookStack to use your theme via the `APP_THEME` option in yo
Content placed in your `themes/<theme_name>/` folder will override the original view files found in the `resources/views` folder. These files are typically [Laravel Blade](https://laravel.com/docs/10.x/blade) files.
As an example, I could override the `resources/views/books/parts/list-item.blade.php` file with my own template at the path `themes/<theme_name>/books/parts/list-item.blade.php`.
In addition to overriding original views, this could be used to add new views for use via the [logical theme system](logical-theme-system.md).
By using the `THEME_REGISTER_VIEWS` logical event, you can also register your views to be rendered before/after existing views. An example of this can be found in our [logical theme guidance](logical-theme-system.md#custom-view-registration-example).
## Customizing Icons
SVG files placed in a `themes/<theme_name>/icons` folder will override any icons of the same name within `resources/icons`. You'd typically want to follow the format convention of the existing icons, where no XML deceleration is included and no width & height attributes are set, to ensure optimal compatibility.
@@ -53,7 +50,7 @@ configured application theme.
There are some considerations to these publicly served files:
- Only a predetermined range of "web safe" content-types are currently served.
- Only a predetermined range "web safe" content-types are currently served.
- This limits running into potential insecure scenarios in serving problematic file types.
- A static 1-day cache time it set on files served from this folder.
- You can use alternative cache-breaking techniques (change of query string) upon changes if needed.

33
public/dist/app.js vendored Normal file

File diff suppressed because one or more lines are too long

32
public/dist/code.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/export-styles.css vendored Normal file

File diff suppressed because one or more lines are too long

3
public/dist/legacy-modes.js vendored Normal file

File diff suppressed because one or more lines are too long

28
public/dist/markdown.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/dist/styles.css vendored Normal file

File diff suppressed because one or more lines are too long

32
public/dist/wysiwyg.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,289 +0,0 @@
<?php
namespace Tests\Commands;
use GuzzleHttp\Psr7\Response;
use Illuminate\Support\Facades\File;
use Tests\TestCase;
use ZipArchive;
class InstallModuleCommandTest extends TestCase
{
public function test_local_module_install_with_active_theme()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
$expectedInstallPath = theme_path('modules/test-module');
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsOutput('Module "Test Module" (v1.0.0) successfully installed!')
->expectsOutput("Install location: {$expectedInstallPath}")
->assertExitCode(0);
$this->assertDirectoryExists($expectedInstallPath);
$this->assertFileExists($expectedInstallPath . '/bookstack-module.json');
});
}
public function test_remote_module_install_with_active_theme()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
$http = $this->mockHttpClient([
new Response(200, ['Content-Length' => filesize($zip)], file_get_contents($zip))
]);
$expectedInstallPath = theme_path('modules/test-module');
$this->artisan('bookstack:install-module', ['location' => 'https://example.com/test-module.zip'])
->expectsOutput("This will download a module from example.com. Modules can contain code which would have the ability to do anything on the BookStack host server.\nYou should only install modules from trusted sources.")
->expectsConfirmation('Are you sure you trust this source?', 'yes')
->expectsOutput('Module "Test Module" (v1.0.0) successfully installed!')
->expectsOutput("Install location: {$expectedInstallPath}")
->assertExitCode(0);
$this->assertEquals(1, $http->requestCount());
$request = $http->requestAt(0);
$this->assertEquals('/test-module.zip', $request->getUri()->getPath());
$this->assertDirectoryExists($expectedInstallPath);
$this->assertFileExists($expectedInstallPath . '/bookstack-module.json');
});
}
public function test_remote_http_module_warns_and_prompts_users()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
$http = $this->mockHttpClient([
new Response(200, ['Content-Length' => filesize($zip)], file_get_contents($zip))
]);
$expectedInstallPath = theme_path('modules/test-module');
$this->artisan('bookstack:install-module', ['location' => 'http://example.com/test-module.zip'])
->expectsOutput("This will download a module from example.com. Modules can contain code which would have the ability to do anything on the BookStack host server.\nYou should only install modules from trusted sources.")
->expectsConfirmation('Are you sure you trust this source?', 'yes')
->expectsOutput("You are downloading a module from an insecure HTTP source.\nWe recommend only using HTTPS sources to avoid various security risks.")
->expectsConfirmation('Are you sure you want to continue without HTTPS?', 'yes')
->expectsOutput('Module "Test Module" (v1.0.0) successfully installed!')
->expectsOutput("Install location: {$expectedInstallPath}")
->assertExitCode(0);
$request = $http->requestAt(0);
$this->assertEquals('/test-module.zip', $request->getUri()->getPath());
});
}
public function test_remote_module_install_follows_redirects()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
$http = $this->mockHttpClient([
new Response(302, ['Location' => 'https://example.com/a-test-module.zip']),
new Response(200, ['Content-Length' => filesize($zip)], file_get_contents($zip))
]);
$this->artisan('bookstack:install-module', ['location' => 'https://example.com/test-module.zip'])
->expectsConfirmation('Are you sure you trust this source?', 'yes')
->assertExitCode(0);
$this->assertEquals(2, $http->requestCount());
$this->assertEquals('/test-module.zip', $http->requestAt(0)->getUri()->getPath());
$this->assertEquals('/a-test-module.zip', $http->requestAt(1)->getUri()->getPath());
});
}
public function test_remote_module_install_does_not_follow_redirects_to_different_origin()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
$http = $this->mockHttpClient([
new Response(302, ['Location' => 'http://example.com/a-test-module.zip']),
new Response(200, ['Content-Length' => filesize($zip)], file_get_contents($zip))
]);
$this->artisan('bookstack:install-module', ['location' => 'https://example.com/test-module.zip'])
->expectsConfirmation('Are you sure you trust this source?', 'yes')
->assertExitCode(1);
$this->assertEquals(1, $http->requestCount());
$this->assertEquals('https', $http->requestAt(0)->getUri()->getScheme());
});
}
public function test_remote_module_install_download_failures_are_announced_to_user()
{
$this->usingThemeFolder(function () {
$http = $this->mockHttpClient([
new Response(404),
]);
$this->artisan('bookstack:install-module', ['location' => 'https://example.com/test-module.zip'])
->expectsConfirmation('Are you sure you trust this source?', 'yes')
->expectsOutput('ERROR: Failed to download module from https://example.com/test-module.zip')
->expectsOutput('Download failed with status code 404')
->assertExitCode(1);
$this->assertEquals(1, $http->requestCount());
});
}
public function test_run_with_invalid_path_exits_early()
{
$this->artisan('bookstack:install-module', ['location' => '/not-found.zip'])
->expectsOutput('ERROR: Module file not found at /not-found.zip')
->assertExitCode(1);
}
public function test_run_with_invalid_zip_has_early_exit()
{
$zip = $this->getModuleZipPath();
file_put_contents($zip, 'invalid zip');
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsOutput("ERROR: Cannot open ZIP file at {$zip}")
->assertExitCode(1);
}
public function test_run_with_large_zip_has_early_exit()
{
$zip = $this->getModuleZipPath(null, [
'large-file.txt' => str_repeat('a', 1024 * 1024 * 51)
]);
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsOutput("ERROR: Module ZIP file contents are too large. Maximum size is 50MB")
->assertExitCode(1);
}
public function test_run_with_invalid_module_data_has_early_exit()
{
$zip = $this->getModuleZipPath([
'name' => 'Invalid Module',
'description' => 'A module with invalid data',
'version' => 'dog',
]);
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsOutput("ERROR: Failed to read module metadata with error: Module in folder \"_temp\" has an invalid 'version' format. Expected semantic version format like '1.0.0' or 'v1.0.0'")
->assertExitCode(1);
}
public function test_local_module_install_without_active_theme_can_setup_theme_folder()
{
$zip = $this->getModuleZipPath();
$expectedThemePath = base_path('themes/custom');
File::deleteDirectory($expectedThemePath);
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsConfirmation('No active theme folder found, would you like to create one?', 'yes')
->expectsOutput("Created theme folder at {$expectedThemePath}")
->expectsOutput("You will need to set APP_THEME=custom in your BookStack env configuration to enable this theme!")
->expectsOutput('Module "Test Module" (v1.0.0) successfully installed!')
->assertExitCode(0);
$this->assertDirectoryExists($expectedThemePath . '/modules/test-module');
File::deleteDirectory($expectedThemePath);
}
public function test_local_module_install_with_active_theme_and_conflicting_modules_file_causes_early_exit()
{
$this->usingThemeFolder(function () {
$zip = $this->getModuleZipPath();
File::put(theme_path('modules'), '{}');
$this->artisan('bookstack:install-module', ['location' => $zip])
->expectsOutput("ERROR: Cannot create a modules folder, file already exists at " . theme_path('modules'))
->assertExitCode(1);
});
}
public function test_single_existing_module_with_same_name_replace()
{
$this->usingThemeFolder(function () {
$original = $this->createModuleFolderInCurrentTheme(['name' => 'Test Module', 'description' => 'cat', 'version' => '1.0.0']);
$new = $this->getModuleZipPath(['name' => 'Test Module', 'description' => '', 'version' => '2.0.0']);
$this->artisan('bookstack:install-module', ['location' => $new])
->expectsOutput('The following modules already exist with the same name:')
->expectsOutput('Test Module (test-module:v1.0.0) - cat')
->expectsChoice('What would you like to do?', 'Replace existing module', ['Cancel module install', 'Add alongside existing module', 'Replace existing module'])
->expectsOutput("Replacing existing module in test-module folder")
->assertExitCode(0);
$this->assertFileExists($original . '/bookstack-module.json');
$metadata = json_decode(file_get_contents($original . '/bookstack-module.json'), true);
$this->assertEquals('2.0.0', $metadata['version']);
});
}
public function test_single_existing_module_with_same_name_cancel()
{
$this->usingThemeFolder(function () {
$original = $this->createModuleFolderInCurrentTheme(['name' => 'Test Module', 'description' => 'cat', 'version' => '1.0.0']);
$new = $this->getModuleZipPath(['name' => 'Test Module', 'description' => '', 'version' => '2.0.0']);
$this->artisan('bookstack:install-module', ['location' => $new])
->expectsOutput('The following modules already exist with the same name:')
->expectsOutput('Test Module (test-module:v1.0.0) - cat')
->expectsChoice('What would you like to do?', 'Cancel module install', ['Cancel module install', 'Add alongside existing module', 'Replace existing module'])
->assertExitCode(1);
$this->assertFileExists($original . '/bookstack-module.json');
$metadata = json_decode(file_get_contents($original . '/bookstack-module.json'), true);
$this->assertEquals('1.0.0', $metadata['version']);
});
}
public function test_single_existing_module_with_same_name_add()
{
$this->usingThemeFolder(function () {
$original = $this->createModuleFolderInCurrentTheme(['name' => 'Test Module', 'description' => 'cat', 'version' => '1.0.0']);
$new = $this->getModuleZipPath(['name' => 'Test Module', 'description' => '', 'version' => '2.0.0']);
$this->artisan('bookstack:install-module', ['location' => $new])
->expectsOutput('The following modules already exist with the same name:')
->expectsOutput('Test Module (test-module:v1.0.0) - cat')
->expectsChoice('What would you like to do?', 'Add alongside existing module', ['Cancel module install', 'Add alongside existing module', 'Replace existing module'])
->assertExitCode(0);
$dirs = File::directories(theme_path('modules/'));
$this->assertCount(2, $dirs);
});
}
protected function createModuleFolderInCurrentTheme(array|null $metadata = null, array $extraFiles = []): string
{
$original = $this->getModuleZipPath($metadata, $extraFiles);
$targetPath = theme_path('modules/test-module');
mkdir($targetPath, 0777, true);
$originalZip = new ZipArchive();
$originalZip->open($original);
$originalZip->extractTo($targetPath);
$originalZip->close();
return $targetPath;
}
protected function getModuleZipPath(array|null $metadata = null, array $extraFiles = []): string
{
$zip = new ZipArchive();
$tmpFile = tempnam(sys_get_temp_dir(), 'bs-test-module');
$zip->open($tmpFile, ZipArchive::CREATE);
$zip->addFromString('bookstack-module.json', json_encode($metadata ?? [
'name' => 'Test Module',
'description' => 'A test module for BookStack',
'version' => '1.0.0',
]));
foreach ($extraFiles as $path => $contents) {
$zip->addFromString($path, $contents);
}
$zip->close();
return $tmpFile;
}
}

View File

@@ -13,7 +13,6 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Env;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
use Illuminate\Testing\Assert as PHPUnit;
use Illuminate\Testing\Constraints\HasInDatabase;
@@ -158,23 +157,6 @@ abstract class TestCase extends BaseTestCase
}
}
protected function usingThemeFolder(callable $callback): void
{
// Create a folder and configure a theme
$themeFolderName = 'testing_theme_' . str_shuffle(rtrim(base64_encode(time()), '='));
config()->set('view.theme', $themeFolderName);
$themeFolderPath = theme_path('');
// Create a theme folder and clean it up on application tear-down
File::makeDirectory($themeFolderPath);
$this->beforeApplicationDestroyed(fn() => File::deleteDirectory($themeFolderPath));
// Run provided callback with the theme env option set
$this->runWithEnv(['APP_THEME' => $themeFolderName], function () use ($callback, $themeFolderName) {
call_user_func($callback, $themeFolderName);
});
}
/**
* Check the keys and properties in the given map to include
* exist, albeit not exclusively, within the map to check.

View File

@@ -1,321 +0,0 @@
<?php
namespace Tests\Theme;
use BookStack\Activity\ActivityType;
use BookStack\Activity\DispatchWebhookJob;
use BookStack\Activity\Models\Webhook;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Tools\PageContent;
use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;
use BookStack\Users\Models\User;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use League\CommonMark\Environment\Environment;
use Tests\TestCase;
class LogicalThemeEventsTest extends TestCase
{
public function test_commonmark_environment_configure()
{
$callbackCalled = false;
$callback = function ($environment) use (&$callbackCalled) {
$this->assertInstanceOf(Environment::class, $environment);
$callbackCalled = true;
return $environment;
};
Theme::listen(ThemeEvents::COMMONMARK_ENVIRONMENT_CONFIGURE, $callback);
$page = $this->entities->page();
$content = new PageContent($page);
$content->setNewMarkdown('# test', $this->users->editor());
$this->assertTrue($callbackCalled);
}
public function test_web_middleware_before()
{
$callbackCalled = false;
$requestParam = null;
$callback = function ($request) use (&$callbackCalled, &$requestParam) {
$requestParam = $request;
$callbackCalled = true;
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_BEFORE, $callback);
$this->get('/login', ['Donkey' => 'cat']);
$this->assertTrue($callbackCalled);
$this->assertInstanceOf(Request::class, $requestParam);
$this->assertEquals('cat', $requestParam->header('donkey'));
}
public function test_web_middleware_before_return_val_used_as_response()
{
$callback = function (Request $request) {
return response('cat', 412);
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_BEFORE, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$resp->assertSee('cat');
$resp->assertStatus(412);
}
public function test_web_middleware_after()
{
$callbackCalled = false;
$requestParam = null;
$responseParam = null;
$callback = function ($request, Response $response) use (&$callbackCalled, &$requestParam, &$responseParam) {
$requestParam = $request;
$responseParam = $response;
$callbackCalled = true;
$response->header('donkey', 'cat123');
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_AFTER, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$this->assertTrue($callbackCalled);
$this->assertInstanceOf(Request::class, $requestParam);
$this->assertInstanceOf(Response::class, $responseParam);
$resp->assertHeader('donkey', 'cat123');
}
public function test_web_middleware_after_return_val_used_as_response()
{
$callback = function () {
return response('cat456', 443);
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_AFTER, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$resp->assertSee('cat456');
$resp->assertStatus(443);
}
public function test_auth_login_standard()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_LOGIN, $callback);
$this->post('/login', ['email' => 'admin@admin.com', 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertInstanceOf(User::class, $args[1]);
}
public function test_auth_register_standard()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertInstanceOf(User::class, $args[1]);
}
public function test_auth_pre_register()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_PRE_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertEquals([
'email' => $user->email,
'name' => $user->name,
'password' => 'password',
], $args[1]);
$this->assertDatabaseHas('users', ['email' => $user->email]);
}
public function test_auth_pre_register_with_false_return_blocks_registration()
{
$callback = function () {
return false;
};
Theme::listen(ThemeEvents::AUTH_PRE_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$resp = $this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$resp->assertRedirect('/login');
$this->assertSessionError('User account could not be registered for the provided details');
$this->assertDatabaseMissing('users', ['email' => $user->email]);
}
public function test_webhook_call_before()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
return ['test' => 'hello!'];
};
Theme::listen(ThemeEvents::WEBHOOK_CALL_BEFORE, $callback);
$responses = $this->mockHttpClient([new \GuzzleHttp\Psr7\Response(200, [], '')]);
$webhook = new Webhook(['name' => 'Test webhook', 'endpoint' => 'https://example.com']);
$webhook->save();
$event = ActivityType::PAGE_UPDATE;
$detail = Page::query()->first();
dispatch((new DispatchWebhookJob($webhook, $event, $detail)));
$this->assertCount(5, $args);
$this->assertEquals($event, $args[0]);
$this->assertEquals($webhook->id, $args[1]->id);
$this->assertEquals($detail->id, $args[2]->id);
$this->assertEquals(1, $responses->requestCount());
$request = $responses->latestRequest();
$reqData = json_decode($request->getBody(), true);
$this->assertEquals('hello!', $reqData['test']);
}
public function test_activity_logged()
{
$book = $this->entities->book();
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::ACTIVITY_LOGGED, $callback);
$this->asEditor()->put($book->getUrl(), ['name' => 'My cool update book!']);
$this->assertCount(2, $args);
$this->assertEquals(ActivityType::BOOK_UPDATE, $args[0]);
$this->assertTrue($args[1] instanceof Book);
$this->assertEquals($book->id, $args[1]->id);
}
public function test_page_include_parse()
{
/** @var Page $page */
/** @var Page $otherPage */
$page = $this->entities->page();
$otherPage = Page::query()->where('id', '!=', $page->id)->first();
$otherPage->html = '<p id="bkmrk-cool">This is a really cool section</p>';
$page->html = "<p>{{@{$otherPage->id}#bkmrk-cool}}</p>";
$page->save();
$otherPage->save();
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
return '<strong>Big &amp; content replace surprise!</strong>';
};
Theme::listen(ThemeEvents::PAGE_INCLUDE_PARSE, $callback);
$resp = $this->asEditor()->get($page->getUrl());
$this->withHtml($resp)->assertElementContains('.page-content strong', 'Big & content replace surprise!');
$this->assertCount(4, $args);
$this->assertEquals($otherPage->id . '#bkmrk-cool', $args[0]);
$this->assertEquals('This is a really cool section', $args[1]);
$this->assertTrue($args[2] instanceof Page);
$this->assertTrue($args[3] instanceof Page);
$this->assertEquals($page->id, $args[2]->id);
$this->assertEquals($otherPage->id, $args[3]->id);
}
public function test_routes_register_web_and_web_auth()
{
$functionsContent = <<<'END'
<?php
use BookStack\Theming\ThemeEvents;
use BookStack\Facades\Theme;
use Illuminate\Routing\Router;
Theme::listen(ThemeEvents::ROUTES_REGISTER_WEB, function (Router $router) {
$router->get('/cat', fn () => 'cat')->name('say.cat');
});
Theme::listen(ThemeEvents::ROUTES_REGISTER_WEB_AUTH, function (Router $router) {
$router->get('/dog', fn () => 'dog')->name('say.dog');
});
END;
$this->usingThemeFolder(function () use ($functionsContent) {
$functionsFile = theme_path('functions.php');
file_put_contents($functionsFile, $functionsContent);
$app = $this->createApplication();
/** @var \Illuminate\Routing\Router $router */
$router = $app->get('router');
/** @var \Illuminate\Routing\Route $catRoute */
$catRoute = $router->getRoutes()->getRoutesByName()['say.cat'];
$this->assertEquals(['web'], $catRoute->middleware());
/** @var \Illuminate\Routing\Route $dogRoute */
$dogRoute = $router->getRoutes()->getRoutesByName()['say.dog'];
$this->assertEquals(['web', 'auth'], $dogRoute->middleware());
});
}
public function test_register_views_to_insert_views_before_and_after()
{
$this->usingThemeFolder(function (string $folder) {
$before = 'this-is-my-before-header-string';
$afterA = 'this-is-my-after-header-string-a';
$afterB = 'this-is-my-after-header-string-b';
$afterC = 'this-is-my-after-header-string-{{ 1+51 }}';
$functionsContent = <<<'CONTENT'
<?php use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;
use BookStack\Theming\ThemeViews;
Theme::listen(ThemeEvents::THEME_REGISTER_VIEWS, function (ThemeViews $themeViews) {
$themeViews->renderBefore('layouts.parts.header', 'before', 4);
$themeViews->renderAfter('layouts.parts.header', 'after-a', 4);
$themeViews->renderAfter('layouts.parts.header', 'after-b', 1);
$themeViews->renderAfter('layouts.parts.header', 'after-c', 12);
});
CONTENT;
$viewDir = theme_path();
file_put_contents($viewDir . '/functions.php', $functionsContent);
file_put_contents($viewDir . '/before.blade.php', $before);
file_put_contents($viewDir . '/after-a.blade.php', $afterA);
file_put_contents($viewDir . '/after-b.blade.php', $afterB);
file_put_contents($viewDir . '/after-c.blade.php', $afterC);
$this->refreshApplication();
$this->artisan('view:clear');
$resp = $this->get('/login');
$resp->assertSee($before);
// Ensure ordering of the multiple after views
$resp->assertSee($afterB . "\n" . $afterA . "\nthis-is-my-after-header-string-52");
});
$this->artisan('view:clear');
}
}

View File

@@ -1,105 +0,0 @@
<?php
namespace Tests\Theme;
use BookStack\Exceptions\ThemeException;
use BookStack\Facades\Theme;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Tests\TestCase;
class LogicalThemeTest extends TestCase
{
public function test_theme_functions_file_used_and_app_boot_event_runs()
{
$this->usingThemeFolder(function ($themeFolder) {
$functionsFile = theme_path('functions.php');
app()->alias('cat', 'dog');
file_put_contents($functionsFile, "<?php\nTheme::listen(\BookStack\Theming\ThemeEvents::APP_BOOT, function(\$app) { \$app->alias('cat', 'dog');});");
$this->runWithEnv(['APP_THEME' => $themeFolder], function () {
$this->assertEquals('cat', $this->app->getAlias('dog'));
});
});
}
public function test_theme_functions_loads_errors_are_caught_and_logged()
{
$this->usingThemeFolder(function ($themeFolder) {
$functionsFile = theme_path('functions.php');
file_put_contents($functionsFile, "<?php\n\\BookStack\\Biscuits::eat();");
$this->expectException(ThemeException::class);
$this->expectExceptionMessageMatches('/Failed loading theme functions file at ".*?" with error: Class "BookStack\\\\Biscuits" not found/');
$this->runWithEnv(['APP_THEME' => $themeFolder], fn() => null);
});
}
public function test_add_social_driver()
{
Theme::addSocialDriver('catnet', [
'client_id' => 'abc123',
'client_secret' => 'def456',
], 'SocialiteProviders\Discord\DiscordExtendSocialite@handleTesting');
$this->assertEquals('catnet', config('services.catnet.name'));
$this->assertEquals('abc123', config('services.catnet.client_id'));
$this->assertEquals(url('/login/service/catnet/callback'), config('services.catnet.redirect'));
$loginResp = $this->get('/login');
$loginResp->assertSee('login/service/catnet');
}
public function test_add_social_driver_uses_name_in_config_if_given()
{
Theme::addSocialDriver('catnet', [
'client_id' => 'abc123',
'client_secret' => 'def456',
'name' => 'Super Cat Name',
], 'SocialiteProviders\Discord\DiscordExtendSocialite@handleTesting');
$this->assertEquals('Super Cat Name', config('services.catnet.name'));
$loginResp = $this->get('/login');
$loginResp->assertSee('Super Cat Name');
}
public function test_add_social_driver_allows_a_configure_for_redirect_callback_to_be_passed()
{
Theme::addSocialDriver(
'discord',
[
'client_id' => 'abc123',
'client_secret' => 'def456',
'name' => 'Super Cat Name',
],
'SocialiteProviders\Discord\DiscordExtendSocialite@handle',
function ($driver) {
$driver->with(['donkey' => 'donut']);
}
);
$loginResp = $this->get('/login/service/discord');
$redirect = $loginResp->headers->get('location');
$this->assertStringContainsString('donkey=donut', $redirect);
}
public function test_register_command_allows_provided_command_to_be_usable_via_artisan()
{
Theme::registerCommand(new MyCustomCommand());
Artisan::call('bookstack:test-custom-command', []);
$output = Artisan::output();
$this->assertStringContainsString('Command ran!', $output);
}
}
class MyCustomCommand extends Command
{
protected $signature = 'bookstack:test-custom-command';
public function handle()
{
$this->line('Command ran!');
}
}

View File

@@ -1,223 +0,0 @@
<?php
namespace Tests\Theme;
use BookStack\Facades\Theme;
use Tests\TestCase;
class ThemeModuleTests extends TestCase
{
public function test_modules_loaded_on_theme_load()
{
$this->usingThemeFolder(function ($themeFolder) {
$a = theme_path('modules/a');
$b = theme_path('modules/b');
mkdir($a, 0777, true);
mkdir($b, 0777, true);
file_put_contents($a . '/bookstack-module.json', json_encode([
'name' => 'Module A',
'description' => 'This is module A',
'version' => '1.0.0',
]));
file_put_contents($b . '/bookstack-module.json', json_encode([
'name' => 'Module B',
'description' => 'This is module B',
'version' => 'v0.5.0',
]));
$this->refreshApplication();
$modules = Theme::getModules();
$this->assertCount(2, $modules);
$moduleA = $modules['a'];
$this->assertEquals('Module A', $moduleA->name);
$this->assertEquals('This is module A', $moduleA->description);
$this->assertEquals('1.0.0', $moduleA->version);
});
}
public function test_module_not_loaded_if_no_bookstack_module_json()
{
$this->usingThemeFolder(function ($themeFolder) {
$moduleDir = theme_path('/modules/a');
mkdir($moduleDir, 0777, true);
file_put_contents($moduleDir . '/module.json', '{}');
$this->refreshApplication();
$modules = Theme::getModules();
$this->assertCount(0, $modules);
});
}
public function test_language_text_overridable_via_module()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$translationPath = $moduleFolderPath . '/lang/en';
mkdir($translationPath, 0777, true);
file_put_contents($translationPath . '/entities.php', '<?php return ["books" => "SuperBeans"];');
$this->refreshApplication();
$this->asAdmin()->get('/books')->assertSee('SuperBeans');
});
}
public function test_language_files_merge_with_theme_files_with_theme_taking_precedence()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$moduleTranslationPath = $moduleFolderPath . '/lang/en';
mkdir($moduleTranslationPath, 0777, true);
file_put_contents($moduleTranslationPath . '/entities.php', '<?php return ["books" => "SuperBeans", "recently_viewed" => "ViewedBiscuits"];');
$themeTranslationPath = theme_path('lang/en');
mkdir($themeTranslationPath, 0777, true);
file_put_contents($themeTranslationPath . '/entities.php', '<?php return ["books" => "WonderBeans"];');
$this->refreshApplication();
$this->asAdmin()->get('/books')
->assertSee('WonderBeans')
->assertDontSee('SuperBeans')
->assertSee('ViewedBiscuits');
});
}
public function test_view_files_overridable_from_module()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$viewsFolder = $moduleFolderPath . '/views/layouts/parts';
mkdir($viewsFolder, 0777, true);
file_put_contents($viewsFolder . '/header.blade.php', 'My custom header that says badgerriffic');
$this->refreshApplication();
$this->asAdmin()->get('/')->assertSee('badgerriffic');
});
}
public function test_theme_view_files_take_precedence_over_module_view_files()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$viewsFolder = $moduleFolderPath . '/views/layouts/parts';
mkdir($viewsFolder, 0777, true);
file_put_contents($viewsFolder . '/header.blade.php', 'My custom header that says badgerriffic');
$themeViewsFolder = theme_path('layouts/parts');
mkdir($themeViewsFolder, 0777, true);
file_put_contents($themeViewsFolder . '/header.blade.php', 'My theme header that says awesomeferrets');
$this->refreshApplication();
$this->asAdmin()->get('/')
->assertDontSee('badgerriffic')
->assertSee('awesomeferrets');
});
}
public function test_theme_and_modules_views_can_be_used_at_the_same_time()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$viewsFolder = $moduleFolderPath . '/views/layouts/parts';
mkdir($viewsFolder, 0777, true);
file_put_contents($viewsFolder . '/base-body-start.blade.php', 'My custom header that says badgerriffic');
$themeViewsFolder = theme_path('layouts/parts');
mkdir($themeViewsFolder, 0777, true);
file_put_contents($themeViewsFolder . '/base-body-end.blade.php', 'My theme header that says awesomeferrets');
$this->refreshApplication();
$this->asAdmin()->get('/')
->assertSee('badgerriffic')
->assertSee('awesomeferrets');
});
}
public function test_icons_can_be_overridden_from_module()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$iconsFolder = $moduleFolderPath . '/icons';
mkdir($iconsFolder, 0777, true);
file_put_contents($iconsFolder . '/books.svg', '<svg><path d="supericonpath"/></svg>');
$this->refreshApplication();
$this->asAdmin()->get('/')->assertSee('supericonpath', false);
});
}
public function test_theme_icons_take_precedence_over_module_icons()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$iconsFolder = $moduleFolderPath . '/icons';
mkdir($iconsFolder, 0777, true);
file_put_contents($iconsFolder . '/books.svg', '<svg><path d="supericonpath"/></svg>');
$this->refreshApplication();
$themeViewsFolder = theme_path('icons');
mkdir($themeViewsFolder, 0777, true);
file_put_contents($themeViewsFolder . '/books.svg', '<svg><path d="wackyiconpath"/></svg>');
$this->asAdmin()->get('/')
->assertSee('wackyiconpath', false)
->assertDontSee('supericonpath', false);
});
}
public function test_public_folder_can_be_provided_from_module()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$publicFolder = $moduleFolderPath . '/public';
mkdir($publicFolder, 0777, true);
$themeName = basename(dirname(dirname($moduleFolderPath)));
file_put_contents($publicFolder . '/test.txt', 'hellofrominsidethisfileimaghostwoooo!');
$this->refreshApplication();
$resp = $this->asAdmin()->get("/theme/{$themeName}/test.txt")->streamedContent();
$this->assertEquals('hellofrominsidethisfileimaghostwoooo!', $resp);
});
}
public function test_theme_public_files_take_precedence_over_modules()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
$publicFolder = $moduleFolderPath . '/public';
mkdir($publicFolder, 0777, true);
$themeName = basename(theme_path());
file_put_contents($publicFolder . '/test.txt', 'hellofrominsidethisfileimaghostwoooo!');
$themePublicFolder = theme_path('public');
mkdir($themePublicFolder, 0777, true);
file_put_contents($themePublicFolder . '/test.txt', 'imadifferentghostinsidethetheme,woooooo!');
$this->refreshApplication();
$resp = $this->asAdmin()->get("/theme/{$themeName}/test.txt")->streamedContent();
$this->assertEquals('imadifferentghostinsidethetheme,woooooo!', $resp);
});
}
public function test_logical_functions_file_loaded_from_module_and_it_runs_alongside_theme_functions()
{
$this->usingModuleFolder(function (string $moduleFolderPath) {
file_put_contents($moduleFolderPath . '/functions.php', "<?php\nTheme::listen(\BookStack\Theming\ThemeEvents::APP_BOOT, function(\$app) { \$app->alias('cat', 'dog');});");
$themeFunctionsFile = theme_path('functions.php');
file_put_contents($themeFunctionsFile, "<?php\nTheme::listen(\BookStack\Theming\ThemeEvents::APP_BOOT, function(\$app) { \$app->alias('beans', 'cheese');});");
$this->refreshApplication();
$this->assertEquals('cat', $this->app->getAlias('dog'));
$this->assertEquals('beans', $this->app->getAlias('cheese'));
});
}
protected function usingModuleFolder(callable $callback): void
{
$this->usingThemeFolder(function (string $themeFolder) use ($callback) {
$moduleFolderPath = theme_path('modules/test-module');
mkdir($moduleFolderPath, 0777, true);
file_put_contents($moduleFolderPath . '/bookstack-module.json', json_encode([
'name' => 'Test Module',
'description' => 'This is a test module',
'version' => 'v1.0.0',
]));
$callback($moduleFolderPath);
});
}
}

View File

@@ -1,132 +0,0 @@
<?php
namespace Tests\Theme;
use Illuminate\Support\Facades\File;
use Tests\TestCase;
class VisualThemeTest extends TestCase
{
public function test_translation_text_can_be_overridden_via_theme()
{
$this->usingThemeFolder(function () {
$translationPath = theme_path('/lang/en');
File::makeDirectory($translationPath, 0777, true);
$customTranslations = '<?php
return [\'books\' => \'Sandwiches\'];
';
file_put_contents($translationPath . '/entities.php', $customTranslations);
$homeRequest = $this->actingAs($this->users->viewer())->get('/');
$this->withHtml($homeRequest)->assertElementContains('header nav', 'Sandwiches');
});
}
public function test_custom_settings_category_page_can_be_added_via_view_file()
{
$content = 'My SuperCustomSettings';
$this->usingThemeFolder(function (string $folder) use ($content) {
$viewDir = theme_path('settings/categories');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/beans.blade.php', $content);
$this->asAdmin()->get('/settings/beans')->assertSee($content);
});
}
public function test_base_body_start_and_end_template_files_can_be_used()
{
$bodyStartStr = 'barry-fought-against-the-panther';
$bodyEndStr = 'barry-lost-his-fight-with-grace';
$this->usingThemeFolder(function (string $folder) use ($bodyStartStr, $bodyEndStr) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/base-body-start.blade.php', $bodyStartStr);
file_put_contents($viewDir . '/base-body-end.blade.php', $bodyEndStr);
$resp = $this->asEditor()->get('/');
$resp->assertSee($bodyStartStr);
$resp->assertSee($bodyEndStr);
});
}
public function test_export_body_start_and_end_template_files_can_be_used()
{
$bodyStartStr = 'garry-fought-against-the-panther';
$bodyEndStr = 'garry-lost-his-fight-with-grace';
$page = $this->entities->page();
$this->usingThemeFolder(function (string $folder) use ($bodyStartStr, $bodyEndStr, $page) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/export-body-start.blade.php', $bodyStartStr);
file_put_contents($viewDir . '/export-body-end.blade.php', $bodyEndStr);
$resp = $this->asEditor()->get($page->getUrl('/export/html'));
$resp->assertSee($bodyStartStr);
$resp->assertSee($bodyEndStr);
});
}
public function test_login_and_register_message_template_files_can_be_used()
{
$loginMessage = 'Welcome to this instance, login below you scallywag';
$registerMessage = 'You want to register? Enter the deets below you numpty';
$this->usingThemeFolder(function (string $folder) use ($loginMessage, $registerMessage) {
$viewDir = theme_path('auth/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/login-message.blade.php', $loginMessage);
file_put_contents($viewDir . '/register-message.blade.php', $registerMessage);
$this->setSettings(['registration-enabled' => 'true']);
$this->get('/login')->assertSee($loginMessage);
$this->get('/register')->assertSee($registerMessage);
});
}
public function test_header_links_start_template_file_can_be_used()
{
$content = 'This is added text in the header bar';
$this->usingThemeFolder(function (string $folder) use ($content) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/header-links-start.blade.php', $content);
$this->setSettings(['registration-enabled' => 'true']);
$this->get('/login')->assertSee($content);
});
}
public function test_public_folder_contents_accessible_via_route()
{
$this->usingThemeFolder(function (string $themeFolderName) {
$publicDir = theme_path('public');
mkdir($publicDir, 0777, true);
$text = 'some-text ' . md5(random_bytes(5));
$css = "body { background-color: tomato !important; }";
file_put_contents("{$publicDir}/file.txt", $text);
file_put_contents("{$publicDir}/file.css", $css);
copy($this->files->testFilePath('test-image.png'), "{$publicDir}/image.png");
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/file.txt");
$resp->assertStreamedContent($text);
$resp->assertHeader('Content-Type', 'text/plain; charset=utf-8');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/image.png");
$resp->assertHeader('Content-Type', 'image/png');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/file.css");
$resp->assertStreamedContent($css);
$resp->assertHeader('Content-Type', 'text/css; charset=utf-8');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
});
}
}

521
tests/ThemeTest.php Normal file
View File

@@ -0,0 +1,521 @@
<?php
namespace Tests;
use BookStack\Activity\ActivityType;
use BookStack\Activity\DispatchWebhookJob;
use BookStack\Activity\Models\Webhook;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Tools\PageContent;
use BookStack\Exceptions\ThemeException;
use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;
use BookStack\Users\Models\User;
use Illuminate\Console\Command;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\File;
use League\CommonMark\Environment\Environment;
class ThemeTest extends TestCase
{
protected string $themeFolderName;
protected string $themeFolderPath;
public function test_translation_text_can_be_overridden_via_theme()
{
$this->usingThemeFolder(function () {
$translationPath = theme_path('/lang/en');
File::makeDirectory($translationPath, 0777, true);
$customTranslations = '<?php
return [\'books\' => \'Sandwiches\'];
';
file_put_contents($translationPath . '/entities.php', $customTranslations);
$homeRequest = $this->actingAs($this->users->viewer())->get('/');
$this->withHtml($homeRequest)->assertElementContains('header nav', 'Sandwiches');
});
}
public function test_theme_functions_file_used_and_app_boot_event_runs()
{
$this->usingThemeFolder(function ($themeFolder) {
$functionsFile = theme_path('functions.php');
app()->alias('cat', 'dog');
file_put_contents($functionsFile, "<?php\nTheme::listen(\BookStack\Theming\ThemeEvents::APP_BOOT, function(\$app) { \$app->alias('cat', 'dog');});");
$this->runWithEnv(['APP_THEME' => $themeFolder], function () {
$this->assertEquals('cat', $this->app->getAlias('dog'));
});
});
}
public function test_theme_functions_loads_errors_are_caught_and_logged()
{
$this->usingThemeFolder(function ($themeFolder) {
$functionsFile = theme_path('functions.php');
file_put_contents($functionsFile, "<?php\n\\BookStack\\Biscuits::eat();");
$this->expectException(ThemeException::class);
$this->expectExceptionMessageMatches('/Failed loading theme functions file at ".*?" with error: Class "BookStack\\\\Biscuits" not found/');
$this->runWithEnv(['APP_THEME' => $themeFolder], fn() => null);
});
}
public function test_event_commonmark_environment_configure()
{
$callbackCalled = false;
$callback = function ($environment) use (&$callbackCalled) {
$this->assertInstanceOf(Environment::class, $environment);
$callbackCalled = true;
return $environment;
};
Theme::listen(ThemeEvents::COMMONMARK_ENVIRONMENT_CONFIGURE, $callback);
$page = $this->entities->page();
$content = new PageContent($page);
$content->setNewMarkdown('# test', $this->users->editor());
$this->assertTrue($callbackCalled);
}
public function test_event_web_middleware_before()
{
$callbackCalled = false;
$requestParam = null;
$callback = function ($request) use (&$callbackCalled, &$requestParam) {
$requestParam = $request;
$callbackCalled = true;
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_BEFORE, $callback);
$this->get('/login', ['Donkey' => 'cat']);
$this->assertTrue($callbackCalled);
$this->assertInstanceOf(Request::class, $requestParam);
$this->assertEquals('cat', $requestParam->header('donkey'));
}
public function test_event_web_middleware_before_return_val_used_as_response()
{
$callback = function (Request $request) {
return response('cat', 412);
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_BEFORE, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$resp->assertSee('cat');
$resp->assertStatus(412);
}
public function test_event_web_middleware_after()
{
$callbackCalled = false;
$requestParam = null;
$responseParam = null;
$callback = function ($request, Response $response) use (&$callbackCalled, &$requestParam, &$responseParam) {
$requestParam = $request;
$responseParam = $response;
$callbackCalled = true;
$response->header('donkey', 'cat123');
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_AFTER, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$this->assertTrue($callbackCalled);
$this->assertInstanceOf(Request::class, $requestParam);
$this->assertInstanceOf(Response::class, $responseParam);
$resp->assertHeader('donkey', 'cat123');
}
public function test_event_web_middleware_after_return_val_used_as_response()
{
$callback = function () {
return response('cat456', 443);
};
Theme::listen(ThemeEvents::WEB_MIDDLEWARE_AFTER, $callback);
$resp = $this->get('/login', ['Donkey' => 'cat']);
$resp->assertSee('cat456');
$resp->assertStatus(443);
}
public function test_event_auth_login_standard()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_LOGIN, $callback);
$this->post('/login', ['email' => 'admin@admin.com', 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertInstanceOf(User::class, $args[1]);
}
public function test_event_auth_register_standard()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertInstanceOf(User::class, $args[1]);
}
public function test_event_auth_pre_register()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::AUTH_PRE_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$this->assertCount(2, $args);
$this->assertEquals('standard', $args[0]);
$this->assertEquals([
'email' => $user->email,
'name' => $user->name,
'password' => 'password',
], $args[1]);
$this->assertDatabaseHas('users', ['email' => $user->email]);
}
public function test_event_auth_pre_register_with_false_return_blocks_registration()
{
$callback = function () {
return false;
};
Theme::listen(ThemeEvents::AUTH_PRE_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
$user = User::factory()->make();
$resp = $this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$resp->assertRedirect('/login');
$this->assertSessionError('User account could not be registered for the provided details');
$this->assertDatabaseMissing('users', ['email' => $user->email]);
}
public function test_event_webhook_call_before()
{
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
return ['test' => 'hello!'];
};
Theme::listen(ThemeEvents::WEBHOOK_CALL_BEFORE, $callback);
$responses = $this->mockHttpClient([new \GuzzleHttp\Psr7\Response(200, [], '')]);
$webhook = new Webhook(['name' => 'Test webhook', 'endpoint' => 'https://example.com']);
$webhook->save();
$event = ActivityType::PAGE_UPDATE;
$detail = Page::query()->first();
dispatch((new DispatchWebhookJob($webhook, $event, $detail)));
$this->assertCount(5, $args);
$this->assertEquals($event, $args[0]);
$this->assertEquals($webhook->id, $args[1]->id);
$this->assertEquals($detail->id, $args[2]->id);
$this->assertEquals(1, $responses->requestCount());
$request = $responses->latestRequest();
$reqData = json_decode($request->getBody(), true);
$this->assertEquals('hello!', $reqData['test']);
}
public function test_event_activity_logged()
{
$book = $this->entities->book();
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
};
Theme::listen(ThemeEvents::ACTIVITY_LOGGED, $callback);
$this->asEditor()->put($book->getUrl(), ['name' => 'My cool update book!']);
$this->assertCount(2, $args);
$this->assertEquals(ActivityType::BOOK_UPDATE, $args[0]);
$this->assertTrue($args[1] instanceof Book);
$this->assertEquals($book->id, $args[1]->id);
}
public function test_event_page_include_parse()
{
/** @var Page $page */
/** @var Page $otherPage */
$page = $this->entities->page();
$otherPage = Page::query()->where('id', '!=', $page->id)->first();
$otherPage->html = '<p id="bkmrk-cool">This is a really cool section</p>';
$page->html = "<p>{{@{$otherPage->id}#bkmrk-cool}}</p>";
$page->save();
$otherPage->save();
$args = [];
$callback = function (...$eventArgs) use (&$args) {
$args = $eventArgs;
return '<strong>Big &amp; content replace surprise!</strong>';
};
Theme::listen(ThemeEvents::PAGE_INCLUDE_PARSE, $callback);
$resp = $this->asEditor()->get($page->getUrl());
$this->withHtml($resp)->assertElementContains('.page-content strong', 'Big & content replace surprise!');
$this->assertCount(4, $args);
$this->assertEquals($otherPage->id . '#bkmrk-cool', $args[0]);
$this->assertEquals('This is a really cool section', $args[1]);
$this->assertTrue($args[2] instanceof Page);
$this->assertTrue($args[3] instanceof Page);
$this->assertEquals($page->id, $args[2]->id);
$this->assertEquals($otherPage->id, $args[3]->id);
}
public function test_event_routes_register_web_and_web_auth()
{
$functionsContent = <<<'END'
<?php
use BookStack\Theming\ThemeEvents;
use BookStack\Facades\Theme;
use Illuminate\Routing\Router;
Theme::listen(ThemeEvents::ROUTES_REGISTER_WEB, function (Router $router) {
$router->get('/cat', fn () => 'cat')->name('say.cat');
});
Theme::listen(ThemeEvents::ROUTES_REGISTER_WEB_AUTH, function (Router $router) {
$router->get('/dog', fn () => 'dog')->name('say.dog');
});
END;
$this->usingThemeFolder(function () use ($functionsContent) {
$functionsFile = theme_path('functions.php');
file_put_contents($functionsFile, $functionsContent);
$app = $this->createApplication();
/** @var \Illuminate\Routing\Router $router */
$router = $app->get('router');
/** @var \Illuminate\Routing\Route $catRoute */
$catRoute = $router->getRoutes()->getRoutesByName()['say.cat'];
$this->assertEquals(['web'], $catRoute->middleware());
/** @var \Illuminate\Routing\Route $dogRoute */
$dogRoute = $router->getRoutes()->getRoutesByName()['say.dog'];
$this->assertEquals(['web', 'auth'], $dogRoute->middleware());
});
}
public function test_add_social_driver()
{
Theme::addSocialDriver('catnet', [
'client_id' => 'abc123',
'client_secret' => 'def456',
], 'SocialiteProviders\Discord\DiscordExtendSocialite@handleTesting');
$this->assertEquals('catnet', config('services.catnet.name'));
$this->assertEquals('abc123', config('services.catnet.client_id'));
$this->assertEquals(url('/login/service/catnet/callback'), config('services.catnet.redirect'));
$loginResp = $this->get('/login');
$loginResp->assertSee('login/service/catnet');
}
public function test_add_social_driver_uses_name_in_config_if_given()
{
Theme::addSocialDriver('catnet', [
'client_id' => 'abc123',
'client_secret' => 'def456',
'name' => 'Super Cat Name',
], 'SocialiteProviders\Discord\DiscordExtendSocialite@handleTesting');
$this->assertEquals('Super Cat Name', config('services.catnet.name'));
$loginResp = $this->get('/login');
$loginResp->assertSee('Super Cat Name');
}
public function test_add_social_driver_allows_a_configure_for_redirect_callback_to_be_passed()
{
Theme::addSocialDriver(
'discord',
[
'client_id' => 'abc123',
'client_secret' => 'def456',
'name' => 'Super Cat Name',
],
'SocialiteProviders\Discord\DiscordExtendSocialite@handle',
function ($driver) {
$driver->with(['donkey' => 'donut']);
}
);
$loginResp = $this->get('/login/service/discord');
$redirect = $loginResp->headers->get('location');
$this->assertStringContainsString('donkey=donut', $redirect);
}
public function test_register_command_allows_provided_command_to_be_usable_via_artisan()
{
Theme::registerCommand(new MyCustomCommand());
Artisan::call('bookstack:test-custom-command', []);
$output = Artisan::output();
$this->assertStringContainsString('Command ran!', $output);
}
public function test_base_body_start_and_end_template_files_can_be_used()
{
$bodyStartStr = 'barry-fought-against-the-panther';
$bodyEndStr = 'barry-lost-his-fight-with-grace';
$this->usingThemeFolder(function (string $folder) use ($bodyStartStr, $bodyEndStr) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/base-body-start.blade.php', $bodyStartStr);
file_put_contents($viewDir . '/base-body-end.blade.php', $bodyEndStr);
$resp = $this->asEditor()->get('/');
$resp->assertSee($bodyStartStr);
$resp->assertSee($bodyEndStr);
});
}
public function test_export_body_start_and_end_template_files_can_be_used()
{
$bodyStartStr = 'garry-fought-against-the-panther';
$bodyEndStr = 'garry-lost-his-fight-with-grace';
$page = $this->entities->page();
$this->usingThemeFolder(function (string $folder) use ($bodyStartStr, $bodyEndStr, $page) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/export-body-start.blade.php', $bodyStartStr);
file_put_contents($viewDir . '/export-body-end.blade.php', $bodyEndStr);
$resp = $this->asEditor()->get($page->getUrl('/export/html'));
$resp->assertSee($bodyStartStr);
$resp->assertSee($bodyEndStr);
});
}
public function test_login_and_register_message_template_files_can_be_used()
{
$loginMessage = 'Welcome to this instance, login below you scallywag';
$registerMessage = 'You want to register? Enter the deets below you numpty';
$this->usingThemeFolder(function (string $folder) use ($loginMessage, $registerMessage) {
$viewDir = theme_path('auth/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/login-message.blade.php', $loginMessage);
file_put_contents($viewDir . '/register-message.blade.php', $registerMessage);
$this->setSettings(['registration-enabled' => 'true']);
$this->get('/login')->assertSee($loginMessage);
$this->get('/register')->assertSee($registerMessage);
});
}
public function test_header_links_start_template_file_can_be_used()
{
$content = 'This is added text in the header bar';
$this->usingThemeFolder(function (string $folder) use ($content) {
$viewDir = theme_path('layouts/parts');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/header-links-start.blade.php', $content);
$this->setSettings(['registration-enabled' => 'true']);
$this->get('/login')->assertSee($content);
});
}
public function test_custom_settings_category_page_can_be_added_via_view_file()
{
$content = 'My SuperCustomSettings';
$this->usingThemeFolder(function (string $folder) use ($content) {
$viewDir = theme_path('settings/categories');
mkdir($viewDir, 0777, true);
file_put_contents($viewDir . '/beans.blade.php', $content);
$this->asAdmin()->get('/settings/beans')->assertSee($content);
});
}
public function test_public_folder_contents_accessible_via_route()
{
$this->usingThemeFolder(function (string $themeFolderName) {
$publicDir = theme_path('public');
mkdir($publicDir, 0777, true);
$text = 'some-text ' . md5(random_bytes(5));
$css = "body { background-color: tomato !important; }";
file_put_contents("{$publicDir}/file.txt", $text);
file_put_contents("{$publicDir}/file.css", $css);
copy($this->files->testFilePath('test-image.png'), "{$publicDir}/image.png");
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/file.txt");
$resp->assertStreamedContent($text);
$resp->assertHeader('Content-Type', 'text/plain; charset=utf-8');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/image.png");
$resp->assertHeader('Content-Type', 'image/png');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
$resp = $this->asAdmin()->get("/theme/{$themeFolderName}/file.css");
$resp->assertStreamedContent($css);
$resp->assertHeader('Content-Type', 'text/css; charset=utf-8');
$resp->assertHeader('Cache-Control', 'max-age=86400, private');
});
}
protected function usingThemeFolder(callable $callback)
{
// Create a folder and configure a theme
$themeFolderName = 'testing_theme_' . str_shuffle(rtrim(base64_encode(time()), '='));
config()->set('view.theme', $themeFolderName);
$themeFolderPath = theme_path('');
// Create theme folder and clean it up on application tear-down
File::makeDirectory($themeFolderPath);
$this->beforeApplicationDestroyed(fn() => File::deleteDirectory($themeFolderPath));
// Run provided callback with theme env option set
$this->runWithEnv(['APP_THEME' => $themeFolderName], function () use ($callback, $themeFolderName) {
call_user_func($callback, $themeFolderName);
});
}
}
class MyCustomCommand extends Command
{
protected $signature = 'bookstack:test-custom-command';
public function handle()
{
$this->line('Command ran!');
}
}

View File

@@ -1 +1 @@
v26.01-dev
v25.12.2