Coder Social home page Coder Social logo

linuxserver / docker-bookstack Goto Github PK

View Code? Open in Web Editor NEW
729.0 20.0 107.0 3.15 MB

A Docker container for the BookStack documentation wiki

License: GNU General Public License v3.0

Dockerfile 56.96% HTML 43.04%
docker documentation bookstack-container hacktoberfest

docker-bookstack's Introduction

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release featuring:

  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:

  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • Fleet - an online web interface which displays all of our maintained images.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build LSIO CI

Bookstack is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease.

Powered by SQL and including a Markdown editor for those who prefer it, BookStack is geared towards making documentation more of a pleasure than a chore.

For more information on BookStack visit their website and check it out: https://www.bookstackapp.com

bookstack

Supported Architectures

We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.

Simply pulling lscr.io/linuxserver/bookstack:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.

The architectures supported by this image are:

Architecture Available Tag
x86-64 amd64-<version tag>
arm64 arm64v8-<version tag>
armhf

Application Setup

The default username is [email protected] with the password of password, access the container at http://dockerhost:6875.

This application is dependent on a MySQL database be it one you already have or a new one. If you do not already have one, set up our MariaDB container here https://hub.docker.com/r/linuxserver/mariadb/.

If you intend to use this application behind a subfolder reverse proxy, such as our SWAG container or Traefik you will need to make sure that the APP_URL environment variable is set to your external domain, or it will not work.

Documentation for BookStack can be found at https://www.bookstackapp.com/docs/.

BookStack File & Directory Paths

This container ensures certain BookStack application files & folders, such as user file upload folders, are retained within the /config folder so that they are persistent & accessible when the /config container path is bound as a volume. There may be cases, when following the BookStack documentation, that you'll need to know how these files and folders are used relative to a non-container BookStack installation.

Below is a mapping of container /config paths to those relative within a BookStack install directory:

  • /config container path => BookStack relative path
  • /config/www/.env => .env
  • /config/www/laravel.log => storage/logs/laravel.log
  • /config/www/backups/ => storage/backups/
  • /config/www/files/ => storage/uploads/files/
  • /config/www/images/ => storage/uploads/images/
  • /config/www/themes/ => themes/
  • /config/www/uploads/ => public/uploads/

Advanced Users (full control over the .env file)

If you wish to use the extra functionality of BookStack such as email, Memcache, LDAP and so on you will need to make your own .env file with guidance from the BookStack documentation.

When you create the container, do not set any arguments for any SQL settings. The container will copy an exemplary .env file to /config/www/.env on your host system for you to edit.

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.

docker-compose (recommended, click here for more info)

---
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - APP_URL=https://bookstack.example.com
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=<yourdbpass>
      - DB_DATABASE=bookstackapp
    volumes:
      - /path/to/bookstack_app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db

  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MYSQL_ROOT_PASSWORD=<yourdbpass>
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=<yourdbpass>
    volumes:
      - /path/to/bookstack_db_data:/config
    restart: unless-stopped
docker run -d \
  --name=bookstack \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e APP_URL=yourbaseurl \
  -e DB_HOST=yourdbhost \
  -e DB_PORT=yourdbport \
  -e DB_USER=yourdbuser \
  -e DB_PASS=yourdbpass \
  -e DB_DATABASE=bookstackapp \
  -e QUEUE_CONNECTION= `#optional` \
  -p 6875:80 \
  -v /path/to/bookstack/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/bookstack:latest

Parameters

Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 80 will map the container's port 80 to port 6875 on the host
-e PUID=1000 for UserID - see below for explanation
-e PGID=1000 for GroupID - see below for explanation
-e TZ=Etc/UTC specify a timezone to use, see this list.
-e APP_URL=yourbaseurl for specifying the IP:port or URL your application will be accessed on (ie. http://192.168.1.1:6875 or https://bookstack.mydomain.com
-e DB_HOST=yourdbhost for specifying the database host
-e DB_PORT=yourdbport for specifying the database port if not default 3306
-e DB_USER=yourdbuser for specifying the database user
-e DB_PASS=yourdbpass for specifying the database password (minimum 4 characters & non-alphanumeric passwords must be properly escaped.)
-e DB_DATABASE=bookstackapp for specifying the database to be used
-e QUEUE_CONNECTION= Set to database to enable async actions like sending email or triggering webhooks. See documentation.
-v /config Persistent config files

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Docker Mods

Docker Mods Docker Universal Mods

We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.

Support Info

  • Shell access whilst the container is running:

    docker exec -it bookstack /bin/bash
  • To monitor the logs of the container in realtime:

    docker logs -f bookstack
  • Container version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' bookstack
  • Image version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/bookstack:latest

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose

  • Update images:

    • All images:

      docker-compose pull
    • Single image:

      docker-compose pull bookstack
  • Update containers:

    • All containers:

      docker-compose up -d
    • Single container:

      docker-compose up -d bookstack
  • You can also remove the old dangling images:

    docker image prune

Via Docker Run

  • Update the image:

    docker pull lscr.io/linuxserver/bookstack:latest
  • Stop the running container:

    docker stop bookstack
  • Delete the container:

    docker rm bookstack
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)

  • You can also remove the old dangling images:

    docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver/docker-bookstack.git
cd docker-bookstack
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/bookstack:latest .

The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 27.05.24: - Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings.
  • 25.01.24: - Existing users should update: site-confs/default.conf - Cleanup default site conf.
  • 23.12.23: - Rebase to Alpine 3.19 with php 8.3.
  • 31.10.23: - Further sanitize sed replace.
  • 07.06.23: - Add mariadb-client for bookstack-system-cli support.
  • 25.05.23: - Rebase to Alpine 3.18, deprecate armhf.
  • 13.04.23: - Move ssl.conf include to default.conf.
  • 01.03.23: - Add php iconv.
  • 19.01.23: - Rebase to alpine 3.17 with php8.1.
  • 16.01.23: - Wrap .env values in quotes.
  • 05.01.23: - Fix db password setting (sed escape &).
  • 21.12.22: - Update db info in .env file when env vars are updated.
  • 10.10.22: - Remove password escape logic which caused problems for a small subset of users.
  • 20.08.22: - Rebasing to alpine 3.15 with php8. Restructure nginx configs (see changes announcement).
  • 14.03.22: - Add symlinks for theme support.
  • 11.07.21: - Rebase to Alpine 3.14.
  • 12.01.21: - Remove unused requirement, as of release 0.31.0.
  • 17.12.20: - Make APP_URL var required (upstream changes).
  • 17.09.20: - Rebase to alpine 3.12. Fix APP_URL setting. Bump php post max and upload max filesizes to 100MB by default.
  • 19.12.19: - Rebasing to alpine 3.11.
  • 26.07.19: - Use old version of tidyhtml pending upstream fixes.
  • 28.06.19: - Rebasing to alpine 3.10.
  • 14.06.19: - Add wkhtmltopdf to image for PDF rendering.
  • 20.04.19: - Rebase to Alpine 3.9, add MySQL init logic.
  • 22.03.19: - Switching to new Base images, shift to arm32v7 tag.
  • 20.01.19: - Added php7-curl
  • 04.11.18: - Added php7-ldap
  • 15.10.18: - Changed functionality for advanced users
  • 08.10.18: - Advanced mode, symlink changes, sed fixing, docs updated, added some composer files
  • 23.09.28: - Updates pre-release
  • 02.07.18: - Initial Release.

docker-bookstack's People

Contributors

alex-phillips avatar aptalca avatar chbmb avatar cnfw avatar drizuid avatar homerr avatar j0nnymoe avatar jasonyang-ee avatar kangie avatar klutchell avatar linuxserver-ci avatar mainmachine avatar nemchik avatar pixeye33 avatar rjmidau avatar roxedus avatar sparklyballs avatar ssddanbrown avatar thelamer avatar thespad avatar thohng avatar tobbenb avatar tokugero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-bookstack's Issues

connection to mysql server with specific port not working.

linuxserver.io


Expected Behavior

Bookstack app should connect to use mysql running on 10.1.1.50:3315. (ip and port should be considered which is defined in docker-compose.yml file)

Current Behavior

When Providing DB_PORT environment variable in docker-compose.yml file, is ignored by the image and still tries to connect to default mysql port 3306.

Steps to Reproduce

  1. docker-compose.yml file:
version: "2"
services:
  bookstack:
    image: ghcr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=localhost
      - DB_HOST=10.1.1.50
      - DB_PORT=3315
      - DB_DATABASE=bookstack
      - DB_USER=bookstack
      - DB_PASS=bookstack
    volumes:
      - /path/to/data:/config
    ports:
      - 80:80
    restart: unless-stopped

networks:
  bookstack-network:
    external:
      name: bookstack

Environment

OS: : tried on Linux Debian and also on Linux Ubuntu and also on MacOs same issue on all of this OS
CPU architecture: x86_64
How docker service was installed:

Docker service installed from official instruction here : https://docs.docker.com/get-docker/

Command used to create docker container (run/create/compose/screenshot)

docker-compose up

Docker logs

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client")

After debugging found out that above log generated because of mysql server port is not considered as defined in docker-compose.yml (DB_PORT=3315) but tries to connect to default port of mysql server 3306 which is not port of mysql server in mycase.

Thank you for help. Please write me if you need more information.

Logo served with local URL

linuxserver.io

Whenever I access to my Bookstack instance via our domain (https://wiki.mydomain.com), deployed in a server within a LAN, the logo gets loaded using the LAN IP:

image

Besides, the browser suggests on mixed content (most of it served as HTTPS, but some images under HTTP):

image

I've tried the following config in my Apache 2.4 server, with no luck:

<VirtualHost *:443>                                                                                                                                                                                                                                                                    
   ServerName wiki.mydomain.com                                                                                                                                                                                                                                                   
   ServerAdmin [email protected]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
   ErrorLog ${APACHE_LOG_DIR}/error_apache_wiki.log                                                                                                                                                                                                                               
   CustomLog ${APACHE_LOG_DIR}/access_apache_wiki.log combined                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
   Include /etc/apache2/sites-available/mydomain.com-common-ssl.conf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
   #       ProxyRequests Off                                                                                                                                                                                                                                                              
   ProxyPreserveHost On                                                                                                                                                                                                                                                           
   ProxyPass / https://localhost:6876/                                                                                                                                                                                                                                            
   ProxyPassReverse / https://localhost:6876/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
   Options +FollowSymLinks                                                                                                                                                                                                                                                        
   RewriteEngine On                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
   RewriteCond %{HTTPS}    Off                                                                                                                                                                                                                                                    
   RewriteRule "^/?(.*)"        "https://wiki.mydomain.com/$1" [L,R,NE]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </VirtualHost>

What can I try?

Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-54-generic x86_64)

Env config:

DB_HOST | 192.168.1.104
DB_USER | bookstack
DB_PASS | ***********
DB_DATABASE | bookstack
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PS1 | $(whoami)@$(hostname):$(pwd)$
HOME | /root
TERM | xterm
APP_URL | https://wiki.mydomain.com/

