[Support] Linuxserver.io - Bookstack


Recommended Posts

20 hours ago, bucky2076 said:

saarg,

the basic unraid template did not work for me, and I had to tear my hair out.

  • DB_USER variable was incorrect. Needed to be DB_USERNAME
  • Same issue for DB_PASS
  • Passing IP/Port did not work for me on the DB_HOST

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='bookstack' --net='bridge' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e 'DB_HOST'='192.168.92.254' -e 'DB_USERNAME'='ben' -e 'DB_PASSWORD'='xyz' -e 'DB_DATABASE'='bookstack' -e 'APP_URL'='' -e 'PUID'='99' -e 'PGID'='100' -e 'DB_PORT'='3306' -p '8083:80/tcp' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack'

 

I've moved on now, experimenting with Traefik for reverse proxy.

 

The template is correct. You are supposed to use the variables in the template and there is nothing in the template that suggest adding the port in the db host variable.

Not sure why it didn't work for you, but I think you might have had multiple errors in your template that led to this.

Link to comment
On 4/24/2020 at 4:42 PM, xhaloz said:

Jesus christ, thank you so much.  I was going nuts.  I used a password manager to generate the DB password and it had some symbols in it to include a '#'.  I appreciate you!!

Ha! I didn't expect such a fast pay-off on that. The password manager is exactly how I got into that place too. Glad it helped!

Link to comment
  • 2 weeks later...

Anyone know how to insert a link and get it to take you to that location?  I click on the insert link option on the page and put www.google.com for the url.  When I click on the link it doesn't do anything.  I have to select to open in a new tab and then it appends the unraid address in front.  It looks something like this (10.10.23.20:21312/www.google.com).  Obviously the page won't open.  Any ideas on how to fix this?

 

Also how do I reorder pages in a chapter?  I can click on move and reorder books and chapters, however, pages doesn't seem movable.  Trying to have the pages sorted alphabetically.

 

Thanks.

Link to comment
  • 3 weeks later...

I have another pro-tip for the masses. A little while ago it went from working perfectly to real website rendering issues, none of the assets loading correctly and unable to log in. I suspect this coincided with the arrival of the "reverse proxy URL" field in the container template, but that is pure speculation.

 

To date I had the APP_URL defined in the .env file

# /config/www/.env

# 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=https://wiki.exampleTLD.com

Now I see it is a variable that can be passed but it was blank. Cool, I fired in wiki.exampleTLD.com and moved on. Same problem. Mixed and matched, screwed around, I could see the Chrome console that it was nesting urls, e.g. wiki.exampleTLD.com/wiki.exampleTLD.com/page. Just not working.

 

The answer is that you need the protocol in the variable, and remove it from the .env file.

https://wiki.exampleTLD.com

image.thumb.png.50388e779c39550dedda82bf477fb9dc.png

 

Back in action. Stay safe out there.

  • Thanks 1
Link to comment

Not sure if the issue I'm experiencing is with the container or Bookstack itself. I'm using the CA template and following the mariadb instructions from Gilbn's technicalramblings blog. It seems that the process chokes on an SQL command. Even after starting from a clean slate (i.e. delete and re-create the appdata/bookstack folder and bookstack database in mariadb) I get the same result.

 

And the logs

 

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


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

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

User uid: 99
User gid: 100
-------------------------------------

[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 67: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 67: warning: command substitution: ignored null byte in input
Migrating: 2015_08_29_105422_add_roles_and_permissions

Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`bookstack`.`roles`' already exists (SQL: create table `roles` (`id` int unsigned not null auto_increment primary key, `name` varchar(191) not null, `display_name` varchar(191) null, `description` varchar(191) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

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[42S01]: Base table or view already exists: 1050 Table '`bookstack`.`roles`' already exists")
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123

2 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`bookstack`.`roles`' already exists")
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121

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.

 

Bookstack.png

Edited by WuZiMu
Adding additional information
Link to comment
  • 2 weeks later...

I can confirm that this container is of a much lower quality/attention to detail from linuxserver.io than they usually provide.

After much faffing around and seeing DB auth errors in the log, what fixed it for me was:

1. Setting the IP to be the host (standard) and specifying the port for the Db in the same variable

Example: Database host (DB_HOST) = UNRAID_IP:PORT

2. Making sure that the DB password had no special characters whatsoever.

Mine seemed to error with ANY i picked.

 

What a faff!

Link to comment
  • 1 month later...
  • 4 weeks later...

Something is wrong with this template I have configured it several times and it refuses to connect to the database.

My config is

Host: unraid.home.my.domain

User: bookstack

Pass: (set correctly can login remotely and locally)

Database Name: (bookstack and created new database bookstack2)

 

Why is it launching with lowercase bookstack but authing with uppercase Bookstack?


Launch Command

 

Quote

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='bookstack' --net='bridge' -e TZ="America/New_York" -e HOST_OS="Unraid" -e 'DB_HOST'='unraid.home.ajmcateer.us' -e 'DB_USER'='bookstack' -e 'DB_PASS'='*******' -e 'DB_DATABASE'='bookstack2' -e 'APP_URL'='' -e 'PUID'='99' -e 'PGID'='100' -p '8082:80/tcp' -v '/mnt/user/appdata/bookstack':'/config':'rw' 'linuxserver/bookstack'

 

Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'Bookstack'@'172.17.0.1' (using password: YES) (SQL: select * from information_schema.tables where table_schema = bookstack2 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'@'172.17.0.1' (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'@'172.17.0.1' (using password: YES)")
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27 

EDIT: Changing DB_USER and DB PASS to DB_USERNAME and DB_PASSWORD fixed it something is wrong with the template.

 
Edited by macattack
Link to comment
  • 3 weeks later...

I had the same issue of connection refused from the mariadb docker. for me, the error was the account I created only had permissions to connect locally, not from another docker. what worked for me was:

 

set the DB_HOST value to the IP address of the Unraid server and the nonstandard port that I had set up for the mariadb docker like this: 192.168.10.10:33069 and granting the privileges for the [email protected] (the network segment I run the mariadb and bookstack on, since the request via the unraid IP will be routed through there). technicalramblings has a great article on this.

 

adding this as it might help someone down the line.

Link to comment

Something I noticed this morning. Every time this container is restarted, the lines

upload_max_filesize = 100MB
post_max_size = 100MB

is added to the file php-local.ini

 

Which then causes an error and I am unable to login. Once I remove the extra lines I can login. Any ideas?

 

Here is a screenshot of the bookstack error. TIA

 

7DMuiTr.png

Edited by dartworth
Link to comment

When using Docker and Traefik, I was unable to connect ("Bad Gateway") and getting the error:

nc: getaddrinfo: Name does not resolve

 This may be obvious to most, but I wanted to post my solution in case it is helpful to someone else.

If you are bind mounting a Docker volume to /config on the containers, it is necessary to chown the volume before running docker-compose up:

docker create volume bookstack
chown -R 1000:1000 /var/lib/docker/volumes/bookstack
docker-compose up -d


Thank you, Linuxserver.io, for the awesome service you have provided.

Link to comment
12 hours ago, yarrow said:

When using Docker and Traefik, I was unable to connect ("Bad Gateway") and getting the error:


nc: getaddrinfo: Name does not resolve

 This may be obvious to most, but I wanted to post my solution in case it is helpful to someone else.

If you are bind mounting a Docker volume to /config on the containers, it is necessary to chown the volume before running docker-compose up:


docker create volume bookstack
chown -R 1000:1000 /var/lib/docker/volumes/bookstack
docker-compose up -d


Thank you, Linuxserver.io, for the awesome service you have provided.

You are not using unraid, so this is not the correct place to post this.

 

There should not be any need to chown the volume. Then you have something wrong in your setup. Join our discord  if you want to figure it out.

Link to comment

Well after countless hours of trying to get this docker started I finally managed to reach the login screen. Thanks to the pointers about the issue with special characters in the password. Mine did not have a # but had a few other special characters: }[24+KsM;7=)AVe24zHR64U2NtLG/RH

It would not generate any error and I would just get a blank screen after launching the docker. The database would stay empty too.

Changing my password from the above to one without special characters did the trick!

Just in case this helps anyone else

Link to comment
  • 1 month later...

Is it possible to use duckdns for reverse proxy with bookstack?

 

I followed gilbn's guide but when I got up to the Nginx section it didn't seem to work. I noticed in the comments of the code that I had to copy into the 'default' file in the swag appdata that it said

Quote

## NOTE: The add_header Content-Security-Policy won't work with duckdns since you don't own the root domain. Just buy a domain. It's cheap

Does that mean the entire reverse proxy won't work, or just that specific feature won't work? Sorry I'm not very familiar with web stuff like Content-Security-Policy.

 

I have swag reverse proxy set up for multiple other containers using duckdns and I have also have bookstack running fine locally. I understand if the solution is to just buy a domain but I wanted to see if it was possible to do it the way I have everything else set up first.

Link to comment
Is it possible to use duckdns for reverse proxy with bookstack?   I followed gilbn's guide but when I got up to the Nginx section it didn't seem to work. I noticed in the comments of the code that I had to copy into the 'default' file in the swag appdata that it said   

 

 

Does that mean the entire reverse proxy won't work, or just that specific feature won't work? Sorry I'm not very familiar with web stuff like Content-Security-Policy.   I have swag reverse proxy set up for multiple other containers using duckdns and I have also have bookstack running fine locally. I understand if the solution is to just buy a domain but I wanted to see if it was possible to do it the way I have everything else set up first.

 

    

 

I have mine working with swag and duck dns. Do you have your own domain? I can send you my working config file.

 

Edit: I'm on mobile and Tapatalk was giving me issues with the quote inside of the quote. Gave up and deleted it.

 

 

Sent from my iPhone using Tapatalk

Link to comment
10 hours ago, Janddy said:

That's good to hear. I think I only have my own subdomain - something similar to janddybookstack.duckdns.org.

 

Your config file would be great if you don't mind.

Here you go, @Janddy. This is my config file for subdomain. Just make sure that you add  the CNAME in the DNS settings of your domain provider. I followed one of SpaceInvader's videos to set up a different docker behind the reverse proxy and then just kind of fumbled my way through other ones. 

 

# make sure that your dns has a cname set for bookstack and that your bookstack container is named bookstack
# Ensure you have the APP_URL Environment Variable set correctly in your Docker Run/Compose or in BookStack Env File (/www/.env)
# https://github.com/linuxserver/docker-bookstack#docker

server {
    listen 443 ssl;
    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;

    # enable for Authelia
    #include /config/nginx/authelia-server.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 /ldaplogin;

        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app bookstack;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }   
}

 

  • Thanks 1
Link to comment

Thanks for that @Richamc01, I've managed to get it working after a bit of messing around. Looking at your config made me realize I forgot to change the server_name from bookstack.* to janddybookstack.* to match my duckdns subdomain (it's not janddybookstack, but you get the idea). Once I made that change the reverse proxy was working, but the page wasn't loading correctly. I remembered reading something about that before and sure enough, I scrolled up and @klogg had the answer:

