├── .dockerignore
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── config.yml
├── dependabot.yml
└── workflows
│ ├── main.yml
│ └── manual.yml
├── CHANGELOG.md
├── Dockerfile
├── LICENSE
├── README.md
├── build-assets
├── scripts
│ └── .empty
└── src
│ └── .empty
├── examples
└── docker-compose.yml
└── install
├── assets
└── defaults
│ └── 30-bookstack
└── etc
├── cont-init.d
└── 30-bookstack
├── nginx
└── sites.available
│ └── bookstack.conf
└── services.available
├── 30-bookstack-ldap
└── run
└── 31-bookstack-optimize-images
└── run
/.dockerignore:
--------------------------------------------------------------------------------
1 | examples/
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [tiredofit]
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: If something isn't working right..
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Summary
11 |
12 |
13 |
14 |
15 | ### Steps to reproduce
16 |
17 |
18 |
19 |
20 | ### What is the expected *correct* behavior?
21 |
22 |
23 |
24 |
25 | ### Relevant logs and/or screenshots
26 |
27 |
28 |
29 | ### Environment
30 |
31 |
32 | - Image version / tag:
33 | - Host OS:
34 |
35 |
36 | Any logs | docker-compose.yml
37 |
38 |
39 |
40 |
41 | ### Possible fixes
42 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea or feature
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | ---
11 | name: Feature Request
12 | about: Suggest an idea for this project
13 |
14 | ---
15 |
16 | **Description of the feature**
17 |
18 |
19 | **Benftits of feature**
20 |
21 |
22 | **Additional context**
23 |
24 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Maintain dependencies for GitHub Actions
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | ### Application Level Image CI - Bookstack
2 | ### Dave Conroy
3 |
4 | name: 'Multi PHP Version Build'
5 | on:
6 | push:
7 | paths:
8 | - '**'
9 | - '!README.md'
10 | jobs:
11 | # php80:
12 | # uses: tiredofit/github_actions/.github/workflows/php80_alpine_amd64_armv7_arm64.yml@main
13 | # secrets: inherit
14 | # php81:
15 | # uses: tiredofit/github_actions/.github/workflows/php81_alpine_amd64_armv7_arm64.yml@main
16 | # secrets: inherit
17 | php83:
18 | uses: tiredofit/github_actions/.github/workflows/php83_alpine_amd64.yml@main
19 | secrets: inherit
20 |
--------------------------------------------------------------------------------
/.github/workflows/manual.yml:
--------------------------------------------------------------------------------
1 | # Manual Workflow (Application)
2 |
3 | name: manual
4 |
5 | on:
6 | workflow_dispatch:
7 | inputs:
8 | Manual Build:
9 | description: 'Manual Build'
10 | required: false
11 | jobs:
12 | # php80:
13 | # uses: tiredofit/github_actions/.github/workflows/php80_alpine_amd64_armv7_arm64.yml@main
14 | # secrets: inherit
15 | # php81:
16 | # uses: tiredofit/github_actions/.github/workflows/php81_alpine_amd64_armv7_arm64.yml@main
17 | # secrets: inherit
18 | php83:
19 | uses: tiredofit/github_actions/.github/workflows/php83_alpine_amd64.yml@main
20 | secrets: inherit
21 |
22 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.9.38 2025-05-31
2 |
3 | ### Added
4 | - BookStack 25.05
5 |
6 |
7 | ## 1.9.37 2025-05-17
8 |
9 | ### Added
10 | - Change github actions to PHP8.3
11 | - Enable ZIP PHP module at buildtime
12 |
13 |
14 | ## 1.9.36 2025-05-17
15 |
16 | ### Added
17 | - BookStack 25.02.5
18 |
19 |
20 | ## 1.9.35 2025-05-08
21 |
22 | ### Added
23 | - BookStack 25.02.4
24 |
25 |
26 | ## 1.9.34 2025-05-05
27 |
28 | ### Changed
29 | - Handle old base image upgrade scenarios
30 |
31 |
32 | ## 1.9.33 2025-05-05
33 |
34 | ### Added
35 | - Pin to tiredofit/nginx-php-fpm:7.7.19
36 | - BookStack 25.02.3
37 |
38 |
39 | ## 1.9.32 2025-04-24
40 |
41 | ### Added
42 | - Add support for REDIS_PASS variable
43 |
44 |
45 | ## 1.9.31 2025-04-24
46 |
47 | ### Added
48 | - feat: Conditionally add Redis password to connection string
49 |
50 | ## 1.9.30 2025-04-02
51 |
52 | ### Added
53 | - Book Stack 25.02.2
54 |
55 |
56 | ## 1.9.29 2025-03-17
57 |
58 | ### Added
59 | - Book Stack 25.2.1
60 |
61 |
62 | ## 1.9.28 2025-02-26
63 |
64 | ### Added
65 | - Change to PHP 8.3 Base
66 | - BookStack 25.02
67 |
68 |
69 | ## 1.9.27 2025-01-06
70 |
71 | ### Added
72 | - BookStack 24.12.1
73 |
74 |
75 | ## 1.9.26 2024-12-23
76 |
77 | ### Added
78 | - BookStack 24.12
79 |
80 |
81 | ## 1.9.25 2024-11-29
82 |
83 | ### Added
84 | - BookStack 24.10.3
85 |
86 |
87 | ## 1.9.24 2024-11-13
88 |
89 | ### Added
90 | - Bookstack 24.10.2
91 | - Pin to tiredofit/nginx-php-fpm:7.7.13
92 |
93 |
94 | ## 1.9.23 2024-10-09
95 |
96 | ### Changed
97 | - Fix previous release
98 |
99 |
100 | ## 1.9.22 2024-10-09
101 |
102 | ### Added
103 | - Bookstack 24.10
104 | - Pin to tiredofit/nginx-php-fpm:8.2-alpine-7.7.12
105 |
106 |
107 | ## 1.9.21 2024-08-29
108 |
109 | ### Added
110 | - BookStack 24.05.4
111 |
112 |
113 | ## 1.9.20 2024-07-14
114 |
115 | ### Added
116 | - Bookstack 24.05.3
117 |
118 |
119 | ## 1.9.19 2024-06-10
120 |
121 | ### Added
122 | - Bookstack 24.05.2
123 |
124 |
125 | ## 1.9.18 2024-05-21
126 |
127 | ### Added
128 | - Bookstack 24.05.1
129 |
130 |
131 | ## 1.9.17 2024-05-11
132 |
133 | ### Added
134 | - Bookstack 24.05
135 |
136 | ### Reverted
137 | - Removal of PDF options and wkhtmlpdf
138 |
139 |
140 | ## 1.9.16 2024-04-05
141 |
142 | ### Added
143 | - Bookstack 24.02.3
144 |
145 |
146 | ## 1.9.15 2024-03-11
147 |
148 | ### Added
149 | - Bookstack 24.02.2
150 |
151 |
152 | ## 1.9.14 2024-03-10
153 |
154 | ### Added
155 | - Bookstack 24.02.1
156 |
157 |
158 | ## 1.9.13 2024-02-28
159 |
160 | ### Added
161 | - Bookstack 24.02
162 |
163 |
164 | ## 1.9.12 2024-02-26
165 |
166 | ### Added
167 | - Bookstack 23.12.3
168 |
169 |
170 | ## 1.9.11 2024-01-24
171 |
172 | ### Added
173 | - Bookstack 23.12.2
174 |
175 |
176 | ## 1.9.10 2024-01-16
177 |
178 | ### Added
179 | - Bookstack 23.12.1
180 |
181 |
182 | ## 1.9.9 2023-12-29
183 |
184 | ### Added
185 | - Bookstack 23.12
186 |
187 |
188 | ## 1.9.8 2023-11-20
189 |
190 | ### Added
191 | - Bookstack 23.10.4
192 |
193 |
194 | ## 1.9.7 2023-11-07
195 |
196 | ### Added
197 | - Bookstack 23.10.2
198 |
199 |
200 | ## 1.9.6 2023-11-02
201 |
202 | ### Added
203 | - Bookstack 23.10.1
204 |
205 |
206 | ## 1.9.5 2023-10-30
207 |
208 | ### Added
209 | - Bookstack 23.10
210 |
211 |
212 | ## 1.9.4 2023-09-15
213 |
214 | ### Added
215 | - Bookstack 23.08.3
216 |
217 |
218 | ## 1.9.3 2023-09-15
219 |
220 | ### Added
221 | - Bookstack 28.8.3
222 |
223 |
224 | ## 1.9.2 2023-09-04
225 |
226 | ### Added
227 | - Bookstack 23.08.2
228 |
229 |
230 | ## 1.9.1 2023-09-03
231 |
232 | ### Added
233 | - Bookstack 23.08.1
234 |
235 |
236 | ## 1.9.0 2023-08-30
237 |
238 | ### Added
239 | - Add ALLOWED_SSR_HOSTS to protect server side requests with webhooks as part of new feature of 23.08
240 |
241 |
242 | ## 1.8.8 2023-08-30
243 |
244 | ### Added
245 | - Bookstack 23.08
246 |
247 |
248 | ## 1.8.7 2023-07-12
249 |
250 | ### Added
251 | - Bookstack 23.06.2
252 |
253 |
254 | ## 1.8.6 2023-07-05
255 |
256 | ### Added
257 | - Bookstack 23.06.1
258 |
259 |
260 | ## 1.8.5 2023-06-30
261 |
262 | ### Added
263 | - Bookstack 23.06
264 |
265 |
266 | ## 1.8.4 2023-05-23
267 |
268 | ### Added
269 | - Bookstack 23.05.2
270 |
271 |
272 | ## 1.8.3 2023-05-10
273 |
274 | ### Changed
275 | - Alpine 3.18 base
276 |
277 |
278 | ## 1.8.2 2023-05-08
279 |
280 | ### Added
281 | - Bookstack 23.05.1
282 |
283 |
284 | ## 1.8.1 2023-05-03
285 |
286 | ### Added
287 | - Bookstack 23.05
288 |
289 |
290 | ## 1.8.0 2023-04-26
291 |
292 | ### Added
293 | - Introduce support for '_FILE' environment variables
294 |
295 |
296 | ## 1.7.8 2023-04-07
297 |
298 | ### Added
299 | - Bookstack 23.02.3
300 |
301 |
302 | ## 1.7.7 2023-03-25
303 |
304 | ### Added
305 | - Bookstack 23.02.2
306 |
307 |
308 | ## 1.7.6 2023-03-16
309 |
310 | ### Added
311 | - Add build_assets folder and functionality to inject code and scripts into the build process
312 |
313 |
314 | ## 1.7.5 2023-02-27
315 |
316 | ### Added
317 | - Bookstack 23.02.1
318 |
319 |
320 | ## 1.7.4 2023-02-26
321 |
322 | ### Added
323 | - Bookstack 23.02
324 |
325 |
326 | ## 1.7.3 2023-02-02
327 |
328 | ### Added
329 | - Bookstack 23.01.1
330 |
331 |
332 | ## 1.7.2 2023-01-31
333 |
334 | ### Added
335 | - Bookstack 23.01
336 |
337 |
338 | ## 1.7.1 2022-12-16
339 |
340 | ### Added
341 | - Bookstack 22.11.1
342 |
343 |
344 | ## 1.7.0 2022-11-30
345 |
346 | ### Added
347 | - Bookstack 22.11
348 | - Rework Dockerfile and Github Actions
349 |
350 |
351 | ## 1.6.66 2022-11-02
352 |
353 | ### Added
354 | - Bookstack 22.10.2
355 |
356 |
357 | ## 1.6.65 2022-10-21
358 |
359 | ### Added
360 | - Bookstack 22.10.1
361 |
362 |
363 | ## 1.6.64 2022-10-21
364 |
365 | ### Added
366 | - Bookstack 22.10
367 | - Add IP_PRECISION environment variable
368 | - Added LOG_FAILED_LOGIN_* environment variable for log tracking
369 |
370 | ### Changed
371 | - Change OIDC Group Claim environment variable
372 | - Code cleanup
373 |
374 |
375 | ## 1.6.63 2022-10-05
376 |
377 | ### Added
378 | - Migrate legacy nginx configuration
379 |
380 |
381 | ## 1.6.62 2022-09-20
382 |
383 | ### Added
384 | - Bookstack 22.09.1
385 |
386 |
387 | ## 1.6.61 2022-09-11
388 |
389 | ### Changed
390 | - Update defaults
391 | - Change revision count to 100 as per upstream
392 |
393 |
394 | ## 1.6.60 2022-09-11
395 |
396 | ### Added
397 | - Bookstack 22.09
398 | - Additional OIDC Group Syncing options
399 |
400 |
401 | ## 1.6.59 2022-08-11
402 |
403 | ### Added
404 | - Bookstack 22.07.3
405 |
406 |
407 | ## 1.6.58 2022-08-09
408 |
409 | ### Added
410 | - Bookstack 22.07.2
411 |
412 |
413 | ## 1.6.57 2022-08-09
414 |
415 | ### Added
416 |
417 |
418 | ## 1.6.56 2022-08-08
419 |
420 | ### Changed
421 | - Change bookstack log file name from bookstack to default laravel.log
422 |
423 |
424 | ## 1.6.55 2022-08-06
425 |
426 | ### Added
427 | - Start using custom_scripts and custom_files functions from base
428 |
429 |
430 | ## 1.6.54 2022-08-02
431 |
432 | ### Added
433 | - Bookstack 22.07.1
434 |
435 |
436 | ## 1.6.53 2022-07-29
437 |
438 | ### Added
439 | - Bookstack 22.07
440 |
441 |
442 | ## 1.6.52 2022-06-28
443 |
444 | ### Added
445 | - Bookstack 22.06.2
446 |
447 |
448 | ## 1.6.51 2022-06-25
449 |
450 | ### Added
451 | - Bookstack 22.06.1
452 |
453 |
454 | ## 1.6.50 2022-06-24
455 |
456 | ### Added
457 | - Bookstack 22.06
458 | - Update to support custom DB Port for database migrations
459 | - Code cleanup
460 | - ENABLE_AUTO_LOGIN environment variable should SAML or OIDC be the only authentication choice available
461 |
462 |
463 | ## 1.6.49 2022-06-23
464 |
465 | ### Added
466 | - Support tiredofit/nginx:6.0.0 and tiredofit/nginx-php-fpm:7.0.0 changes
467 |
468 |
469 | ## 1.6.48 2022-05-12
470 |
471 | ### Changed
472 | - Version bump to build multiple PHP versions
473 |
474 |
475 | ## 1.6.47 2022-05-09
476 |
477 | ### Added
478 | - Bookstack 22.04.2
479 |
480 |
481 | ## 1.6.46 2022-05-04
482 |
483 | ### Added
484 | - Bookstack 22.04.1
485 |
486 |
487 | ## 1.6.45 2022-04-29
488 |
489 | ### Added
490 | - Bookstack 22.04
491 |
492 |
493 | ## 1.6.44 2022-03-30
494 |
495 | ### Added
496 | - Bookstack 22.03.1
497 |
498 |
499 | ## 1.6.43 2022-03-30
500 |
501 | ### Added
502 | - Bookstack 22.03
503 |
504 |
505 | ## 1.6.42 2022-03-14
506 |
507 | ### Changed
508 | - Fix issues relating to S6 overlay dropping use of /var/run/s6/services
509 |
510 |
511 | ## 1.6.41 2022-03-07
512 |
513 | ### Added
514 | - Bookstack 22.02.3
515 | - Add ALLOWED_IFRAME_SOURCES environment variable to limit what websites can be loaded in an iframe
516 |
517 |
518 | ## 1.6.40 2022-03-01
519 |
520 | ### Added
521 | - Bookstack 22.02.2
522 |
523 |
524 | ## 1.6.39 2022-02-27
525 |
526 | ### Added
527 | - Bookstack 22.02.1
528 |
529 |
530 | ## 1.6.38 2022-02-26
531 |
532 | ### Added
533 | - Bookstack 22.02
534 |
535 |
536 | ## 1.6.37 2022-02-10
537 |
538 | ### Changed
539 | - Update to support upstream base image features
540 |
541 |
542 | ## 1.6.36 2022-02-06
543 |
544 | ### Added
545 | - Bookstack 21.12.5
546 |
547 |
548 | ## 1.6.35 2022-02-01
549 |
550 | ### Added
551 | - Bookstack 21.12.4
552 | - Added PDF_EXPORT_PAGE_SIZE environment variable (Default: a4)
553 |
554 |
555 | ## 1.6.34 2022-01-24
556 |
557 | ### Added
558 | - Bookstack 21.12.3
559 |
560 |
561 | ## 1.6.33 2022-01-10
562 |
563 | ### Added
564 | - Bookstack v21.12.2
565 |
566 |
567 | ## 1.6.32 2022-01-06
568 |
569 | ### Added
570 | - Bookstack 21.12.1
571 |
572 |
573 | ## 1.6.31 2021-12-22
574 |
575 | ### Added
576 | - Bookstack 21.12
577 |
578 |
579 | ## 1.6.30 2021-12-15
580 |
581 | ### Changed
582 | - Temporarily remove wkhtmltopdf package
583 |
584 |
585 | ## 1.6.29 2021-12-15
586 |
587 | ### Added
588 | - Bookstack 21.11.3
589 |
590 |
591 | ## 1.6.28 2021-11-30
592 |
593 | ### Added
594 | - Bookstack 21.11.2
595 |
596 |
597 | ## 1.6.27 2021-11-23
598 |
599 | ### Added
600 | - Bookstack 21.11.1
601 |
602 |
603 | ## 1.6.26 2021-11-16
604 |
605 | ### Added
606 | - Bookstack 21.11
607 | - New Environment Variable FILE_UPLOAD_MAX_SIZE (default 50)
608 |
609 |
610 | ## 1.6.25 2021-11-01
611 |
612 | ### Added
613 | - Bookstack 21.10.3
614 |
615 |
616 | ## 1.6.24 2021-10-28
617 |
618 | ### Added
619 | - Bookstack 21.10.2
620 |
621 |
622 | ## 1.6.23 2021-10-27
623 |
624 | ### Added
625 | - Bookstack 21.10.1
626 |
627 |
628 | ## 1.6.22 2021-10-25
629 |
630 | ### Added
631 | - Bookstack 21.10
632 | - Added Support for OIDC Logins
633 |
634 | ### Changed
635 | - Cleanup to SAML2 Code
636 |
637 |
638 | ## 1.6.21 2021-10-15
639 |
640 | ### Added
641 | - Bookstack 21.08.6
642 |
643 |
644 | ## 1.6.20 2021-10-08
645 |
646 | ### Added
647 | - Bookstack 21.08.5
648 |
649 |
650 | ## 1.6.19 2021-10-04
651 |
652 | ### Added
653 | - Bookstack 21.08.4
654 |
655 |
656 | ## 1.6.18 2021-09-23
657 |
658 | ### Changed
659 | - Alias reset
660 |
661 |
662 | ## 1.6.17 2021-09-23
663 |
664 | ### Changed
665 | - Fix artisan shortcut alias
666 |
667 |
668 | ## 1.6.16 2021-09-23
669 |
670 | ### Changed
671 | - Update what settings are called with WKHTMLPDF exporter selection
672 |
673 |
674 | ## 1.6.15 2021-09-19
675 |
676 | ### Changed
677 | - Artisan command reverts to previous directory after running
678 |
679 |
680 | ## 1.6.14 2021-09-12
681 |
682 | ### Added
683 | - Bookstack 21.08.3
684 |
685 |
686 | ## 1.6.13 2021-09-04
687 |
688 | ### Added
689 | - Add LOG_PATH and LOG_FILE variables
690 |
691 | ### Changed
692 | - Change the way logroation config is generated
693 |
694 |
695 | ## 1.6.12 2021-09-04
696 |
697 | ### Added
698 | - Bookstack 21.08.2
699 |
700 |
701 | ## 1.6.11 2021-09-02
702 |
703 | ### Added
704 | - Bookstack 21.08.1
705 |
706 |
707 | ## 1.6.10 2021-08-04
708 |
709 | ### Added
710 | - Bookstack 21.05.4
711 |
712 |
713 | ## 1.6.9 2021-07-03
714 |
715 | ### Added
716 | - Bookstack 21.05.3
717 |
718 |
719 | ## 1.6.8 2021-06-13
720 |
721 | ### Added
722 | - Bookstack 21.05.2
723 |
724 |
725 | ## 1.6.7 2021-06-04
726 |
727 | ### Added
728 | - Bookstack 24.05.1
729 |
730 |
731 | ## 1.6.6 2021-05-30
732 |
733 | ### Added
734 | - Bookstack v24.05
735 |
736 |
737 | ## 1.6.5 2021-05-15
738 |
739 | ### Added
740 | - BookStack v21.04.5
741 |
742 |
743 | ## 1.6.4 2021-05-09
744 |
745 | ### Added
746 | - Bookstack v21.04.4
747 |
748 |
749 | ## 1.6.3 2021-04-27
750 |
751 | ### Added
752 | - Bookstack 21.04.3
753 |
754 |
755 | ## 1.6.2 2021-04-20
756 |
757 | ### Added
758 | - Bookstack 21.04.2
759 |
760 |
761 | ## 1.6.1 2021-04-19
762 |
763 | ### Added
764 | - Bookstack 21.04.1
765 |
766 |
767 | ## 1.6.0 2021-04-09
768 |
769 | ### Added
770 | - Bookstack 21.04
771 | - PHP 8.0.x
772 |
773 |
774 | ## 1.5.8 2021-03-13
775 |
776 | ### Added
777 | - Bookstack 0.31.8
778 |
779 |
780 | ## 1.5.7 2021-03-02
781 |
782 | ### Added
783 | - Bookstack 0.31.7
784 |
785 |
786 | ## 1.5.6 2021-02-06
787 |
788 | ### Added
789 | - Bookstack v0.31.6
790 |
791 |
792 | ## 1.5.5 2021-02-02
793 |
794 | ### Added
795 | - Booksack 0.31.5
796 |
797 |
798 | ## 1.5.4 2021-01-16
799 |
800 | ### Added
801 | - Bookstack 0.31.4
802 |
803 |
804 | ## 1.5.3 2021-01-11
805 |
806 | ### Added
807 | - Bookstack 0.31.3
808 |
809 |
810 | ## 1.5.2 2021-01-09
811 |
812 | ### Changed
813 | - Additional Iframe Hosts fix
814 |
815 |
816 | ## 1.5.1 2021-01-09
817 |
818 | ### Changed
819 | - Bugfix with ALLOWED_IFRAME_HOSTS
820 |
821 |
822 | ## 1.5.0 2021-01-04
823 |
824 | ### Added
825 | - Bookstack 0.31.1
826 | - Added environment variable ALLOWED_IFRAME_HOSTS to support loading as an IFrame from other domains
827 |
828 |
829 | ## 1.4.2 2020-12-18
830 |
831 | ### Added
832 | - Bookstack 0.30.7
833 |
834 |
835 | ## 1.4.1 2020-12-17
836 |
837 | ### Added
838 | - Bookstack 0.30.6
839 |
840 |
841 | ## 1.4.0 2020-12-12
842 |
843 | ### Added
844 | - Switch to PHP 7.4
845 |
846 |
847 | ## 1.3.7 2020-12-06
848 |
849 | ### Added
850 | - Bookstack 0.30.5
851 |
852 |
853 | ## 1.3.6 2020-10-31
854 |
855 | ### Added
856 | - Bookstack 0.30.4
857 |
858 |
859 | ## 1.3.5 2020-10-20
860 |
861 | ### Changed
862 | - Fix Exclude email once and for all
863 |
864 |
865 | ## 1.3.4 2020-10-20
866 |
867 | ### Changed
868 | - Fix for LDAP_SYNC_EXCLUDE_EMAIL
869 |
870 |
871 | ## 1.3.3 2020-10-20
872 |
873 | ### Added
874 | - Add custom script support for LDAP sync
875 |
876 |
877 | ## 1.3.2 2020-10-20
878 |
879 | ### Added
880 | - Add LDAP_SYNC_BEGIN argument to schedule LDAP syncing to start
881 |
882 |
883 | ## 1.3.1 2020-10-20
884 |
885 | ### Added
886 | - Add option to start optimizing images at specific time along with interval
887 |
888 |
889 | ## 1.3.0 2020-10-20
890 |
891 | ### Added
892 | - Add automatic image optimization schedule via optipng and jpegoptim
893 |
894 |
895 | ## 1.2.3 2020-10-19
896 |
897 | ### Added
898 | - Add excluding from LDAP Sync command
899 |
900 |
901 | ## 1.2.2 2020-10-18
902 |
903 | ### Changed
904 | - Tweaks to LDAP Sync routine scheduler
905 |
906 |
907 | ## 1.2.1 2020-10-18
908 |
909 | ### Added
910 | - Add MAP_THEMES environment variable to map it to /data for persistence
911 |
912 |
913 | ## 1.2.0 2020-10-18
914 |
915 | ### Added
916 | - Redo LDAP Sync routines to have better scheduling support
917 |
918 |
919 | ## 1.1.10 2020-10-18
920 |
921 | ### Changed
922 | - Fix for auto upgrade function
923 | - Fix for Cron LDAP Sync routines
924 | - Cleanup extra fi
925 |
926 |
927 | ## 1.1.9 2020-10-18
928 |
929 | ### Added
930 | - Add initial LDAP synchronization routine on startup of container if Auth set to LDAP and Sync enabled
931 |
932 |
933 | ## 1.1.8 2020-10-18
934 |
935 | ### Added
936 | - Add SSO support for out of tree modification
937 |
938 |
939 | ## 1.1.7 2020-10-13
940 |
941 | ### Added
942 | - Bookstack v0.30.3
943 |
944 |
945 | ## 1.1.6 2020-09-30
946 |
947 | ### Added
948 | - Bookstack v.30.2
949 |
950 |
951 | ## 1.1.5 2020-09-26
952 |
953 | ### Added
954 | - Bookstack 0.30.1
955 |
956 |
957 | ## 1.1.4 2020-09-20
958 |
959 | ### Added
960 | - Bookstack 0.30.0
961 |
962 |
963 | ## 1.1.3 2020-09-05
964 |
965 | ### Changed
966 | - Stop looking for custom assets twice
967 |
968 |
969 | ## 1.1.2 2020-09-03
970 |
971 | ### Added
972 | - Adjustment to Sync User Filter name in .env
973 |
974 |
975 | ## 1.1.1 2020-09-03
976 |
977 | ### Changed
978 | - Fixes for LDAP support
979 |
980 |
981 | ## 1.1.0 2020-08-20
982 |
983 | ### Added
984 | - Pull version from customizable GIT source and branch
985 | - Add routines to support upcoming LDAP_SYNC_USER functionality
986 |
987 |
988 | ## 1.0.2 2020-07-29
989 |
990 | ### Added
991 | - Add `PDF_EXPORT` environment variable to switch between domPDF and wkhtmltoPDF
992 | - Added functionality to copy custom files from /assets/custom overtop of the nginx webroot on startup
993 | - Added functionality to execute custom scripts from /assets/custom-scripts/ to perform actions on container startup to extend image
994 |
995 |
996 | ## 1.0.1 2020-07-12
997 |
998 | ### Added
999 | - Add logrotation for bookstack/laravel logs
1000 |
1001 |
1002 | ## 1.0.0 2020-07-07
1003 |
1004 | ### Added
1005 | - Initial Release of Image
1006 | - Bookstack 0.29.3
1007 | - Custom Generating configuration on bootup
1008 | - Admin User and Password Generation on first startup
1009 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG PHP_VERSION=8.3
2 | ARG DISTRO="alpine"
3 |
4 | FROM docker.io/tiredofit/nginx-php-fpm:${PHP_VERSION}-${DISTRO}-7.7.19
5 | LABEL maintainer="Dave Conroy (github.com/tiredofit)"
6 |
7 | ARG BOOKSTACK_VERSION
8 |
9 | ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION:-"v25.05"} \
10 | BOOKSTACK_REPO_URL=https://github.com/BookStackApp/BookStack \
11 | PHP_ENABLE_CREATE_SAMPLE_PHP=FALSE \
12 | PHP_ENABLE_LDAP=TRUE \
13 | PHP_ENABLE_SIMPLEXML=TRUE \
14 | PHP_ENABLE_MEMCACHED=TRUE \
15 | PHP_ENABLE_PDO=TRUE \
16 | PHP_ENABLE_PDO_MYSQL=TRUE \
17 | PHP_ENABLE_FILEINFO=TRUE \
18 | PHP_ENABLE_TOKENIZER=TRUE \
19 | PHP_ENABLE_XMLWRITER=TRUE \
20 | PHP_ENABLE_ZIP=TRUE \
21 | NGINX_WEBROOT=/www/bookstack \
22 | NGINX_SITE_ENABLED=bookstack \
23 | CONTAINER_ENABLE_MESSAGING=TRUE \
24 | IMAGE_NAME="tiredofit/bookstack" \
25 | IMAGE_REPO_URL="https://github.com/tiredofit/docker-bookstack/"
26 |
27 | RUN source /assets/functions/00-container \
28 | set -x && \
29 | package update && \
30 | package upgrade && \
31 | package install .bookstack-run-deps \
32 | fontconfig \
33 | git \
34 | jpegoptim \
35 | libmemcached \
36 | optipng \
37 | && \
38 | \
39 | php-ext prepare && \
40 | php-ext reset && \
41 | php-ext enable core && \
42 | clone_git_repo "${BOOKSTACK_REPO_URL}" "${BOOKSTACK_VERSION}" /assets/install && \
43 | if [ -d "/build-assets/src" ] ; then cp -Rp /build-assets/src/* /assets/install ; fi; \
44 | if [ -d "/build-assets/scripts" ] ; then for script in /build-assets/scripts/*.sh; do echo "** Applying $script"; bash $script; done && \ ; fi ; \
45 | composer install && \
46 | \
47 | package cleanup && \
48 | rm -rf \
49 | /assets/install/.git \
50 | /assets/install/*.yml \
51 | /assets/install/dev \
52 | /assets/install/php*.xml \
53 | /assets/install/tests \
54 | /root/.composer
55 |
56 | COPY install /
57 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2022 Dave Conroy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # github.com/tiredofit/docker-bookstack
2 |
3 | [](https://github.com/tiredofit/docker-bookstack/releases/latest)
4 | [](https://github.com/tiredofit/docker-bookstack.git/actions)
5 | [](https://hub.docker.com/r/tiredofit/bookstack/)
6 | [](https://hub.docker.com/r/tiredofit/bookstack/)
7 | [](https://github.com/sponsors/tiredofit)
8 | [](https://www.paypal.me/tiredofit)
9 |
10 | * * *
11 |
12 | ## About
13 |
14 | This will build a Docker image for [Bookstack](https://bookstackapp.com/) - A Knowledge Base/Information Manager.
15 |
16 | - Automatically installs and sets up installation upon first start
17 |
18 | ## Maintainer
19 |
20 | - [Dave Conroy](https://github.com/tiredofit)
21 |
22 | ## Table of Contents
23 |
24 | - [About](#about)
25 | - [Maintainer](#maintainer)
26 | - [Table of Contents](#table-of-contents)
27 | - [Prerequisites and Assumptions](#prerequisites-and-assumptions)
28 | - [Installation](#installation)
29 | - [Build from Source](#build-from-source)
30 | - [Prebuilt Images](#prebuilt-images)
31 | - [Configuration](#configuration)
32 | - [Quick Start](#quick-start)
33 | - [Persistent Storage](#persistent-storage)
34 | - [Environment Variables](#environment-variables)
35 | - [Base Images used](#base-images-used)
36 | - [Core Options](#core-options)
37 | - [Bookstack Options](#bookstack-options)
38 | - [Authentication Settings](#authentication-settings)
39 | - [LDAP Options](#ldap-options)
40 | - [SAML Options](#saml-options)
41 | - [OpenID Connect](#openid-connect)
42 | - [External Login Services](#external-login-services)
43 | - [Cache and Session Settings](#cache-and-session-settings)
44 | - [Mail Settings](#mail-settings)
45 | - [Storage Settings](#storage-settings)
46 | - [Networking](#networking)
47 | - [Maintenance](#maintenance)
48 | - [Shell Access](#shell-access)
49 | - [Support](#support)
50 | - [Usage](#usage)
51 | - [Bugfixes](#bugfixes)
52 | - [Feature Requests](#feature-requests)
53 | - [Updates](#updates)
54 | - [License](#license)
55 | - [References](#references)
56 |
57 | ## Prerequisites and Assumptions
58 | * Assumes you are using some sort of SSL terminating reverse proxy such as:
59 | * [Traefik](https://github.com/tiredofit/docker-traefik)
60 | * [Nginx](https://github.com/jc21/nginx-proxy-manager)
61 | * [Caddy](https://github.com/caddyserver/caddy)
62 | * Requires access to a MySQL/MariaDB Database server
63 |
64 | ## Installation
65 |
66 | ### Build from Source
67 | Clone this repository and build the image with `docker build -t (imagename) .`
68 |
69 | ### Prebuilt Images
70 | Builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/bookstack)
71 |
72 | ```bash
73 | docker pull docker.io/tiredofit/bookstack:(imagetag)
74 | ```
75 |
76 | Builds of the image are also available on the [Github Container Registry](https://github.com/tiredofit/docker-bookstack/pkgs/container/docker-bookstack)
77 |
78 | ```
79 | docker pull ghcr.io/tiredofit/docker-bookstack:(imagetag)
80 | ```
81 |
82 | The following image tags are available along with their tagged release based on what's written in the [Changelog](CHANGELOG.md):
83 |
84 | | Container OS | Tag |
85 | | ------------ | --------- |
86 | | Alpine | `:latest` |
87 |
88 | ## Configuration
89 |
90 | ### Quick Start
91 |
92 | - The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). See the examples folder for a working [docker-compose.yml](examples/docker-compose.yml) that can be modified for development or production use.
93 |
94 | - Set various [environment variables](#environment-variables) to understand the capabilities of this image.
95 | - Map [persistent storage](#data-volumes) for access to configuration and data files for backup.
96 | - Make [networking ports](#networking) available for public access if necessary
97 |
98 | **The first boot can take from 2 minutes - 5 minutes depending on your CPU to setup the proper schemas.**
99 |
100 | - Login to the web server and enter in your admin email address, admin password and start configuring the system!
101 |
102 |
103 | ### Persistent Storage
104 |
105 | The following directories are used for configuration and can be mapped for persistent storage.
106 |
107 | | Directory | Description |
108 | | ---------------- | ---------------------------------------------------------------------------- |
109 | | `/www/logs` | Nginx and PHP Log files |
110 | | `/www/bookstack` | (Optional) If you want to expose the bookstack sourcecode expose this volume |
111 | | **OR** | |
112 | | `/data` | Hold onto your persistent sessions and cache between container restarts |
113 |
114 | ### Environment Variables
115 |
116 | #### Base Images used
117 |
118 | This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`,`nano`.
119 |
120 | Be sure to view the following repositories to understand all the customizable options:
121 |
122 | | Image | Description |
123 | | ------------------------------------------------------------- | -------------------------------------- |
124 | | [OS Base](https://github.com/tiredofit/docker-alpine/) | Customized Image based on Alpine Linux |
125 | | [Nginx](https://github.com/tiredofit/docker-nginx/) | Nginx webserver |
126 | | [PHP-FPM](https://github.com/tiredofit/docker-nginx-php-fpm/) | PHP Interpreter |
127 | #### Core Options
128 |
129 | | Parameter | Description | Default | `_FILE` |
130 | | -------------------------- | ---------------------------------------------------------------- | ----------------- | ------- |
131 | | `ADMIN_NAME` | Full name of Administrator Account | `BookStack Admin` | x |
132 | | `ADMIN_PASS` | Password of Administrator account | `password` | x |
133 | | `ADMIN_EMAIL` | Email address of Administrator Account | `admin@admin.com` | x |
134 | | `DB_HOST` | Host or container name of MariaDB Server e.g. `bookstack-db` | | x |
135 | | `DB_NAME` | MariaDB Database name e.g. `bookstack` | | x |
136 | | `DB_PASS` | MariaDB Password for above Database e.g. `password` | | x |
137 | | `DB_PORT` | MariaDB Port | `3306` | x |
138 | | `DB_USER` | MariaDB Username for above Database e.g. `bookstack` | | x |
139 | | `ENABLE_OPTMIZE_IMAGES` | Enable automatic image optimizations using optipng and jpegoptim | `TRUE` | |
140 | | `OPTIMIZE_IMAGES_BEGIN` | When to start image optimization use military time HHMM | `0300` | |
141 | | `OPTIMIZE_IMAGES_INTERVAL` | How often to perform image optimization in minutes | `1440` | |
142 | | `LANGUAGE` | Language for Application | `en` | |
143 | | `SETUP_TYPE` | `AUTO` generate configuration. `MANUAL` don't do anything | `AUTO` | |
144 | | `SITE_URL` | The full URL that you are serving this application from | `null` | |
145 | | `TIMEZONE` | Timezone - Use Unix Style | `Etc/UTC` | |
146 |
147 | -
148 |
149 | #### Bookstack Options
150 |
151 | | Parameter | Description | Default |
152 | | ---------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
153 | | `ALLOWED_IFRAME_HOSTS` | Allow serving Bookstack via an IFrame - Multiple can be used seperated by a line | |
154 | | `ALLOWED_IFRAME_SOURCES` | Allow IFrames from specific domains `*` for All | `https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com` |
155 | | `ALLOWED_SSR_HOSTS` | Allowed Server Side Request List (Webhooks) | `*` |
156 | | `ALLOW_CONTENT_SCRIPTS` | Allow javascript within content | `false` |
157 | | `ALLOW_ROBOTS` | Allow robots to Index site | `false` |
158 | | `API_DEFAULT_ITEM_COUNT` | API Default Return Items Count | `100` |
159 | | `API_DEFAULT_MAX_ITEM_COUNT` | API Default Maximum Items Count | `500` |
160 | | `API_REQUESTS_PER_MIN` | API Requests per minute limit | `180` |
161 | | `AVATAR_URL` | Set URL for external Avatar fetching | |
162 | | `DEFAULT_DARK_MODE` | Use Dark mode by default | `false` |
163 | | `DISABLE_EXTERNAL_SERVICES` | Disable every external service | `false` |
164 | | `DRAWIO_HOST` | Full URL of DrawIO server if not wanting to use default | |
165 | | `ENABLE_DRAWIO` | Enable DrawIO Functionality | `false` |
166 | | `FILE_UPLOAD_MAX_SIZE` | Max MB of files to upload into the system | `50` |
167 | | `IP_ADDRESS_PRECISION` | Alter precision of IP Addresses stored by bookstack `0` to `4` | `4` |
168 | | `LOG_FILE` | Log File | `bokstack.log` |
169 | | `LOG_PATH` | Log Path | `/www/logs/bokstack` |
170 | | `LOG_FAILED_LOGIN_MESSAGE` | Enable logging of fdailed email and password logins with given message | `false` |
171 | | `LOG_FAILED_LOGIN_CHANNEL` | Default log channel uses php_error_log function | `errorlog_plain_webserver` |
172 | | `LANGUAGE_AUTO_DETECT` | Detect Language via Browser | `false` |
173 | | `QUEUE_CONNECTION` | Queue Connection | `sync` |
174 | | `RECYCLE_BIN_LIFETIME` | How Many days Recycle Bin should wait before auto deleting. `0` for no feature, `-1` for unlimited | `30` |
175 | | `REVISION_LIMIT` | Default Revision Limit for pages | `100` |
176 | | `THEME` | Drop themes in /data/themes and set value here | `false` |
177 | | `VIEW_BOOKS` | View books in either `list` or `grid` format | `list` |
178 | | `VIEW_SHELVES` | View shelves in either `list` or `grid` format | `grid` |
179 |
180 | #### Authentication Settings
181 |
182 | | Parameter | Description | Default |
183 | | --------------------- | ---------------------------------- | ---------- |
184 | | `AUTHENTICATION_TYPE` | `STANDARD`, `LDAP`, `OIDC`, `SAML` | `STANDARD` |
185 |
186 | ##### LDAP Options
187 |
188 | | Parameter | Description | Default | `_FILE` |
189 | | ----------------------------- | ------------------------------------------------------- | ------------------------------------ | ------- |
190 | | `ENABLE_LDAP_USER_SYNC` | Enable Scheduled Syncing of LDAP User list | `TRUE` | |
191 | | `LDAP_ATTRIBUTE_DISPLAY_NAME` | Display Name Attribute | `cn` | |
192 | | `LDAP_ATTRIBUTE_GROUP` | Group Attribute | `memberOf` | |
193 | | `LDAP_ATTRIBUTE_ID` | Unique Identifier Attribute | `uid` | |
194 | | `LDAP_ATTRIBUTE_MAIL` | Mail Attribute | `mail` | |
195 | | `LDAP_THUMBNAIL_ATTRIBUTE` | Thumb nail attribute | | |
196 | | `LDAP_BASE_DN` | Base DN to search | | x |
197 | | `LDAP_BIND_PASS` | Bind password for authentication | | x |
198 | | `LDAP_BIND_USER` | Bind User for authentication | | x |
199 | | `LDAP_DUMP_USER_DETAILS` | Used for Debugging | `false` | |
200 | | `LDAP_FILTER_USER` | User Filter | `(&(${LDAP_ATTRIBUTE_ID}=\${user}))` | |
201 | | `LDAP_FILTER_SYNC` | Filter for syncing users from LDAP | `false` | |
202 | | `LDAP_FOLLOW_REFERRALS` | Follow LDAP Referrals | `true` | |
203 | | `LDAP_HOST` | LDAP Hostname | | x |
204 | | `LDAP_SYNC_BEGIN` | When to start syncing in military time HHMM | `+0` (immediate) | |
205 | | `LDAP_SYNC_EXCLUDE_EMAIL` | Comma seperated values of emails to ignore when syncing | | |
206 | | `LDAP_SYNC_INTERVAL` | In minutes amount of time to reperform LDAP Sync | `60` | |
207 | | `LDAP_SYNC_RECURSIVE` | Recursively search through LDAP Groups | `true` | |
208 | | `LDAP_REMOVE_FROM_GROUPS` | Remove user from Groups | `false` | |
209 | | `LDAP_TLS_INSECURE` | Use TLS without verifying | `false` | |
210 | | `LDAP_USER_TO_GROUPS` | Add user to Groups | `false` | |
211 | | `LDAP_VERSION` | Version of LDAP | `3` | |
212 |
213 | -
214 | ##### SAML Options
215 |
216 | | Parameter | Description | Default |
217 | | ----------------------------- | -------------------------------- | -------------- |
218 | | `SAML_IDP_ENTITYID` | URL of SAML IDP entity | |
219 | | `SAML_IDP_SLO` | SAML Single Log off URL | |
220 | | `SAML_IDP_SSO` | SAML Single Sign on URL | |
221 | | `SAML_ATTRIBUTE_DISPLAY_NAME` | SAML Display Name attribute | `givenName sn` |
222 | | `SAML_ATTRIBUTE_GROUP` | SAML Group attribute | `groups` |
223 | | `SAML_ATTRIBUTE_MAIL` | SAML Mail attribute | `mail` |
224 | | `SAML_ATTRIBUTE_EXTERNAL_ID` | SAML External ID attribute | `uid` |
225 | | `SAML_AUTOLOAD_METADATA` | Auto Load Metadata from SAML IDP | `true` |
226 | | `SAML_DUMP_USER_DETAILS` | Used for debugging | `false` |
227 | | `SAML_NAME` | SAML Public Service Name | `SSO` |
228 | | `SAML_REMOVE_FROM_GROUPS` | Remove user from Groups | `false` |
229 | | `SAML_USER_TO_GROUPS` | Add user to Groups | `true` |
230 | | `SAML2_IDP_AUTHNCONTEXT` | AuthN Context | `true` |
231 | | `SAML_SP_X509` | SAML SP Public Certificate | `` |
232 | | `SAML_SP_X509_KEY` | SAML SP Private Key | `` |
233 |
234 |
235 | -
236 |
237 | ##### OpenID Connect
238 |
239 | | Parameter | Description | Default | `_FILE` |
240 | | -------------------------- | -------------------------------------------------------------------- | -------- | ------- |
241 | | `OIDC_NAME` | Name to appear on login screen | `SSO` | |
242 | | `OIDC_DISPLAY_NAME_CLAIMS` | Claims to use for users display name | `name` | x |
243 | | `OIDC_CLIENT_ID` | OIDC Client ID | | x |
244 | | `OIDC_CLIENT_SECRET` | OIDC Client Secret | | x |
245 | | `OIDC_ISSUER` | Issuer URL must start with https:// | | x |
246 | | `OIDC_ISSUER_DISCOVER` | Auto Discover endpoints from .well-known | `TRUE` | |
247 | | `OIDC_PUBLIC_KEY` | (if above false) File path to where Public Key of provicer is stored | | x |
248 | | `OIDC_AUTH_ENDPOINT` | (if above false) Full URL to Authorize Endpoint | | x |
249 | | `OIDC_TOKEN_ENDPOINT` | (if above false) FulL URL to Token Endpoint | | x |
250 | | `OIDC_ADDITIONAL_SCOPES` | OIDC Additional Scopes | `null` | |
251 | | `OIDC_USER_TO_GROUPS` | Add user to Groups | `false` | |
252 | | `OIDC_ATTRIBUTE_GROUP` | Groups Attribute passed from OIDC Server | `groups` | |
253 | | `OIDC_REMOVE_FROM_GROUPS` | Remove user from groups | `false` | |
254 | | |
255 | #### External Login Services
256 |
257 | | Parameter | Description | Default | `_FILE` |
258 | | ------------------------------------------------------- | ------------------------------- | ------- | ------- |
259 | | `ENABLE_LOGIN_AZURE` | Enable Logging in from Azure | `false` | |
260 | | `AZURE_APP_ID` | Application ID | | x |
261 | | `AZURE_APP_SECRET` | Application Secret | | x |
262 | | `AZURE_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
263 | | `AZURE_AUTO_REGISTER` | Auto register username | `false` | x |
264 | | `AZURE_TENANT` | Tenant ID | | |
265 | | `ENABLE_LOGIN_DISCORD` | Enable Logging in from Discord | `false` | |
266 | | `DISCORD_APP_ID` | Application ID | | x |
267 | | `DISCORD_APP_SECRET` | Application Secret | | x |
268 | | `DISCORD_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
269 | | `DISCORD_AUTO_REGISTER` | Auto register username | `false` | |
270 | | `ENABLE_LOGIN_FACEBOOK` | Enable Logging in from Facebook | `false` | |
271 | | `FACEBOOK_APP_ID` | Application ID | | x |
272 | | `FACEBOOK_APP_SECRET` | Application Secret | | x |
273 | | `FACEBOOK_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
274 | | `FACEBOOK_AUTO_REGISTER` | Auto register username | `false` | |
275 | | `ENABLE_LOGIN_GITHUB` | Enable Logging in from Github | `false` | |
276 | | `GITHUB_APP_ID` | Application ID | | x |
277 | | `GITHUB_APP_SECRET` | Application Secret | | x |
278 | | `GITHUB_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
279 | | `GITHUB_AUTO_REGISTER` | Auto register username | `false` | |
280 | | `ENABLE_LOGIN_GITLAB` | Enable Logging in from Gitlab | `false` | |
281 | | `GITLAB_APP_ID` | Application ID | | x |
282 | | `GITLAB_APP_SECRET` | Application Secret | | x |
283 | | `GITLAB_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
284 | | `GITLAB_AUTO_REGISTER` | Auto register username | `false` | |
285 | | `GITLAB_BASE_URI` | Gitlab URI | | x |
286 | | `ENABLE_LOGIN_GOOGLE` | Enable Logging in from Google | `false` | |
287 | | `GOOGLE_APP_ID` | Application ID | | x |
288 | | `GOOGLE_APP_SECRET` | Application Secret | | x |
289 | | `GOOGLE_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
290 | | `GOOGLE_AUTO_REGISTER` | Auto register username | `false` | |
291 | | `GOOGLE_SELECT_ACCOUNT` | Select Google Account | | x |
292 | | `ENABLE_LOGIN_OKTA` | Enable Logging in from OKTA | `false` | |
293 | | `OKTA_APP_ID` | Application ID | | x |
294 | | `OKTA_APP_SECRET` | Application Secret | | x |
295 | | `OKTA_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
296 | | `OKTA_AUTO_REGISTER` | Auto register username | `false` | |
297 | | `OKTA_BASE_URL` | OKTA Base URI | | x |
298 | | `ENABLE_LOGIN_SLACK` | Enable Logging in from Slack | `false` | |
299 | | `SLACK_APP_ID` | Application ID | | x |
300 | | `SLACK_APP_SECRET` | Application Secret | | x |
301 | | `SLACK_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
302 | | `SLACK_AUTO_REGISTER` | Auto register username | `false` | |
303 | | `ENABLE_LOGIN_TWITCH` | Enable Logging in from Twitch | `false` | |
304 | | `TWITCH_APP_ID` | Application ID | | x |
305 | | `TWITCH_APP_SECRET` | Application Secret | | x |
306 | | `TWITCH_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
307 | | `TWITCH_AUTO_REGISTER` | Auto register username | `false` | |
308 | | `ENABLE_LOGIN_TWITTER` | Enable Logging in from Twitter | `false` | |
309 | | `TWITTER_APP_ID` | Application ID | | x |
310 | | `TWITTER_APP_SECRET` | Application Secret | | x |
311 | | `TWITTER_AUTO_CONFIRM_EMAIL` | Auto confirm email address | `false` | |
312 | | `TWITTER_AUTO_REGISTER` | Auto register username | `false` | |
313 | | |
314 | | - |
315 |
316 |
317 | #### Cache and Session Settings
318 |
319 | | Parameter | Description | Default | `_FILE` |
320 | | ----------------------- | ------------------------------------------------------------------------------ | ------------------- | ------- |
321 | | `CACHE_DRIVER` | Use what backend for cache `file` `database` `redis` `memcached` | `file` | |
322 | | `CACHE_PREFIX` | Cache Prefix | `bookstack` | |
323 | | `SESSION_COOKIE_NAME` | Cookie Name | `bookstack_session` | |
324 | | `SESSION_DRIVER` | Use what backend for sesssion management `file` `database` `redis` `memcached` | `FILE` | |
325 | | `SESSION_LIFETIME` | How long in minutes for Ssession | `120` | |
326 | | `SESSION_SECURE_COOKIE` | Deliver HTTPS cookie | `true` | |
327 | | `MEMCACHED_HOST` | Memcached Hostname | | x |
328 | | `MEMCACHED_PORT` | Memcached Port | `11211` | |
329 | | `MEMCACHED_WEIGHT` | Memcached Weight | `100` | |
330 | | `REDIS_DB` | Redis DB | `0` | x |
331 | | `REDIS_PORT` | Redis Port | `6379` | x |
332 | | `REDIS_HOST` | Redis Hostname | | x |
333 | | `REDIS_PASS` | Redis password | | x |
334 |
335 | -
336 |
337 | #### Mail Settings
338 |
339 | | Parameter | Description | Default | `_FILE` |
340 | | ---------------- | --------------------------------------- | ----------------------- | ------- |
341 | | `MAIL_FROM_NAME` | Display name to be sent from Bookstack | `BookStack` | |
342 | | `MAIL_FROM` | Email address to be sent from Bookstack | `bookstack@example.com` | |
343 | | `MAIL_TYPE` | How to send mail - `SMTP` | `SMTP` | |
344 | | `SMTP_HOST` | Hostname of SMTP Server | `postfix-relay` | x |
345 | | `SMTP_PASS` | SMTP Password | `null` | x |
346 | | `SMTP_PORT` | SMTP Port | `25` | x |
347 | | `SMTP_TLS` | Enable TLS for SMTP Connections | `FALSE` | |
348 | | `SMTP_USER` | SMTP Username | `null` | x |
349 |
350 | -
351 |
352 | #### Storage Settings
353 |
354 | | Parameter | Description | Default | `FILE` |
355 | | ------------------------- | ------------------------------------------------------------------------ | -------------- | ------ |
356 | | `STORAGE_TYPE` | How to store files `local` `local_secure` `s3` | `local` | |
357 | | `STORAGE_ATTACHMENT_TYPE` | Attachment storage type | `local_secure` | |
358 | | `STORAGE_IMAGE_TYPE` | Image storage type | `local` | |
359 | | `STORAGE_S3_BUCKET` | S3 Bucket | | x |
360 | | `STORAGE_S3_KEY` | S3 Key | | x |
361 | | `STORAGE_S3_REGION` | S3 Region | | x |
362 | | `STORAGE_S3_SECRET` | S3 Key | | x |
363 | | `STORAGE_URL` | Set this if you are connecting to a compatible service like Minio/Wasabi | | x |
364 |
365 | -
366 |
367 | ### Networking
368 |
369 | The following ports are exposed.
370 |
371 | | Port | Description |
372 | | ---- | ----------- |
373 | | `80` | HTTP |
374 |
375 | * * *
376 | ## Maintenance
377 |
378 | ### Shell Access
379 |
380 | For debugging and maintenance purposes you may want access the containers shell.
381 |
382 | ``bash
383 | docker exec -it (whatever your container name is) bash
384 | ``
385 | ## Support
386 |
387 | These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community.
388 | ### Usage
389 | - The [Discussions board](../../discussions) is a great place for working with the community on tips and tricks of using this image.
390 | - [Sponsor me](https://tiredofit.ca/sponsor) for personalized support
391 | ### Bugfixes
392 | - Please, submit a [Bug Report](issues/new) if something isn't working as expected. I'll do my best to issue a fix in short order.
393 |
394 | ### Feature Requests
395 | - Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
396 | - [Sponsor me](https://tiredofit.ca/sponsor) regarding development of features.
397 |
398 | ### Updates
399 | - Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
400 | - [Sponsor me](https://tiredofit.ca/sponsor) for up to date releases.
401 |
402 | ## License
403 | MIT. See [LICENSE](LICENSE) for more details.
404 |
405 | ## References
406 |
407 | -
408 |
--------------------------------------------------------------------------------
/build-assets/scripts/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiredofit/docker-bookstack/6e419cfe56cdebbcd73061e92178a3f3b93e24d0/build-assets/scripts/.empty
--------------------------------------------------------------------------------
/build-assets/src/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiredofit/docker-bookstack/6e419cfe56cdebbcd73061e92178a3f3b93e24d0/build-assets/src/.empty
--------------------------------------------------------------------------------
/examples/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.7"
2 | services:
3 | bookstack-app:
4 | image: tiredofit/bookstack
5 | container_name: bookstack-app
6 | labels:
7 | - traefik.enable=true
8 | - traefik.http.routers.bookstack.rule=Host(`bookstack.example.com`)
9 | - traefik.http.services.bookstack.loadbalancer.server.port=80
10 | volumes:
11 | - ./data:/data
12 | - ./logs:/www/logs/
13 | environment:
14 | - CONTAINER_NAME=bookstack-app
15 |
16 | - DB_HOST=bookstack-db
17 | - DB_PORT=3306
18 | - DB_NAME=bookstack
19 | - DB_USER=bookstack
20 | - DB_PASS=bookstackpass
21 |
22 | - SITE_URL=https://bookstack.example.com
23 | networks:
24 | - proxy
25 | - services
26 | restart: always
27 |
28 | bookstack-db:
29 | image: tiredofit/mariadb
30 | container_name: bookstack-db
31 | volumes:
32 | - ./db:/var/lib/mysql
33 | environment:
34 | - ROOT_PASS=password
35 | - DB_NAME=bookstack
36 | - DB_USER=bookstack
37 | - DB_PASS=bookstackpass
38 | networks:
39 | - services
40 | restart: always
41 |
42 | bookstack-db-backup:
43 | image: tiredofit/db-backup
44 | container_name: bookstack-db-backup
45 | links:
46 | - bookstack-db
47 | volumes:
48 | - ./dbbackup:/backup
49 | environment:
50 | - CONTAINER_NAME=bookstack-db-backup
51 | - DB_HOST=bookstack-db
52 | - DB_TYPE=mariadb
53 | - DB_NAME=bookstack
54 | - DB_USER=bookstack
55 | - DB_PASS=bookstackpass
56 | - DB01_BACKUP_INTERVAL=1440
57 | - DB01_BACKUP_BEGIN=0000
58 | - DB_CLEANUP_TIME=8640
59 | - COMPRESSION=BZ
60 | - MD5=TRUE
61 | networks:
62 | - services
63 | restart: always
64 |
65 | networks:
66 | proxy:
67 | external: true
68 | services:
69 | external: true
70 |
--------------------------------------------------------------------------------
/install/assets/defaults/30-bookstack:
--------------------------------------------------------------------------------
1 |
2 | #!/command/with-contenv bash
3 | ADMIN_EMAIL=${ADMIN_EMAIL:-"admin@admin.com"}
4 | ADMIN_NAME=${ADMIN_NAME:-"BookStack Admin"}
5 | ADMIN_PASS=${ADMIN_PASS:-"password"}
6 | ALLOW_CONTENT_SCRIPTS=${ALLOW_CONTENT_SCRIPTS:-"false"}
7 | ALLOW_ROBOTS=${ALLOW_ROBOTS:-"false"}
8 | ALLOWED_SSR_HOSTS=${ALLOWED_SSR_HOSTS:-"*"}
9 | API_DEFAULT_ITEM_COUNT=${API_DEFAULT_ITEM_COUNT:-"100"}
10 | API_DEFAULT_MAX_ITEM_COUNT=${API_DEFAULT_MAX_ITEM_COUNT:-"500"}
11 | API_REQUESTS_PER_MIN=${API_REQUESTS_PER_MIN:-"180"}
12 | APP_DEBUG=${APP_DEBUG:-false}
13 | APP_KEY=${APP_KEY:-SomeRandomStringWith32Characters}
14 | AUTHENTICATION_TYPE=${AUTHENTICATION_TYPE:-"standard"}
15 | AZURE_AUTO_CONFIRM_EMAIL=${AZURE_AUTO_CONFIRM_EMAIL:-"false"}
16 | AZURE_AUTO_REGISTER=${AZURE_AUTO_REGISTER:-"false"}
17 | AZURE_TENANT=${AZURE_TENANT:-"false"}
18 | CACHE_DRIVER=${CACHE_DRIVER:-"file"}
19 | CACHE_PREFIX=${CACHE_PREFIX:-"bookstack"}
20 | DB_PORT=${DB_PORT:-3306}
21 | DEFAULT_DARK_MODE=${DEFAULT_DARK_MODE:-"false"}
22 | DISABLE_EXTERNAL_SERVICES=${DISABLE_EXTERNAL_SERVICES:-"false"}
23 | DISCORD_AUTO_CONFIRM_EMAIL=${DISCORD_AUTO_CONFIRM_EMAIL:-"false"}
24 | DISCORD_AUTO_REGISTER=${DISCORD_AUTO_REGISTER:-"false"}
25 | ENABLE_AUTH_LOGIN=${ENABLE_AUTH_LOGIN:-"FALSE"}
26 | ENABLE_AUTO_UPDATE=${ENABLE_AUTO_UPDATE:-"TRUE"}
27 | ENABLE_DRAWIO=${ENABLE_DRAWIO:-"false"}
28 | ENABLE_LDAP_SYNC_USER=${ENABLE_LDAP_SYNC_USER:-"FALSE"}
29 | ENABLE_LOGIN_AZURE=${ENABLE_LOGIN_AZURE:-"false"}
30 | ENABLE_LOGIN_DISCORD=${ENABLE_LOGIN_DISCORD:-"false"}
31 | ENABLE_LOGIN_FACEBOOK=${ENABLE_LOGIN_FACEBOOK:-"false"}
32 | ENABLE_LOGIN_GITHUB=${ENABLE_LOGIN_GITHUB:-"false"}
33 | ENABLE_LOGIN_GITLAB=${ENABLE_LOGIN_GITLAB:-"false"}
34 | ENABLE_LOGIN_GOOGLE=${ENABLE_LOGIN_GOOGLE:-"false"}
35 | ENABLE_LOGIN_OKTA=${ENABLE_LOGIN_OKTA:-"false"}
36 | ENABLE_LOGIN_SLACK=${ENABLE_LOGIN_SLACK:-"false"}
37 | ENABLE_LOGIN_TWITCH=${ENABLE_LOGIN_TWITCH:-"false"}
38 | ENABLE_LOGIN_TWITTER=${ENABLE_LOGIN_TWITTER:-"false"}
39 | ENABLE_OPTIMIZE_IMAGES=${ENABLE_OPTIMIZE_IMAGES:-"TRUE"}
40 | FACEBOOK_AUTO_CONFIRM_EMAIL=${FACEBOOK_AUTO_CONFIRM_EMAIL:-"false"}
41 | FACEBOOK_AUTO_REGISTER=${FACEBOOK_AUTO_REGISTER:-"false"}
42 | FILE_UPLOAD_MAX_SIZE=${FILE_UPLOAD_MAX_SIZE:-"50"}
43 | GITHUB_AUTO_CONFIRM_EMAIL=${GITHUB_AUTO_CONFIRM_EMAIL:-"false"}
44 | GITHUB_AUTO_REGISTER=${GITHUB_AUTO_REGISTER:-"false"}
45 | GITLAB_AUTO_CONFIRM_EMAIL=${GITLAB_AUTO_CONFIRM_EMAIL:-"false"}
46 | GITLAB_AUTO_REGISTER=${GITLAB_AUTO_REGISTER:-"false"}
47 | GOOGLE_AUTO_CONFIRM_EMAIL=${GOOGLE_AUTO_CONFIRM_EMAIL:-"false"}
48 | GOOGLE_AUTO_REGISTER=${GOOGLE_AUTO_REGISTER:-"false"}
49 | GOOGLE_SELECT_ACCOUNT=${GOOGLE_SELECT_ACCOUNT:-"false"}
50 | IP_ADDRESS_PRECISION=${IP_ADDRESS_PRECISION:-"4"}
51 | LANGUAGE=${LANGUAGE:-"en"}
52 | LANGUAGE_AUTO_DETECT=${LANGUAGE_AUTO_DETECT:-"false"}
53 | LDAP_ATTRIBUTE_DISPLAY_NAME=${LDAP_ATTRIBUTE_DISPLAY_NAME:-"cn"}
54 | LDAP_ATTRIBUTE_GROUP=${LDAP_ATTRIBUTE_GROUP:-"memberOf"}
55 | LDAP_ATTRIBUTE_ID=${LDAP_ATTRIBUTE_ID:-"uid"}
56 | LDAP_ATTRIBUTE_MAIL=${LDAP_ATTRIBUTE_MAIL:-"mail"}
57 | LDAP_DUMP_USER_DETAILS=${LDAP_DUMP_USER_DETAILS:-"false"}
58 | LDAP_FILTER_USER=${LDAP_FILTER_USER:-"(&(${LDAP_ATTRIBUTE_ID}=\${user}))"}
59 | LDAP_FOLLOW_REFERRALS=${LDAP_FOLLOW_REFERRALS:-"true"}
60 | LDAP_REMOVE_FROM_GROUPS=${LDAP_REMOVE_FROM_GROUPS:-"false"}
61 | LDAP_SYNC_BEGIN=${LDAP_SYNC_BEGIN:-"+0"}
62 | LDAP_SYNC_INTERVAL=${LDAP_SYNC_INTERVAL:-"60"}
63 | LDAP_SYNC_RECURSIVE=${LDAP_SYNC_RECURSIVE:-"true"}
64 | LDAP_TLS_INSECURE=${LDAP_TLS_INSECURE:-"false"}
65 | LDAP_USER_TO_GROUPS=${LDAP_USER_TO_GROUPS:-"false"}
66 | LDAP_VERSION=${LDAP_VERSION:-"3"}
67 | LOG_FILE=${LOG_FILE:-"laravel.log"}
68 | LOG_PATH=${LOG_PATH:-"/www/logs/bookstack"}
69 | LOG_FAILED_LOGIN_MESSAGE=${LOG_FAILED_LOGIN_MESSAGE:-"false"}
70 | LOG_FAILED_LOGIN_CHANNEL=${LOG_FAILED_LOGIN_CHANNEL:-"errorlog_plain_webserver"}
71 | MAIL_FROM=${MAIL_FROM:-"bookstack@example.com"}
72 | MAIL_FROM_NAME=${MAIL_FROM_NAME:-"BookStack"}
73 | MAIL_TYPE=${MAIL_TYPE:-"SMTP"}
74 | MAP_THEMES=${MAP_THEMES:-"FALSE"}
75 | MEMCACHED_PORT=${MEMCACHED_PORT:-"11211"}
76 | MEMCACHED_WEIGHT=${MEMCACHED_WEIGHT:-"100"}
77 | OIDC_ADDITIONAL_SCOPES=${OIDC_ADDITIONAL_SCOPES:-"null"}
78 | OIDC_CLAIMS_GROUP=${OIDC_CLAIMS_GROUP:-"groups"}
79 | OIDC_DUMP_USER_DETAILS=${OIDC_DUMP_USER_DETAILS:-"false"}
80 | OIDC_NAME=${OIDC_NAME:-"SSO"}
81 | OIDC_REMOVE_FROM_GROUPS=${OIDC_REMOVE_FROM_GROUPS:-"false"}
82 | OIDC_USER_TO_GROUPS=${OIDC_USER_TO_GROUPS:-"false"}
83 | OKTA_AUTO_CONFIRM_EMAIL=${OKTA_AUTO_CONFIRM_EMAIL:-"false"}
84 | OKTA_AUTO_REGISTER=${OKTA_AUTO_REGISTER:-"false"}
85 | OPTIMIZE_IMAGES_BEGIN=${OPTIMIZE_IMAGES_BEGIN:-"0300"}
86 | OPTIMIZE_IMAGES_INTERVAL=${OPTIMIZE_IMAGES_INTERVAL:-"1440"}
87 | QUEUE_CONNECTION=${QUEUE_CONNECTION:-"sync"}
88 | RECYCLE_BIN_LIFETIME=${RECYCLE_BIN_LIFETIME:-"30"}
89 | REDIS_DB=${REDIS_DB:-"0"}
90 | REDIS_PORT=${REDIS_PORT:-"6379"}
91 | REVISION_LIMIT=${REVISION_LIMIT:-"100"}
92 | SAML_ATTRIBUTE_DISPLAY_NAME=${SAML_ATTRIBUTE_DISPLAY_NAME:-"givenName|sn"}
93 | SAML_ATTRIBUTE_EXTERNAL_ID=${SAML_ATTRIBUTE_EXTERNAL_ID:-"uid"}
94 | SAML_ATTRIBUTE_GROUP=${SAML_ATTRIBUTE_GROUP:-"groups"}
95 | SAML_ATTRIBUTE_MAIL=${SAML_ATTRIBUTE_MAIL:-"mail"}
96 | SAML_AUTOLOAD_METADATA=${SAML_AUTOLOAD_METADATA:-"true"}
97 | SAML_DUMP_USER_DETAILS=${SAML_DUMP_USER_DETAILS:-"false"}
98 | SAML_IDP_AUTHNCONTEXT=${SAML_IDP_AUTHNCONTEXT:-"false"}
99 | SAML_NAME=${SAML_NAME:-"SSO"}
100 | SAML_REMOVE_FROM_GROUPS=${SAML_REMOVE_FROM_GROUPS:-"false"}
101 | SAML_USER_TO_GROUPS=${SAML_USER_TO_GROUPS:-"true"}
102 | SESSION_COOKIE_NAME=${SESSION_COOKIE_NAME:-"bookstack_session"}
103 | SESSION_DRIVER=${SESSION_DRIVER:-"FILE"}
104 | SESSION_LIFETIME=${SESSION_LIFETIME:-"120"}
105 | SESSION_SECURE_COOKIE=${SESSION_SECURE_COOKIE:-"true"}
106 | SETUP_TYPE=${SETUP_TYPE:-"AUTO"}
107 | SLACK_AUTO_CONFIRM_EMAIL=${SLACK_AUTO_CONFIRM_EMAIL:-"false"}
108 | SLACK_AUTO_REGISTER=${SLACK_AUTO_REGISTER:-"false"}
109 | SMTP_HOST=${SMTP_HOST:-"localhost"}
110 | SMTP_PORT=${SMTP_PORT:-"25"}
111 | STORAGE_ATTACHMENT_TYPE=${STORAGE_ATTACHMENT_TYPE:-"local_secure"}
112 | STORAGE_IMAGE_TYPE=${STORAGE_IMAGE_TYPE:-"local_secure"}
113 | STORAGE_TYPE=${STORAGE_TYPE:-"local"}
114 | THEME=${THEME:-"false"}
115 | TWITCH_AUTO_CONFIRM_EMAIL=${TWITCH_AUTO_CONFIRM_EMAIL:-"false"}
116 | TWITCH_AUTO_REGISTER=${TWITCH_AUTO_REGISTER:-"false"}
117 | TWITTER_AUTO_CONFIRM_EMAIL=${TWITTER_AUTO_CONFIRM_EMAIL:-"false"}
118 | TWITTER_AUTO_REGISTER=${TWITTER_AUTO_REGISTER-"false"}
119 | VIEW_BOOKS=${VIEW_BOOKS:-"list"}
120 | VIEW_SHELVES=${VIEW_SHELVES:-"grid"}
--------------------------------------------------------------------------------
/install/etc/cont-init.d/30-bookstack:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | source /assets/functions/00-container
4 | prepare_service
5 | SERVICE_NAME="bookstack"
6 |
7 | sanity_db
8 | db_ready mariadb
9 |
10 | ### Logfile redirection
11 | mkdir -p "${LOG_PATH}"
12 | touch "${LOG_PATH}"/"${LOG_FILE}"
13 | create_logrotate bookstack ${LOG_PATH}/${LOG_FILE} none ${NGINX_USER} ${NGINX_GROUP}
14 | chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${LOG_PATH}"
15 | rm -rf "${NGINX_WEBROOT}"/storage/logs
16 | ln -sf "${LOG_PATH}" "${NGINX_WEBROOT}"/storage/logs
17 |
18 | ### Check if New Install
19 | if [ ! -f "${NGINX_WEBROOT}"/server.php ]; then
20 | print_warn "Potential New Installation / Standalone Installation Detected - Copying Bookstack Sourcecode"
21 | cp -R /assets/install/* "${NGINX_WEBROOT}"
22 |
23 | ### If running with /www/html or NGINX_WEBROOT mapped, then create persistent storage
24 | ### Storage redirection
25 | if [ -d "/data" ]; then
26 | print_warn "Detected /data directory - Persistently saving settings/sessions/cache/uploads/modules"
27 | if [ ! -d "/data/storage" ]; then
28 | cp -R "${NGINX_WEBROOT}"/storage /data
29 | fi
30 | rm -rf "${NGINX_WEBROOT}"/storage
31 | ln -sf /data/storage "${NGINX_WEBROOT}"/storage
32 | if [ ! -d "/data/uploads" ]; then
33 | cp -R "${NGINX_WEBROOT}"/public/uploads /data
34 | fi
35 | rm -rf "${NGINX_WEBROOT}"/public/uploads
36 | ln -s /data/uploads "${NGINX_WEBROOT}"/public/uploads
37 | if var_true "${MAP_THEMES}" ; then
38 | if [ ! -d "/data/themes" ]; then
39 | cp -R "${NGINX_WEBROOT}"/themes /data
40 | fi
41 | rm -rf "${NGINX_WEBROOT}"/themes
42 | ln -s /data/themes "${NGINX_WEBROOT}"/themes
43 | fi
44 |
45 | ln -sf /data/config "${NGINX_WEBROOT}"/.env
46 | touch /data/config
47 | silent chown "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"/.env
48 | ln -sf /data/.bookstack-version "${NGINX_WEBROOT}"/.bookstack-version
49 | chown -R "${NGINX_USER}":"${NGINX_GROUP}" /data
50 | fi
51 |
52 | ### Auto Upgrade functionality
53 | if [ ! -f "${NGINX_WEBROOT}/.bookstack-version" ]; then
54 | echo "${BOOKSTACK_VERSION} first installed on $(date)" >> "${NGINX_WEBROOT}"/.bookstack-version
55 | fi
56 | chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
57 | else
58 | if var_true "${ENABLE_AUTO_UPDATE}"; then
59 | if [ "${BOOKSTACK_VERSION}" != $(head -n 1 "${NGINX_WEBROOT}"/.bookstack-version | awk '{print $1'}) ]; then
60 | print_warn "Detected in place Bookstack version $(head -n 1 "${NGINX_WEBROOT}"/.bookstack-version | awk "{print $1"}) - Upgrading to ${BOOKSTACK_VERSION}"
61 | cp -R /assets/install/* "${NGINX_WEBROOT}"
62 | chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
63 | cd "${NGINX_WEBROOT}" || exit
64 | silent sudo -u "${NGINX_USER}" sudo -u "${NGINX_USER}" php artisan migrate --force
65 | sed -i --follow-symlinks "1 i\
66 | ${BOOKSTACK_VERSION} upgraded on $(date)" "${NGINX_WEBROOT}"/.bookstack-version
67 | fi
68 | fi
69 | fi
70 |
71 | if [ "${SETUP_TYPE,,}" = "auto" ]; then
72 | print_notice "Generating Configuration"
73 |
74 | ### Authentication
75 | case "${AUTHENTICATION_TYPE,,}" in
76 | "standard" )
77 | print_debug "Setting Standard/Local Authentication"
78 | authentication=$(
79 | cat <"${NGINX_WEBROOT}"/.env </dev/null 2>&1
698 | if [ $? -gt 0 ]; then
699 | ### Perform Database Installation Routines
700 | print_warn "Detected empty Database - Setting up - Please wait.."
701 | sleep 5
702 | silent sudo -u "${NGINX_USER}" php artisan migrate --force
703 | silent sudo -u "${NGINX_USER}" php artisan cache:clear
704 | silent sudo -u "${NGINX_USER}" php artisan view:clear
705 |
706 | ### Create Admin User
707 | print_notice "Creating Administrative User"
708 | mysql -u "$DB_USER" -p"$DB_PASS" -h"$DB_HOST" -P"${DB_PORT}" -e "use ""$DB_NAME""; DELETE FROM users where id=1;"
709 | transform_file_var \
710 | ADMIN_EMAIL \
711 | ADMIN_NAME \
712 | ADMIN_PASS
713 | sudo -u "${NGINX_USER}" php ${NGINX_WEBROOT}/artisan bookstack:create-admin --no-ansi --email="${ADMIN_EMAIL}" --name="${ADMIN_NAME}" --password="${ADMIN_PASS}"
714 | fi
715 |
716 | custom_files "${CONTAINER_CUSTOM_PATH}" "${NGINX_WEBROOT}" "${NGINX_USER}" "${NGINX_GROUP}"
717 | custom_scripts
718 |
719 | cd "${NGINX_WEBROOT}"
720 | chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
721 | chmod ug+rwx "${NGINX_WEBROOT}"
722 |
723 | print_warn "Running any Database Migrations"
724 | cd "${NGINX_WEBROOT}"
725 | silent sudo -u "${NGINX_USER}" php artisan migrate --no-ansi --force
726 |
727 | ### Add alias for running artisan
728 | cat >> /root/.bashrc < /dev/null 2>&1 ; done
40 | find /data/uploads/images/ -maxdepth 4 -type d -print0 | while IFS= read -rd '' dir; do cd $dir ; jpegoptim *.jpeg > /dev/null 2>&1 ; done
41 | print_notice "Optimizing Images completed at $(date)"
42 |
43 | ### Go back to Sleep until next Backup time
44 | sleep $(($OPTIMIZE_IMAGES_INTERVAL*60))
45 | done
46 | else
47 | s6-svc -d /var/run/s6/legacy-services/31-bookstack-optimize-images
48 | fi
49 |
--------------------------------------------------------------------------------