2019-08-07T09:59:40.317699419Z [s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
2019-08-07T09:59:40.488492085Z [s6-init] ensuring user provided files have correct perms...exited 0.,
2019-08-07T09:59:40.489452239Z [fix-attrs.d] applying ownership & permissions fixes...,
2019-08-07T09:59:40.490410914Z [fix-attrs.d] done.,
2019-08-07T09:59:40.491040428Z [cont-init.d] executing container initialization scripts...,
2019-08-07T09:59:40.492107631Z [cont-init.d] 10-adduser: executing... ,
2019-08-07T09:59:40.729073740Z usermod: no changes,
2019-08-07T09:59:40.729228128Z ,
2019-08-07T09:59:40.729235879Z -------------------------------------,
2019-08-07T09:59:40.729240431Z           _         (),
2019-08-07T09:59:40.729244528Z          | |  ___   _    __,
2019-08-07T09:59:40.729248714Z          | | / __| | |  /  \ ,
2019-08-07T09:59:40.729253014Z          | | \__ \ | | | () |,
2019-08-07T09:59:40.729257411Z          |_| |___/ |_|  \__/,
2019-08-07T09:59:40.729261516Z ,
2019-08-07T09:59:40.729265432Z ,
2019-08-07T09:59:40.729269485Z Brought to you by linuxserver.io,
2019-08-07T09:59:40.729273605Z We gratefully accept donations at:,
2019-08-07T09:59:40.729277742Z https://www.linuxserver.io/donate/,
2019-08-07T09:59:40.729281756Z -------------------------------------,
2019-08-07T09:59:40.729285828Z GID/UID,
2019-08-07T09:59:40.729289838Z -------------------------------------,
2019-08-07T09:59:40.731675530Z ,
2019-08-07T09:59:40.731693152Z User uid:    911,
2019-08-07T09:59:40.731698702Z User gid:    911,
2019-08-07T09:59:40.731703191Z -------------------------------------,
2019-08-07T09:59:40.731707543Z ,
2019-08-07T09:59:40.735245180Z [cont-init.d] 10-adduser: exited 0.,
2019-08-07T09:59:40.736024567Z [cont-init.d] 20-config: executing... ,
2019-08-07T09:59:40.905193516Z [cont-init.d] 20-config: exited 0.,
2019-08-07T09:59:40.905898171Z [cont-init.d] 30-keygen: executing... ,
2019-08-07T09:59:40.908485653Z using keys found in /config/keys,
2019-08-07T09:59:40.908875889Z [cont-init.d] 30-keygen: exited 0.,
2019-08-07T09:59:40.909765809Z [cont-init.d] 50-config: executing... ,
2019-08-07T09:59:40.927730828Z App Key found - setting variable for seds,
2019-08-07T09:59:40.930437590Z Running config - db_user set,
2019-08-07T10:00:21.199613136Z Nothing to migrate.,
2019-08-07T10:05:56.562449884Z [cont-init.d] 50-config: exited 0.,
2019-08-07T10:05:56.563455213Z [cont-init.d] 99-custom-files: executing... ,
2019-08-07T10:05:56.570621898Z [custom-init] no custom files found exiting...,
2019-08-07T10:05:56.571162106Z [cont-init.d] 99-custom-files: exited 0.,
2019-08-07T10:05:56.571832307Z [cont-init.d] done.,
2019-08-07T10:05:56.572544605Z [services.d] starting services,
2019-08-07T10:05:56.586225378Z [services.d] done.,

I'm using the following mounting point:

  • Host volume: /opt/bookstack-data
  • Path in container: /config

Thanks, team linuxserver.io

Thanks for making Bookstack possible with Docker.

Instructions in readme are wrong.

The bot already triaged incorrectly closed issue #55 to “done” but I want to stress it’s not fixed. Here are to screenshots. Thanks for your time.

E1A99077-FBE5-4108-B310-71753FA2340A
94EBA23A-4A64-4FEC-9B4F-BBE3467EF4A2

container doesn't start if DB_HOST not set in docker-compose.yml

Plattform: x64, Arch Linux, Docker 18.09.6-ce

When I don't provide any SQL-settings in docker-compose.yml as suggested here https://github.com/linuxserver/docker-bookstack#advanced-users-full-control-over-the-env-file the container doesn't come up.

bookstack    | [cont-init.d] 10-adduser: exited 0.
bookstack    | [cont-init.d] 20-config: executing...
bookstack    | [cont-init.d] 20-config: exited 0.
bookstack    | [cont-init.d] 30-keygen: executing...
bookstack    | using keys found in /config/keys
bookstack    | [cont-init.d] 30-keygen: exited 0.
bookstack    | [cont-init.d] 50-config: executing...
bookstack    | App Key found - setting variable for seds
bookstack    | usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-O length]
bookstack    | 	  [-P proxy_username] [-p source_port] [-q seconds] [-s source]
bookstack    | 	  [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
bookstack    | 	  [-x proxy_address[:port]] [destination] [port]
bookstack    | usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-O length]
bookstack    | 	  [-P proxy_username] [-p source_port] [-q seconds] [-s source]
bookstack    | 	  [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
bookstack    | 	  [-x proxy_address[:port]] [destination] [port]

and so on ... until I press control-c

The minimum environment variable I have to provide ist DB_HOST.

By the way:
Even if I set DB_HOST in docker-compose.yml the container comes up with a warning:

bookstack    | [cont-init.d] 50-config: executing...
bookstack    | App Key found - setting variable for seds
bookstack    | /var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
bookstack    | /var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
bookstack    | Nothing to migrate.
bookstack    | [cont-init.d] 50-config: exited 0.

Not sure, if that is an error in the container or a missleading information in the README.

docker-compose.yml
To reproduce the error I commented DB-HOST. If I uncomment the line everything runs fine.

version: '3'
services:
    bookstack:
        image: linuxserver/bookstack
        container_name: bookstack
        hostname: mimir
        restart: always
        environment:
            - PUID=1000
            - PGID=1000
            # - DB_HOST=mariadb
        networks:
            - web
            - dcnetwork
        expose:
            - 80
        volumes:
            - ./config:/config
        labels:
            - "traefik.enable=true"
        ...

And the relevant part from .env

APP_URL=https://mimir.xxx.xxx

# Database details
DB_HOST=mariadb
DB_DATABASE=xxx
DB_USERNAME=xxx
DB_PASSWORD=xxx

[Kubernetes] - APP_URL causes container to not start

Whenever I set the environmental variable APP_URL, my bookstack application never comes up. If I remove the APP_URL environmental variable, the app starts with no issues.

Host OS: Rancher OS
Rancher Server Version: 2.2.4
LinuxServer.io Image Version: linuxserver/bookstack:v0.27.4-ls59

Docker Logs (when using APP_URL=https://fqdn.tld - wait over 10 mintues, still never starts):

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 911
User gid: 911
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 63: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 63: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Signal handled: Terminated.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Docker Logs (when not using APP_URL variable at all - completely removed from deployment altogether - starts in about 10 seconds):

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 911
User gid: 911
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 63: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 63: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Duplicated text in README

linuxserver.io


Expected Behavior

At https://github.com/linuxserver/docker-bookstack/blob/master/README.md#advanced-users-full-control-over-the-env-file

I expect to see:

"When you create the container, do not set any arguments for any SQL settings, or APP_URL. The container will copy an exemplary .env file to /config/www/.env on your host system for you to edit."

Current Behavior

I see the text twice:

"When you create the container, do not set any arguments for any SQL settings, or APP_URL. The container will copy an .env file to /config/www/.env on your host system for you to edit. When you create the container, do not set any arguments for any SQL settings, or APP_URL. The container will copy an exemplary .env file to /config/www/.env on your host system for you to edit."

Allow custom mysql port configuration with DB_PORT

#41 Expected Behavior
As a user with my own mysql backend, I want to be able to specify a nonstandard mysql port using an environment variable such as DB_PORT=3307

Current Behavior

The database port is hardcoded to 3306 instead of providing a docker environment variable that defaults to 3306, but can be overridden

Steps to Reproduce

  1. Set DB_HOST = myhostname:3307 (not a mysql standard of 3306 port)
  2. See error in logs that the address doesn't exist

Environment

OS: All
CPU architecture: all
How docker service was installed: Synology

PUID & PGID are not set inside the container

Expected Behavior

The set PUID and PGID should be used.

Current Behavior

I set up a new docker container on my synology nas. According to the documentation I set the PUID and PGID environment variables. But when I launch the container the splash screen shows UID = 0 and GID = 0. This causes an error from php-fpm, since php-fpm should not be run as root.

Steps to Reproduce

Environment

OS: Synology (Linux)
CPU architecture: x86_64
How docker service was installed: Wizard from synology docker app

Command used to create docker container

image

Docker logs

image

image

For Raspberry Pi armv7 -env should be DB_PASSWORD not DB_PASS

New to github but I spent hours racking my brain over getting the application to be able to log in to the database. Turns out the image for the database for raspberry pi armv7 should be mariadb and the env variable for password should be DB_PASSWORD not DB_PASS. Figured I would pass along this information in case other people are having this issue. Sorry it's not in the right format but if you close out this issue it should be searchable.

This is the error I was getting before making the change.

Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')

at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669

665|         // If an exception occurs when attempting to run a query, we'll format the error


666|         // message to include the bindings with SQL, which will make this exception a


667|         // lot more helpful to the developer instead of just the database's errors.


668|         catch (Exception $e) {

669| throw new QueryException(

670|                 $query, $this->prepareBindings($bindings), $e


671|             );


672|         }


673|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")

  /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

2 PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")

  /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

Please use the argument -v to see more details.

custom mysql DB_PORT is not working. only default 3306 works

linuxserver.io


Expected Behavior

Connection to mysql on defined port should work.

Current Behavior

currently only works on default 3306 mysql port

Steps to Reproduce

  1. set specific DB_PORT to connect to specific port for mysql.
    Example : DB_PORT: 3310
    :Error: do not connect Please fix it. thanks

Environment

OS:
CPU architecture: x86_64
How docker service was installed:

In case of providing Port at the end of DB_HOST other issue.
Logs: when providing - DB_HOST=10.10.0.5:3310
bookstack | nc: getaddrinfo: Name does not resolve

wkhtmltopdf support

To generate better quality PDFs in bookstack it would be nice to be able to use wkhtmltopdf instead of the default PDF generator.
I found this project:
https://github.com/Surnet/docker-wkhtmltopdf

Maybe it's combinable with this project?
I'm quite new to Docker so I'm not really sure how I would start with combining the two.

Can anyone help me? Server 0 code.

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

Upload files. I am also using a traefik proxy and cloudfare, i don't have any issue with the proxy on other apps.

Current Behavior

Server 0 error code

imagen

Steps to Reproduce

  1. Upload files to a page

Environment

OS: Raspbian
CPU architecture: Raspberry 4
How docker service was installed:

Command used to create docker container (run/create/compose/screenshot)

Docker logs

App Key found - setting variable for seds

Running config - db_user set

/var/run/s6/etc/cont-init.d/50-config: line 77: warning: command substitution: ignored null byte in input

/var/run/s6/etc/cont-init.d/50-config: line 77: warning: command substitution: ignored null byte in input

Nothing to migrate.

[cont-init.d] 50-config: exited 0.

[cont-init.d] 99-custom-files: executing...

[custom-init] no custom files found exiting...

[cont-init.d] 99-custom-files: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

DB LOGS

[cont-init.d] 30-config: executing...

[cont-init.d] 30-config: exited 0.

[cont-init.d] 40-initialise-db: executing...

[cont-init.d] 40-initialise-db: exited 0.

[cont-init.d] 99-custom-scripts: executing...

[custom-init] no custom files found exiting...

[cont-init.d] 99-custom-scripts: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

200930 13:30:05 mysqld_safe Logging to syslog.

200930 13:30:06 mysqld_safe Starting mysqld daemon with databases from /config/databases

SQL error Column already exists: 1060 Duplicate column name 'slug' when performing upgrade

When performing upgrade via command docker-compose down && docker-compose up -d I receive the following SQL error in the bookstack container:

-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing... 
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
Migrating: 2021_03_08_215138_add_user_slug

   Illuminate\Database\QueryException  : SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'slug' (SQL: alter table `users` add `slug` varchar(180) not null)

  at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|

  Exception trace:

  1   Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'slug'")
      /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18

  2   Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
      /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:114

  Please use the argument -v to see more details.

All seems to be working well tough.

Here is my environment:

SBC Odroid XU4
Armbian 21.02.3 with Linux kernel Linux 4.14.222-odroidxu4

Here is my docker-compose.yml


---
version: "2"
services:
  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://bookstackurl
      - DB_HOST=bookstack_db
      - DB_USER=<db-user>
      - DB_PASS=<db-pw>
      - DB_DATABASE=<<db-user-pwd>
    volumes:
      - /path/to/config:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=<mysql root pw>
      - TZ=Europe/Brussels
      - MYSQL_DATABASE=<db-bookstack>
      - MYSQL_USER=<db-user>
      - MYSQL_PASSWORD=<db-user-pwd>
    volumes:
      - /path/to/config:/config
      - /path/to/sqlback/:/home
 restart: unless-stopped

Migration fails

linuxserver.io

Hello,

on Raspberry Pi 4 the migration fails. This bug is also mentioned on the offical repo and its already closed. For some reason it still exists here. Maybe it's the database version?

BookStackApp/BookStack#425

Thank you for your help.


Expected Behavior

migrating successfully

Current Behavior

migration fails with exception

Steps to Reproduce

  1. copy the compose file
  2. edit environment variables and network -> see below
  3. compose up
  4. starting fails

Environment

OS: Debian Buster
CPU architecture: arm32 / RPI 4

Command used to create docker container (run/create/compose/screenshot)

container -->

version: "2"
services:
bookstack:
image: ghcr.io/linuxserver/bookstack:version-v21.04
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL= bookstack.xx.duckdns.org
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS=xxx
- DB_DATABASE=bookstackapp
volumes:
- /opt/containers/bookstack/app:/config
ports:
- 6875:80
networks:
- default
- proxy
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: ghcr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=xxy
- TZ=Europe/London
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=xxx
volumes:
- /opt/containers/bookstack/db:/config
restart: unless-stopped
networks:
proxy:
external: true

Docker logs

  Migrating: 2021_03_08_215138_add_user_slug

Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_slug_unique`(`slug`))

at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669

 665|         // If an exception occurs when attempting to run a query, we'll format the error

 666|         // message to include the bindings with SQL, which will make this exception a

 667|         // lot more helpful to the developer instead of just the database's errors.

 668|         catch (Exception $e) {

669| throw new QueryException(

 670|                 $query, $this->prepareBindings($bindings), $e

 671|             );

 672|         }

 673|

Exception trace:

1 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")

   /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18

2 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))

   /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

Please use the argument -v to see more details.

[cont-init.d] 50-config: exited 0.

[cont-init.d] 99-custom-files: executing...

[custom-init] no custom files found exiting...

[cont-init.d] 99-custom-files: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

Bug with the revisions changes pages

linuxserver.io

Ubuntu 18.04, Docker 18.09.6-ce

I am struggling with an issue and I'm wondering if anyone else notice this too. The problem is with the view of the revision changes (URL is like : https://SERVER/books/BOOK/page/PAGE/revisions/NUMBER/changes). The view is kind of messed up and not everything is shown (only the first few characters of each lines).

Example : https://ibb.co/37BJ5DF
Actually the hole page is like : https://ibb.co/BcCFvj4

This issue appears on every revision pages but only if want to see the "Changes".
But no issue on the demo website : https://demo.bookstackapp.com

Did anyone else have the same issue ?

Thanks, team linuxserver.io

Redirect issues with APP_URL env

linuxserver.io


Expected Behavior

Accessing bookstack unter localhost:6875 with loaded CSS and images

Current Behavior

I set up bookstack in a pod with podman, I set the environment variables from your documentation.
If I set something for APP_URL the redirect isn't working and no images nor CSS is loading.
A curl gives me this:

    <title>Redirecting to 127.0.0.1/127.0.0.1/login</title>
</head>
<body>
    Redirecting to <a href="127.0.0.1/127.0.0.1/login">127.0.0.1/127.0.0.1/login</a>.
</body>

When I do not set the APP_URL environment variable it somehow gets my WAN IP and sets this as external URL which of course doesn't work

Steps to Reproduce

  1. setup pod, setup containers as described
  2. run pod
  3. try to access
  4. no luck

Environment

OS: Fedora 33 with Podman 3.0
CPU architecture: x86_64
How docker service was installed:

Podman ;)

Command used to create docker container (run/create/compose/screenshot)

Ansible Playbook

`---

  • name: install bookstack
    hosts: localhost
    become: false

    tasks:

    • name: setup pod
      containers.podman.podman_pod:
      name: bookstack
      state: started
      publish:
      - 127.0.0.1:6875:80

    • name: create db volume
      containers.podman.podman_volume:
      state: present
      name: bookstack-db

    • name: create app volume
      containers.podman.podman_volume:
      state: present
      name: bookstack-app

    • name: setup mariadb container
      containers.podman.podman_container:
      name: bookstack-db
      image: ghcr.io/linuxserver/mariadb
      pod: bookstack
      state: started
      volume:
      - bookstack-db:/config:z
      env:
      PUID: 1000
      PGID: 1000
      MYSQL_ROOT_PASSWORD: "password"
      TZ: "Europe/Berlin"
      MYSQL_DATABASE: "bookstackapp"
      MYSQL_USER: "bookstack"
      MYSQL_PASSWORD: "password"

    • name: setup bookstack container
      containers.podman.podman_container:
      name: bookstack-app
      image: ghcr.io/linuxserver/bookstack
      pod: bookstack
      state: started
      volume:
      - bookstack-app:/config:z
      env:
      PUID: 1000
      PGID: 1000
      APP_URL: "127.0.0.1"
      DB_HOST: "bookstack-db"
      DB_USER: "bookstack"
      DB_PASS: "password"
      DB_DATABASE: "bookstackapp"`

Docker logs

...
Migrated: 2016_03_13_082138_add_page_drafts (0.02 seconds)
Migrating: 2016_03_25_123157_add_markdown_support
Migrated: 2016_03_25_123157_add_markdown_support (0.01 seconds)
Migrating: 2016_04_09_100730_add_view_permissions_to_roles
Migrated: 2016_04_09_100730_add_view_permissions_to_roles (0.07 seconds)
Migrating: 2016_04_20_192649_create_joint_permissions_table
Migrated: 2016_04_20_192649_create_joint_permissions_table (0.21 seconds)
Migrating: 2016_05_06_185215_create_tags_table
Migrated: 2016_05_06_185215_create_tags_table (0.09 seconds)
Migrating: 2016_07_07_181521_add_summary_to_page_revisions
Migrated: 2016_07_07_181521_add_summary_to_page_revisions (0.01 seconds)
Migrating: 2016_09_29_101449_remove_hidden_roles
Migrated: 2016_09_29_101449_remove_hidden_roles (0.04 seconds)
Migrating: 2016_10_09_142037_create_attachments_table
Migrated: 2016_10_09_142037_create_attachments_table (0.07 seconds)
Migrating: 2017_01_21_163556_create_cache_table
Migrated: 2017_01_21_163556_create_cache_table (0.06 seconds)
Migrating: 2017_01_21_163602_create_sessions_table
Migrated: 2017_01_21_163602_create_sessions_table (0.06 seconds)
Migrating: 2017_03_19_091553_create_search_index_table
Migrated: 2017_03_19_091553_create_search_index_table (0.1 seconds)
Migrating: 2017_04_20_185112_add_revision_counts
Migrated: 2017_04_20_185112_add_revision_counts (0.03 seconds)
Migrating: 2017_07_02_152834_update_db_encoding_to_ut8mb4
Migrated: 2017_07_02_152834_update_db_encoding_to_ut8mb4 (0 seconds)
Migrating: 2017_08_01_130541_create_comments_table
Migrated: 2017_08_01_130541_create_comments_table (0.08 seconds)
Migrating: 2017_08_29_102650_add_cover_image_display
Migrated: 2017_08_29_102650_add_cover_image_display (0.01 seconds)
Migrating: 2018_07_15_173514_add_role_external_auth_id
Migrated: 2018_07_15_173514_add_role_external_auth_id (0.03 seconds)
Migrating: 2018_08_04_115700_create_bookshelves_table
Migrated: 2018_08_04_115700_create_bookshelves_table (0.47 seconds)
Migrating: 2019_07_07_112515_add_template_support
Migrated: 2019_07_07_112515_add_template_support (0.03 seconds)
Migrating: 2019_08_17_140214_add_user_invites_table
Migrated: 2019_08_17_140214_add_user_invites_table (0.05 seconds)
Migrating: 2019_12_29_120917_add_api_auth
Migrated: 2019_12_29_120917_add_api_auth (0.07 seconds)
Migrating: 2020_08_04_111754_drop_joint_permissions_id
Migrated: 2020_08_04_111754_drop_joint_permissions_id (0.12 seconds)
Migrating: 2020_08_04_131052_remove_role_name_field
Migrated: 2020_08_04_131052_remove_role_name_field (0.01 seconds)
Migrating: 2020_09_19_094251_add_activity_indexes
Migrated: 2020_09_19_094251_add_activity_indexes (0.03 seconds)
Migrating: 2020_09_27_210059_add_entity_soft_deletes
Migrated: 2020_09_27_210059_add_entity_soft_deletes (0.02 seconds)
Migrating: 2020_09_27_210528_create_deletions_table
Migrated: 2020_09_27_210528_create_deletions_table (0.06 seconds)
Migrating: 2020_11_07_232321_simplify_activities_table
Migrated: 2020_11_07_232321_simplify_activities_table (0.09 seconds)
Migrating: 2020_12_30_173528_add_owned_by_field_to_entities
Migrated: 2020_12_30_173528_add_owned_by_field_to_entities (0.12 seconds)
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
...

Redirects to example.com

linuxserver.io


Expected Behavior

Should use the host ip as app url

Current Behavior

Redirecting to example.com. If container created without "APP_URL" environment.

Steps to Reproduce

  1. Spin up latest version
  2. open the hostip:6875 in browser
  3. redirected to example.com/login

Environment

OS: Ubuntu 20.04
CPU architecture: x86_64
How docker service was installed: https://hub.docker.com/r/linuxserver/bookstack

Command used to create docker container (run/create/compose/screenshot)

Docker logs

Allow setting APP_KEY from env variables

Expected Behavior

I want to be able to seed an APP_KEY env variable (stored in a secret in Kubernetes for example), and the container should take it instead of regenerating one and forcefully putting it in the .env

Current Behavior

Currently if I destroy the container (only keeping the uploads, that's what should be immutable), it will recreate an APP_KEY again, thus invalidating the data in database. The DB_PASS/USER can be passed again, so this is not a problem for it.

Steps to Reproduce

  1. Destroy the container (and the volume if configured on /config), try to replug it to the DB.

Environment

OS: Ubuntu
CPU architecture: x86_64
How docker service was installed: On Kubernetes with a Helm chart

CHOWN command incredibly slow

linuxserver.io

My ubuntu host hangs on this 2 year old line for quite a while.

I don't know why correct 'chown' encoded into the docker image?


Expected Behavior

Expected that my server would start within a minute or so

Current Behavior

Can hang for as long as 5-10 minutes on my slow slice.

Steps to Reproduce

using standard docker-compose

Environment

**OS: Ubuntu 18.x
CPU architecture: x86_64/arm32/arm64
How docker service was installed:

Command used to create docker container (run/create/compose/screenshot)

docker-compose -f docker-compose-book.yml up -d

Docker logs

... docker exec bookstack ps ax
271 root 0:00 bash /var/run/s6/etc/cont-init.d/50-config
308 root 0:03 chown -R abc:abc /config /var/www/
324 root 0:00 ps ax

Failure if invalid `.env` is present

Expected Behavior

Better handling or warning in log of potential problem.

Could validate an .env file has required vars before starting the service, or just checking for a zero sized file should at least avoid this scenario.

Current Behavior

If .env is an empty (0 bytes) file, the current behaviour is to ignore updating the .env:

# check for .env and copy default if needed
[[ ! -f "/config/www/.env" ]] && \
cp /var/www/html/.env.example /config/www/.env

This prevents all .env update logic via sed replace operations. Which in turn causes Bookstack to fail to start:

Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')

Exception trace:

1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO)")
     /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO)")
     /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

This scenario shouldn't happen, but affected a production setup that had been running fine for about 2 years when the host system ran out of disk space for the volume the container mounted to persist data. The container restarted itself at some point, and some condition to write or write to .env on disk (perhaps due to disk write error) resulted in the file becoming empty/blank.

It was unclear initially why the service was failing to restore after resolving the disk space issue with the given failure message above, especially since the docker-compose.yml ENV (separate from internal container managed .env file) was valid which the error output implied was not being used.

Steps to Reproduce

  1. Use a default setup.
  2. Override the created .env file to be empty.
  3. Start the service again and check logs for failure like shown above.

Environment

OS: Linux
CPU architecture: x86_64
How docker service was installed: Official distro repo

Command used to create docker container (run/create/compose/screenshot)

/docker/docker-compose.yml example (generates default network based on directory name, thus docker_default like above example error snippet):

bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=hunter2
      - DB_DATABASE=bookstackapp
      - APP_URL=https://wiki.example.com
    volumes:
      - /path/to/data/app:/config
    restart: unless-stopped
    depends_on:
      - bookstack_db

  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=hunter2
      - TZ=ETC/UTC
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=hunter2
    volumes:
      - /path/to/data/db:/config
    restart: unless-stopped

Docker logs

$ docker-compose logs bookstack

Attaching to bookstack
bookstack            | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack            | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack            | [fix-attrs.d] applying ownership & permissions fixes...
bookstack            | [fix-attrs.d] done.
bookstack            | [cont-init.d] executing container initialization scripts...
bookstack            | [cont-init.d] 01-envfile: executing... 
bookstack            | [cont-init.d] 01-envfile: exited 0.
bookstack            | [cont-init.d] 10-adduser: executing... 
bookstack            | 
bookstack            | -------------------------------------
bookstack            |           _         ()
bookstack            |          | |  ___   _    __
bookstack            |          | | / __| | |  /  \ 
bookstack            |          | | \__ \ | | | () |
bookstack            |          |_| |___/ |_|  \__/
bookstack            | 
bookstack            | 
bookstack            | Brought to you by linuxserver.io
bookstack            | -------------------------------------
bookstack            | 
bookstack            | To support LSIO projects visit:
bookstack            | https://www.linuxserver.io/donate/
bookstack            | -------------------------------------
bookstack            | GID/UID
bookstack            | -------------------------------------
bookstack            | 
bookstack            | User uid:    1000
bookstack            | User gid:    1000
bookstack            | -------------------------------------
bookstack            | 
bookstack            | [cont-init.d] 10-adduser: exited 0.
bookstack            | [cont-init.d] 20-config: executing... 
bookstack            | [cont-init.d] 20-config: exited 0.
bookstack            | [cont-init.d] 30-keygen: executing... 
bookstack            | using keys found in /config/keys
bookstack            | [cont-init.d] 30-keygen: exited 0.
bookstack            | [cont-init.d] 50-config: executing... 
bookstack            | App Key found - setting variable for seds
bookstack            | Running config - db_user set
bookstack            | /var/run/s6/etc/cont-init.d/50-config: line 77: warning: command substitution: ignored null byte in input
bookstack            | /var/run/s6/etc/cont-init.d/50-config: line 77: warning: command substitution: ignored null byte in input
bookstack            | 
bookstack            |    Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')
bookstack            | 
bookstack            |   at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
bookstack            |     665|         // If an exception occurs when attempting to run a query, we'll format the error
bookstack            |     666|         // message to include the bindings with SQL, which will make this exception a
bookstack            |     667|         // lot more helpful to the developer instead of just the database's errors.
bookstack            |     668|         catch (Exception $e) {
bookstack            |   > 669|             throw new QueryException(
bookstack            |     670|                 $query, $this->prepareBindings($bindings), $e
bookstack            |     671|             );
bookstack            |     672|         }
bookstack            |     673|
bookstack            | 
bookstack            |   Exception trace:
bookstack            | 
bookstack            |   1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO)")
bookstack            |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
bookstack            | 
bookstack            |   2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'forge'@'bookstack.docker_default' (using password: NO)")
bookstack            |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
bookstack            | 
bookstack            |   Please use the argument -v to see more details.
bookstack            | [cont-init.d] 50-config: exited 0.
bookstack            | [cont-init.d] 99-custom-files: executing... 
bookstack            | [custom-init] no custom files found exiting...
bookstack            | [cont-init.d] 99-custom-files: exited 0.
bookstack            | [cont-init.d] done.
bookstack            | [services.d] starting services
bookstack            | [services.d] done.
bookstack            | Signal handled: Terminated.
bookstack            | [cont-finish.d] executing container finish scripts...
bookstack            | [cont-finish.d] done.
bookstack            | [s6-finish] waiting for services.
bookstack            | s6-svwait: fatal: supervisor died
bookstack            | [s6-finish] sending all processes the TERM signal.
bookstack            | Signal handled: Terminated.
bookstack            | Signal handled: Terminated.
bookstack            | [s6-finish] sending all processes the KILL signal and exiting.
bookstack            | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack            | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack            | [fix-attrs.d] applying ownership & permissions fixes...
bookstack            | [fix-attrs.d] done.
bookstack            | [cont-init.d] executing container initialization scripts...
bookstack            | [cont-init.d] 01-envfile: executing... 
bookstack            | [cont-init.d] 01-envfile: exited 0.
bookstack            | [cont-init.d] 10-adduser: executing... 
bookstack            | usermod: no changes

A thanks and request to link to this project

Hi linuxserver team,
I'm the primary maintainer of BookStack, Just want to say thanks for creating and maintaining this docker image.

Would it be okay for me to link to this project from the install docs to provide our docker-happy users with an additional option to get going with BookStack?

Thanks,
Dan

The server does not allow uploads of this size. Please try a smaller file size

I was busy for the last 2 hours trying to find the root cause - no success.

My error message when I am uploading is:
"The server does not allow uploads of this size. Please try a smaller file size."

php-local.ini

memory_limit = 512M
post_max_size = 100M
upload_max_filesize = 100M

I checked everything, the syntax, different values. No effect at all. It seems like the config file isn't read. But the files were created from the application and it's mounted correctly.
I also checked the nginx config, in which I haven't changed anything
nginx.conf
client_max_body_size 0;
The value is set to 0, which means unlimited.

Custom HTML Head Content
<script> window.uploadLimit = 1500; </script>

My upload limit is still 1 MB.


Expected Behavior

Respect the configuration file settings to allow bigger upload attachment sizes

Current Behavior

Can't upload attachments bigger than 1MB

Steps to Reproduce

  • Fill out docker-compose config based on the README. I added a custom volumes path for bookstack and mariadb config
  • docker-compose up -d
  • Access it through a browser

Environment

OS: Ubuntu 16.04
CPU architecture: x86_64
How docker service was installed: Like docker's documentation shows

Command used to create docker container (run/create/compose/screenshot)

docker-compose up -d

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
Nothing to migrate.

Container does not serve static assets when proxied through Nginx

linuxserver.io

When proxied through Nginx, static assets are not available, and return 404 in the browser.


Expected Behavior

Static assets should load when directly proxied with nginx.

Current Behavior

They do not load.

Steps to Reproduce

  1. Run the mariadb and bookstack containers with the documented example
  2. Point nginx to it with proxy_pass.
  3. Profit
  4. ?

Environment

OS: Ubuntu 20.04
CPU architecture: x86_64
How docker service was installed: From the docker repo, via docker run.

Command used to create docker container (run/create/compose/screenshot)

docker run -d \
  --name=bookstack \
  -e APP_URL=<my custom url which is correct> \
  -e DB_HOST=mariadb \
  -e DB_USER=bookstack \
  -e DB_PASS=12345 \
  -e DB_DATABASE=bookstack \
  -p 6875:80 \
  -v /var/lib/dockerdata/bookstack:/config \
  --restart unless-stopped \
  --network=bookstack \
  ghcr.io/linuxserver/bookstack

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
........................................+++++
...................................................................+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing... 
Generating BookStack app key for first run
App Key set to base64:<snip>= you can modify the file to update /config/BOOKSTACK_APP_KEY.txt
Running config - db_user set
**** APP_URL in /config/www/.env is being updated from https://example.com to <my custom url which is correct> ****
**** If this is an existing install, you should run the following line from your host terminal to update the database URL entries: ****
************************************************************************
docker exec -it bookstack php /var/www/html/artisan bookstack:update-url https://example.com <my custom url which is correct>
************************************************************************
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Nginx Configuration

server {
  listen 444 ssl http2;
  listen [::]:444 ssl http2;

  server_name kb.rcscartage.ca;

  # SSL Config here

  add_header Strict-Transport-Security max-age=15768000;

  location ~* \.(js|css|png|jp?g|gif|ico)$ {
      expires 1M;
      add_header Cache-Control public;
  }

  location / {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:6875;
  }

  location ^~ /.well-known/acme-challenge/ {
    default_type "text/plain";
    root         /var/www/;
  }

  location = /.well-known/acme-challenge/ {
    return 404;
  }
}

I have tried setting the index and root settings. I also tried exposing /var/www/html/public to the host, however when doing so the container refused to write any files there. (I did see it correctly writes when not mounted with docker exec bookstack ls /var/www/html/public).

Illuminate\Http\Exceptions\PostTooLargeException when posting a form

On a fresh install using the provided docker-compose.yml, whenever I post a form (create a new shelf, try to change the default admin password) I get an Illuminate\Http\Exceptions\PostTooLargeException.

Perhaps this is caused by

8af8464#diff-47ffcee93649ec8520ea742cfddc9b9bR66


Expected Behavior

I should be able to post forms.

Current Behavior

When I post any form, the error Illuminate\Http\Exceptions\PostTooLargeException appears.

Steps to Reproduce

  1. Fresh install using the provided docker-compose.yml
  2. Log in as admin
  3. Try to create a shelf

Environment

OS:
CPU architecture: x86_64/arm32/arm64
How docker service was installed:

Command used to create docker container (run/create/compose/screenshot)

version: "2"
services:
  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=mypassword
      - DB_DATABASE=bookstackapp
    volumes:
      - /var/www/bookstack/config:/config
    ports:
      - 80:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=mypassword
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=mypassword
    volumes:
      - /var/www/bookstack/config:/config
    restart: unless-stopped

Docker logs

The docker logs show nothing, but the nginx logs do:

2020/09/18 15:37:04 [error] 357#357: *19 FastCGI sent in stderr: "PHP message: PHP Warning:  POST Content-Length of 1072 bytes exceeds the limit of 100 bytes in Unknown on line 0" while reading response header from upstream, client: 5.180.62.10, server: _, request: "POST /settings/users/1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "78.46.181.222", referrer: "http://78.46.181.222/settings/users/1"

I'm don't know that much about php.ini configuration, but googling for post_max_size the size was always specified as 100M while the recent change used 100MB - don't know if that could be the problem maybe.

Add opcache module for php

Hi,
thank you for docker image of bookstack.
If I see correctly there is no module opcache installed, I'd like to ask you to add opcache to image. It can be disabled by default if you prefer to not use opcache.

db err

bookstack_db |
bookstack_db | 2019-06-15 19:22:15 0 [Note] mysqld (mysqld 10.3.15-MariaDB-1:10.3.15+maria~bionic-log) starting as process 266 ...
bookstack_db | 2019-06-15 19:22:15 0 [ERROR] mysqld: File '/config/log/mysql/mariadb-bin.index' not found (Errcode: 13 "Permission denied")
bookstack_db | 2019-06-15 19:22:15 0 [ERROR] Aborting
bookstack_db |

servername _ causes invalid helo for smtp mail sending

Hi everyone,

I have been using this image and want to use a smtp server with it. the problem is though that somehow the servername is an underscore and that causes an invalid helo message...

I have found this in the nginx configuration:

server_name _;

Apparently a similar problem exists also on the nextcloud image and has been reported as an issue

nextcloud/server#14941

Is there a easy workaroud or some better configuration to fix this ?

Greetings and thanks for the otherwise awesome image!

Initial .env config breaks when passwords contain certain special characters

In the initial run of the docker-compose.yml, the .env file breaks when setting a password that contains special characters such as & ' /.

Pop!_OS 18.10

docker-compose up -d

The resulting .env file (www/.env) contains the following variables:

DB_HOST=bookstack_db
DB_DATABASE=bookstackapp
DB_USERNAME=bookstack
DB_PASSWORD=exampleDB_PASSWORD=database_user_passwordpassword

Not sure how the fields in the docker-compose.yml are parsed, but escaping these characters could be a solution. Another solution could be to mention the limitation and advise users to use only alphanumeric passwords.

Thanks, team linuxserver.io

LDAP PHP extension not installed

I have enabled advanced mode with the latest container, configured the LDAP authentication settings and enabled LDAP auth. When attempting to logon to bookstack after restarting the container, it displays that the LDAP PHP extension is not installed.

Host OS - Ubuntu 16.04
Output log, no errors appear in the log
unknown

Container startup does not set APP_KEY

Host: Ubuntu Server 16.04.05
No errors reported in the docker log, but the laravel.log file reported cipher errors:

[2019-01-25 04:23:22] production.ERROR: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"exception":"[object] (RuntimeException(code: 0): The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. at /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:43)

Full log: https://pastebin.com/RjFJXfKY

Turned on APP_DEBUG, found that all DB related ENV variables were set correctly, but APP_KEY was still set to SomeRandomString, even though /config/BOOKSTACK_APP_KEY.txt had a valid value.
I was able to get this working by manually editing the /config/www/.env file with the output from php artisan key:generate.

I'm not configuring the container by landing a custom /config/www/.env, but this should probably be fixed for others.
I suspect this sed command isn't working as it should be:

sed -i "s,APP_KEY=SomeRandomString,APP_KEY=${key},g" /config/www/.env

wkhtmltopdf segfault

linuxserver.io


Expected Behavior

As per docs, update bookstack to use /usr/bin/wkhtmltopdf to generate PDFs

Current Behavior

The process has been signaled with signal "11".

Steps to Reproduce

  1. Update .env to point to /usr/bin/wkhtmltopdf
  2. Attempt to export a book to PDF

Environment

OS: Debian 10
CPU architecture: x86_64
How docker service was installed: DockerHub

Command used to create docker container (run/create/compose/screenshot)

version: '3.2'

secrets:
  bookstack_db_password:
    external: true

services:
  bookstack:
    image: linuxserver/bookstack
    secrets:
      - bookstack_db_password
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://xxxxxxxxxxxxxxxxx
      - DB_HOST=db
      - DB_USER=bookstack
      - FILE__DB_PASS=/run/secrets/bookstack_db_password
      - DB_DATABASE=bookstack
    volumes:
      - /srv/bookstack/data/bookstack:/config
    networks:
      - db-net
      - traefik-net
    deploy:
      mode: replicated
      replicas: 1
      labels:
        - traefik.frontend.rule=Host:xxxxxxxxxxxxxxx
        - traefik.enable=true
        - traefik.backend.loadbalancer.swarm=true
        - traefik.http.services.portainer.loadbalancer.server.port=80
        - traefik.docker.network=traefik-net

networks:
  db-net:
    external:
      name: db-net
  traefik-net:
    external:
      name: traefik-net

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[env-init] DB_PASS set from FILE__DB_PASS
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
sed: unmatched '/'
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 86: warning: command substitution: ignored null byte in input
Nothing to migrate.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

uploads Folder is wrong link

First of all, my english is not good.
Bookstack uploads images are saved in '/var/www/html/public/uploads' folder.
But linux soft link is '/var/www/html/public/uploads/uploads' -> '/config/www/uploads'

Problem with wkhtmltopdf rendering Chinese characters

hey guys,

I've been bother by this wkhtmltopdf problem for a whole week and can't get it to work properly.
The issue was posted here: BookStackApp/BookStack#1778

I also tried to install bookstack without docker and wkhtmltopdf works well.

I think this problem only happens when I use docker with wkhtmltopdf.

One of friend was very kindly sent his solution which adds boot_wkhtmltopdf.sh to Dockerfile seems to solve this problem.

https://github.com/or0or1/docker-bookstack/blob/master/boot_wkhtmltopdf.sh
Could you check this problem, thank you so much!

Unable to connect at URL

I'm trying to run Bookstack on my dedicated CentOS server. I already have Gitea running in a Docker container so I understand some Docker basics.

I want Bookstack to run at http://example.com:10081. After running docker-compose pull and creating a docker-compose.yml file (see below) and running docker-compose up I thought I would see Bookstack at http://example.com:10081. Instead I see "Unable to connect" in my browser. I think I'm missing something important but after reading the readme file and Docs at linuxserver.io I cannot figure out what it is.

Example docker-compose.yml

---
version: "2"
services:
  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=examplepassword
      - DB_DATABASE=bookstackapp
    volumes:
      - ./data:/config
    ports:
      - 10081:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=examplepassword
      - TZ=America/New_York
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=examplepassword
    volumes:
      - ./data:/config
    restart: unless-stopped

Additional details: This server has WHM/cPanel, Apache, MySQL, etc. installed. I figured since Bookstack was in a Docker container that shouldn't matter. I didn't need to do anything special for Gitea (official Docker image) to work — I just had to give it a port. I was hoping Bookstack would be just as easy.

What am I missing?

Reverse Proxy

Couldn't get this to work properly behind LE/Nginx until I set

APP_URL=https://server.com/bookstack in /var/www/html/.env

I'm guessing it's going to be yet another environmental variable that needs the ability to set in the docker run command.

APP_URL changes itself

After starting with the newest build the APP_URL changed to the IP of the server. And then I can't access the bookstack instance anymore.

A Issue was opened in the bookstack repo, describing the problem. But since its with the docker image ssdanbrown said a issues should be opened here

BookStackApp/BookStack#2420

Edit:
It changed in the .env file, because it was not set in my compose. Okay. Now it stays. But still cant access bookstack.

wkhtmltopdf generating wrong TOC links

Expected Behavior

Links should point to the heading for that section as can be seen when done through the BookStack development environment.

Current Behavior

When exporting a page to pdf with wkhtmltopdf and opening it, clicking one of the TOC links, it doesn't take me to the correct location and shows a meaningless link address, like file:///tmp/knp_snappy5ff65ed5491ae7.13561238.html.

This behaviour cannot be reproduced on the official BookStack install or development environment, only the Linuxserver and Solidnerd images.

Steps to Reproduce

Steps to reproduce the behavior:

Create a page with some headers
Configure BookStack to use wkhtmltopdf for pdf-generating
Export and open
Click one of the TOC links

Process of elimination has narrowed this down to the version of wkhtmltopdf running:

Development environment: wkhtmltopdf 0.12.6 (with patched qt)
Linuxserver: wkhtmltopdf 0.12.5
Solidnerd: wkhtmltopdf 0.12.5

So I updated the Linuxserver image to the 0.12.6 (actually I bumped the Alpine container version to .13, which then pointed it to the new repository which had the 0.12.6 in it). But the issue still occurred.

Then I pulled the latest build directly from the website (https://wkhtmltopdf.org/downloads.html) into the Solidnerd container, and the issue was resolved.

The difference, is in 1. the wkhtmltopdf version became: wkhtmltopdf 0.12.6. In scenario 2. the version became: wkhtmltopdf 0.12.6 (with patched qt)

The solution then it appears, is to install wkhtmltopdf 0.12.6 (with patched qt. More can be read about qt here: https://wkhtmltopdf.org/downloads.html).

This should be relatively easy for the Solidnerd container as it can be pulled directly from the source.

For the Linuxserver though, which is Alpine Linux, there doesn't appear to be a version compatible with MUSL, so wasn't able to get the QT version installed.

Discussion over on BookStack that lead to here: BookStackApp/BookStack#2459 (comment)

A discussion on the wkhtmltopdf repo related to Alpine support: wkhtmltopdf/packaging#2

File Not Found - Sorry for 2 Issues, once i hit enter to fast

linuxserver.io

File Not Found (Manifest latest)

Expected Behavior

I think it should get an File from an Server (https://ghcr.io/v2/linixserver/bookstack/manifests/latest) but this is not public.

Current Behavior

It outputs just an error:
ERROR: Get "https://ghcr.io/v2/linixserver/bookstack/manifests/latest": denied

Steps to Reproduce

  1. I wrote a Docker Compose file.
  2. I compose the file
  3. It outputs the error

Environment

OS: OpenSUSE Leap 15
CPU architecture: x86_64
How docker service was installed: zypper install

Command used to create docker container (run/create/compose/screenshot)

Docker-Composefile:

version: "2"
services:
bookstack:
image: ghcr.io/linixserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=https://bookstack.schule6314.ch
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS="pw
- DB_DATABASE=bookstackapp
volumes:
- /srv/docker/bookstack/data_app:/config
ports:
- "3002:80"
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: ghcr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD="pw"
- TZ=Europe/Zurich
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD="pw"
volumes:
- /srv/docker/bookstack/data_db:/config
restart: unless-stopped

docker-compose -f filename.yaml up -d

Docker logs

OutPut:
WARNING: Found orphan containers (...) for this project. If you removed or renamed this service in
your compose file, you can run this command with the --remove-orphans flag to clean it up.
Pulling bookstack (ghcr.io/linixserver/bookstack:)...
ERROR: Get "https://ghcr.io/v2/linixserver/bookstack/manifests/latest": denied

Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored...' at line 1

linuxserver.io


Expected Behavior

If procced with restore of database in docker similar to instruction:
https://www.bookstackapp.com/docs/admin/backup-restore/
you should be able to import sql file.

Current Behavior

If procced with restore of database in docker similar to instruction:
https://www.bookstackapp.com/docs/admin/backup-restore/
then you will recive error:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored...' at line 1

Steps to Reproduce

  1. Make a dump of sql: sudo docker exec -it bookstack-db mysqldump -uroot -ppassword bookstack > bookstack.sql
  2. Try to import it: sudo docker exec -it bookstack-db /bin/sh -c "mysql -uroot -ppassword bookstack < bookstack.sql"
  3. Error shows up

Environment

OS: Docker/ Linux 5.10.0-0.bpo.3-amd64 #1 SMP Debian 5.10.13-1~bpo10+1 (2021-02-11) x86_64 GNU/Linux
CPU architecture: x86_64
How docker service was installed:

OMV 5

Command used to create docker container (run/create/compose/screenshot)

version: "2"
services:

  bookstack-db:
    image: linuxserver/mariadb
    container_name: bookstack-db
    hostname: bookstack-db
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=100
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=bookstack
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=password
      
    volumes:
      - /srv/dev1212/dockerdisk/bookstack/bookstack-db-data:/config


  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    hostname: bookstack
    restart: unless-stopped
    environment:
      - TZ=Europe/Warsaw
      - PUID=1000
      - PGID=100
      - APP_URL=https://mydomain.com
      - DB_HOST=bookstack-db
      - DB_USER=bookstack
      - DB_PASS=password
      - DB_DATABASE=bookstack



    depends_on:
      - bookstack-db
    volumes:
      - /srv/dev1212/dockerdisk/bookstack/bookstack-data:/config


Docker logs

Operation timed out during startup

I'm running this container and the linuxserver/docker-mariadb container in my Kubernetes cluster. The container starts the service inside fails quickly. Full log below:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing... 
Advanced Mode Enabled - Syncing .env from /config to /var/www/html - if you're doing this you better read the BookStack documentation. Restart container after making changes to .env

                                                                               
  [Illuminate\Database\QueryException]                                         
  SQLSTATE[HY000] [2002] Operation timed out (SQL: select * from information_  
  schema.tables where table_schema = bookstackapp and table_name = migrations  
  )                                                                            
                                                                               

                                              
  [Doctrine\DBAL\Driver\PDOException]         
  SQLSTATE[HY000] [2002] Operation timed out  
                                              

                                              
  [PDOException]                              
  SQLSTATE[HY000] [2002] Operation timed out  
                                              

[cont-init.d] 50-config: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

I turned query logging on and confirmed that query is never reaching the mariadb instance.

Lots of files are written to the mounted /config directory so it seems like permissions are correct except there is no /config/logs/laravel.log so whatever failure is happening seems to be extremely early in the startup process

K8s master and nodes all running Ubuntu 18.04 VM in ESXI.

bootstack.yaml

apiVersion: v1                                                                   
kind: Namespace                                                                  
metadata:                                                                        
  name: bookstack                                                                
---                                                                              
apiVersion: v1                                                                   
kind: Service                                                                    
metadata:                                                                           
  labels:                                                                                                                                                                                                                                           
    app: bookstack                                                                  
  name: bookstack                                                                   
  namespace: bookstack                                                              
spec:                                                                               
  ports:                                                                            
  - name: web                                                                       
    port: 80                                                                        
    nodePort: 31015                                                                 
  selector:                                                                         
    app: bookstack                                                                  
  type: NodePort                                                                    
---                                                                                 
apiVersion: apps/v1                                                                 
kind: Deployment                                                                    
metadata:                                                                           
  name: bookstack                                                                   
  namespace: bookstack                                                              
spec:                                                                               
  selector:                                                                         
    matchLabels:                                                                    
      app: bookstack                                                                
  template:                                                                         
    metadata:                                                                       
      labels:                                                                       
        app: bookstack                                                              
      namespace: bookstack                                                       
    spec:                                                                           
      containers:                                                                   
      - env:                                                                        
        - name: ADVANCED_MODE                                                       
          value: "1"                                                                
        - name: PGID                                                                
          value: "1000"                                                             
        - name: PUID                                                                
          value: "1000"                                                             
        image: linuxserver/bookstack                                                
        name: bookstack                                                             
        ports:                                                                      
        - containerPort: 80                                                         
          name: web                                                                 
        volumeMounts:                                                               
        - mountPath: /config                                                        
          name: config                                                              
          subPath: bookstack                                                        
      terminationGracePeriodSeconds: 10                                             
      volumes:                                                                      
      - name: config                                                                
        nfs:                                                                        
          path: /storage                                                            
          server: nfs

mariadb.yaml

apiVersion: v1                                                                      
kind: Namespace                                                                     
metadata:                                                                           
  name: mariadb                                                                     
---                                                                                 
apiVersion: v1                                                                      
kind: Service                                                                       
metadata:                                                                           
  labels:                                                                           
    app: mariadb                                                                    
  name: mariadb                                                                     
  namespace: mariadb                                                                
spec:                                                                               
  ports:                                                                            
  - name: db                                                                        
    port: 3306                                                                      
    nodePort: 31014                                                                 
  selector:                                                                                                                                                                                                                                         
    app: mariadb                                                                    
  type: NodePort                                                                    
---                                                                                 
apiVersion: apps/v1                                                                 
kind: Deployment                                                                    
metadata:                                                                           
  name: mariadb                                                                     
  namespace: mariadb                                                                
spec:                                                                               
  selector:                                                                         
    matchLabels:                                                                    
      app: mariadb                                                                  
  template:                                                                         
    metadata:                                                                       
      labels:                                                                       
        app: mariadb                                                                
      namespace: mariadb                                                            
    spec:                                                                           
      containers:                                                                   
      - env:                                                                        
        - name: MYSQL_ROOT_PASSWORD                                                 
          value: "wtac,ACTB0818SQL"                                                 
        - name: PGID                                                                
          value: "1000"                                                             
        - name: PUID                                                                
          value: "1000"                                                             
        - name: TZ                                                                  
          value: "America/Los_Angeles"                                              
        image: linuxserver/mariadb                                                  
        name: mariadb                                                               
        ports:                                                                      
        - containerPort: 3306                                                       
          name: db                                                                  
        volumeMounts:                                                               
        - mountPath: /config                                                        
          name: config                                                              
          subPath: mariadb                                                          
      terminationGracePeriodSeconds: 10                                             
      volumes:                                                                      
      - name: config                                                                
        nfs:                                                                        
          path: /storage                                                            
          server: nfs                   

File upload limit set to 2MB

It would be nice if the default upload limit could be increased a bit, as it's currently set to 2MB. It can already be easily changed by adding these lines to /config/php/php-local.ini:

post_max_size = 10M
upload_max_filesize = 10M

However, I think it's sensible to increase the defaults to 10MB, as recommended in the docs.

CVE-2019-11043: PHP-FPM arbitrary code execution vulnerability

There is a new PHP/nginx vulnerability that might affect docker-bookstack.

PHP bugtracker: https://bugs.php.net/bug.php?id=78599
Exploit PoC: https://github.com/neex/phuip-fpizdam
An example vulnerable docker-compose env: https://github.com/vulhub/vulhub/tree/master/php/CVE-2019-11043

The solution according to this article is:

On October 24, PHP 7.3.11 (current stable) and PHP 7.2.24 (old stable) were released to address this vulnerability along with other scheduled bug fixes. Those using nginx with PHP-FPM are encouraged to upgrade to a patched version as soon as possible.

If patching is not feasible, the suggested workaround is to include checks to verify whether or not a file exists. This is achieved either by including the try_files directive or using an if statement, such as if (-f $uri).

This is how Nextcloud handles the issue: https://nextcloud.com/blog/urgent-security-issue-in-nginx-php-fpm/

Hi Linuxserver Team

linuxserver.io

File Not Found (Manifest latest)

Expected Behavior

I think it should get an File from an Server (https://ghcr.io/v2/linixserver/bookstack/manifests/latest) but this is not public.

Current Behavior

It outputs just an error:
ERROR: Get "https://ghcr.io/v2/linixserver/bookstack/manifests/latest": denied

Steps to Reproduce

  1. I wrote a Docker Compose file.
  2. I compose the file
  3. It outputs the error

Environment

OS: OpenSUSE Leap 15
CPU architecture: x86_64
How docker service was installed: zypper install

Command used to create docker container (run/create/compose/screenshot)

Docker-Composefile:

version: "2"
services:
bookstack:
image: ghcr.io/linixserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=https://bookstack.schule6314.ch
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS="pw
- DB_DATABASE=bookstackapp
volumes:
- /srv/docker/bookstack/data_app:/config
ports:
- "3002:80"
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: ghcr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD="pw"
- TZ=Europe/Zurich
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD="pw"
volumes:
- /srv/docker/bookstack/data_db:/config
restart: unless-stopped

docker-compose -f filename.yaml up -d

Docker logs

OutPut:
WARNING: Found orphan containers (...) for this project. If you removed or renamed this service in
your compose file, you can run this command with the --remove-orphans flag to clean it up.
Pulling bookstack (ghcr.io/linixserver/bookstack:)...
ERROR: Get "https://ghcr.io/v2/linixserver/bookstack/manifests/latest": denied

Cannot create directory - Permission denied

Issue

Container fails at creating directory during initialization.
Thanks for your help.

System

$ uname -a
Linux 5.2.15-200.fc30.x86_64 #1 SMP Mon Sep 16 15:17:36 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-68.git47e2230.fc30.x86_64
 Go version:      go1.12.7
 Git commit:      47e2230/1.13.1
 Built:           Sat Aug 17 19:58:07 2019
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-68.git47e2230.fc30.x86_64
 Go version:      go1.12.7
 Git commit:      47e2230/1.13.1
 Built:           Sat Aug 17 19:58:07 2019
 OS/Arch:         linux/amd64
 Experimental:    false

Local volumes ownership

$ ls -la
total 4
drwxrwxr-x. 4 admin admin  69 Sep 21 16:26 .
drwxr-x---. 8 admin admin  86 Sep 21 16:23 ..
drwxr-xr-x. 2 admin admin   6 Sep 21 16:26 bookstack
drwxr-xr-x. 2 admin admin   6 Sep 21 16:26 bookstack_db
-rw-rw-r--. 1 admin admin 773 Sep 21 16:25 docker-compose.yml

Owner UID and GID

$ cat /etc/passwd | grep admin
admin:x:1000:1000:admin:/home/admin:/bin/bash

Docker file

$ cat docker-compose.yml 
version: "2"

services:

  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=yourdbpass
      - DB_DATABASE=bookstackapp
    volumes:
      - ./bookstack:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db

  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=yourdbpass
      - TZ=America/Chicago
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=yourdbpass
    volumes:
      - ./bookstack_db:/config
    restart: unless-stopped

Logs

$ docker-compose logs
Attaching to bookstack, bookstack_db
bookstack       | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack       | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack_db    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack_db    | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack_db    | [fix-attrs.d] applying ownership & permissions fixes...
bookstack_db    | [fix-attrs.d] done.
bookstack       | [fix-attrs.d] applying ownership & permissions fixes...
bookstack       | [fix-attrs.d] done.
bookstack       | [cont-init.d] executing container initialization scripts...
bookstack       | [cont-init.d] 10-adduser: executing... 
bookstack       | -------------------------------------
bookstack       |           _         ()
bookstack       |          | |  ___   _    __
bookstack       |          | | / __| | |  /  \ 
bookstack       |          | | \__ \ | | | () |
bookstack       |          |_| |___/ |_|  \__/
bookstack       | Brought to you by linuxserver.io
bookstack       | We gratefully accept donations at:
bookstack       | https://www.linuxserver.io/donate/
bookstack       | -------------------------------------
bookstack       | GID/UID
bookstack       | -------------------------------------
bookstack       | User uid:    1000
bookstack       | User gid:    1000
bookstack       | -------------------------------------
bookstack       | usermod: Failed to change ownership of the home directorychown: changing ownership of '/config': Permission denied
bookstack       | [cont-init.d] 10-adduser: exited 0.
bookstack       | [cont-init.d] 20-config: executing... 
bookstack       | mkdir: cannot create directory ‘/config/nginx’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/www’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/log’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/keys’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/log’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/php’: Permission denied
bookstack       | cp: cannot create regular file '/config/nginx/nginx.conf': No such file or directory
bookstack       | cp: cannot create regular file '/config/nginx/site-confs/default': No such file or directory
bookstack       | find: /config/www: No such file or directory
bookstack       | cp: cannot create regular file '/config/www/index.html': No such file or directory
bookstack       | /var/run/s6/etc/cont-init.d/20-config: line 20: /config/php/php-local.ini: No such file or directory
bookstack       | cp: cannot stat '/config/php/php-local.ini': No such file or directory
bookstack       | /var/run/s6/etc/cont-init.d/20-config: line 30: /config/php/www2.conf: No such file or directory
bookstack       | cp: cannot stat '/config/php/www2.conf': No such file or directory
bookstack       | chown: cannot read directory '/config': Permission denied
bookstack       | chmod: cannot access '/config/nginx': No such file or directory
bookstack       | chmod: cannot access '/config/www': No such file or directory
bookstack       | [cont-init.d] 20-config: exited 0.
bookstack       | [cont-init.d] 30-keygen: executing... 
bookstack       | generating self-signed keys in /config/keys, you can replace these with your own keys if required
bookstack       | Generating a RSA private key
bookstack       | ..........................+++++
bookstack       | .......................+++++
bookstack       | writing new private key to '/config/keys/cert.key'
bookstack       | req: Can't open "/config/keys/cert.key" for writing, No such file or directory
bookstack       | [cont-init.d] 30-keygen: exited 1.
bookstack       | [cont-init.d] 50-config: executing... 
bookstack       | mkdir: cannot create directory ‘/config/www’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/www’: Permission denied
bookstack       | mkdir: cannot create directory ‘/config/www’: Permission denied
bookstack       | cp: cannot create regular file '/config/www/.env': No such file or directory
bookstack       | Generating BookStack app key for first run
bookstack       | /var/run/s6/etc/cont-init.d/50-config: line 31: /config/BOOKSTACK_APP_KEY.txt: Permission denied
bookstack       | App Key set to base64:py8IlZfbiwjArUlXn/KlmXIzAkJqQgRzoReDcO8VHj8= you can modify the file to update /config/BOOKSTACK_APP_KEY.txt
bookstack       | grep: /config/www/.env: No such file or directory
bookstack       | grep: /config/www/.env: No such file or directory
bookstack       | sed: /config/www/.env: No such file or directory
bookstack       | Running config - db_user set
bookstack       | sed: /config/www/.env: No such file or directory
bookstack       | sed: /config/www/.env: No such file or directory
bookstack       | sed: /config/www/.env: No such file or directory
bookstack       | sed: /config/www/.env: No such file or directory
bookstack_db    | [cont-init.d] executing container initialization scripts...
bookstack_db    | [cont-init.d] 10-adduser: executing... 
bookstack_db    | -------------------------------------
bookstack_db    |           _         ()
bookstack_db    |          | |  ___   _    __
bookstack_db    |          | | / __| | |  /  \ 
bookstack_db    |          | | \__ \ | | | () |
bookstack_db    |          |_| |___/ |_|  \__/
bookstack_db    | Brought to you by linuxserver.io
bookstack_db    | We gratefully accept donations at:
bookstack_db    | https://www.linuxserver.io/donate/
bookstack_db    | -------------------------------------
bookstack_db    | GID/UID
bookstack_db    | -------------------------------------
bookstack_db    | User uid:    1000
bookstack_db    | User gid:    1000
bookstack_db    | -------------------------------------
bookstack_db    | usermod: Failed to change ownership of the home directorychown: changing ownership of '/config': Permission denied
bookstack_db    | [cont-init.d] 10-adduser: exited 0.
bookstack_db    | [cont-init.d] 30-config: executing... 
bookstack_db    | mkdir: cannot create directory ‘/config/databases’: Permission denied
bookstack_db    | mkdir: cannot create directory ‘/config/log’: Permission denied
bookstack_db    | cp: cannot create regular file '/config/custom.cnf': Permission denied
bookstack_db    | [cont-init.d] 30-config: exited 0.
bookstack_db    | [cont-init.d] 40-initialise-db: executing... 
bookstack_db    | Setting Up Initial Databases
bookstack_db    | chown: cannot access '/config/log/mysql': No such file or directory
bookstack_db    | chmod: cannot access '/config/log/mysql': No such file or directory
bookstack_db    | mkdir: cannot create directory ‘/config/databases’: Permission denied
bookstack_db    | Fatal error Can't create database directory '/config/databases'
bookstack_db    | The latest information about mysql_install_db is available at
bookstack_db    | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
bookstack_db    | 2019-09-22 16:36:39 0 [Note] mysqld (mysqld 10.3.18-MariaDB-1:10.3.18+maria~bionic-log) starting as process 260 ...
bookstack_db    | 2019-09-22 16:36:39 0 [Warning] Can't create test file /config/databases/e162732c4c48.lower-test
bookstack_db    | mysqld: Can't change dir to '/config/databases/' (Errcode: 2 "No such file or directory")
bookstack_db    | 2019-09-22 16:36:39 0 [ERROR] Aborting

Server refusing to connect

I've tried to install this on two separate servers via docker-compose by copy/pasting services in the README, and in both it doesn't serve.


Expected Behavior

Should serve Bookstack.

Current Behavior

Doesn't serve Bookstack.

Steps to Reproduce

  1. Copy/paste docker-compose config from README with the addition of APP_URL
  2. docker-compose up -d
  3. Access it through a browser

Environment

OS: Ubuntu 16.04
CPU architecture: x86_64
How docker service was installed: Like docker's documentation shows

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
Nothing to migrate.

Environment variables for DB username, password are not correct

linuxserver.io


Expected Behavior

The example docker-compose.yml should provide a working configuration that can successfully run BookStack.

Current Behavior

The bookstack container launches with database connection errors.

Steps to Reproduce

  1. Copy the example docker-compose.yml file to a directory of your choice.
  2. Replace the <yourdbpass> sample with some value.
  3. Run docker-compose up.
  4. Startup fails and ports aren't bound.

Environment

OS: Raspbian 10 buster
CPU architecture: arm32
How docker service was installed: curl -fsSL https://get.docker.com -o get-docker.sh

Command used to create docker container (run/create/compose/screenshot)

docker-compose up

Docker logs

bookstack       |    Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')
bookstack       | 
bookstack       |   at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
bookstack       |     665|         // If an exception occurs when attempting to run a query, we'll format the error
bookstack       |     666|         // message to include the bindings with SQL, which will make this exception a
bookstack       |     667|         // lot more helpful to the developer instead of just the database's errors.
bookstack       |     668|         catch (Exception $e) {
bookstack       |   > 669|             throw new QueryException(
bookstack       |     670|                 $query, $this->prepareBindings($bindings), $e
bookstack       |     671|             );
bookstack       |     672|         }
bookstack       |     673|
bookstack       | 
bookstack       |   Exception trace:
bookstack       | 
bookstack       |   1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")
bookstack       |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
bookstack       | 
bookstack       |   2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.bookstack_default' (using password: YES)")
bookstack       |       /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.