From 073fd124ee98f6b11c124f304800c4c307273393 Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 6 May 2021 11:24:59 +0200 Subject: [PATCH 01/22] add .env variable + SAML cert generation --- Dockerfile | 8 +++---- docker-entrypoint.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 112593ab..71d18ac0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,7 @@ WORKDIR /var/www/bookstack # www-data USER 33 -VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads"] +VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads","/var/www/html/vendor/onelogin/php-saml/certs"] ENV RUN_APACHE_USER=www-data \ RUN_APACHE_GROUP=www-data @@ -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="occyss" \ + org.label-schema.url="https://github.com/occyss/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/occyss/docker-bookstack.git" \ org.label-schema.vcs-type="Git" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6a2455fa..7aa189ac 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -28,6 +28,9 @@ if [ ! -f ".env" ]; then # Cache and session CACHE_DRIVER=file SESSION_DRIVER=file + SESSION_LIFETIME=${SESSION_LIFETIME:-600} + SESSION_COOKIE_NAME=${SESSION_COOKIE_NAME:-bookstack_session} + SESSION_SECURE_COOKIE=${SESSION_SECURE_COOKIE:-true} # If using Memcached, comment the above and uncomment these #CACHE_DRIVER=memcached #SESSION_DRIVER=memcached @@ -41,6 +44,7 @@ if [ ! -f ".env" ]; then # Storage STORAGE_TYPE=${STORAGE_TYPE:-local} + STORAGE_TYPE=${STORAGE_TYPE:-local} # Amazon S3 Config STORAGE_S3_KEY=${STORAGE_S3_KEY:-false} STORAGE_S3_SECRET=${STORAGE_S3_SECRET:-false} @@ -53,6 +57,22 @@ if [ ! -f ".env" ]; then # General auth AUTH_METHOD=${AUTH_METHOD:-standard} + # SAML Settings + SAML2_NAME=${SAML2_NAME} + SAML2_EMAIL_ATTRIBUTE=${SAML2_EMAIL_ATTRIBUTE} + SAML2_EXTERNAL_ID_ATTRIBUTE=${SAML2_EXTERNAL_ID_ATTRIBUTE} + SAML2_DISPLAY_NAME_ATTRIBUTES=${SAML2_DISPLAY_NAME_ATTRIBUTES} + SAML2_IDP_ENTITYID=${SAML2_IDP_ENTITYID} + SAML2_AUTOLOAD_METADATA=${SAML2_AUTOLOAD_METADATA:-false} + SAML2_IDP_SSO=${SAML2_IDP_SSO} + SAML2_IDP_SLO=${SAML2_IDP_SLO} + SAML2_IDP_x509=${SAML2_IDP_x509} + + # Groups SAML Settings + SAML2_USER_TO_GROUPS=${SAML2_USER_TO_GROUPS:-false} + SAML2_GROUP_ATTRIBUTE=${SAML2_GROUP_ATTRIBUTE} + SAML2_REMOVE_FROM_GROUPS=${SAML2_REMOVE_FROM_GROUPS:-false} + # Social Authentication information. Defaults as off. GITHUB_APP_ID=${GITHUB_APP_ID:-false} GITHUB_APP_SECRET=${GITHUB_APP_SECRET:-false} @@ -78,6 +98,7 @@ if [ ! -f ".env" ]; then MAIL_PASSWORD=${MAIL_PASSWORD:-null} MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null} # URL used for social login redirects, NO TRAILING SLASH + EOF else echo >&2 'error: missing DB_HOST environment variable' @@ -85,6 +106,35 @@ EOF fi fi +if [ ! -f "certs/bookstack.${WIKI_NAME}.cnf" ]; then + mkdir certs + cat > "certs/bookstack.${WIKI_NAME}.cnf" < Date: Thu, 6 May 2021 11:58:50 +0200 Subject: [PATCH 02/22] add ln commande for certs --- docker-entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7aa189ac..90c3ae29 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -133,6 +133,8 @@ if [ ! -f "certs/bookstack.${WIKI_NAME}.cnf" ]; then EOF echo "Generate SAML Certs" openssl req -new -x509 -config certs/bookstack.${WIKI_NAME}.cnf -text -out certs/sp-cert.pem -days 3650 + ln certs/sp-cert.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-cert.pem + ln certs/sp-key.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-key.pem fi echoerr "wait-for-db: waiting for ${DB_HOST_NAME}:${DB_PORT}" From 8fee5ca919143e1b8af28fed78cfd2eddeaf04d1 Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 6 May 2021 13:45:06 +0200 Subject: [PATCH 03/22] corr bug certificate generation --- docker-entrypoint.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 90c3ae29..6aa65891 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -107,7 +107,7 @@ EOF fi if [ ! -f "certs/bookstack.${WIKI_NAME}.cnf" ]; then - mkdir certs + mkdir -p certs cat > "certs/bookstack.${WIKI_NAME}.cnf" < Date: Thu, 6 May 2021 15:19:31 +0200 Subject: [PATCH 04/22] corr bug certif --- Dockerfile | 2 +- docker-entrypoint.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71d18ac0..e13f885f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,7 @@ WORKDIR /var/www/bookstack # www-data USER 33 -VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads","/var/www/html/vendor/onelogin/php-saml/certs"] +VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads"] ENV RUN_APACHE_USER=www-data \ RUN_APACHE_GROUP=www-data diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6aa65891..7162f994 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -44,7 +44,7 @@ if [ ! -f ".env" ]; then # Storage STORAGE_TYPE=${STORAGE_TYPE:-local} - STORAGE_TYPE=${STORAGE_TYPE:-local} + STORAGE_IMAGE_TYPE=${STORAGE_TYPE:-local} # Amazon S3 Config STORAGE_S3_KEY=${STORAGE_S3_KEY:-false} STORAGE_S3_SECRET=${STORAGE_S3_SECRET:-false} @@ -121,7 +121,7 @@ if [ ! -f "certs/bookstack.${WIKI_NAME}.cnf" ]; then x509_extensions=ext # customize the "default_keyfile,", "CN" and "subjectAltName" lines below - default_keyfile=sp-key.pem + default_keyfile=certs/sp-key.pem [dn] CN=${WIKI_NAME}.${DOMAIN_NAME} From dd4b9231e96aca9e9b2660392b75935988cc208c Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 6 May 2021 15:21:21 +0200 Subject: [PATCH 05/22] corr bug certif --- docker-entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7162f994..56767a48 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -136,6 +136,7 @@ EOF fi if [ ! -f "certs/sp-cert.pem" ]; then + mkdir -p /var/www/html/vendor/onelogin/php-saml/certs cp certs/sp-cert.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-cert.pem cp certs/sp-key.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-key.pem fi From 02ffd5b4a93c876ac6523f0f0b937a16022a4dc8 Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 6 May 2021 15:24:16 +0200 Subject: [PATCH 06/22] corr bug certif --- docker-entrypoint.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 56767a48..cf831686 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -135,11 +135,10 @@ EOF openssl req -new -x509 -config ./certs/bookstack.${WIKI_NAME}.cnf -text -out ./certs/sp-cert.pem -days 3650 fi -if [ ! -f "certs/sp-cert.pem" ]; then - mkdir -p /var/www/html/vendor/onelogin/php-saml/certs - cp certs/sp-cert.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-cert.pem - cp certs/sp-key.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-key.pem -fi +mkdir -p /var/www/html/vendor/onelogin/php-saml/certs +cp certs/sp-cert.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-cert.pem +cp certs/sp-key.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-key.pem + echoerr "wait-for-db: waiting for ${DB_HOST_NAME}:${DB_PORT}" From e86c29232f985bbb9b081142f2fe312ca3bdaf4c Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 6 May 2021 16:49:27 +0200 Subject: [PATCH 07/22] first working version --- Dockerfile | 1 + docker-entrypoint.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e13f885f..79e2dc59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ RUN set -x; \ curl \ libzip-dev \ unzip \ + nano \ \ && docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy \ && docker-php-ext-configure ldap \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index cf831686..0c7d8788 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -136,8 +136,8 @@ EOF fi mkdir -p /var/www/html/vendor/onelogin/php-saml/certs -cp certs/sp-cert.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-cert.pem -cp certs/sp-key.pem /var/www/html/vendor/onelogin/php-saml/certs/sp-key.pem +cp certs/sp-cert.pem /var/www/bookstack/vendor/onelogin/php-saml/certs/sp.crt +cp certs/sp-key.pem /var/www/bookstack/vendor/onelogin/php-saml/certs/sp.key echoerr "wait-for-db: waiting for ${DB_HOST_NAME}:${DB_PORT}" From 8e3b5ec43b26dde8c2a3e0c141e61bda78fb605a Mon Sep 17 00:00:00 2001 From: gritzman Date: Tue, 11 May 2021 16:16:40 +0200 Subject: [PATCH 08/22] add subfolder compatibility to work with ingress (rancher) --- Dockerfile | 9 ++++---- bookstack.conf | 49 ++++++++++++++++++++++++++------------------ docker-entrypoint.sh | 10 +++++++-- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79e2dc59..eb1b745d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,11 +44,11 @@ RUN a2enmod rewrite remoteip; \ } > /etc/apache2/conf-available/remoteip.conf; \ a2enconf remoteip +COPY bookstack.conf /etc/apache2/sites-available/000-default.conf + RUN set -ex; \ sed -i "s/Listen 80/Listen 8080/" /etc/apache2/ports.conf; \ - sed -i "s/VirtualHost *:80/VirtualHost *:8080/" /etc/apache2/sites-available/*.conf - -COPY bookstack.conf /etc/apache2/sites-available/000-default.conf + sed -i "s/VirtualHost *:80/VirtualHost *:8080/" /etc/apache2/sites-available/*.conf COPY --from=bookstack --chown=33:33 /bookstack/ /var/www/bookstack/ @@ -60,7 +60,8 @@ 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 + && chown -R www-data:www-data /var/www/bookstack \ + && chown -R www-data:www-data /etc/apache2/sites-available COPY php.ini /usr/local/etc/php/php.ini COPY docker-entrypoint.sh /bin/docker-entrypoint.sh diff --git a/bookstack.conf b/bookstack.conf index 8f2b1fbf..ff9e425f 100644 --- a/bookstack.conf +++ b/bookstack.conf @@ -1,23 +1,32 @@ - # The ServerName directive sets the request scheme, hostname and port that - # the server uses to identify itself. This is used when creating - # redirection URLs. In the context of virtual hosts, the ServerName - # specifies what hostname must appear in the request's Host: header to - # match this virtual host. For the default virtual host (this file) this - # value is not decisive as it is used as a last resort host regardless. - # However, you must set it for any further virtual host explicitly. - ServerName bookstack + ServerName bookstack + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html - DocumentRoot /var/www/bookstack/public + # BookStack Configuration + Alias "/WIKI_NAME" "/var/www/bookstack/public" - - Options FollowSymLinks MultiViews - AllowOverride All - Require all granted - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - LogLevel info - + + Options FollowSymlinks + AllowOverride none + Require all granted + + RewriteEngine On + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)/$ /$1 [L,R=301] + + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + + + + + AllowOverride None + Require all denied + + # End BookStack Configuration + + \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 0c7d8788..59a9094a 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,6 +7,7 @@ echoerr() { echo "$@" 1>&2; } IFS=":" read -r DB_HOST_NAME DB_PORT <<< "$DB_HOST" DB_PORT=${DB_PORT:-3306} +# create .env file if not there if [ ! -f ".env" ]; then if [[ "${DB_HOST}" ]]; then cat > ".env" < "certs/bookstack.${WIKI_NAME}.cnf" < Date: Mon, 17 May 2021 15:57:49 +0200 Subject: [PATCH 09/22] remove redirect when end with '/' --- bookstack.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/bookstack.conf b/bookstack.conf index ff9e425f..f1b4b245 100644 --- a/bookstack.conf +++ b/bookstack.conf @@ -12,9 +12,6 @@ Require all granted RewriteEngine On - # Redirect Trailing Slashes If Not A Folder... - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d From baa64c18993cc16948c069c2e2aa3a36bef404c6 Mon Sep 17 00:00:00 2001 From: gritzman Date: Tue, 18 May 2021 12:16:55 +0200 Subject: [PATCH 10/22] update to bookstack 21.04.5 and update README --- Dockerfile | 2 +- README.md | 98 +++--------------------------------------------------- 2 files changed, 5 insertions(+), 95 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb1b745d..4d393b41 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.5 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/README.md b/README.md index 12d0cdb0..d37829f3 100644 --- a/README.md +++ b/README.md @@ -1,103 +1,13 @@ ## 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") +This fork mainly focus to host multiple BookStack Instances on K8s in subdirectories (wiki.example.com/wiki1, wiki.example.com/wiki2, ...) without root privileges -## Current Version: [0.31.6](https://github.com/SolidNerd/docker-bookstack/blob/master/Dockerfile) +## Current Version: [21.04.5] ### Changes -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` - -### Quickstart - -With Docker Compose is a Quickstart very easy. Run the following command: - -``` -docker-compose up -``` - -and after that open your Browser and go to [http://localhost:8080](http://localhost:8080) . You can login with username 'admin@admin.com' and password 'password'. - -### Issues - -If you have any issues feel free to create an [issue on GitHub](https://github.com/solidnerd/docker-bookstack/issues). - - -### How to use the Image without Docker compose - -Note that if you want to use LDAP, `$` has to be escape like `\$`, i.e. `-e "LDAP_USER_FILTER"="(&(uid=\${user}))"` - -Networking changed in Docker v1.9, so you need to do one of the following steps. - -#### Docker < v1.9 - -1. MySQL Container: - -```bash -docker run -d \ --p 3306:3306 \ --e MYSQL_ROOT_PASSWORD=secret \ --e MYSQL_DATABASE=bookstack \ --e MYSQL_USER=bookstack \ --e MYSQL_PASSWORD=secret \ ---name bookstack_db \ -mysql:5.7.21 -``` -2. BookStack Container: - -```bash -docker run -d --link bookstack_db_:mysql \ --p 8080:8080 \ ---name bookstack_0.31.6 \ -solidnerd/bookstack:0.31.6 -``` - -#### Docker 1.9+ - -1. Create a shared network: - -```bash -docker network create bookstack_nw -``` - -2. Run MySQL container : - -```bash -docker run -d --net bookstack_nw \ --e MYSQL_ROOT_PASSWORD=secret \ --e MYSQL_DATABASE=bookstack \ --e MYSQL_USER=bookstack \ --e MYSQL_PASSWORD=secret \ - --name="bookstack_db" \ - mysql:5.7.21 -``` - -3. Run BookStack Container - -```bash -docker run -d --net bookstack_nw \ --e DB_HOST=bookstack_db:3306 \ --e DB_DATABASE=bookstack \ --e DB_USERNAME=bookstack \ --e DB_PASSWORD=secret \ --p 8080:8080 \ ---name="bookstack_0.31.6" \ - solidnerd/bookstack:0.31.6 -``` - -#### Volumes -To access your `.env` file and important bookstack folders on your host system change `` in the following line to your host directory and add it then to your run command: - -```bash ---mount type=bind,source=/.env,target=/var/www/bookstack/.env \ --v :/var/www/bookstack/public/uploads \ --v :/var/www/bookstack/storage/uploads -``` -In case of a windows host machine the .env file has to be already created in the host directory otherwise a folder named .env will be created. - -After these steps you can visit [http://localhost:8080](http://localhost:8080) . You can login with username 'admin@admin.com' and password 'password'. +Update to bookstack 21.04.5, added more environement variables (mainly for SAML auth) and mainly focus to host on K8s with subdirectory bookstack install (=> Multiple BookStack Instances with Ingress) ### 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/solidnerd/docker-bookstack). From 191006727642018a272549decba4e2ad2f60dd17 Mon Sep 17 00:00:00 2001 From: Occyss <38866739+Occyss@users.noreply.github.com> Date: Fri, 28 May 2021 08:40:59 +0200 Subject: [PATCH 11/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d37829f3..00ea23c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Docker Image For [BookStack](https://github.com/ssddanbrown/BookStack) -This fork mainly focus to host multiple BookStack Instances on K8s in subdirectories (wiki.example.com/wiki1, wiki.example.com/wiki2, ...) without root privileges +This fork mainly focus to host multiple BookStack Instances on K8s in subdirectories (example.com/wiki1, example.com/wiki2, ...) without root privileges ## Current Version: [21.04.5] From deff1cee0449ea74fb4f158c5413a859f2c9b039 Mon Sep 17 00:00:00 2001 From: Occyss <38866739+Occyss@users.noreply.github.com> Date: Fri, 28 May 2021 08:42:14 +0200 Subject: [PATCH 12/22] Update to 21.04.5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 46214d1f..0c7feb09 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.31.6 +21.04.5 From e693ce68ea0d2172bd7cbe42d8bcbdfb9b43c2f9 Mon Sep 17 00:00:00 2001 From: gritzman Date: Mon, 21 Jun 2021 09:17:49 +0200 Subject: [PATCH 13/22] update to v21.05.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d393b41..2cee17fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3 as bookstack -ENV BOOKSTACK_VERSION=21.04.5 +ENV BOOKSTACK_VERSION=21.05.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 \ From bb7240eb904835a356e4f1ade893f1d2c68720f7 Mon Sep 17 00:00:00 2001 From: gritzman Date: Wed, 30 Jun 2021 15:06:58 +0200 Subject: [PATCH 14/22] add db_init to solve set of DB on cluster Mysql --- docker-entrypoint.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 59a9094a..1a9c3824 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -167,8 +167,58 @@ echo "Generating Key..." php artisan key:generate --show echo "Starting Migration..." +# DB first set up +if [[ "${DB_INIT}" == true ]]; then + echo "Starting Initialisation..." + cat > "initdb1.php" <setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + \$sql = "ALTER TABLE pages DROP COLUMN template"; + // Prepare statement + \$stmt = \$conn->prepare(\$sql); + + // execute the query + \$stmt->execute(); + + // echo a message to say the UPDATE succeeded + echo \$stmt->rowCount(); + } catch(PDOException \$e) { + echo \$sql . "
" . \$e->getMessage(); + } + \$conn = null; + ?> +EOF + cat > "initdb2.php" <setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + \$sql = "ALTER TABLE users DROP COLUMN slug"; + // Prepare statement + \$stmt = \$conn->prepare(\$sql); + + // execute the query + \$stmt->execute(); + + // echo a message to say the UPDATE succeeded + echo \$stmt->rowCount(); + } catch(PDOException \$e) { + echo \$sql . "
" . \$e->getMessage(); + } + \$conn = null; + ?> +EOF + cat initdb1.php + php artisan migrate --force || php initdb1.php + php artisan migrate --force || php initdb2.php +fi php artisan migrate --force + echo "Clearing caches..." php artisan cache:clear php artisan view:clear From 2333e7b90d59ea9d95369c7e6b61d3dc5ec0a91c Mon Sep 17 00:00:00 2001 From: gritzman Date: Thu, 11 Nov 2021 11:40:56 +0100 Subject: [PATCH 15/22] update to bookstack v21.10.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2cee17fc..11f1fdd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3 as bookstack -ENV BOOKSTACK_VERSION=21.05.2 +ENV BOOKSTACK_VERSION=21.10.3 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 \ From db79880346e6d923001651788c5f2d5638303ad4 Mon Sep 17 00:00:00 2001 From: Occyss <38866739+Occyss@users.noreply.github.com> Date: Thu, 11 Nov 2021 11:48:00 +0100 Subject: [PATCH 16/22] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00ea23c9..1264c178 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ This fork mainly focus to host multiple BookStack Instances on K8s in subdirectories (example.com/wiki1, example.com/wiki2, ...) without root privileges -## Current Version: [21.04.5] +## Current Version: [v21.10.3] ### Changes -Update to bookstack 21.04.5, added more environement variables (mainly for SAML auth) and mainly focus to host on K8s with subdirectory bookstack install (=> Multiple BookStack Instances with Ingress) +Update to bookstack v21.10.3, added more environement variables (mainly for SAML auth) and mainly focus to host on K8s with subdirectory bookstack install (=> Multiple BookStack Instances with Ingress) ### Inspiration From 500551107bc5d6fb4f7e952c5d28b4b2e84358c8 Mon Sep 17 00:00:00 2001 From: gritzman Date: Tue, 25 Jan 2022 14:04:46 +0100 Subject: [PATCH 17/22] update to 21.12.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 11f1fdd3..95ff9645 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3 as bookstack -ENV BOOKSTACK_VERSION=21.10.3 +ENV BOOKSTACK_VERSION=21.12.3 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 \ From dcbabb976fbf444d93f61626d2fc50ea798d9b33 Mon Sep 17 00:00:00 2001 From: Occyss <38866739+Occyss@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:09:53 +0100 Subject: [PATCH 18/22] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0c7feb09..a57a241d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -21.04.5 +21.12.3 From 63576165be4dc92dd64099f1243daa4d76d9dcfc Mon Sep 17 00:00:00 2001 From: gritzman Date: Fri, 28 Jan 2022 09:11:00 +0100 Subject: [PATCH 19/22] Update PHP --- Dockerfile | 6 ++---- php.ini | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95ff9645..395ff96d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN set -x; \ && tar xvf bookstack.tar.gz -C /bookstack --strip-components=1 \ && rm bookstack.tar.gz -FROM php:7.4-apache-buster as final +FROM php:8.1-apache-buster as final RUN set -x; \ apt-get update \ && apt-get install -y --no-install-recommends \ @@ -52,13 +52,11 @@ RUN set -ex; \ COPY --from=bookstack --chown=33:33 /bookstack/ /var/www/bookstack/ -ARG COMPOSER_VERSION=1.10.16 +ARG COMPOSER_VERSION=2.1.12 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 /var/www/bookstack \ && chown -R www-data:www-data /etc/apache2/sites-available diff --git a/php.ini b/php.ini index 8c04c367..531422a7 100644 --- a/php.ini +++ b/php.ini @@ -1,4 +1,4 @@ [PHP] -post_max_size = 10M -upload_max_filesize = 10M +post_max_size = 100M +upload_max_filesize = 100M From 77435424a29e775c3642a92620210a151647a802 Mon Sep 17 00:00:00 2001 From: gritzman Date: Fri, 28 Jan 2022 09:11:45 +0100 Subject: [PATCH 20/22] Update 21.12.3 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1264c178..79f3a510 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ This fork mainly focus to host multiple BookStack Instances on K8s in subdirectories (example.com/wiki1, example.com/wiki2, ...) without root privileges -## Current Version: [v21.10.3] +## Current Version: [21.12.3] ### Changes -Update to bookstack v21.10.3, added more environement variables (mainly for SAML auth) and mainly focus to host on K8s with subdirectory bookstack install (=> Multiple BookStack Instances with Ingress) +Update to bookstack 21.12.3, added more environement variables (mainly for SAML auth) and mainly focus to host on K8s with subdirectory bookstack install (=> Multiple BookStack Instances with Ingress) ### Inspiration From 5b16f7990344d287d00b3264a3b3230e398b5bba Mon Sep 17 00:00:00 2001 From: gritzman Date: Fri, 28 Jan 2022 10:12:03 +0100 Subject: [PATCH 21/22] Add ENV var --- docker-entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 1a9c3824..c01b21d0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -100,6 +100,13 @@ if [ ! -f ".env" ]; then MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null} # URL used for social login redirects, NO TRAILING SLASH + # Allow