diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index cd67048d..aa4dcbcf 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -10,21 +10,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up CI Image Metadata id: docker_meta_ci - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: solidnerd/bookstack-dev tags: | type=sha - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build Image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -37,7 +37,7 @@ jobs: outputs: type=docker,dest=/tmp/image-bookstack.tar - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: image-bookstack-master path: /tmp/image-bookstack.tar @@ -48,10 +48,10 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image-bookstack-master path: /tmp @@ -62,15 +62,15 @@ jobs: docker image ls -a push: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: e2e steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Docker Hub Image Metadata id: docker_meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack tags: | @@ -81,7 +81,7 @@ jobs: type=ref,event=branch - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image-bookstack-master path: /tmp @@ -92,27 +92,27 @@ jobs: docker image ls -a - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - name: Build and Push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2cbf798d..d1bf1e42 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,21 +10,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Docker meta ci id: docker_meta_ci - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: solidnerd/bookstack-dev tags: | type=sha - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build and push Dev - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -38,7 +38,7 @@ jobs: outputs: type=docker,dest=/tmp/image-bookstack.tar - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: image-bookstack path: /tmp/image-bookstack.tar @@ -49,10 +49,10 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image-bookstack path: /tmp diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86cfaa2b..c0f69e6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,21 +10,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up CI Image Metadata id: docker_meta_ci - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: solidnerd/bookstack-dev tags: | type=sha - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build and push Dev - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -37,7 +37,7 @@ jobs: outputs: type=docker,dest=/tmp/image-bookstack.tar - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: image-bookstack-master path: /tmp/image-bookstack.tar @@ -47,10 +47,10 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image-bookstack-master path: /tmp @@ -61,26 +61,33 @@ jobs: docker image ls -a push: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: e2e steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Docker Hub Image Metadata id: docker_meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | solidnerd/bookstack ghcr.io/solidnerd/docker-bookstack + # Blanket-enable "latest" tagging for all of the releases that make it + # this far, as SemVer's pre-release tag is used as a build indicator + # for this project. Note that _actual_ semver build info is not used, + # as it is discarded by almost everything that consumes SemVer (as it + # should be). + flavor: | + latest=true tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}.{{patch}} - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image-bookstack-master path: /tmp @@ -91,27 +98,27 @@ jobs: docker image ls -a - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - name: Build and Push master - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -124,27 +131,25 @@ jobs: cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }} create-release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: push steps: # To use this repository's private action, you must check out the repository - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Generate changelog id: changelog - uses: metcalfc/changelog-generator@v4.1.0 + uses: metcalfc/changelog-generator@v4.6.2 with: myToken: ${{ secrets.GITHUB_TOKEN }} - name: Create Release id: create_release - uses: actions/create-release@v1.1.4 + uses: softprops/action-gh-release@v2 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/Dockerfile b/Dockerfile index a76f4fa7..8ae6d7ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM alpine:3 as bookstack -ENV BOOKSTACK_VERSION=23.02.1 +FROM alpine:3 AS bookstack +ENV BOOKSTACK_VERSION=v25.07.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 \ + curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_VERSION}.tar.gz \ && mkdir -p /bookstack \ && tar xvf bookstack.tar.gz -C /bookstack --strip-components=1 \ && rm bookstack.tar.gz -FROM php:8.2-apache-buster as final +FROM php:8.4-apache-bookworm AS final RUN set -x; \ apt-get update \ && apt-get install -y --no-install-recommends \ @@ -27,10 +27,6 @@ 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 \ && docker-php-ext-install -j$(nproc) ldap \ @@ -54,7 +50,7 @@ COPY bookstack.conf /etc/apache2/sites-available/000-default.conf COPY --from=bookstack --chown=33:33 /bookstack/ /var/www/bookstack/ -ARG COMPOSER_VERSION=2.1.12 +ARG COMPOSER_VERSION=2.7.6 RUN set -x; \ cd /var/www/bookstack \ && curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \ diff --git a/Makefile b/Makefile index 04f6ff2a..ded68cbf 100644 --- a/Makefile +++ b/Makefile @@ -13,13 +13,13 @@ build: -t $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE_DEV):$(DOCKER_INTERNAL_TAG) \ --build-arg VCS_REF=$(DOCKER_INTERNAL_TAG) \ --build-arg BUILD_DATE=$(BUILD_DATE) \ - --build-arg VCS_URL=$(VCS_URL) + --build-arg VCS_URL=$(VCS_URL) push-dev: docker push $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE_DEV):$(DOCKER_INTERNAL_TAG) pull: - docker pull $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE_DEV):$(DOCKER_INTERNAL_TAG) + docker pull $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE_DEV):$(DOCKER_INTERNAL_TAG) release: docker tag $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE_DEV):$(DOCKER_INTERNAL_TAG) $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE):$(DOCKER_RELEASE_TAG) @@ -30,8 +30,8 @@ push-release: docker push $(DOCKER_RELEASE_REG)/$(DOCKER_IMAGE):latest -e2e: - @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker-compose -f docker-compose.test.yml up -d - @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker-compose -f docker-compose.test.yml run --rm sut - @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker-compose -f docker-compose.test.yml down -v +e2e: + @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker compose -f docker-compose.test.yml up -d + @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker compose -f docker-compose.test.yml run --rm sut + @BOOKSTACK_IMAGE="$(DOCKER_RELEASE_REG)/${DOCKER_IMAGE_DEV}:${DOCKER_INTERNAL_TAG}" docker compose -f docker-compose.test.yml down -v diff --git a/README.md b/README.md index 402f1e99..ef5c8966 100644 --- a/README.md +++ b/README.md @@ -1,107 +1,117 @@ -## 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://img.shields.io/github/actions/workflow/status/solidnerd/docker-bookstack/master.yml) +![Latest release](https://img.shields.io/github/v/tag/solidnerd/docker-bookstack?label=Latest%20release) +![GitHub contributors](https://img.shields.io/github/contributors/solidnerd/docker-bookstack) -## Current Version: [23.2.1](https://github.com/SolidNerd/docker-bookstack/blob/master/Dockerfile) +## Changes -### Changes +Users of version 24.2.3 should switch to 24.2.3-1 (or higher); a maintainer +erroneously set image tag 24.2.3 to use 23.2.3 as the release. -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` +Versions higher than 23.6.2 no longer use an in-container `.env` file for +environment variable management. Instead, the preferred approach is to manage +them directly with the container runtime (e.g. Docker's `-e`). This is to +simplify troubleshooting if and when errors occur. The most important change is +that `${APP_KEY}` is no longer provided for you, instead it is up to the +operator to ensure this value is present. Versions prior to this supplied +`${APP_KEY}` (with a default of `SomeRandomStringWith32Characters`. A full +reference of available environment variables is available in the [Bookstack +repository](https://github.com/BookStackApp/BookStack/blob/development/.env.example.complete) -### Quickstart +The version 23.6.0 is broken due to a bad `.env` configuration created by the +entrypoint script. This is fixed in version 23.6.0-1. + +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 +```bash +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'. +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 +## 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 +## 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_23.2.1 \ -solidnerd/bookstack:23.2.1 -``` - -#### Docker 1.9+ +### Docker 1.9+ 1. Create a shared network: -```bash -docker network create bookstack_nw -``` + ```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 -``` + ```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:9.2.0 + ``` 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 \ --e APP_URL=http://example.com \ --p 8080:8080 \ ---name="bookstack_23.2.1" \ - solidnerd/bookstack:23.2.1 -``` - -The APP_URL parameter should be the base URL for your BookStack instance without a trailing slash. For example: -APP_URL=http://example.com - -#### 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 + docker run -d --net bookstack_nw \ + -e DB_HOST=bookstack_db:3306 \ + -e DB_DATABASE=bookstack \ + -e DB_USERNAME=bookstack \ + -e DB_PASSWORD=secret \ + -e APP_URL=http://localhost:8080 \ + -e APP_KEY=SomeRandomStringWith32Characters \ + -p 8080:8080 \ + --name="bookstack_25.7.1" \ + solidnerd/bookstack:25.7.1 + ``` + + The APP_URL parameter should be the base URL for your BookStack instance without + a trailing slash, but including any port numbers. For example: + + `APP_URL=http://example.com` or `APP_URL=http://localhost:8080`. + + The following environment variables are required for Bookstack to start: + - `APP_KEY` + - `APP_URL` + - `DB_HOST` (in the form `${hostname_or_ip_address}:${port}`) + - `DB_DATABASE` + - `DB_USERNAME` + - `DB_PASSWORD` + +### Volumes + +To access your 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'. +After these steps you can visit [http://localhost:8080](http://localhost:8080). +You can login with username `admin@admin.com` and password `password`. -### Inspiration +## 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 +[Kilhog/docker-bookstack](https://github.com/Kilhog/docker-bookstack). Kilhog +did the intial work, but I want to go in a different direction. diff --git a/RELEASE.md b/RELEASE.md index 0f76d129..0db7ced4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,15 +4,33 @@ When the version changes, a new release should be cut. To do this, push a tag with the [valid SemVer][semver-checker] version number as the tag. It may also be useful to update documentation references at the same time. +## Scripts + +Update the Dockerfile with: + +```shell +$ scripts/update_dockerfile.sh +Fetching latest Bookstack release from GitHub API + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 3467 100 3467 0 0 18743 0 --:--:-- --:--:-- --:--:-- 18842 +Found latest version: v24.10.1 +Updating Dockerfile.. +``` + ## Example For Bookstack version 23.01: ```shell -sed -i '' -e 's/22.11.1/23.1.0/g' * # 22.11.1 was the previous version -git commit -am "Update references to version 23.1.0" [-S] +sed -i '' -e 's/22.11.1/23.1.0/g' Dockerfile # 22.11.1 was the previous version +git commit -am "feat: Update Bookstack to version 23.1.0" [-S] +# Build and test this git tag [-s] -a 23.1.0 -m "Release version 23.01" git push --tags +sed -i '' -e 's/22.11.1/23.1.0/g' * # Update documentation to point to the +newer release +git commit -am "doc: update references to version 23.1" ``` The workflow will then build, test, push, and release this image. diff --git a/VERSION b/VERSION index 3f833b5b..f274d3be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -23.2.1 +25.7.1 diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 71e50543..d0116fa7 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,4 +1,3 @@ -version: '2.4' services: sut: image: appropriate/curl @@ -6,7 +5,7 @@ services: depends_on: - bookstack mysql: - image: mysql:8.0 + image: mysql:9.2 environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=bookstack @@ -21,6 +20,7 @@ services: - mysql environment: - APP_URL=http://localhost:${DEV_PORT:-8080} + - APP_KEY=SomeRandomStringWith32Characters - DB_HOST=mysql:3306 - DB_DATABASE=bookstack - DB_USERNAME=bookstack diff --git a/docker-compose.yml b/docker-compose.yml index 4d66fcae..0b3395ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '2' services: mysql: - image: mysql:8.0 + image: mysql:9.2 environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=bookstack @@ -11,7 +10,7 @@ services: - mysql-data:/var/lib/mysql bookstack: - image: solidnerd/bookstack:23.2.1 + image: solidnerd/bookstack:25.7.1 depends_on: - mysql environment: @@ -19,8 +18,16 @@ services: - DB_DATABASE=bookstack - DB_USERNAME=bookstack - DB_PASSWORD=secret - #set the APP_ to the URL of bookstack without without a trailing slash APP_URL=https://example.com - - APP_URL=http://example.com + # Set the APP_ to the URL of bookstack without without a trailing slash, + # but including any port numbers. For example, one of: + # APP_URL=https://example.com + # APP_URL=http://localhost:8080 + # APP_URL=https://wiki.example.com:8443 + - APP_URL=http://localhost:8080 + # APP_KEY is used for encryption where needed, so needs to be persisted to + # preserve decryption abilities. + # Can run `php artisan key:generate` to generate a key + - APP_KEY=SomeRandomStringWith32Characters volumes: - uploads:/var/www/bookstack/public/uploads - storage-uploads:/var/www/bookstack/storage/uploads diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6a2455fa..7d5dea20 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,86 +3,43 @@ set -e echoerr() { echo "$@" 1>&2; } +check_vars_exist() { + var_names=("$@") + + for var_name in "${var_names[@]}"; do + if [ -z "${!var_name}" ]; then + echoerr "error: missing ${var_name} environment variable" + exit 1 + fi + done +} + # Split out host and port from DB_HOST env variable IFS=":" read -r DB_HOST_NAME DB_PORT <<< "$DB_HOST" DB_PORT=${DB_PORT:-3306} -if [ ! -f ".env" ]; then - if [[ "${DB_HOST}" ]]; then - cat > ".env" <&2 'error: missing DB_HOST environment variable' - exit 1 - fi +# Check a number of essential variables are set +check_vars_exist \ + APP_KEY \ + APP_URL \ + DB_DATABASE \ + DB_HOST \ + DB_PASSWORD \ + DB_PORT \ + DB_USERNAME + +if [ -n "${FILE_UPLOAD_SIZE_LIMITS}" ]; then + echo "Note: If you're setting FILE_UPLOAD_SIZE_LIMITS to more than 10M, you" + echo "may also need to modify the php.ini file." + echo "See:" + echo "https://github.com/solidnerd/docker-bookstack/issues/423" fi echoerr "wait-for-db: waiting for ${DB_HOST_NAME}:${DB_PORT}" @@ -102,9 +59,6 @@ else echoerr "wait-for-db: timeout out after 15 seconds waiting for ${DB_HOST_NAME}:${DB_PORT}" fi -echo "Generating Key..." -php artisan key:generate --show - echo "Starting Migration..." php artisan migrate --force diff --git a/php.ini b/php.ini index 8c04c367..3b9c045a 100644 --- a/php.ini +++ b/php.ini @@ -1,4 +1,4 @@ [PHP] - +memory_limit = 256M post_max_size = 10M upload_max_filesize = 10M diff --git a/scripts/update_dockerfile.sh b/scripts/update_dockerfile.sh new file mode 100755 index 00000000..e203e0ff --- /dev/null +++ b/scripts/update_dockerfile.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +echo "Fetching latest Bookstack release from GitHub API" + +BOOKSTACK_VERSION=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/BookstackApp/Bookstack/releases/latest | \ + jq -r .tag_name +) + +echo "Found latest version: ${BOOKSTACK_VERSION}" + +# Get the root of the Git repository in order to correctly path e.g. Dockerfile +GIT_ROOT=$(git rev-parse --show-toplevel) + +echo "Updating Dockerfile.." +sed \ + -i '' \ + -e "s/^ENV BOOKSTACK_VERSION=.*/ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}/" \ + "${GIT_ROOT}/Dockerfile" + +git add "${GIT_ROOT}/Dockerfile" +git commit -S -m "feat: update Dockerfile to use Bookstack ${BOOKSTACK_VERSION}" diff --git a/scripts/update_tags_and_docs.sh b/scripts/update_tags_and_docs.sh new file mode 100755 index 00000000..51c8edec --- /dev/null +++ b/scripts/update_tags_and_docs.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Get the root of the Git repository in order to correctly path e.g. Dockerfile +GIT_ROOT=$(git rev-parse --show-toplevel) + +# Extract the version from the Dockerfile, as there could have been a new +# release since the last run. + +BOOKSTACK_VERSION=$(awk \ + '/ENV BOOKSTACK_VERSION/{split($2,b,"="); print b[2]}' \ + "${GIT_ROOT}/Dockerfile" +) + +echo "Extracted version: ${BOOKSTACK_VERSION}" + +# Remove the 'v' for our tags +BOOKSTACK_VERSION="${BOOKSTACK_VERSION/#v/}" +# Remove leading zeros to make the version fit a SemVer-shaped hole +BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}" + +# If the version only has one decimal dot in it, it doesn't have a patch +# version and one should be added to ensure semver-shape. +BS_DECIMALS="${BOOKSTACK_VERSION//[^.]}" +if [[ "${#BS_DECIMALS}" -eq "1" ]]; then + BOOKSTACK_VERSION="${BOOKSTACK_VERSION}.0" +fi + +echo "Tag name: ${BOOKSTACK_VERSION}" + +read -p "Is the tag name correct? (y/n)" -n 1 -r +echo +if ! [[ "${REPLY}" =~ ^[Yy]$ ]]; then + echo "Aborting.." + exit 1 +fi + +git tag -s -a "${BOOKSTACK_VERSION}" -m "Release version ${BOOKSTACK_VERSION}" +git push --tags + +echo "Extracting old version info.." +OLD_BS_VERSION="$(cat VERSION)" + +echo "Updating README and reference docker-compose.yml.." +sed \ + -i '' \ + -e "s/${OLD_BS_VERSION}/${BOOKSTACK_VERSION}/g" \ + "${GIT_ROOT}/README.md" \ + "${GIT_ROOT}/docker-compose.yml" + +echo "Updating VERSION file.." +echo "${BOOKSTACK_VERSION}" > "${GIT_ROOT}/VERSION" + +git add \ + "${GIT_ROOT}/README.md" \ + "${GIT_ROOT}/docker-compose.yml" \ + "${GIT_ROOT}/VERSION" + +git commit -S -m "doc: update documentation to reference ${BOOKSTACK_VERSION}" +git push pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy