From a58540d5f17b67878536a97501738611d5290791 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 18 Apr 2021 17:09:17 -0500
Subject: [PATCH 01/40] Changing links to point to DM for build and upping
 version to latest 21.04.

---
 .github/workflows/master.yml  | 10 +++++-----
 .github/workflows/pr.yml      |  4 ++--
 .github/workflows/release.yml | 10 +++++-----
 Dockerfile                    | 10 +++++-----
 Makefile                      |  4 ++--
 README.md                     | 10 +++++-----
 VERSION                       |  2 +-
 docker-entrypoint.sh          |  4 ++++
 8 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 11efd8d8..19755d18 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -15,7 +15,7 @@ jobs:
       id: docker_meta_ci
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: solidnerd/bookstack-dev
+        images: digitalmotion/bookstack-dev
         tag-sha: true
     - name: Set up Docker Buildx
       uses: docker/setup-buildx-action@v1
@@ -29,7 +29,7 @@ jobs:
         tags: |
           ${{ steps.docker_meta_ci.outputs.tags }}
         labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=solidnerd/bookstack-dev:master
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
         outputs: type=docker,dest=/tmp/image-bookstack.tar
     - name: Upload artifact
       uses: actions/upload-artifact@v2
@@ -62,7 +62,7 @@ jobs:
       id: docker_meta
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
+        images: digitalmotion/bookstack,ghcr.io/digitalmotiontech/docker-bookstack
         tag-semver: |
           {{version}}
           {{major}}.{{minor}}
@@ -103,5 +103,5 @@ jobs:
         tags: |
           ${{ steps.docker_meta.outputs.tags }}
         labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
+        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index fff73aa4..74bafa3c 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -15,7 +15,7 @@ jobs:
       id: docker_meta_ci
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: solidnerd/bookstack-dev
+        images: digitalmotion/bookstack-dev
         tag-sha: true
     - name: Set up Docker Buildx
       uses: docker/setup-buildx-action@v1
@@ -29,7 +29,7 @@ jobs:
         tags: |
           ${{ steps.docker_meta_ci.outputs.tags }}
         labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=solidnerd/bookstack-dev:master
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
         cache-to: type=inline
         outputs: type=docker,dest=/tmp/image-bookstack.tar
     - name: Upload artifact
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 71734384..b40a93ae 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -15,7 +15,7 @@ jobs:
       id: docker_meta_ci
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: solidnerd/bookstack-dev
+        images: digitalmotion/bookstack-dev
         tag-sha: true
     - name: Set up Docker Buildx
       uses: docker/setup-buildx-action@v1
@@ -29,7 +29,7 @@ jobs:
         tags: |
           ${{ steps.docker_meta_ci.outputs.tags }}
         labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=solidnerd/bookstack-dev:master
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
         outputs: type=docker,dest=/tmp/image-bookstack.tar
     - name: Upload artifact
       uses: actions/upload-artifact@v2
@@ -61,7 +61,7 @@ jobs:
       id: docker_meta
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
+        images: digitalmotion/bookstack,ghcr.io/digitalmotiontech/docker-bookstack
         tag-semver: |
           {{version}}
           {{major}}.{{minor}}
@@ -101,8 +101,8 @@ jobs:
         tags: |
           ${{ steps.docker_meta.outputs.tags }}
         labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
+        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
   create-release:
     runs-on: ubuntu-20.04
     needs: push
diff --git a/Dockerfile b/Dockerfile
index 112593ab..66a4c118 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 FROM alpine:3 as bookstack
-ENV BOOKSTACK_VERSION=0.31.6
+ENV BOOKSTACK_VERSION=21.04
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
@@ -61,7 +61,7 @@ RUN set -x; \
     && rm -rf /var/www/bookstack/composer.phar /root/.composer \
     && chown -R www-data:www-data /var/www/bookstack
 
-COPY php.ini /usr/local/etc/php/php.ini
+COPY php.ini /usr/local/etc/php/conf.d/docker-bookstack-default.ini
 COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
 
 WORKDIR /var/www/bookstack
@@ -84,8 +84,8 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
       org.label-schema.docker.dockerfile="/Dockerfile" \
       org.label-schema.license="MIT" \
       org.label-schema.name="bookstack" \
-      org.label-schema.vendor="solidnerd" \
-      org.label-schema.url="https://github.com/solidnerd/docker-bookstack/" \
+      org.label-schema.vendor="digitalmotion" \
+      org.label-schema.url="https://github.com/DigitalMotionTech/docker-bookstack/" \
       org.label-schema.vcs-ref=$VCS_REF \
-      org.label-schema.vcs-url="https://github.com/solidnerd/docker-bookstack.git" \
+      org.label-schema.vcs-url="https://github.com/DigitalMotionTech/docker-bookstack.git" \
       org.label-schema.vcs-type="Git"
diff --git a/Makefile b/Makefile
index 04f6ff2a..dabb6205 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-DOCKER_RELEASE_REG=solidnerd
+DOCKER_RELEASE_REG=digitalmotion
 DOCKER_IMAGE=bookstack
 DOCKER_IMAGE_DEV=${DOCKER_IMAGE}-dev
 DOCKER_INTERNAL_TAG := "sha-$(shell git rev-parse --short HEAD)"
 DOCKER_RELEASE_TAG := $(shell git describe)
 BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
-VCS_URL := https://github.com/solidnerd/docker-bookstack
+VCS_URL := https://github.com/DigitalMotionTech/docker-bookstack
 
 .PHONY: build  push pull release
 
diff --git a/README.md b/README.md
index 12d0cdb0..20caa13c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
+## Docker Image For [BookStack] (https://github.com/ssddanbrown/BookStack)
 
