1 # Full list of environment variables that can be used with BookStack.
2 # Selectively copy these to your '.env' file as required.
3 # Each option is shown with it's default value.
4 # Do not copy this whole file to use as your '.env' file.
6 # Application environment
7 # Can be 'production', 'development', 'testing' or 'demo'
11 # Shows advanced debug information and errors.
12 # CAN EXPOSE OTHER VARIABLES, LEAVE DISABLED
16 # Used for encryption where needed.
17 # Run `php artisan key:generate` to generate a valid key.
18 APP_KEY=SomeRandomString
21 # This must be the root URL that you want to host BookStack on.
22 # All URL's in BookStack will be generated using this value.
23 APP_URL=https://example.com
25 # Application default language
26 # The default language choice to show.
27 # May be overridden by user-preference or visitor browser settings.
30 # Auto-detect language for public visitors.
31 # Uses browser-sent headers to infer a language.
32 # APP_LANG will be used if such a header is not provided.
33 APP_AUTO_LANG_PUBLIC=true
35 # Application timezone
36 # Used where dates are displayed such as on exported content.
37 # Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
41 # Used to specific a themes/<APP_THEME> folder where BookStack UI
42 # overrides can be made. Defaults to disabled.
46 # Used to indicate trust of systems that proxy to the application so
47 # certain header values (Such as "X-Forwarded-For") can be used from the
48 # incoming proxy request to provide origin detail.
49 # Set to an IP address, or multiple comma seperated IP addresses.
50 # Can alternatively be set to "*" to trust all proxy addresses.
54 # Host can contain a port (localhost:3306) or a separate DB_PORT option can be used.
57 DB_DATABASE=database_database
58 DB_USERNAME=database_username
59 DB_PASSWORD=database_user_password
61 # MySQL specific connection options
62 # Path to Certificate Authority (CA) certificate file for your MySQL instance.
63 # When this option is used host name identity verification will be performed
64 # which checks the hostname, used by the client, against names within the
65 # certificate itself (Common Name or Subject Alternative Name).
66 MYSQL_ATTR_SSL_CA="/path/to/ca.pem"
69 # Can be 'smtp' or 'sendmail'
72 # Mail sending options
74 MAIL_FROM_NAME=BookStack
83 # Cache & Session driver to use
84 # Can be 'file', 'database', 'memcached' or 'redis'
88 # Session configuration
90 SESSION_COOKIE_NAME=bookstack_session
91 SESSION_SECURE_COOKIE=false
94 # Can be used to prevent conflicts multiple BookStack instances use the same store.
95 CACHE_PREFIX=bookstack
97 # Memcached server configuration
98 # If using a UNIX socket path for the host, set the port to 0
99 # This follows the following format: HOST:PORT:WEIGHT
100 # For multiple servers separate with a comma
101 MEMCACHED_SERVERS=127.0.0.1:11211:100
103 # Redis server configuration
104 # This follows the following format: HOST:PORT:DATABASE
105 # or, if using a password: HOST:PORT:DATABASE:PASSWORD
106 # For multiple servers separate with a comma. These will be clustered.
107 REDIS_SERVERS=127.0.0.1:6379:0
109 # Queue driver to use
110 # Can be 'sync', 'database' or 'redis'
111 QUEUE_CONNECTION=sync
113 # Storage system to use
114 # Can be 'local', 'local_secure' or 's3'
117 # Image storage system to use
118 # Defaults to the value of STORAGE_TYPE if unset.
119 # Accepts the same values as STORAGE_TYPE.
120 STORAGE_IMAGE_TYPE=local
122 # Attachment storage system to use
123 # Defaults to the value of STORAGE_TYPE if unset.
124 # Accepts the same values as STORAGE_TYPE although 'local' will be forced to 'local_secure'.
125 STORAGE_ATTACHMENT_TYPE=local_secure
127 # Amazon S3 storage configuration
128 STORAGE_S3_KEY=your-s3-key
129 STORAGE_S3_SECRET=your-s3-secret
130 STORAGE_S3_BUCKET=s3-bucket-name
131 STORAGE_S3_REGION=s3-bucket-region
133 # S3 endpoint to use for storage calls
134 # Only set this if using a non-Amazon s3-compatible service such as Minio
135 STORAGE_S3_ENDPOINT=https://my-custom-s3-compatible.service.com:8001
138 # Used as a base for any generated image urls.
139 # An s3-format URL will be generated if not set.
142 # Authentication method to use
143 # Can be 'standard', 'ldap', 'saml2' or 'oidc'
146 # Automatically initiate login via external auth system if it's the only auth method.
147 # Works with saml2 or oidc auth methods.
148 AUTH_AUTO_INITIATE=false
150 # Social authentication configuration
151 # All disabled by default.
152 # Refer to https://www.bookstackapp.com/docs/admin/third-party-auth/
155 AZURE_APP_SECRET=false
157 AZURE_AUTO_REGISTER=false
158 AZURE_AUTO_CONFIRM_EMAIL=false
161 DISCORD_APP_SECRET=false
162 DISCORD_AUTO_REGISTER=false
163 DISCORD_AUTO_CONFIRM_EMAIL=false
165 FACEBOOK_APP_ID=false
166 FACEBOOK_APP_SECRET=false
167 FACEBOOK_AUTO_REGISTER=false
168 FACEBOOK_AUTO_CONFIRM_EMAIL=false
171 GITHUB_APP_SECRET=false
172 GITHUB_AUTO_REGISTER=false
173 GITHUB_AUTO_CONFIRM_EMAIL=false
176 GITLAB_APP_SECRET=false
177 GITLAB_BASE_URI=false
178 GITLAB_AUTO_REGISTER=false
179 GITLAB_AUTO_CONFIRM_EMAIL=false
182 GOOGLE_APP_SECRET=false
183 GOOGLE_SELECT_ACCOUNT=false
184 GOOGLE_AUTO_REGISTER=false
185 GOOGLE_AUTO_CONFIRM_EMAIL=false
189 OKTA_APP_SECRET=false
190 OKTA_AUTO_REGISTER=false
191 OKTA_AUTO_CONFIRM_EMAIL=false
194 SLACK_APP_SECRET=false
195 SLACK_AUTO_REGISTER=false
196 SLACK_AUTO_CONFIRM_EMAIL=false
199 TWITCH_APP_SECRET=false
200 TWITCH_AUTO_REGISTER=false
201 TWITCH_AUTO_CONFIRM_EMAIL=false
204 TWITTER_APP_SECRET=false
205 TWITTER_AUTO_REGISTER=false
206 TWITTER_AUTO_CONFIRM_EMAIL=false
208 # LDAP authentication configuration
209 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
214 LDAP_USER_FILTER=false
217 LDAP_TLS_INSECURE=false
218 LDAP_ID_ATTRIBUTE=uid
219 LDAP_EMAIL_ATTRIBUTE=mail
220 LDAP_DISPLAY_NAME_ATTRIBUTE=cn
221 LDAP_THUMBNAIL_ATTRIBUTE=null
222 LDAP_FOLLOW_REFERRALS=true
223 LDAP_DUMP_USER_DETAILS=false
225 # LDAP group sync configuration
226 # Refer to https://www.bookstackapp.com/docs/admin/ldap-auth/
227 LDAP_USER_TO_GROUPS=false
228 LDAP_GROUP_ATTRIBUTE="memberOf"
229 LDAP_REMOVE_FROM_GROUPS=false
230 LDAP_DUMP_USER_GROUPS=false
232 # SAML authentication configuration
233 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
235 SAML2_EMAIL_ATTRIBUTE=email
236 SAML2_DISPLAY_NAME_ATTRIBUTES=username
237 SAML2_EXTERNAL_ID_ATTRIBUTE=null
238 SAML2_IDP_ENTITYID=null
242 SAML2_ONELOGIN_OVERRIDES=null
243 SAML2_DUMP_USER_DETAILS=false
244 SAML2_AUTOLOAD_METADATA=false
245 SAML2_IDP_AUTHNCONTEXT=true
247 SAML2_SP_x509_KEY=null
249 # SAML group sync configuration
250 # Refer to https://www.bookstackapp.com/docs/admin/saml2-auth/
251 SAML2_USER_TO_GROUPS=false
252 SAML2_GROUP_ATTRIBUTE=group
253 SAML2_REMOVE_FROM_GROUPS=false
255 # OpenID Connect authentication configuration
256 # Refer to https://www.bookstackapp.com/docs/admin/oidc-auth/
258 OIDC_DISPLAY_NAME_CLAIMS=name
260 OIDC_CLIENT_SECRET=null
262 OIDC_ISSUER_DISCOVER=false
264 OIDC_AUTH_ENDPOINT=null
265 OIDC_TOKEN_ENDPOINT=null
266 OIDC_ADDITIONAL_SCOPES=null
267 OIDC_DUMP_USER_DETAILS=false
268 OIDC_USER_TO_GROUPS=false
269 OIDC_GROUPS_CLAIM=groups
270 OIDC_REMOVE_FROM_GROUPS=false
272 # Disable default third-party services such as Gravatar and Draw.IO
273 # Service-specific options will override this option
274 DISABLE_EXTERNAL_SERVICES=false
276 # Use custom avatar service, Sets fetch URL
277 # Possible placeholders: ${hash} ${size} ${email}
278 # If set, Avatars will be fetched regardless of DISABLE_EXTERNAL_SERVICES option.
279 # Example: AVATAR_URL=https://seccdn.libravatar.org/avatar/${hash}?s=${size}&d=identicon
282 # Enable diagrams.net integration
283 # Can simply be true/false to enable/disable the integration.
284 # Alternatively, It can be URL to the diagrams.net instance you want to use.
285 # For URLs, The following URL parameters should be included: embed=1&proto=json&spin=1&configure=1
288 # Default item listing view
289 # Used for public visitors and user's without a preference.
290 # Can be 'list' or 'grid'.
292 APP_VIEWS_BOOKSHELVES=grid
293 APP_VIEWS_BOOKSHELF=grid
295 # Use dark mode by default
296 # Will be overriden by any user/session preference.
297 APP_DEFAULT_DARK_MODE=false
299 # Page revision limit
300 # Number of page revisions to keep in the system before deleting old revisions.
301 # If set to 'false' a limit will not be enforced.
304 # Recycle Bin Lifetime
305 # The number of days that content will remain in the recycle bin before
306 # being considered for auto-removal. It is not a guarantee that content will
307 # be removed after this time.
308 # Set to 0 for no recycle bin functionality.
309 # Set to -1 for unlimited recycle bin lifetime.
310 RECYCLE_BIN_LIFETIME=30
313 # Maximum file size, in megabytes, that can be uploaded to the system.
314 FILE_UPLOAD_SIZE_LIMIT=50
317 # Primarily used to determine page size of PDF exports.
318 # Can be 'a4' or 'letter'.
321 # Allow <script> tags in page content
322 # Note, if set to 'true' the page editor may still escape scripts.
323 ALLOW_CONTENT_SCRIPTS=false
325 # Indicate if robots/crawlers should crawl your instance.
326 # Can be 'true', 'false' or 'null'.
327 # The behaviour of the default 'null' option will depend on the 'app-public' admin setting.
328 # Contents of the robots.txt file can be overridden, making this option obsolete.
331 # Allow server-side fetches to be performed to potentially unknown
332 # and user-provided locations. Primarily used in exports when loading
333 # in externally referenced assets.
334 # Can be 'true' or 'false'.
335 ALLOW_UNTRUSTED_SERVER_FETCHING=false
337 # A list of hosts that BookStack can be iframed within.
338 # Space separated if multiple. BookStack host domain is auto-inferred.
339 # For Example: ALLOWED_IFRAME_HOSTS="https://example.com https://a.example.com"
340 # Setting this option will also auto-adjust cookies to be SameSite=None.
341 ALLOWED_IFRAME_HOSTS=null
343 # A list of sources/hostnames that can be loaded within iframes within BookStack.
344 # Space separated if multiple. BookStack host domain is auto-inferred.
345 # Can be set to a lone "*" to allow all sources for iframe content (Not advised).
346 # Defaults to a set of common services.
347 # Current host and source for the "DRAWIO" setting will be auto-appended to the sources configured.
348 ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com"
350 # The default and maximum item-counts for listing API requests.
351 API_DEFAULT_ITEM_COUNT=100
352 API_MAX_ITEM_COUNT=500
354 # The number of API requests that can be made per minute by a single user.
355 API_REQUESTS_PER_MIN=180
357 # Enable the logging of failed email+password logins with the given message.
358 # The default log channel below uses the php 'error_log' function which commonly
359 # results in messages being output to the webserver error logs.
360 # The message can contain a %u parameter which will be replaced with the login
361 # user identifier (Username or email).
362 LOG_FAILED_LOGIN_MESSAGE=false
363 LOG_FAILED_LOGIN_CHANNEL=errorlog_plain_webserver
365 # Alter the precision of IP addresses stored by BookStack.
366 # Should be a number between 0 and 4, where 4 retains the full IP address
367 # and 0 completely hides the IP address. As an example, a value of 2 for the
368 # IP address '146.191.42.4' would result in '146.191.x.x' being logged.
369 # For the IPv6 address '2001:db8:85a3:8d3:1319:8a2e:370:7348' this would result as:
370 # '2001:db8:85a3:8d3:x:x:x:x'
371 IP_ADDRESS_PRECISION=4