You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" }
32
+
- { env_var: "APPURL", env_value: "your.site.here.xyz", desc: "for specifying the url your application will be accessed on "}
33
+
- { env_var: "ADVANCED_MODE", env_value: "1", desc: "enables advanced mode for direct editing of the .env - scroll down for details on this"}
32
34
33
35
param_usage_include_ports: true
34
36
param_ports:
@@ -57,8 +59,23 @@ app_setup_block: |
57
59
58
60
Default username is admin@admin.com with password of **password**
59
61
62
+
If you intend to use this application behind a reverse proxy, such as our LetsEncrypt container or Traefik you will need to make sure that the `APPURL` environment variable is set, or it will not work
63
+
60
64
Documentation can be found at https://www.bookstackapp.com/docs/
61
65
66
+
### Advanced Mode
67
+
We have implemented a special 'advanced mode' where users who wish to leverage the built in SMTP or LDAP functionality, will have the ability to edit the .env by hand. With `ADVANCED_MODE=1` set when
68
+
the container is created, it will copy the .env.example to /config within the container. You can then edit this file on the host system (make sure you read the BookStack docs) and restart the
69
+
container when finished. When the container starts, it copies /config/.env to /var/www/html/.env within the container for the web app to use. It will do this every time the container restarts.
70
+
71
+
Note, the APP_KEY is still set by PHP environment so you do not need to worrry about this.
72
+
73
+
### Composer
74
+
75
+
Some simple docker-compose files are included for you to get started with. You will still need to manually configure the SQL server, but the compose files will get the stack running for you.
76
+
62
77
# changelog
63
78
changelogs:
79
+
- { date: "08.10.18:", desc: "Advanced mode, symlink changes, sed fixing, docs updated, added some composer files"}
# Check for ADVANCED_MODE to be set. If set, copy sample env file to /config and then copy to /var/www/html.env so advanced users can make their own customisations
20
+
# If not set, runs in basic mode where .example.env is copied to /var/www/html/.env and seds are applied to set documented variables
21
+
if [ "$ADVANCED_MODE" == 1 ];
22
+
then
23
+
echo "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"
24
+
[[ ! -f "/config/.env" ]] && \
25
+
cp /var/www/html/.env.example /config/.env
26
+
cp /config/.env /var/www/html/.env
27
+
elif [ -z "$ADVANCED_MODE" ];
28
+
then
29
+
echo "Basic Mode Enabled - Using sed to set BookStack variables from Docker environment variables - check the docs"
30
+
cp /var/www/html/.env.example /var/www/html/.env
31
+
# set up .env
32
+
sed -i "s/APP_KEY=SomeRandomString/APP_KEY=$key/g" /var/www/html/.env
33
+
sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env
34
+
sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env
35
+
sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env
36
+
sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env
37
+
else
38
+
echo "Nothing to do with .env - what did you do homer?"
39
+
fi
40
+
41
+
# Check to see if appurl is set, and whether advanced mode is set. Will set .env APP_URL if variable present, and advanced mode not set
42
+
if [ ! -z "$APP_URL" -a -z "$ADVANCED_MODE" ];
43
+
then
44
+
echo "App URL Set"
45
+
sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env
46
+
fi
47
+
20
48
# Create API key if needed
21
49
if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ]
22
50
then
@@ -26,13 +54,6 @@ if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ]
26
54
echo "App Key set to $key you can modify the file to update /config/BOOKSTACK_APP_KEY.txt"
27
55
fi
28
56
29
-
# set up .env
30
-
sed -i "s/APP_KEY=SomeRandomString/APP_KEY=$key/g" /var/www/html/.env
31
-
sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env
32
-
sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env
33
-
sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env
34
-
sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env
35
-
36
57
# update database - will set up database if fresh, or, migrate existing
0 commit comments