On 6/16/2020 at 10:59 AM, klogg said:

Now I see it is a variable that can be passed but it was blank. Cool, I fired in wiki.exampleTLD.com and moved on. Same problem. Mixed and matched, screwed around, I could see the Chrome console that it was nesting urls, e.g. wiki.exampleTLD.com/wiki.exampleTLD.com/page. Just not working.

 

The answer is that you need the protocol in the variable, and remove it from the .env file.


https://wiki.exampleTLD.com

image.thumb.png.50388e779c39550dedda82bf477fb9dc.png

 

 

Removing https:// from the APP_URL in the .env file fixes the problem, but restarting the container seems to overwrite the manual change and puts the https:// back in. Weirdly, even after the https:// is back in the file, loading the page still works. However It didn't work when I tried it on my phone at first, but then I removed the https:// again and it worked on my phone from then on. Maybe it's cached in each device's browser or something? Not a huge deal, but if anyone knows how to stop the .env file from being overwritten on restart that would be cool.

 

Anyway everything is 99% functioning now so thanks @Richamc01 and @klogg for the assist and thanks to the linuxserver team for the docker :)

  • Thanks 1
Link to comment
  • 3 weeks later...

Is the key in the CA template correct for the username and pass? On a fresh pull, the keys DB_USER and DB_PASS don't seem to flow over to www/.env. Took me a couple hours of fidgeting to check .env and see the values weren't matching what I was passing through. 

 

I edited the keys on the template to DB_USERNAME and DB_PASSWORD and was able to hit the login page. 

Link to comment
4 hours ago, crazykidguy said:

Is the key in the CA template correct for the username and pass? On a fresh pull, the keys DB_USER and DB_PASS don't seem to flow over to www/.env. Took me a couple hours of fidgeting to check .env and see the values weren't matching what I was passing through. 

 

I edited the keys on the template to DB_USERNAME and DB_PASSWORD and was able to hit the login page. 

Yes they are correct. I thought no this happens if you are using existing appdata to set up the container again.

From my testing it worked with the env variables in the template.

Link to comment
  • 1 month later...

I’m new to Unraid, docker and many things here. I need some education or a pointer to some education. I’m going to use my desire to run BookStack as an example.

 

Easy enough to find BookStack via Community Applications. When I click to install I’m faced with having to provide some information. Since I don’t have much experience I’m looking for some pointers on where to go to figure out what all those container settings should be?

 

I watched a youtube video on someone installing BookStack via Portainer. In that video it appears the installation creates the BookStack app and the database to support it. However when I click to install on my Unraid server there’s a very clear “A database server is needed.” This leads to a series of rookie questions:

 

1.    What database should I install? (I assume I need to install it first.)

2.    Does the BookStack app take care of doing all the database work or is there some database configuration that’s required before BookStack is installed?

 

I run into this information void with every docker I install. Sometimes I can find a good walk-thru document or video that helps, but so far I haven’t run into anything too helpful for BookStack on Unraid. Just looking for some pointers to how people track these answers down?

Edited by Abe677
Link to comment

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.