-[![Build Status](https://travis-ci.org/solidnerd/docker-bookstack.svg?branch=master)](https://travis-ci.org/solidnerd/docker-bookstack) [![](https://images.microbadger.com/badges/image/solidnerd/bookstack.svg)](https://microbadger.com/images/solidnerd/bookstack "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/solidnerd/bookstack.svg)](https://microbadger.com/images/solidnerd/bookstack "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/version/solidnerd/bookstack.svg)](https://microbadger.com/images/solidnerd/bookstack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/license/solidnerd/bookstack.svg)](https://microbadger.com/images/solidnerd/bookstack "Get your own license badge on microbadger.com")
+[![Build Status](https://travis-ci.org/DigitalMotionTech/docker-bookstack.svg?branch=master)](https://travis-ci.org/DigitalMotionTech/docker-bookstack) [![](https://images.microbadger.com/badges/image/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/version/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/license/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own license badge on microbadger.com")
 
-## Current Version: [0.31.6](https://github.com/SolidNerd/docker-bookstack/blob/master/Dockerfile)
+## Current Version: [21.04](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 
 ### Changes
 
@@ -21,7 +21,7 @@ and after that open your Browser and go to [http://localhost:8080](http://localh
 
 ### Issues
 
-If you have any issues feel free to create an [issue on GitHub](https://github.com/solidnerd/docker-bookstack/issues).
+If you have any issues feel free to create an [issue on GitHub](https://github.com/DigitalMotionTech/docker-bookstack/issues).
 
 
 ### How to use the Image without Docker compose
@@ -100,4 +100,4 @@ After these steps you can visit [http://localhost:8080](http://localhost:8080) .
 
 ### Inspiration
 
-This is a fork of [Kilhog/docker-bookstack](https://github.com/Kilhog/docker-bookstack). Kilhog did the intial work, but I want to go in a different direction.
+This is a fork of [solidnerd/docker-bookstack](https://github.com/solidnert/docker-bookstack).
\ No newline at end of file
diff --git a/VERSION b/VERSION
index 46214d1f..716d3f31 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.31.6
+21.04
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 6a2455fa..67da5bc3 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -102,6 +102,10 @@ else
   echoerr "wait-for-db: timeout out after 15 seconds waiting for ${DB_HOST_NAME}:${DB_PORT}"
 fi
 
+if [ ! -z $MAX_UPLOAD_SIZE ]; then
+  echo -e "[PHP]\npost_max_size = ${MAX_UPLOAD_SIZE}\nupload_max_filesize = ${MAX_UPLOAD_SIZE}\n" > /usr/local/etc/php/conf.d/zbookstack-max-upload.ini
+fi
+
 echo "Generating Key..."
 php artisan key:generate --show
 

From 1e399c72bf3ca4fa4695c2a2a5b40bffabd375c8 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 18 Apr 2021 18:13:17 -0500
Subject: [PATCH 02/40] README updates

---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 20caa13c..650d66a7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Docker Image For [BookStack] (https://github.com/ssddanbrown/BookStack)
+## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
 
-[![Build Status](https://travis-ci.org/DigitalMotionTech/docker-bookstack.svg?branch=master)](https://travis-ci.org/DigitalMotionTech/docker-bookstack) [![](https://images.microbadger.com/badges/image/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/version/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/license/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own license badge on microbadger.com")
+[![](https://images.microbadger.com/badges/image/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/version/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/license/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own license badge on microbadger.com")
 
 ## Current Version: [21.04](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 

From bd0d544d67b747a764acaccf14256418e897b32a Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 18 Apr 2021 19:21:37 -0500
Subject: [PATCH 03/40] Using GITHUB_ACTOR variable now

---
 .github/workflows/master.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 19755d18..360c8002 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -91,8 +91,8 @@ jobs:
       uses: docker/login-action@v1 
       with:
         registry: ghcr.io
-        username: ${{ github.repository_owner }}
-        password: ${{ secrets.CR_PAT }}
+        username: ${{ GITHUB_ACTOR }}
+        password: ${{ secrets.CR_PATH }}
     - name: Build and Push
       uses: docker/build-push-action@v2
       with:

From 191488182d3b45c41c2df55032b833e9b32f993c Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 18 Apr 2021 19:25:58 -0500
Subject: [PATCH 04/40] env.GITHUB_ACTOR might work

---
 .github/workflows/master.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 360c8002..688efd95 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -91,7 +91,7 @@ jobs:
       uses: docker/login-action@v1 
       with:
         registry: ghcr.io
-        username: ${{ GITHUB_ACTOR }}
+        username: ${{ env.GITHUB_ACTOR }}
         password: ${{ secrets.CR_PATH }}
     - name: Build and Push
       uses: docker/build-push-action@v2

From 18581a4c29da7961e01d8f4c49de46813c242552 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 18 Apr 2021 19:36:53 -0500
Subject: [PATCH 05/40] Fixing typo for CR_PATH to CR_PAT

---
 .github/workflows/master.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 688efd95..ab44fcc4 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -92,7 +92,7 @@ jobs:
       with:
         registry: ghcr.io
         username: ${{ env.GITHUB_ACTOR }}
-        password: ${{ secrets.CR_PATH }}
+        password: ${{ secrets.CR_PAT }}
     - name: Build and Push
       uses: docker/build-push-action@v2
       with:

From dec77b3ef54c8b9632afacd3a8fcf92c98545772 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Mon, 19 Apr 2021 15:33:33 -0500
Subject: [PATCH 06/40] use secret for CR username

---
 .github/workflows/master.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index ab44fcc4..b260e5f9 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -91,7 +91,7 @@ jobs:
       uses: docker/login-action@v1 
       with:
         registry: ghcr.io
-        username: ${{ env.GITHUB_ACTOR }}
+        username: ${{ secrets.CR_USERNAME }}
         password: ${{ secrets.CR_PAT }}
     - name: Build and Push
       uses: docker/build-push-action@v2

From 784b36b4776477075266b701cf848abf7bc0ccd9 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Tue, 20 Apr 2021 18:13:41 -0500
Subject: [PATCH 07/40] Working to get ghcr deployments to work

---
 .github/workflows/master.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index b260e5f9..143bed65 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -103,5 +103,5 @@ jobs:
         tags: |
           ${{ steps.docker_meta.outputs.tags }}
         labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
+        cache-from: type=registry,ref=digitalmotiontech/bookstack-dev:${{ github.sha }}
+        cache-to: type=registry,ref=digitalmotiontech/bookstack-dev:${{ github.sha }}

From 68fae8d6e1b9831e19219ebc3986bb0ee2403c36 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Tue, 20 Apr 2021 18:37:21 -0500
Subject: [PATCH 08/40] Working to get ghcr deployments to work

---
 .github/workflows/master.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 143bed65..b94b53ae 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -62,7 +62,7 @@ jobs:
       id: docker_meta
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: digitalmotion/bookstack,ghcr.io/digitalmotiontech/docker-bookstack
+        images: digitalmotion/bookstack,docker.pkg.github.com/digitalmotiontech/docker-bookstack
         tag-semver: |
           {{version}}
           {{major}}.{{minor}}
@@ -103,5 +103,5 @@ jobs:
         tags: |
           ${{ steps.docker_meta.outputs.tags }}
         labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotiontech/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=digitalmotiontech/bookstack-dev:${{ github.sha }}
+        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
+        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}

From 865a9bb72ddb8b43c13aa983790339ab489c11d8 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Tue, 20 Apr 2021 18:50:42 -0500
Subject: [PATCH 09/40] Working to get ghcr deployments to work

---
 .github/workflows/master.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index b94b53ae..6292fda8 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -90,7 +90,7 @@ jobs:
     - name: Login to GitHub Container Registry
       uses: docker/login-action@v1 
       with:
-        registry: ghcr.io
+        registry: docker.pkg.github.com
         username: ${{ secrets.CR_USERNAME }}
         password: ${{ secrets.CR_PAT }}
     - name: Build and Push

From dbe3ae2b99c8c9cd45bac1402a0944aefaad5d10 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Tue, 20 Apr 2021 19:08:51 -0500
Subject: [PATCH 10/40] Working to get ghcr deployments to work

---
 .github/workflows/master.yml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 6292fda8..48025c65 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -55,6 +55,9 @@ jobs:
   push:
     runs-on: ubuntu-20.04
     needs: e2e
+    permissions:
+      packages: write
+      content: read
     steps:
     - name: Checkout
       uses: actions/checkout@v2
@@ -62,7 +65,7 @@ jobs:
       id: docker_meta
       uses: crazy-max/ghaction-docker-meta@v1
       with:
-        images: digitalmotion/bookstack,docker.pkg.github.com/digitalmotiontech/docker-bookstack
+        images: digitalmotion/bookstack,docker.pkg.github.com/DigitalMotionTech/docker-bookstack/docker-bookstack
         tag-semver: |
           {{version}}
           {{major}}.{{minor}}
@@ -91,8 +94,8 @@ jobs:
       uses: docker/login-action@v1 
       with:
         registry: docker.pkg.github.com
-        username: ${{ secrets.CR_USERNAME }}
-        password: ${{ secrets.CR_PAT }}
+        username: ${{ github.actor }}
+        password: ${{ secrets.GITHUB_TOKEN }}
     - name: Build and Push
       uses: docker/build-push-action@v2
       with:

From 307e529237dd2b95e6eb009a9d30ed0abf797ec1 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Tue, 20 Apr 2021 19:16:00 -0500
Subject: [PATCH 11/40] Working to get ghcr deployments to work

---
 .github/workflows/master.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 48025c65..5ea8a7af 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -57,7 +57,7 @@ jobs:
     needs: e2e
     permissions:
       packages: write
-      content: read
+      contents: read
     steps:
     - name: Checkout
       uses: actions/checkout@v2

From 57ab6fd3229e3526beece0c85691dcb42251b099 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sat, 24 Apr 2021 14:17:55 -0500
Subject: [PATCH 12/40] Removed all github actions and updated gitlab ci

---
 .github/dependabot.yml        |   7 --
 .github/stale.yml             |  18 -----
 .github/workflows/master.yml  | 107 ----------------------------
 .github/workflows/pr.yml      |  58 ---------------
 .github/workflows/release.yml | 128 ----------------------------------
 .gitlab-ci.yml                |  20 ++++--
 6 files changed, 15 insertions(+), 323 deletions(-)
 delete mode 100644 .github/dependabot.yml
 delete mode 100644 .github/stale.yml
 delete mode 100644 .github/workflows/master.yml
 delete mode 100644 .github/workflows/pr.yml
 delete mode 100644 .github/workflows/release.yml

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 2c7d1708..00000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-version: 2
-updates:
-  # Maintain dependencies for GitHub Actions
-  - package-ecosystem: "github-actions"
-    directory: "/"
-    schedule:
-      interval: "daily"
diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644
index f58ecd39..00000000
--- a/.github/stale.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 30
-# Number of days of inactivity before a stale issue is closed
-daysUntilClose: 7
-# Issues with these labels will never be considered stale
-exemptLabels:
-  - pinned
-  - security
-  - keep-alive
-# Label to use when marking an issue as stale
-staleLabel: stale
-# Comment to post when marking an issue as stale. Set to `false` to disable
-markComment: >
-  This issue has been automatically marked as stale because it has not had
-  any activity for the last 30 days. It will be closed if no further activity
-  occurs during the next 7 days. Thank you for your contributions.
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
deleted file mode 100644
index 19755d18..00000000
--- a/.github/workflows/master.yml
+++ /dev/null
@@ -1,107 +0,0 @@
-name: "master"
-
-on:
-  push:
-    branches:
-      - master
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Set up CI Image Metadata
-      id: docker_meta_ci
-      uses: crazy-max/ghaction-docker-meta@v1
-      with:
-        images: digitalmotion/bookstack-dev
-        tag-sha: true
-    - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
-    - name: Build Image
-      uses: docker/build-push-action@v2
-      with:
-        context: .
-        file: ./Dockerfile
-        platforms: linux/amd64
-        push: false
-        tags: |
-          ${{ steps.docker_meta_ci.outputs.tags }}
-        labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
-        outputs: type=docker,dest=/tmp/image-bookstack.tar
-    - name: Upload artifact
-      uses: actions/upload-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp/image-bookstack.tar
-        if-no-files-found: warn
-  e2e:
-    runs-on: ubuntu-latest
-    needs: build
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Download artifact
-      uses: actions/download-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp
-    - name: Load Docker image
-      run: |
-        docker load --input /tmp/image-bookstack.tar
-        docker image ls -a
-  push:
-    runs-on: ubuntu-20.04
-    needs: e2e
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name:  Set up Docker Hub Image Metadata
-      id: docker_meta
-      uses: crazy-max/ghaction-docker-meta@v1
-      with:
-        images: digitalmotion/bookstack,ghcr.io/digitalmotiontech/docker-bookstack
-        tag-semver: |
-          {{version}}
-          {{major}}.{{minor}}
-          {{major}}.{{minor}}.{{patch}}
-    - name: Download artifact
-      uses: actions/download-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp
-        if-no-files-found: warn
-    - name: Load Docker image
-      run: |
-        docker load --input /tmp/image-bookstack.tar
-        docker image ls -a
-    - name: Set up QEMU
-      uses: docker/setup-qemu-action@v1
-    - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
-    - name: Login to DockerHub
-      if: github.event_name != 'pull_request'
-      uses: docker/login-action@v1
-      with:
-        username: ${{ secrets.DOCKER_USERNAME }}
-        password: ${{ secrets.DOCKER_PASSWORD }}
-    - name: Login to GitHub Container Registry
-      uses: docker/login-action@v1 
-      with:
-        registry: ghcr.io
-        username: ${{ github.repository_owner }}
-        password: ${{ secrets.CR_PAT }}
-    - name: Build and Push
-      uses: docker/build-push-action@v2
-      with:
-        context: .
-        file: ./Dockerfile
-        platforms: linux/amd64
-        push: ${{ github.event_name != 'pull_request' }}
-        tags: |
-          ${{ steps.docker_meta.outputs.tags }}
-        labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
deleted file mode 100644
index 74bafa3c..00000000
--- a/.github/workflows/pr.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: "PR"
-
-on:
-  pull_request:
-    branches:
-    - master
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Docker meta ci
-      id: docker_meta_ci
-      uses: crazy-max/ghaction-docker-meta@v1
-      with:
-        images: digitalmotion/bookstack-dev
-        tag-sha: true
-    - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
-    - name: Build and push Dev
-      uses: docker/build-push-action@v2
-      with:
-        context: .
-        file: ./Dockerfile
-        platforms: linux/amd64
-        push: ${{ github.event_name != 'pull_request' }}
-        tags: |
-          ${{ steps.docker_meta_ci.outputs.tags }}
-        labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
-        cache-to: type=inline
-        outputs: type=docker,dest=/tmp/image-bookstack.tar
-    - name: Upload artifact
-      uses: actions/upload-artifact@v2
-      with:
-        name: image-bookstack
-        path: /tmp/image-bookstack.tar
-        if-no-files-found: warn
-  e2e:
-    runs-on: ubuntu-latest
-    needs: build
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Download artifact
-      uses: actions/download-artifact@v2
-      with:
-        name: image-bookstack
-        path: /tmp
-        if-no-files-found: warn
-    - name: Load Docker image
-      run: |
-        docker load --input /tmp/image-bookstack.tar
-        docker image ls -a
-    - name: Execute End-to-End Test
-      run: make e2e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index b40a93ae..00000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,128 +0,0 @@
-name: release
-on:
-  push:
-    # Sequence of patterns matched against refs/tags
-    tags:
-      - '*' # Push events to matching v*, i.e. v1.0, v0.4.4
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Set up CI Image Metadata
-      id: docker_meta_ci
-      uses: crazy-max/ghaction-docker-meta@v1
-      with:
-        images: digitalmotion/bookstack-dev
-        tag-sha: true
-    - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
-    - name: Build and push Dev
-      uses: docker/build-push-action@v2
-      with:
-        context: .
-        file: ./Dockerfile
-        platforms: linux/amd64
-        push: false
-        tags: |
-          ${{ steps.docker_meta_ci.outputs.tags }}
-        labels: ${{ steps.docker_meta_ci.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:master
-        outputs: type=docker,dest=/tmp/image-bookstack.tar
-    - name: Upload artifact
-      uses: actions/upload-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp/image-bookstack.tar
-  e2e:
-    runs-on: ubuntu-latest
-    needs: build
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name: Download artifact
-      uses: actions/download-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp
-    - name: Load Docker image
-      run: |
-        docker load --input /tmp/image-bookstack.tar
-        docker image ls -a
-  push:
-    runs-on: ubuntu-20.04
-    needs: e2e
-    steps:
-    - name: Checkout
-      uses: actions/checkout@v2
-    - name:  Set up Docker Hub Image Metadata
-      id: docker_meta
-      uses: crazy-max/ghaction-docker-meta@v1
-      with:
-        images: digitalmotion/bookstack,ghcr.io/digitalmotiontech/docker-bookstack
-        tag-semver: |
-          {{version}}
-          {{major}}.{{minor}}
-          {{major}}.{{minor}}.{{patch}}
-    - name: Download artifact
-      uses: actions/download-artifact@v2
-      with:
-        name: image-bookstack-master
-        path: /tmp
-    - name: Load Docker image
-      run: |
-        docker load --input /tmp/image-bookstack.tar
-        docker image ls -a
-    - name: Set up QEMU
-      uses: docker/setup-qemu-action@v1
-    - name: Set up Docker Buildx
-      uses: docker/setup-buildx-action@v1
-    - name: Login to DockerHub
-      if: github.event_name != 'pull_request'
-      uses: docker/login-action@v1
-      with:
-        username: ${{ secrets.DOCKER_USERNAME }}
-        password: ${{ secrets.DOCKER_PASSWORD }}
-    - name: Login to GitHub Container Registry
-      uses: docker/login-action@v1 
-      with:
-        registry: ghcr.io
-        username: ${{ github.repository_owner }}
-        password: ${{ secrets.CR_PAT }}
-    - name: Build and Push master
-      uses: docker/build-push-action@v2
-      with:
-        context: .
-        file: ./Dockerfile
-        platforms: linux/amd64
-        push: ${{ github.event_name != 'pull_request' }}
-        tags: |
-          ${{ steps.docker_meta.outputs.tags }}
-        labels: ${{ steps.docker_meta.outputs.labels }}
-        cache-from: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
-        cache-to: type=registry,ref=digitalmotion/bookstack-dev:${{ github.sha }}
-  create-release:
-    runs-on: ubuntu-20.04
-    needs: push
-    steps:
-      # To use this repository's private action, you must check out the repository
-      - name: Checkout
-        uses: actions/checkout@v2
-      - name: Generate changelog
-        id: changelog
-        uses: metcalfc/changelog-generator@v0.4.4
-        with:
-          myToken: ${{ secrets.GITHUB_TOKEN }}
-      - name: Create Release
-        id: create_release
-        uses: actions/create-release@v1.1.4
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          tag_name: ${{ github.ref }}
-          release_name: ${{ github.ref }}
-          body: ${{ steps.changelog.outputs.changelog }}
-          draft: false
-          prerelease: false
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35478f85..39dba91b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,26 +2,36 @@ stages:
 - build
 - test
 - image
+
 build:
   stage: build
   before_script:
-    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
+    - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
   script:
     - docker build -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
     - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
     - docker rmi $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
+  after_script:
+    - docker logout $CI_REGISTRY
 
 release:
   stage: image
   before_script:
-    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
+    - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
+    - echo $DH_PASSWORD | docker login -u $DH_USERNAME --password-stdin
   script:
     - docker pull $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
     - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $CI_REGISTRY_IMAGE:$(cat VERSION)
-    - docker push $CI_REGISTRY_IMAGE:$(cat VERSION)
-    - docker rmi $CI_REGISTRY_IMAGE:$(cat VERSION)
+    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $DH_REGISTRY_IMAGE:$(cat VERSION)
     - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $CI_REGISTRY_IMAGE:latest
+    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $DH_REGISTRY_IMAGE:latest
+    - docker push $CI_REGISTRY_IMAGE:$(cat VERSION)
+    - docker push $DH_REGISTRY_IMAGE:$(cat VERSION)
     - docker push $CI_REGISTRY_IMAGE:latest
+    - docker push $DH_REGISTRY_IMAGE:latest
+    - docker rmi $CI_REGISTRY_IMAGE:$(cat VERSION)
+    - docker rmi $DH_REGISTRY_IMAGE:$(cat VERSION)
     - docker rmi $CI_REGISTRY_IMAGE:latest
+    - docker rmi $DH_REGISTRY_IMAGE:latest
   only:
-    - master
+    - tags

From 42c3e832002aa831ca0a4b9aef121b426a9dbcf0 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sat, 24 Apr 2021 14:22:09 -0500
Subject: [PATCH 13/40] Adding in tags and missing services definition for
 pipeline

---
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 39dba91b..22c8329a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,8 +3,14 @@ stages:
 - test
 - image
 
+image: docker:19-git
+
 build:
   stage: build
+  tags:
+    - docker
+  services:
+    - docker:19-dind
   before_script:
     - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
   script:
@@ -16,6 +22,10 @@ build:
 
 release:
   stage: image
+  tags:
+    - docker
+  services:
+    - docker:19-dind
   before_script:
     - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
     - echo $DH_PASSWORD | docker login -u $DH_USERNAME --password-stdin

From deb012e8a7a795626ad243f5867d96e7df510466 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 25 Apr 2021 18:08:26 -0500
Subject: [PATCH 14/40] Changing ownership and passing build args to show ref
 and build date

---
 .gitlab-ci.yml | 2 +-
 Dockerfile     | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 22c8329a..a4b43322 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,7 @@ build:
   before_script:
     - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
   script:
-    - docker build -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
+    - docker build --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT" $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
     - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
     - docker rmi $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
   after_script:
diff --git a/Dockerfile b/Dockerfile
index 66a4c118..5d2dab5f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -51,6 +51,10 @@ COPY bookstack.conf /etc/apache2/sites-available/000-default.conf
 
 COPY --from=bookstack --chown=33:33 /bookstack/ /var/www/bookstack/
 
+COPY php.ini /usr/local/etc/php/conf.d/docker-bookstack-default.ini
+
+COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
+
 ARG COMPOSER_VERSION=1.10.16
 RUN set -x; \
     cd /var/www/bookstack \
@@ -59,10 +63,7 @@ RUN set -x; \
     && /var/www/bookstack/composer.phar install -v -d /var/www/bookstack/ \
     && /var/www/bookstack/composer.phar global -v remove hirak/prestissimo \
     && rm -rf /var/www/bookstack/composer.phar /root/.composer \
-    && chown -R www-data:www-data /var/www/bookstack
-
-COPY php.ini /usr/local/etc/php/conf.d/docker-bookstack-default.ini
-COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
+    && chown -R www-data:www-data /usr/local/etc/php/conf.d/ /var/www/bookstack
 
 WORKDIR /var/www/bookstack
 

From 0b0defad547a3890b056edfff9d0dcfc1487fd88 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 25 Apr 2021 18:10:47 -0500
Subject: [PATCH 15/40] Goofed build command

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a4b43322..6620e2d2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,7 @@ build:
   before_script:
     - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
   script:
-    - docker build --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT" $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
+    - docker build --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT" --tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
     - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
     - docker rmi $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
   after_script:

From 6bf49e7c86545d7bf165b6f7e37527e691a8f146 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 25 Apr 2021 21:02:27 -0500
Subject: [PATCH 16/40] Upped to 21.04.1

---
 Dockerfile | 2 +-
 VERSION    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 5d2dab5f..3746ef2b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 FROM alpine:3 as bookstack
-ENV BOOKSTACK_VERSION=21.04
+ENV BOOKSTACK_VERSION=21.04.1
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
diff --git a/VERSION b/VERSION
index 716d3f31..7ec2a9a8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-21.04
+21.04.1

From 1f26db591942de5fd6a1ece8358e3098ac8e0649 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Mon, 26 Apr 2021 10:42:34 -0500
Subject: [PATCH 17/40] Upped to 21.04.2 and fixed gitlab environment

---
 .gitlab-ci.yml | 1 +
 Dockerfile     | 2 +-
 VERSION        | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6620e2d2..69ac3968 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,7 @@ build:
 
 release:
   stage: image
+  environment: release
   tags:
     - docker
   services:
diff --git a/Dockerfile b/Dockerfile
index 3746ef2b..1d0ab85c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 FROM alpine:3 as bookstack
-ENV BOOKSTACK_VERSION=21.04.1
+ENV BOOKSTACK_VERSION=21.04.2
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
diff --git a/VERSION b/VERSION
index 7ec2a9a8..e80891fb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-21.04.1
+21.04.2

From a5d4e9a4bffcd4f4ef9211ba92ae1b036ec7dd9b Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 14:32:10 -0500
Subject: [PATCH 18/40] Upping to v21.05 and moving to kaniko for container
 builds

---
 .gitlab-ci.yml | 14 +++++++-------
 Dockerfile     |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 69ac3968..c79c4fdb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,16 +9,16 @@ build:
   stage: build
   tags:
     - docker
-  services:
-    - docker:19-dind
   before_script:
-    - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
+    - mkdir -p /kaniko/.docker
+    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
   script:
-    - docker build --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT" --tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
-    - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
-    - docker rmi $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
+    - >
+      /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile
+      --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
+      --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT"
   after_script:
-    - docker logout $CI_REGISTRY
+    - rm -f /kaniko/.docker/config.json
 
 release:
   stage: image
diff --git a/Dockerfile b/Dockerfile
index 1d0ab85c..91944da0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 FROM alpine:3 as bookstack
-ENV BOOKSTACK_VERSION=21.04.2
+ENV BOOKSTACK_VERSION=21.05
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
@@ -55,7 +55,7 @@ COPY php.ini /usr/local/etc/php/conf.d/docker-bookstack-default.ini
 
 COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
 
-ARG COMPOSER_VERSION=1.10.16
+ARG COMPOSER_VERSION=2.0.14
 RUN set -x; \
     cd /var/www/bookstack \
     && curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \

From 7e983cf43e123206320056042b3c2087dfa29bf3 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 14:33:40 -0500
Subject: [PATCH 19/40] Use kaniko image for build

---
 .gitlab-ci.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c79c4fdb..937917b1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,6 +7,9 @@ image: docker:19-git
 
 build:
   stage: build
+  image:
+    name: gcr.io/kaniko-project/executor:debug
+    entrypoint: [""]
   tags:
     - docker
   before_script:

From 5dc7f91c278f8262aaaeb8d998c471732b0fa379 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 15:33:34 -0500
Subject: [PATCH 20/40] Fixies for kaniko and removal of prestissimo since it
 is no longer needed in composer 2.x

---
 .gitlab-ci.yml |  1 +
 Dockerfile     | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 937917b1..8650e3b3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,6 +20,7 @@ build:
       /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile
       --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
       --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT"
+      --cache --cache-dir=/cache --cache-repo=${CI_REGISTRY_IMAGE}/testing
   after_script:
     - rm -f /kaniko/.docker/config.json
 
diff --git a/Dockerfile b/Dockerfile
index 91944da0..e467daf5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -55,21 +55,21 @@ COPY php.ini /usr/local/etc/php/conf.d/docker-bookstack-default.ini
 
 COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
 
+RUN cd /var/www/bookstack \
+    && mkdir /var/www/.composer \
+    && chown -R www-data:www-data /usr/local/etc/php/conf.d/ /var/www/bookstack /var/www/.composer 
+
+# www-data
+USER 33
+
 ARG COMPOSER_VERSION=2.0.14
 RUN set -x; \
     cd /var/www/bookstack \
     && curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \
-    && /var/www/bookstack/composer.phar global -v require hirak/prestissimo \
-    && /var/www/bookstack/composer.phar install -v -d /var/www/bookstack/ \
-    && /var/www/bookstack/composer.phar global -v remove hirak/prestissimo \
-    && rm -rf /var/www/bookstack/composer.phar /root/.composer \
-    && chown -R www-data:www-data /usr/local/etc/php/conf.d/ /var/www/bookstack
+    && /var/www/bookstack/composer.phar install -v -d /var/www/bookstack/ 
 
 WORKDIR /var/www/bookstack
 
-# www-data
-USER 33
-
 VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads"]
 
 ENV RUN_APACHE_USER=www-data \

From 6ccf13b09d818cf510178ab4200c43b8e5051fd2 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 15:56:37 -0500
Subject: [PATCH 21/40] Upping version to 21.05

---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index e80891fb..b9b543d4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-21.04.2
+21.05

From a491550dcffeee6fab4f0e326964e7b992be939c Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 16:47:55 -0500
Subject: [PATCH 22/40] FIxing image release logic

---
 .gitlab-ci.yml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8650e3b3..4575ee35 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,8 +32,11 @@ release:
   services:
     - docker:19-dind
   before_script:
-    - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
-    - echo $DH_PASSWORD | docker login -u $DH_USERNAME --password-stdin
+    - mkdir -p /root/.docker/config.json
+    - $DH_AUTH=$(echo -n "${DH_USERNAME}:${DH_PASSWORD}" | base64)
+    - >
+      echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},
+      \"https://index.docker.io/v1/\":{\"auth\":\"$DH_AUTH\"}}}" > /root/.docker/config.json
   script:
     - docker pull $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
     - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $CI_REGISTRY_IMAGE:$(cat VERSION)
@@ -48,5 +51,7 @@ release:
     - docker rmi $DH_REGISTRY_IMAGE:$(cat VERSION)
     - docker rmi $CI_REGISTRY_IMAGE:latest
     - docker rmi $DH_REGISTRY_IMAGE:latest
+  after_script:
+    - rm -f /root/.docker/config.json
   only:
     - tags

From 9002248520e27fef0e502187729a84bfb6c04764 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Mon, 31 May 2021 16:57:45 -0500
Subject: [PATCH 23/40] Did not save before push

---
 .gitlab-ci.yml | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4575ee35..00e4ba46 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,7 +18,7 @@ build:
   script:
     - >
       /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile
-      --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
+      --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
       --build-arg VCS_REF="$CI_COMMIT_SHA" --build-arg BUILD_DATE="$CI_JOB_STARTED_AT"
       --cache --cache-dir=/cache --cache-repo=${CI_REGISTRY_IMAGE}/testing
   after_script:
@@ -32,23 +32,21 @@ release:
   services:
     - docker:19-dind
   before_script:
-    - mkdir -p /root/.docker/config.json
-    - $DH_AUTH=$(echo -n "${DH_USERNAME}:${DH_PASSWORD}" | base64)
+    - mkdir -p /root/.docker
+    - DH_AUTH=$(echo -n "${DH_USERNAME}:${DH_PASSWORD}" | base64)
     - >
       echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},
       \"https://index.docker.io/v1/\":{\"auth\":\"$DH_AUTH\"}}}" > /root/.docker/config.json
   script:
-    - docker pull $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
-    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $CI_REGISTRY_IMAGE:$(cat VERSION)
-    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $DH_REGISTRY_IMAGE:$(cat VERSION)
-    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $CI_REGISTRY_IMAGE:latest
-    - docker tag $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME $DH_REGISTRY_IMAGE:latest
-    - docker push $CI_REGISTRY_IMAGE:$(cat VERSION)
-    - docker push $DH_REGISTRY_IMAGE:$(cat VERSION)
+    - docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
+    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $DH_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
+    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest
+    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $DH_REGISTRY_IMAGE:latest
+    - docker push $DH_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
     - docker push $CI_REGISTRY_IMAGE:latest
     - docker push $DH_REGISTRY_IMAGE:latest
-    - docker rmi $CI_REGISTRY_IMAGE:$(cat VERSION)
-    - docker rmi $DH_REGISTRY_IMAGE:$(cat VERSION)
+    - docker rmi $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
+    - docker rmi $DH_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
     - docker rmi $CI_REGISTRY_IMAGE:latest
     - docker rmi $DH_REGISTRY_IMAGE:latest
   after_script:

From a4e5c342a4ac15e636cf273935f1c7fd6ba8e65c Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Tue, 1 Jun 2021 15:47:16 -0500
Subject: [PATCH 24/40] Update README.md

---
 README.md | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 650d66a7..416cb020 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,9 @@
 ## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
-
-[![](https://images.microbadger.com/badges/image/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/version/solidnerd/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/license/DigitalMotionTech/bookstack.svg)](https://microbadger.com/images/DigitalMotionTech/bookstack "Get your own license badge on microbadger.com")
-
-## Current Version: [21.04](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
+[![Pipeline Status](https://gitlab.com/DigitalMotion/os/docker-bookstack/badges/master/pipeline.svg)](https://gitlab.com/DigitalMotion/os/docker-bookstack/-/pipelines)
+## Current Version: [21.05](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 
 ### Changes
-
+In 21.05 we moved to composer 2.x and did alot of code and build cleanup - moving image creation over to Kaniko.
 In 0.28.0 we changed the container http port from 80 to 8080 to allow root privileges to be dropped
 In 0.12.2 we removed `DB_PORT` . You can now specify the port via `DB_HOST` like `DB_HOST=mysql:3306`
 
@@ -100,4 +98,4 @@ After these steps you can visit [http://localhost:8080](http://localhost:8080) .
 
 ### Inspiration
 
-This is a fork of [solidnerd/docker-bookstack](https://github.com/solidnert/docker-bookstack).
\ No newline at end of file
+This is a fork of [solidnerd/docker-bookstack](https://github.com/solidnert/docker-bookstack).

From 9d207cb1344c059c18f62b3a80f32dbb68125974 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Wed, 2 Jun 2021 13:34:14 -0500
Subject: [PATCH 25/40] Dockerfile cleanup and removal of VERSION file which is
 no longer needed

---
 Dockerfile | 24 ++++++++++++++++++++----
 VERSION    |  1 -
 2 files changed, 20 insertions(+), 5 deletions(-)
 delete mode 100644 VERSION

diff --git a/Dockerfile b/Dockerfile
index e467daf5..665376d6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,14 @@
+ARG BOOKSTACK_VERSION=21.05
+ARG COMPOSER_VERSION=2.0.14
+ARG BUILD_DATE
+ARG VCS_REF
+
+# Container used to get the bookstack code and extract it
 FROM alpine:3 as bookstack
-ENV BOOKSTACK_VERSION=21.05
+# Renew needed ARGS
+ARG BOOKSTACK_VERSION
+# Setup needed environment variables
+ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}}
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
@@ -7,7 +16,17 @@ RUN set -x; \
     && tar xvf bookstack.tar.gz -C /bookstack --strip-components=1 \
     && rm bookstack.tar.gz
 
+# Actual container used for running bookstack
 FROM php:7.4-apache-buster as final
+# Renew our ARGS
+ARG BOOKSTACK_VERSION
+ARG COMPOSER_VERSION
+ARG BUILD_DATE
+ARG VCS_REF
+# Setup our ENVS
+ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}}
+ENV COMPOSER_VERSION=${COMPOSER_VERSION}}
+
 RUN set -x; \
     apt-get update \
     && apt-get install -y --no-install-recommends \
@@ -62,7 +81,6 @@ RUN cd /var/www/bookstack \
 # www-data
 USER 33
 
-ARG COMPOSER_VERSION=2.0.14
 RUN set -x; \
     cd /var/www/bookstack \
     && curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \
@@ -79,8 +97,6 @@ EXPOSE 8080
 
 ENTRYPOINT ["/bin/docker-entrypoint.sh"]
 
-ARG BUILD_DATE
-ARG VCS_REF
 LABEL org.label-schema.build-date=$BUILD_DATE \
       org.label-schema.docker.dockerfile="/Dockerfile" \
       org.label-schema.license="MIT" \
diff --git a/VERSION b/VERSION
deleted file mode 100644
index b9b543d4..00000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-21.05

From 973cb85c5834f60e51312cb42a7bfecc56a376df Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Wed, 2 Jun 2021 13:37:52 -0500
Subject: [PATCH 26/40] Removing extrenuous brackets

---
 Dockerfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 665376d6..abf3f7ad 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ FROM alpine:3 as bookstack
 # Renew needed ARGS
 ARG BOOKSTACK_VERSION
 # Setup needed environment variables
-ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}}
+ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}
 RUN apk add --no-cache curl tar
 RUN set -x; \
     curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz  \
@@ -24,8 +24,8 @@ ARG COMPOSER_VERSION
 ARG BUILD_DATE
 ARG VCS_REF
 # Setup our ENVS
-ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}}
-ENV COMPOSER_VERSION=${COMPOSER_VERSION}}
+ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}
+ENV COMPOSER_VERSION=${COMPOSER_VERSION}
 
 RUN set -x; \
     apt-get update \

From 899774697c2cdf93165fe468c686cf06966d8bf5 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Fri, 1 Oct 2021 08:01:47 -0500
Subject: [PATCH 27/40] Upping to v21.05.4

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index abf3f7ad..8f89bbe5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.05
+ARG BOOKSTACK_VERSION=21.05.4
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF

From 7909271ea8706131d0fe800088ca100892b69dd5 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Fri, 1 Oct 2021 08:15:18 -0500
Subject: [PATCH 28/40] Updating to v21.08.3

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 8f89bbe5..8beffcd2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.05.4
+ARG BOOKSTACK_VERSION=21.08.3
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF

From 11dd79aa57259354511c269f0b61d0c567924ab7 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Wed, 17 Nov 2021 07:48:38 -0600
Subject: [PATCH 29/40] Bumping to v21.10.3

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 8beffcd2..b9a51fc9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.08.3
+ARG BOOKSTACK_VERSION=21.10.3
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF

From 113ccd4fdf087bcf88e14069696c160b50d6e4b9 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Wed, 17 Nov 2021 08:01:11 -0600
Subject: [PATCH 30/40] Updating to v21.11

---
 Dockerfile | 2 +-
 README.md  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b9a51fc9..051d1efc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.10.3
+ARG BOOKSTACK_VERSION=21.11
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF
diff --git a/README.md b/README.md
index 416cb020..49c1d9f7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 ## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
 [![Pipeline Status](https://gitlab.com/DigitalMotion/os/docker-bookstack/badges/master/pipeline.svg)](https://gitlab.com/DigitalMotion/os/docker-bookstack/-/pipelines)
-## Current Version: [21.05](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
+## Current Version: [21.11](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 
 ### Changes
 In 21.05 we moved to composer 2.x and did alot of code and build cleanup - moving image creation over to Kaniko.

From 6c1ad3152c024af09e0b44794d7cc9e219b1cc35 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Thu, 24 Feb 2022 08:25:51 -0600
Subject: [PATCH 31/40] Updating to latest bookstack release 21.12.5

---
 Dockerfile | 2 +-
 README.md  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 051d1efc..8b15bff9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.11
+ARG BOOKSTACK_VERSION=21.12.5
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF
diff --git a/README.md b/README.md
index 49c1d9f7..78436993 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 ## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
 [![Pipeline Status](https://gitlab.com/DigitalMotion/os/docker-bookstack/badges/master/pipeline.svg)](https://gitlab.com/DigitalMotion/os/docker-bookstack/-/pipelines)
-## Current Version: [21.11](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
+## Current Version: [21.12.5](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 
 ### Changes
 In 21.05 we moved to composer 2.x and did alot of code and build cleanup - moving image creation over to Kaniko.

From a525c36b9d93f1761487d39de32f6ebc53728ab5 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Sat, 11 Jun 2022 00:40:52 -0500
Subject: [PATCH 32/40] Updating to v22.04.2

---
 Dockerfile | 2 +-
 README.md  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8b15bff9..8b78fd00 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=21.12.5
+ARG BOOKSTACK_VERSION=22.04.2
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF
diff --git a/README.md b/README.md
index 78436993..6c986ab0 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 ## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack)
 [![Pipeline Status](https://gitlab.com/DigitalMotion/os/docker-bookstack/badges/master/pipeline.svg)](https://gitlab.com/DigitalMotion/os/docker-bookstack/-/pipelines)
-## Current Version: [21.12.5](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
+## Current Version: [22.04.2](https://github.com/DigitalMotionTech/docker-bookstack/blob/master/Dockerfile)
 
 ### Changes
 In 21.05 we moved to composer 2.x and did alot of code and build cleanup - moving image creation over to Kaniko.

From 2b72f6a5fd0edca91c189591e9df67ca70c16e69 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Fri, 6 Jan 2023 18:28:09 -0600
Subject: [PATCH 33/40] Upgrading to php8.1 and bookstack 22.11.1

---
 Dockerfile | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8b78fd00..e6d7c1a2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=22.04.2
+ARG BOOKSTACK_VERSION=22.11.1
 ARG COMPOSER_VERSION=2.0.14
 ARG BUILD_DATE
 ARG VCS_REF
@@ -17,7 +17,7 @@ RUN set -x; \
     && rm bookstack.tar.gz
 
 # Actual container used for running bookstack
-FROM php:7.4-apache-buster as final
+FROM php:8.1-apache as final
 # Renew our ARGS
 ARG BOOKSTACK_VERSION
 ARG COMPOSER_VERSION
@@ -48,10 +48,8 @@ RUN set -x; \
         unzip \
     \
    && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy  \
-   && docker-php-ext-configure ldap \
-   && docker-php-ext-install -j$(nproc) ldap \
-   && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
-   && docker-php-ext-install -j$(nproc) gd
+   && docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" \
+   && docker-php-ext-install -j$(nproc) ldap pdo_mysql zip gd
 
 RUN a2enmod rewrite remoteip; \
     { \
@@ -76,15 +74,23 @@ COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
 
 RUN cd /var/www/bookstack \
     && mkdir /var/www/.composer \
-    && chown -R www-data:www-data /usr/local/etc/php/conf.d/ /var/www/bookstack /var/www/.composer 
+    && chown -R www-data:www-data /usr/local/etc/php/conf.d/ /var/www/bookstack /var/www/.composer \
+    && mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
+    && sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$PHP_INI_DIR/php.ini"
+
+# Install composer
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
+    && php composer-setup.php \
+    && mv composer.phar /usr/bin/composer \
+    && chmod +x /usr/bin/composer \
+    && php -r "unlink('composer-setup.php');" 
 
 # www-data
 USER 33
 
-RUN set -x; \
-    cd /var/www/bookstack \
-    && curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \
-    && /var/www/bookstack/composer.phar install -v -d /var/www/bookstack/ 
+# Install deps
+RUN cd /var/www/bookstack \
+    && /usr/bin/composer install -v -d /var/www/bookstack/ 
 
 WORKDIR /var/www/bookstack
 

From ac53b1f74ce51b761e0023d76bce54368e988537 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Sat, 7 Jan 2023 00:21:03 -0600
Subject: [PATCH 34/40] Moving back to buster and fixing gd issues, adding
 wkhtmltox

---
 Dockerfile | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index e6d7c1a2..7e83e1ea 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 ARG BOOKSTACK_VERSION=22.11.1
-ARG COMPOSER_VERSION=2.0.14
+ARG COMPOSER_VERSION=2.1.12
 ARG BUILD_DATE
 ARG VCS_REF
 
@@ -17,7 +17,7 @@ RUN set -x; \
     && rm bookstack.tar.gz
 
 # Actual container used for running bookstack
-FROM php:8.1-apache as final
+FROM php:8.1-apache-buster as final
 # Renew our ARGS
 ARG BOOKSTACK_VERSION
 ARG COMPOSER_VERSION
@@ -46,10 +46,15 @@ RUN set -x; \
         curl \
         libzip-dev \
         unzip \
-    \
+   && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb \
+   && chmod a+x ./wkhtmltox_0.12.6-1.buster_amd64.deb \
+   && apt-get install -y ./wkhtmltox_0.12.6-1.buster_amd64.deb \
+   && rm ./wkhtmltox_0.12.6-1.buster_amd64.deb \
    && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy  \
    && docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" \
-   && docker-php-ext-install -j$(nproc) ldap pdo_mysql zip gd
+   && docker-php-ext-install -j$(nproc) ldap \
+   && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
+   && docker-php-ext-install -j$(nproc) gd
 
 RUN a2enmod rewrite remoteip; \
     { \

From a7bc9b623f91f4ba97ba12a900c8b355fbff925e Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Sat, 7 Jan 2023 00:58:14 -0600
Subject: [PATCH 35/40] Fixes for buster build

---
 Dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Dockerfile b/Dockerfile
index 7e83e1ea..7c62fadd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -44,6 +44,7 @@ RUN set -x; \
         wkhtmltopdf  \
         tar \
         curl \
+        wget \
         libzip-dev \
         unzip \
    && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb \

From 8babbe650a95f0ac86352b7e4cb999c45b16f06e Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@digitalmotion.tech>
Date: Sun, 19 Mar 2023 10:16:34 -0500
Subject: [PATCH 36/40] Working on v23 upgrade

---
 Dockerfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 8b78fd00..d1437a8e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
-ARG BOOKSTACK_VERSION=22.04.2
-ARG COMPOSER_VERSION=2.0.14
+ARG BOOKSTACK_VERSION=23.02.1
+ARG COMPOSER_VERSION=2.5.4
 ARG BUILD_DATE
 ARG VCS_REF
 
@@ -17,7 +17,7 @@ RUN set -x; \
     && rm bookstack.tar.gz
 
 # Actual container used for running bookstack
-FROM php:7.4-apache-buster as final
+FROM php:8.1.17-apache as final
 # Renew our ARGS
 ARG BOOKSTACK_VERSION
 ARG COMPOSER_VERSION
@@ -47,7 +47,7 @@ RUN set -x; \
         libzip-dev \
         unzip \
     \
-   && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy  \
+   && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy xml  \
    && docker-php-ext-configure ldap \
    && docker-php-ext-install -j$(nproc) ldap \
    && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \

From b6f407647251d7c54f06222badc4a0e6ec819418 Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Sun, 19 Mar 2023 11:32:55 -0500
Subject: [PATCH 37/40] Updating container build in Makefile

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index dabb6205..b13551e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-DOCKER_RELEASE_REG=digitalmotion
-DOCKER_IMAGE=bookstack
-DOCKER_IMAGE_DEV=${DOCKER_IMAGE}-dev
+DOCKER_RELEASE_REG=registry.gitlab.com/digitalmotion
+DOCKER_IMAGE=docker-bookstack
+DOCKER_IMAGE_DEV=${DOCKER_IMAGE}/dev
 DOCKER_INTERNAL_TAG := "sha-$(shell git rev-parse --short HEAD)"
 DOCKER_RELEASE_TAG := $(shell git describe)
 BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

From 0f3bddb1425e8f329c19d526d5aeff24f9d2754a Mon Sep 17 00:00:00 2001
From: Ed McLain <ed@edmclain.com>
Date: Sun, 19 Mar 2023 13:33:16 -0500
Subject: [PATCH 38/40] Additional fixes for bullseye upgrade

---
 Dockerfile | 5 ++++-
 Makefile   | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 1d049167..f5da5cba 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -41,13 +41,16 @@ RUN set -x; \
         libxml2-dev  \
         fontconfig  \
         fonts-freefont-ttf   \
-        wkhtmltopdf  \
         tar \
         curl \
         wget \
         libzip-dev \
         unzip \
     \
+   && wget -O /wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb  \
+   && chmod a+x /wkhtmltox.deb \
+   && apt-get install -y /wkhtmltox.deb \
+   && rm /wkhtmltox.deb \
    && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy xml  \
    && docker-php-ext-configure ldap \
    && docker-php-ext-install -j$(nproc) ldap \
diff --git a/Makefile b/Makefile
index b13551e2..9aff9717 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-DOCKER_RELEASE_REG=registry.gitlab.com/digitalmotion
+DOCKER_RELEASE_REG=registry.gitlab.com/digitalmotion/os
 DOCKER_IMAGE=docker-bookstack
 DOCKER_IMAGE_DEV=${DOCKER_IMAGE}/dev
 DOCKER_INTERNAL_TAG := "sha-$(shell git rev-parse --short HEAD)"

From 32d8e073502c1959fceace1404f21335d0007d33 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@nibuild.com>
Date: Mon, 21 Oct 2024 09:22:37 -0500
Subject: [PATCH 39/40] Updates for php 8.2

---
 Dockerfile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index f5da5cba..a903c35c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
-ARG BOOKSTACK_VERSION=23.02.1
-ARG COMPOSER_VERSION=2.5.4
+ARG BOOKSTACK_VERSION=23.098.3
+ARG COMPOSER_VERSION=2.6.5
 ARG BUILD_DATE
 ARG VCS_REF
 
@@ -17,7 +17,7 @@ RUN set -x; \
     && rm bookstack.tar.gz
 
 # Actual container used for running bookstack
-FROM php:8.1.17-apache as final
+FROM php:8.2-apache-bookworm as final
 # Renew our ARGS
 ARG BOOKSTACK_VERSION
 ARG COMPOSER_VERSION
@@ -47,11 +47,11 @@ RUN set -x; \
         libzip-dev \
         unzip \
     \
-   && wget -O /wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb  \
+   && wget -O /wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb  \
    && chmod a+x /wkhtmltox.deb \
    && apt-get install -y /wkhtmltox.deb \
    && rm /wkhtmltox.deb \
-   && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy xml  \
+   && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy xml \
    && docker-php-ext-configure ldap \
    && docker-php-ext-install -j$(nproc) ldap \
    && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \

From 1d659f13654bc39d65c44ad65f67996dcaa38077 Mon Sep 17 00:00:00 2001
From: Ed McLain <emclain@nibuild.com>
Date: Mon, 21 Oct 2024 09:41:53 -0500
Subject: [PATCH 40/40] Upgrades to v24.10

---
 Dockerfile           | 2 +-
 docker-entrypoint.sh | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index a903c35c..b8378725 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-ARG BOOKSTACK_VERSION=23.098.3
+ARG BOOKSTACK_VERSION=24.10
 ARG COMPOSER_VERSION=2.6.5
 ARG BUILD_DATE
 ARG VCS_REF
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 67da5bc3..88b75c2e 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -77,7 +77,9 @@ if [ ! -f ".env" ]; then
       MAIL_USERNAME=${MAIL_USERNAME:-null}
       MAIL_PASSWORD=${MAIL_PASSWORD:-null}
       MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null}
-      # URL used for social login redirects, NO TRAILING SLASH
+      
+      # Setup for PDF Printing
+      WKHTMLTOPDF=/usr/local/bin/wkhtmltopdf
 EOF
     else
         echo >&2 'error: missing DB_HOST environment variable'
