[Support] Linuxserver.io - Bookstack


94 posts in this topic Last Reply

Recommended Posts

linuxserver_medium.png?v=4&s=4000

 

Application Name: Bookstack
Application Site: https://www.bookstackapp.com/
Docker Hub: https://hub.docker.com/r/linuxserver/bookstack/
Github: https://github.com/linuxserver/docker-bookstack

 

Please post any questions/issues relating to this docker you have in this thread.

If you are not using Unraid (and you should be!) then please do not post here, rather use the linuxserver.io forum for support.

Link to post
  • Replies 93
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

You have specified the port in the host variable. Remove the port and it should work.

This was it. Thanks a lot for the info. The update is great.

EDIT: I got it working - thank you @j0nnymoe! Here are the steps in case anyone else needs to get this setup:   1. Click on the bookstack docker icon and select console. 2. Type in nano

Posted Images

5 minutes ago, kroovy said:

I'm not seeing this on CA...anyone else?

Update CA.

 

Your (obviously old) version of CA is still utilizing lsio's appfeed which is (and has been) broken for a number of months now.  CA now utilizes a different appfeed which isn't broken, and offers CA far more features than before.

Edited by Squid
Link to post
1 hour ago, Squid said:

Update CA.

 

Your (obviously old) version of CA is still utilizing lsio's appfeed which is (and has been) broken for a number of months now.  CA now utilizes a different appfeed which isn't broken, and offers CA far more features than before.

This was it. Thanks a lot for the info. The update is great.

Link to post

Hi,

 

I'm trying to set up this docker with a subdomain is it possible? I looked in the docs for BookStack and they only described it with subfolder using apache

 

I copied the conf files in Letsencrypt I pasted the code below. if it's possible could you please let me know what I'm doing wrong?

 

in the docker config i used the correct reverseproxy address.

 

# make sure that your dns has a cname set for radarr and that your radarr container is not using a base url

server {
    listen 443 ssl;

    server_name bookstack.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_bookstack bookstack;
        proxy_pass http://$upstream_bookstack:6875;
    }

    location ~ (/radarr)?/api {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_bookstack bookstack;
        proxy_pass http://$upstream_bookstack:6875;
    }
}

 

Regards,

Bilal Yassine

Link to post
  • 1 month later...

Does anyone have a mail server configured with bookstack (for users to create their own accounts and receive an email confirmation)? The documentation on the bookstack website doesn't cover it. I'm sure there's a config file somewhere I have to setup but I can't find it.

 

BookStack settings page to allow user registration via email

image.png.13c9646d206dffe264971fe43e3d747e.png

 

Error message when trying to register new user w/email confirmation

image.png.f7a8112f250a11f51d8e0f0ac1f749bb.png

Edited by secondsunrise
Added in screen shots for clarification
Link to post
6 hours ago, secondsunrise said:

Does anyone have a mail server configured with bookstack (for users to create their own accounts and receive an email confirmation)? The documentation on the bookstack website doesn't cover it. I'm sure there's a config file somewhere I have to setup but I can't find it.

 

BookStack settings page to allow user registration via email

image.png.13c9646d206dffe264971fe43e3d747e.png

 

Error message when trying to register new user w/email confirmation

image.png.f7a8112f250a11f51d8e0f0ac1f749bb.png

Add your mail settings to the .env file in `/config`

Link to post

EDIT: I got it working - thank you @j0nnymoe! Here are the steps in case anyone else needs to get this setup:

 

1. Click on the bookstack docker icon and select console.

2. Type in nano /config/www/.env to edit your .env file

3. Arrow down to the bottom until you get to #Mail settings and configure it according to your mail server (I use Zoho mail). If you have 2FA setup on your mail server account, you'll probably need to request an application specific password to use in your bookstack .env file

