Admin Documentation

Other Configuration


.env Options

As part of the installation of BookStack you will have a .env file containing system options. By default this only contains a few options. Within your BookStack install directory you should also have a .env.example.complete file which contains every supported option available alongside the default value for each. You can copy options in this file to your own .env file as required. Many of the options in the .env.example.complete file are detailed in-depth in this documentation.

The .env file essentially sets environment variables for BookStack to read. Environment variables will be checked if an option is not in the .env file which can be useful in the creation and use of docker containers.


Revision Limit

Each time a page is saved a revision is stored to track history. To prevent your database becoming bloated BookStack will automatically remove revisions when the count, per page, exceeds 50. You can set the following option in your .env file to increase or remove the limit:

# Set the revision limit to 100
# Defaults to '50'
REVISION_LIMIT=100

# Alternatively, You can set to 'false' to disable the limit altogether.
REVISION_LIMIT=false

Custom User Avatar Fetching

When a user is created BookStack will, by default, fetch an avatar image from Gravatar. This functionality can be disabled or the URL can be customized which allows you to use a different avatar service altogether. Examples of this can be seen below:

# In your .env file

# Use libravatar instead of gravatar
AVATAR_URL=https://seccdn.libravatar.org/avatar/${hash}?s=${size}&d=identicon

# Disable avatar fetching altogether
AVATAR_URL=false

The following variables can be used in this setting which will be populated by BookStack when used:

  • ${email} - The user’s email address, URL encoded.
  • ${hash} - MD5 hashed copy of the user’s email address.
  • ${size} - BookStack’s ideal requested image size in pixels.

Custom diagrams.net URL

BookStack uses diagrams.net (formerly draw.io) to provide users with the ability to create & edit drawings. By default BookStack embeds the diagrams.net interface using the following URL:

https://embed.diagrams.net/?embed=1&proto=json&spin=1&configure=1

You can instead define your own URL to customise this embed or even use a self-hosted instance of diagrams.net. This can be done by defining an option in your .env file like so:

DRAWIO=https://drawing.example.com/?embed=1&proto=json&spin=1&configure=1

The embed=1&proto=json&spin=1 query string parameters are required for the integration with BookStack to function. Remember to include these when defining a custom URL.

Refer to this diagrams.net guide to see what options are supported: diagrams.net embed URL parameters. In particular, the stealth=1 option might be of interest if you don’t want other external services to be used.