From d129159b6613058b174bb6d77bd97a2a08f233d0 Mon Sep 17 00:00:00 2001 From: Homer Date: Sun, 23 Sep 2018 11:37:50 +0100 Subject: [PATCH 01/18] updated vars for appurl, blurb on env file --- readme-vars.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme-vars.yml b/readme-vars.yml index 228071f..e934cd5 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -29,6 +29,7 @@ param_env_vars: - { env_var: "DB_USER", env_value: "", desc: "for specifying the database user" } - { env_var: "DB_PASS", env_value: "", desc: "for specifying the database password" } - { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" } + - { env_var: "APPURL", env_value: "your.site.here.xyz", desc: "for specifying the url your application will be accessed on "} param_usage_include_ports: true param_ports: @@ -57,8 +58,11 @@ app_setup_block: | Default username is admin@admin.com with password of **password** + 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 + Documentation can be found at https://www.bookstackapp.com/docs/ # changelog changelogs: + - { date: "23.09.28:", desc: "Updates pre-release"} - { date: "02.07.18:", desc: "Initial Release." } From 111f2d5234f67eba92915128927c536ea253754b Mon Sep 17 00:00:00 2001 From: Homer Date: Thu, 27 Sep 2018 06:58:23 +0100 Subject: [PATCH 02/18] added symlink for env file, appurl env --- root/etc/cont-init.d/50-config | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 0142112..393b327 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -10,12 +10,8 @@ mkdir -p \ ln -sf /config/storage /var/www/html/storage [[ ! -L /var/www/html/public/uploads ]] && \ ln -sf /config/uploads /var/www/html/public/uploads - -for i in "${symlinks[@]}" -do -[[ -e "$i" && ! -L "$i" ]] && rm -rf "$i" -[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i" -done +[[ ! -L /var/www/html/.env ]] && \ + ln -sf /config/env /var/www/html/.env # Create API key if needed if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ] @@ -32,6 +28,7 @@ sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env +sed - i "s/# APP_URL=http://bookstack.dev/APP_URL=${APP_URL}/g" /var/www/html/.env # update database - will set up database if fresh, or, migrate existing php /var/www/html/artisan migrate --force From edfa7b4287e7ee0e7a97a14cd9481bf970453640 Mon Sep 17 00:00:00 2001 From: Homer Date: Thu, 27 Sep 2018 06:58:51 +0100 Subject: [PATCH 03/18] switch to alpine nginx 3.8 from 3.7 --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d82e9f..e9700be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM lsiobase/alpine.nginx:3.7 +FROM lsiobase/alpine.nginx:3.8 # set version label ARG BUILD_DATE diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 5e4d09a..a2e58ec 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM lsiobase/alpine.nginx.arm64:3.7 +FROM lsiobase/alpine.nginx.arm64:3.8 # Add qemu to build on x86_64 systems COPY qemu-aarch64-static /usr/bin diff --git a/Dockerfile.armhf b/Dockerfile.armhf index ee307ac..d9e19f4 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM lsiobase/alpine.nginx.armhf:3.7 +FROM lsiobase/alpine.nginx.armhf:3.8 # Add qemu to build on x86_64 systems COPY qemu-arm-static /usr/bin From 79c81a150719a1de9020f70ab76331f8a2f867a6 Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 28 Sep 2018 10:40:17 +0100 Subject: [PATCH 04/18] symlink updates --- root/etc/cont-init.d/50-config | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 393b327..2ec780f 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -11,7 +11,13 @@ mkdir -p \ [[ ! -L /var/www/html/public/uploads ]] && \ ln -sf /config/uploads /var/www/html/public/uploads [[ ! -L /var/www/html/.env ]] && \ - ln -sf /config/env /var/www/html/.env + ln -sf /config/.env /var/www/html/.env + + for i in "${symlinks[@]}" + do + [[ -e "$i" && ! -L "$i" ]] && rm -rf "$i" + [[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i" + done # Create API key if needed if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ] From 525ead5cbbdcb455412e032d8affe462fd170248 Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 28 Sep 2018 12:07:44 +0100 Subject: [PATCH 05/18] more symlink fixing --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- root/etc/cont-init.d/50-config | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e9700be..8ca5f5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /var/www/html/.env && \ + cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index a2e58ec..81fdb9a 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -44,7 +44,7 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /var/www/html/.env && \ + cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index d9e19f4..151d213 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -44,7 +44,7 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /var/www/html/.env && \ + cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 2ec780f..382bbbf 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -10,6 +10,8 @@ mkdir -p \ ln -sf /config/storage /var/www/html/storage [[ ! -L /var/www/html/public/uploads ]] && \ ln -sf /config/uploads /var/www/html/public/uploads +[[ ! -e /config/.env ]] && \ + cp /defaults/.env /config/.env [[ ! -L /var/www/html/.env ]] && \ ln -sf /config/.env /var/www/html/.env From f3e9fb6e9f5452b71a993fd132b917d9cd88b75f Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 5 Oct 2018 17:06:49 +0100 Subject: [PATCH 06/18] changed Dockerfile to not copy .env file --- Dockerfile | 1 - Dockerfile.aarch64 | 1 - Dockerfile.armhf | 1 - 3 files changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ca5f5a..aa7bdd4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,6 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 81fdb9a..52fbb93 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -44,7 +44,6 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 151d213..e3c4e28 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -44,7 +44,6 @@ RUN \ tar xf \ /tmp/bookstack.tar.gz -C \ /var/www/html/ --strip-components=1 && \ - cp /var/www/html/.env.example /defaults/.env && \ echo "**** install composer ****" && \ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ From 73287fa127459a96e819c8d156cef27913748aed Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 5 Oct 2018 21:31:49 +0100 Subject: [PATCH 07/18] added logic to control how .env is used --- root/etc/cont-init.d/50-config | 44 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 382bbbf..2208f3f 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -3,23 +3,31 @@ # create our folders mkdir -p \ /config/storage \ - /config/uploads - -# make symlinks -[[ ! -L /var/www/html/storage ]] && \ - ln -sf /config/storage /var/www/html/storage -[[ ! -L /var/www/html/public/uploads ]] && \ - ln -sf /config/uploads /var/www/html/public/uploads -[[ ! -e /config/.env ]] && \ - cp /defaults/.env /config/.env -[[ ! -L /var/www/html/.env ]] && \ - ln -sf /config/.env /var/www/html/.env - - for i in "${symlinks[@]}" - do - [[ -e "$i" && ! -L "$i" ]] && rm -rf "$i" - [[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i" - done + /config/public/uploads + +# make folder symlinks +symlinks=( \ +/var/www/html/storage \ +/var/www/html/public/uploads ) + +for i in "${symlinks[@]}" +do +[[ -e "$i" && ! -L "$i" ]] && rm -rf "$i" +[[ ! -L "$i" ]] && ln -s /config/"$(basename "$i")" "$i" +done + +# check for ADVANCED_MODE to be != 0; copy sample env file to /config and ln to /var/www/html if != 0, if = 0 then copy .example.env to .env and run seds +if [ "$ADVANCED_MODE" == 1 && ! -f "/config/.env" ]; + then + echo "Advanced Mode" + cp /var/www/html/.env.example /config/.env + ln -s /config/.env /var/www/html/.env +elif [ -z "$ADVANCED_MODE" ]; + echo "Basic Mode" + cp /var/www/html/.env.example /var/www/html/.env +else + echo "Finished symlinks" +fi # Create API key if needed if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ] @@ -36,7 +44,7 @@ sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -sed - i "s/# APP_URL=http://bookstack.dev/APP_URL=${APP_URL}/g" /var/www/html/.env +#sed -i "s/.*APP_URL=.*/APP_URL=${APP_URL}/g" /var/www/html/.env # update database - will set up database if fresh, or, migrate existing php /var/www/html/artisan migrate --force From 62b791572e9e706bef2c892ee05e3a655dd798f5 Mon Sep 17 00:00:00 2001 From: Homer Date: Sat, 6 Oct 2018 18:23:33 +0100 Subject: [PATCH 08/18] new symlink logic (cheers heimdall) and advanced mode for .env mods --- root/etc/cont-init.d/50-config | 45 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 2208f3f..d9286c7 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -1,32 +1,43 @@ #!/usr/bin/with-contenv bash -# create our folders +# create directory structure mkdir -p \ - /config/storage \ - /config/public/uploads + /config/www/{files,images,uploads,logs} -# make folder symlinks +# create symlinks symlinks=( \ -/var/www/html/storage \ +/var/www/html/storage/logs \ +/var/www/html/storage/uploads/files \ +/var/www/html/storage/uploads/images \ /var/www/html/public/uploads ) for i in "${symlinks[@]}" do [[ -e "$i" && ! -L "$i" ]] && rm -rf "$i" -[[ ! -L "$i" ]] && ln -s /config/"$(basename "$i")" "$i" +[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i" done -# check for ADVANCED_MODE to be != 0; copy sample env file to /config and ln to /var/www/html if != 0, if = 0 then copy .example.env to .env and run seds -if [ "$ADVANCED_MODE" == 1 && ! -f "/config/.env" ]; +# 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 +# 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 +if [ "$ADVANCED_MODE" == 1 ]; then - echo "Advanced Mode" - cp /var/www/html/.env.example /config/.env - ln -s /config/.env /var/www/html/.env + echo "Advanced Mode Enabled - Syncing .env from /config to /var/www/html" + [[ ! -f "/config/.env" ]] && \ + cp /var/www/html/.env.example /config/.env + cp /config/.env /var/www/html/.env elif [ -z "$ADVANCED_MODE" ]; - echo "Basic Mode" + then + echo "Basic Mode Enabled - Using sed to set BookStack variables from Docker environment variables - check the docs" cp /var/www/html/.env.example /var/www/html/.env + # set up .env + sed -i "s/APP_KEY=SomeRandomString/APP_KEY=$key/g" /var/www/html/.env + sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env + sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env + sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env + sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env + sed -i "s/# APP_URL=.*/APP_URL=${APP_URL}/g" /var/www/html/.env else - echo "Finished symlinks" + echo "Nothing to do with .env - what did you do homer?" fi # Create API key if needed @@ -38,14 +49,6 @@ if [ ! -f "/config/BOOKSTACK_APP_KEY.txt" ] echo "App Key set to $key you can modify the file to update /config/BOOKSTACK_APP_KEY.txt" fi -# set up .env -sed -i "s/APP_KEY=SomeRandomString/APP_KEY=$key/g" /var/www/html/.env -sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env -sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env -sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env -sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -#sed -i "s/.*APP_URL=.*/APP_URL=${APP_URL}/g" /var/www/html/.env - # update database - will set up database if fresh, or, migrate existing php /var/www/html/artisan migrate --force From 332c56096a04e35b8949c731f0c0c90b4742e3c2 Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 09:31:06 +0100 Subject: [PATCH 09/18] fixed appurl sed --- root/etc/cont-init.d/50-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index d9286c7..a640639 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -35,7 +35,7 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env - sed -i "s/# APP_URL=.*/APP_URL=${APP_URL}/g" /var/www/html/.env + sed -i "s/# APP_URL=http://bookstack.dev/APP_URL=${APP_URL}/g" /var/www/html/.env else echo "Nothing to do with .env - what did you do homer?" fi From b17d27643c94ba3c729fc32ed324dbc941dfea01 Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 14:25:46 +0100 Subject: [PATCH 10/18] sample compose files, readme updates, fixed seds, symlinks --- docker-compose.advanced.yml.sample | 26 ++++++++++++++++++++++++++ docker-compose.basic.yml.sample | 30 ++++++++++++++++++++++++++++++ readme-vars.yml | 13 +++++++++++++ root/etc/cont-init.d/50-config | 8 +++++--- 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 docker-compose.advanced.yml.sample create mode 100644 docker-compose.basic.yml.sample diff --git a/docker-compose.advanced.yml.sample b/docker-compose.advanced.yml.sample new file mode 100644 index 0000000..73231e5 --- /dev/null +++ b/docker-compose.advanced.yml.sample @@ -0,0 +1,26 @@ +version: '3' +services: + sql: + container_name: bookstack_sql + image: linuxserver/mariadb + volumes: + - ./data/sql:/config + networks: + - net + environment: + - PUID=setyourID + - PGID=setyourGID + - MYSQL_ROOT_PASSWORD=SetAPassword + bookstack: + container_name: bookstack + image: linuxserver/bookstack + volumes: + - ./data/bookstack:/config + environment: + - ADVANCED_MODE=1 + - PUID=setyourID + - PGID=setyourGID + networks: + - net +networks: + net: diff --git a/docker-compose.basic.yml.sample b/docker-compose.basic.yml.sample new file mode 100644 index 0000000..6e3061f --- /dev/null +++ b/docker-compose.basic.yml.sample @@ -0,0 +1,30 @@ +version: '3' +services: + sql: + container_name: bookstack_sql + image: linuxserver/mariadb + volumes: + - ./data/sql:/config + networks: + - net + environment: + - PUID=setyourID + - PGID=setyourGID + - MYSQL_ROOT_PASSWORD=SetAPassword + bookstack: + container_name: bookstack + image: linuxserver/bookstack + volumes: + - ./data/bookstack:/config + environment: + - DB_USER=bookstack + - DB_PASS=SetAPassword + - DB_DATABASE=bookstack + - DB_HOST=bookstack_sql + - "APP_URL=https://your.url.when.using.reverse.proxy" + - PUID=setyourID + - PGID=setyourGID + networks: + - net +networks: + net: diff --git a/readme-vars.yml b/readme-vars.yml index e934cd5..52c74fa 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -30,6 +30,7 @@ param_env_vars: - { env_var: "DB_PASS", env_value: "", desc: "for specifying the database password" } - { env_var: "DB_DATABASE", env_value: "bookstackapp", desc: "for specifying the database to be used" } - { env_var: "APPURL", env_value: "your.site.here.xyz", desc: "for specifying the url your application will be accessed on "} + - { env_var: "ADVANCED_MODE", env_value: "1", desc: "enables advanced mode for direct editing of the .env - scroll down for details on this"} param_usage_include_ports: true param_ports: @@ -62,7 +63,19 @@ app_setup_block: | Documentation can be found at https://www.bookstackapp.com/docs/ + ### Advanced Mode + 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 + 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 + 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. + + Note, the APP_KEY is still set by PHP environment so you do not need to worrry about this. + + ### Composer + + 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. + # changelog changelogs: + - { date: "08.10.18:", desc: "Advanced mode, symlink changes, sed fixing, docs updated, added some composer files"} - { date: "23.09.28:", desc: "Updates pre-release"} - { date: "02.07.18:", desc: "Initial Release." } diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index a640639..5035325 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -2,7 +2,7 @@ # create directory structure mkdir -p \ - /config/www/{files,images,uploads,logs} + /config/www/{storage,public} # create symlinks symlinks=( \ @@ -21,7 +21,7 @@ done # 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 if [ "$ADVANCED_MODE" == 1 ]; then - echo "Advanced Mode Enabled - Syncing .env from /config to /var/www/html" + 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" [[ ! -f "/config/.env" ]] && \ cp /var/www/html/.env.example /config/.env cp /config/.env /var/www/html/.env @@ -35,7 +35,9 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env - sed -i "s/# APP_URL=http://bookstack.dev/APP_URL=${APP_URL}/g" /var/www/html/.env +elif [ "$APP_URL" ] + echo "App URL Set" + sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env else echo "Nothing to do with .env - what did you do homer?" fi From 054ec5b6ef1dd190f7b17832b452a3aa60802289 Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 15:00:15 +0100 Subject: [PATCH 11/18] more symlinking fixing, found the missing ; --- root/etc/cont-init.d/50-config | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 5035325..67364b2 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -2,8 +2,9 @@ # create directory structure mkdir -p \ - /config/www/{storage,public} - + /config/www/storage/uploads \ + /config/www/public + # create symlinks symlinks=( \ /var/www/html/storage/logs \ @@ -36,6 +37,7 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env elif [ "$APP_URL" ] + then; echo "App URL Set" sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env else From ee5189c6c28896ec791e3317d81c7c88f18b87e0 Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 15:37:30 +0100 Subject: [PATCH 12/18] changed if on appurl --- root/etc/cont-init.d/50-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 67364b2..dcf28c2 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -4,7 +4,7 @@ mkdir -p \ /config/www/storage/uploads \ /config/www/public - + # create symlinks symlinks=( \ /var/www/html/storage/logs \ @@ -36,7 +36,7 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -elif [ "$APP_URL" ] +elif [ ! -z "$APP_URL" ] then; echo "App URL Set" sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env From 395835b501fcd954a936e078926c1279265d1898 Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 15:46:05 +0100 Subject: [PATCH 13/18] appurl again --- root/etc/cont-init.d/50-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index dcf28c2..4c2222a 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -36,8 +36,8 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -elif [ ! -z "$APP_URL" ] - then; +elif [ ! -z "$APP_URL" ]; + then echo "App URL Set" sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env else From 7ad31665a6671864c37b78efdd46515c931b36ff Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 16:12:27 +0100 Subject: [PATCH 14/18] removed logs symlink --- root/etc/cont-init.d/50-config | 1 - 1 file changed, 1 deletion(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 4c2222a..8cc123e 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -7,7 +7,6 @@ mkdir -p \ # create symlinks symlinks=( \ -/var/www/html/storage/logs \ /var/www/html/storage/uploads/files \ /var/www/html/storage/uploads/images \ /var/www/html/public/uploads ) From 4867b5c99f40f32e4abbeeb73d1e99899376b5fc Mon Sep 17 00:00:00 2001 From: Homer Date: Mon, 8 Oct 2018 16:24:34 +0100 Subject: [PATCH 15/18] appurl if --- root/etc/cont-init.d/50-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 8cc123e..3a91aba 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -35,7 +35,7 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -elif [ ! -z "$APP_URL" ]; +elif [ ! -z "$APP_URL" -a -z "$ADVANCED_MODE" ]; then echo "App URL Set" sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env From f5c4e2f8ca849f7551ab516f894175153bbf1e2b Mon Sep 17 00:00:00 2001 From: Homer Date: Tue, 9 Oct 2018 06:14:46 +0100 Subject: [PATCH 16/18] moved appurl if block --- root/etc/cont-init.d/50-config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 3a91aba..802b01c 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -35,12 +35,15 @@ elif [ -z "$ADVANCED_MODE" ]; sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env -elif [ ! -z "$APP_URL" -a -z "$ADVANCED_MODE" ]; +else + echo "Nothing to do with .env - what did you do homer?" +fi + +# 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 +if [ ! -z "$APP_URL" -a -z "$ADVANCED_MODE" ]; then echo "App URL Set" sed -i "s,#\sAPP_URL.*,APP_URL=${APP_URL},g" /var/www/html/.env -else - echo "Nothing to do with .env - what did you do homer?" fi # Create API key if needed From d7e02be8c8a057f0853b059b26912ff2130adb5b Mon Sep 17 00:00:00 2001 From: homerr Date: Tue, 9 Oct 2018 09:17:05 +0100 Subject: [PATCH 17/18] fixed symlinks --- root/etc/cont-init.d/50-config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 802b01c..f7993a0 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -2,8 +2,7 @@ # create directory structure mkdir -p \ - /config/www/storage/uploads \ - /config/www/public + /config/www/{uploads,files,images} # create symlinks symlinks=( \ From 8ff6a1bce8a8b1de2cd8d6e548d149aa7ae0e87a Mon Sep 17 00:00:00 2001 From: thelamer Date: Tue, 9 Oct 2018 01:56:09 -0700 Subject: [PATCH 18/18] adding fixes for aarch64 manifest and readme syncing --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 442b33e..7189a22 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -415,11 +415,11 @@ pipeline { sh "docker manifest push --purge ${IMAGE}:latest || :" sh "docker manifest create ${IMAGE}:latest ${IMAGE}:amd64-latest ${IMAGE}:arm32v6-latest ${IMAGE}:arm64v8-latest" sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm32v6-latest --os linux --arch arm" - sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant armv8" + sh "docker manifest annotate ${IMAGE}:latest ${IMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8" sh "docker manifest push --purge ${IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} || :" sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v6-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}" sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v6-${META_TAG} --os linux --arch arm" - sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant armv8" + sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8" sh "docker manifest push --purge ${IMAGE}:latest" sh "docker manifest push --purge ${IMAGE}:${META_TAG}" } @@ -474,7 +474,7 @@ pipeline { -e DOCKERHUB_USERNAME=$DOCKERUSER \ -e DOCKERHUB_PASSWORD=$DOCKERPASS \ -e GIT_REPOSITORY=${LS_USER}/${LS_REPO} \ - -e DOCKER_REPOSITORY=${DOCKERHUB_IMAGE} \ + -e DOCKER_REPOSITORY=${IMAGE} \ -e GIT_BRANCH=master \ lsiodev/readme-sync bash -c 'node sync' ''' }