# Mail settings
MAIL_DRIVER=smtp
MAIL_HOST=smtp.zoho.com
MAIL_PORT=465
MAIL_USERNAME=support@yourdomain.com
MAIL_PASSWORD=xxxxxxxxx
MAIL_ENCRYPTION=ssl
MAIL_FROM=support@yourdomain.com
MAIL_FROM_NAME=BookStack

 

On 1/5/2019 at 4:21 PM, j0nnymoe said:

Add your mail settings to the .env file in `/config`

I've never configured a .env file before. From the unRAID GUI I clicked on my BookStack docker and opened the console and did a

cd /config

but I'm not seeing the .env file anywhere. Just the output below

root@e123b7bc558e:/config$ ls
BOOKSTACK_APP_KEY.txt  keys  log  nginx  php  www

 

Edited by secondsunrise
Link to post
On 11/27/2018 at 9:43 PM, Bilal Yassine said:

Hi,

 

I'm trying to set up this docker with a subdomain is it possible? I looked in the docs for BookStack and they only described it with subfolder using apache

I copied the conf files in Letsencrypt I pasted the code below. if it's possible could you please let me know what I'm doing wrong?

in the docker config i used the correct reverseproxy address.

I just got bookstack up and running behind my Letsencrypt reverse proxy using sub domains, had to tweak a few things to get it working though. Here's my Letsencrypt file:

# redirect all traffic to https
server {
	listen 80;
	server_name _;
	return 301 https://$host$request_uri;
}

# main server block
server {
	listen 443 ssl default_server;

	root /config/www;
	index index.html index.htm index.php;

	server_name _;

	# all ssl related config moved to ssl.conf
	include /config/nginx/ssl.conf;

	client_max_body_size 0;
}

## BookStack
server {
 	listen 443 ssl;
	root /config/www;
	index index.html index.htm index.php;
	server_name bookstack.*;
	include /config/nginx/ssl.conf;
	client_max_body_size 0;	
	location / {
		include /config/nginx/proxy.conf;
		proxy_pass http://10.0.0.3:6875;	
	}
}

