diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4b3e133f..aa4dcbcf 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up CI Image Metadata id: docker_meta_ci @@ -24,7 +24,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build Image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -48,7 +48,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact uses: actions/download-artifact@v4 @@ -62,11 +62,11 @@ jobs: docker image ls -a push: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: e2e steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Docker Hub Image Metadata id: docker_meta @@ -112,7 +112,7 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Build and Push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3a0f9791..d1bf1e42 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Docker meta ci id: docker_meta_ci @@ -24,7 +24,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push Dev - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -49,7 +49,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbc502fb..c0f69e6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up CI Image Metadata id: docker_meta_ci @@ -24,7 +24,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push Dev - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -47,7 +47,7 @@ jobs: needs: build steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Download artifact uses: actions/download-artifact@v4 @@ -61,11 +61,11 @@ jobs: docker image ls -a push: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: e2e steps: - name: Checkout - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Docker Hub Image Metadata id: docker_meta @@ -118,7 +118,7 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Build and Push master - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -131,16 +131,16 @@ jobs: cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }} create-release: - runs-on: ubuntu-22.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@a5ac7e51b41094c92402da3b24376905380afc29 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Generate changelog id: changelog - uses: metcalfc/changelog-generator@v4.3.1 + uses: metcalfc/changelog-generator@v4.6.2 with: myToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index caaf657b..6b3f48c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM alpine:3 as bookstack -ENV BOOKSTACK_VERSION=24.05.2 +FROM alpine:3 AS bookstack +ENV BOOKSTACK_VERSION=v25.02.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 \ + 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.3-apache-bookworm as final +FROM php:8.4-apache-bookworm AS final RUN set -x; \ apt-get update \ && apt-get install -y --no-install-recommends \ diff --git a/Makefile b/Makefile index c5a00a55..ded68cbf 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ push-release: 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 + @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 7a0b2aa0..55d7fd26 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ In 0.12.2 we removed `DB_PORT` . You can now specify the port via `DB_HOST` like With Docker Compose is a Quickstart very easy. Run the following command: ```bash -docker-compose up +docker compose up ``` and after that open your Browser and go to @@ -48,32 +48,6 @@ If you have any issues feel free to create an [issue on GitHub](https://github.c 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_24.5.2 \ - solidnerd/bookstack:24.5.2 - ``` - ### Docker 1.9+ 1. Create a shared network: @@ -91,7 +65,7 @@ Networking changed in Docker v1.9, so you need to do one of the following steps. -e MYSQL_USER=bookstack \ -e MYSQL_PASSWORD=secret \ --name="bookstack_db" \ - mysql:5.7.21 + mysql:9.2.0 ``` 3. Run BookStack Container @@ -102,16 +76,17 @@ Networking changed in Docker v1.9, so you need to do one of the following steps. -e DB_DATABASE=bookstack \ -e DB_USERNAME=bookstack \ -e DB_PASSWORD=secret \ - -e APP_URL=http://example.com \ + -e APP_URL=http://localhost:8080 \ + -e APP_KEY=SomeRandomStringWith32Characters \ -p 8080:8080 \ - --name="bookstack_24.5.2" \ - solidnerd/bookstack:24.5.2 + --name="bookstack_25.2.4" \ + solidnerd/bookstack:25.2.4 ``` The APP_URL parameter should be the base URL for your BookStack instance without - a trailing slash. For example: + a trailing slash, but including any port numbers. For example: - `APP_URL=http://example.com` + `APP_URL=http://example.com` or `APP_URL=http://localhost:8080`. The following environment variables are required for Bookstack to start: - `APP_KEY` @@ -123,19 +98,15 @@ Networking changed in Docker v1.9, so you need to do one of the following steps. ### 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: +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`. diff --git a/RELEASE.md b/RELEASE.md index 9b5e98d8..0db7ced4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,6 +4,20 @@ 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: diff --git a/VERSION b/VERSION index 582c8a58..6d0540a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -24.5.2 +25.2.4 diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 12b773a9..7caf048f 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -6,7 +6,7 @@ services: depends_on: - bookstack mysql: - image: mysql:8.3 + image: mysql:9.2 environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=bookstack diff --git a/docker-compose.yml b/docker-compose.yml index e802ba34..21336660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: mysql: - image: mysql:8.3 + image: mysql:9.2 environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=bookstack @@ -11,7 +11,7 @@ services: - mysql-data:/var/lib/mysql bookstack: - image: solidnerd/bookstack:24.5.2 + image: solidnerd/bookstack:25.2.4 depends_on: - mysql environment: @@ -19,8 +19,12 @@ 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 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