I also had to change the .env file in the bookstack container by following these steps:

  1. Click on the bookstack docker icon and select console
  2. Type in nano /config/www/.env to edit your .env file
  3. Arrow down until you see APPURL or APP_URL (make sure it's set to APP_URL with the underscore)
# The below url has to be set if using social auth options
# or if you are not using BookStack at the root path of your domain.
APP_URL=https://bookstack.yourdomain.com

 

Link to post
  • 1 month later...

After I installed the docker, I created a book, chapter, and page to ensure the docker was working. 

 

I found that the books table was missing the image_id, I manually added this and set it to int and allow null. Finally I tried to delete the page, chapter, and book and was met another error. The database was missing the comments table. I was able to manually add this using the debugger. 

 

I have resolved my issues but this may be something to look into.

Link to post
  • 2 weeks later...

I am unable to access the web UI.  I can install, configure, and have the container start.  However, when I go to the web UI I get a "unable to connect" error.  I am unsure how to test to see if it is a connection to the MySQL db that is causing issues or an improper configuration of the container.  I am able to successfully connect to the MySQL db using MySQL Workbench using the same credentials that I am using in the bookstack container.

 

Sorry for the vague issue, I'm at a loss as to where to start troubleshooting. Thanks

 

 

EDIT:

Ive got it running now.  After filling out an ID10T form I noticed the small log button on the for right of the docker page.  I noticed the container was throwing up errors relating to not being able to connect to the database server.  I was originally trying to use the MySQL database container on CA Apps.  I switched over to MariaDB and tried to administer the database using MySQL workbench.  I still could not get the bookstack container running so I followed the instructions here (which is what I should have done from the beginning) and set up the MariaDB container accordingly.  So long story short, I learned to actually read the docs and to not use MySQL Workbench for editing a Maria database.

Edited by PuffinDoctor
see edit
Link to post
  • 2 weeks later...

I am having problems getting bookstack to work behind my nginx reverse proxy. Following are my config files:

 

letsencrypt configuration: /config/nginx/site-confs/default

# On letsencrypt proxy
server {
        listen 443 ssl;
        server_name bookstack.mydomain.com;

        root /config/www;
        index index.html index.htm index.php;

        ###SSL Certificates
        ssl_certificate /config/keys/letsencrypt/fullchain.pem;
        ssl_certificate_key /config/keys/letsencrypt/privkey.pem;

        ###Diffie-Hellman key exchange ###
        ssl_dhparam /config/nginx/dhparams.pem;

        ###SSL Ciphers
        ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES1';  #this line is much longer and copied from other configs, so it should not be the problem

        ###Extra Settings###
        ssl_prefer_server_ciphers on;
        #ssl_session_cache shared:SSL:1m;

        ### Add HTTP Strict Transport Security ###
        add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
        add_header Front-End-Https on;

        client_max_body_size 0;

        location / {
                proxy_pass http://192.168.0.15:6875/;
                #proxy_redirect http://192.168.0.15:6875/ https://bookstack.mydomain.com/login;
                proxy_max_temp_file_size 2048m;
                include /config/nginx/proxy.conf;
        }
}

Bookstack Configuration: /config/www/.env

# Application key
# Used for encryption where needed.
# Run `php artisan key:generate` to generate a valid key.
APP_KEY=base64:Z0Rsbv/9gHq8Nezl7gT1jtYClYmTyNRPUILFRt6+Sw8=

# Application URL
# Remove the hash below and set a URL if using BookStack behind
# a proxy, if using a third-party authentication option.
# This must be the root URL that you want to host BookStack on.
# All URL's in BookStack will be generated using this value.
APP_URL=http://bookstack.mydomain.com

# Database details
DB_HOST=172.17.0.5:3306
DB_DATABASE=bookstack
DB_USERNAME=dbuser
DB_PASSWORD=my.secret.password.for.dbuser

# Mail system to use
# Can be 'smtp', 'mail' or 'sendmail'
MAIL_DRIVER=smtp

# SMTP mail options
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

 

Error Log on letsencrypt proxy: /config/log/nginx/error.log

2019/03/24 13:07:55 [error] 353#353: *521 SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) while SSL handshaking to upstream, client: 25.25.25.25, server: bookstack.mydomain.com, request: "GET / HTTP/1.1", upstream: "https://192.168.0.15:6875/", host: "bookstack.mydomain.com"2019/03/24 13:07:55 [error] 353#353: *521 SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) while SSL handshaking to upstream, client: 25.25.25.25, server: bookstack.mydomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "https://192.168.0.15:6875/favicon.ico", host: "bookstack.mydomain.com", referrer: "https://bookstack.mydomain.com/"

 

I followed the instructions here, as suggested, and I know it's connecting to the database. When I set the APP_URL variable in the .env file inside of bookstack, I can access bookstack locally from 192.168.0.15:6875. I can login and make stuff. When I navigate to https://bookstack.mydomain.com, I get a 502 Bad Gateway error. My first inclination was to read the logs. I researched the aforementioned error, and tried some things. At this point I am flailing. Any help would be greatly appreciated. I feel like I have spent days reading documentation, and I have learned a lot, but none of the things I have implemented work. I know this is an easy solution that I am just not seeing, because I use the letsencrypt proxy for many other things. Again, any help would be greatly appreciated. 

 

Ok. I filled out an ID10T form, as well. I was had a port mapping from the Bookstack's docker IP from 172.17.0.7:80 to 192.168.0.15:6875. I referenced that same IP:PORT in my proxy_pass line. I was getting the SSL error, because I was trying to negotiate SSL to Bookstack's HTTP service, not it's HTTPS service. My setup is working perfectly, now. 

Edited by benkoloff
Fixed Issue
Link to post
  • 1 month later...

Long story short I need to manually reset my password. Used a BCrypt hash generator with "password" replaced the hash in my database when I try and log in with password I'm getting These credentials do not match our records error. I am I missing a step?

Link to post
6 hours ago, swingline said:

Long story short I need to manually reset my password. Used a BCrypt hash generator with "password" replaced the hash in my database when I try and log in with password I'm getting These credentials do not match our records error. I am I missing a step?

Why would you change the password for bookstack in the database manually?

I guess you didn't backup anything before you did the change?

Link to post
1 hour ago, saarg said:

Why would you change the password for bookstack in the database manually?

I guess you didn't backup anything before you did the change?

I was transitioning to Bitwarden password manager and seems that I overlooked 4 passwords. Which were randomly generated and managed with LastPass which I had already deleted.  No big deal I just manually reset them, that is until bookstack. The container is really new and I haven't added much content yet so it's not all that critical.

Link to post

Well, I wasn't able to manually reset the password but I was able to solve this.

 

  1. Open console for bookstack container
  2. Enter
    cd /var/www/html

     

  3. Then enter and follow the prompts to create a new admin account.
    php artisan bookstack:create-admin

     

Link to post
  • 3 months later...

So, how on earth do you get bookstack to work ? 

Tried MariaDB docker, default settings, specified root password, specified user via mysql workbench, "bookstack" with password and grant all - Access Denied

Created database manually, adding grants and flushed privileges - access denied

 

Tried Mysql standard docker, specified root user just to test, access denied because unsupported authentication (cached sha2), created user with standard authentication - access denied. 

Created database manually, adding grants and flushed privileges - access denied. 

 

In both instances i can logon to both mariadb and mysql standard docker with no issues and all rights/grants. 

 

Thought it might be some wierd network issue.

I therefore set both the mariadb docker and bookstack to custom;br0 with their own specified iPs (192.168.0.5 and .6) - access denied

br0 is defined as a 192.168.0.1/24 in docker settings so it should be fine. 

 

log output 

 

[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
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve


[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.br0' (
using password: YES) (SQL: select * from information_schema.tables where ta
ble_schema = bookstack and table_name = migrations)

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

 

So yeah, added this bookstack.br0 host to the from host privileges in mysql - access still denied. 

Mind you the host privileges is pr default set by me to % = wiildcard 

 

yes you should secure stuff etc, i will do that when stuff is working, right now i give up :)

 

Link to post
8 hours ago, Abnorm said:

So, how on earth do you get bookstack to work ? 

Tried MariaDB docker, default settings, specified root password, specified user via mysql workbench, "bookstack" with password and grant all - Access Denied

Created database manually, adding grants and flushed privileges - access denied

 

Tried Mysql standard docker, specified root user just to test, access denied because unsupported authentication (cached sha2), created user with standard authentication - access denied. 

Created database manually, adding grants and flushed privileges - access denied. 

 

In both instances i can logon to both mariadb and mysql standard docker with no issues and all rights/grants. 

 

Thought it might be some wierd network issue.

I therefore set both the mariadb docker and bookstack to custom;br0 with their own specified iPs (192.168.0.5 and .6) - access denied

br0 is defined as a 192.168.0.1/24 in docker settings so it should be fine. 

 

log output 

 

[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
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve


[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'bookstack.br0' (
using password: YES) (SQL: select * from information_schema.tables where ta
ble_schema = bookstack and table_name = migrations)

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

 

So yeah, added this bookstack.br0 host to the from host privileges in mysql - access still denied. 

Mind you the host privileges is pr default set by me to % = wiildcard 

 

yes you should secure stuff etc, i will do that when stuff is working, right now i give up :)

 

Post you docker run command. At this point it's just guessing.

Link to post
21 minutes ago, saarg said:

Post you docker run command. At this point it's just guessing.

Sorry about that! 

 

docker run -d --name='bookstack' --net='br0' --ip='192.168.0.5' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'DB_HOST'='192.168.0.6:3306' -e 'DB_USER'='bookstack' -e 'DB_PASS'='bookstack' -e 'DB_DATABASE'='bookstack' -e 'TCP_PORT_80'='6875' -e 'APP_URL'='' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack' 

5f2f592ab53d59b44c1a0425323e26d9ec71c52c0b844850b4d4ff2380608451

Link to post
1 hour ago, Abnorm said:

Sorry about that! 

 

docker run -d --name='bookstack' --net='br0' --ip='192.168.0.5' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'DB_HOST'='192.168.0.6:3306' -e 'DB_USER'='bookstack' -e 'DB_PASS'='bookstack' -e 'DB_DATABASE'='bookstack' -e 'TCP_PORT_80'='6875' -e 'APP_URL'='' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack' 

5f2f592ab53d59b44c1a0425323e26d9ec71c52c0b844850b4d4ff2380608451

I might be wrong but if you have both bookstack and mariadb on their on dedicated ip's, there is a docker "security" feature that blocks them talking to each other.

Link to post
2 hours ago, Abnorm said:

Sorry about that! 

 

docker run -d --name='bookstack' --net='br0' --ip='192.168.0.5' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'DB_HOST'='192.168.0.6:3306' -e 'DB_USER'='bookstack' -e 'DB_PASS'='bookstack' -e 'DB_DATABASE'='bookstack' -e 'TCP_PORT_80'='6875' -e 'APP_URL'='' -e 'PUID'='99' -e 'PGID'='100' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack' 

5f2f592ab53d59b44c1a0425323e26d9ec71c52c0b844850b4d4ff2380608451

You have specified the port in the host variable. Remove the port and it should work.

Link to post
27 minutes ago, j0nnymoe said:

I might be wrong but if you have both bookstack and mariadb on their on dedicated ip's, there is a docker "security" feature that blocks them talking to each other.

Dedicated IPs can talk to each other. It's the custom bridge and host that can't talk to each other.

Link to post
2 hours ago, saarg said:

You have specified the port in the host variable. Remove the port and it should work.

Well, there you have it. It works ! 

Thanks a lot for the help, i was pulling my hair out, had to be something super trivial I had missed :)

Link to post
  • 1 month later...

Well after way too much time I realized I'm an idiot and this setup is pretty easy for the letsencrypt container.

 

Here's your conf file:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name bookstack.*;

    include /config/nginx/ssl.conf;
	
    client_max_body_size 128M;
	
    location / {
		include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_bookstack bookstack;
        proxy_pass http://$upstream_bookstack:80;
		proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }
}

 

Do NOT enter anything in the docker for "Reverse proxy URL".

 

DO edit the .env file in /appdata/bookstack/www/.env and UNCOMMENT the "#APP_URL=" as well as put in your domain name including your subdomain prefix.

 

That's it. However if you're an idiot like me and don't do one of those things it can send you on a long trail of trying to fix something that isn't broken.

Link to post
On 8/17/2019 at 9:37 AM, Abnorm said:

Well, there you have it. It works ! 

Thanks a lot for the help, i was pulling my hair out, had to be something super trivial I had missed :)

I'm having basically exactly this same problem, except I'm using bridge not br0... I can't get Bookstack to connect to mariaDB i just keep getting this same error:

Quote

SQLSTATE[HY000] [1045] Access denied for user 'bookstack'@'172.17.0.1' (usi
ng password: YES)

My run command:

Quote

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='bookstack' --net='bridge' -e TZ="America/Chicago" -e HOST_OS="Unraid" -e 'DB_HOST'='10.20.0.10:3306' -e 'DB_USER'='bookstack' -e 'DB_PASS'='test' -e 'DB_DATABASE'='bookstack' -e 'APP_URL'='https://wiki.mydomain.xyz' -e 'PUID'='99' -e 'PGID'='100' -p '6875:80/tcp' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack'

I know this has the port in the DB_HOST field but I've also tried it without the port there and that doesn't work either... I'm able to log into the user cli and the user has % in the host permissions table. Haven't had much luck getting help on the linuxserver  #docker-support discord channel as of yet

Edited by cback
removed my domain
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.