diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c69588f..87ce20b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v1.7.6-1] - 2025-01-10 +### Changed +- [#233] Update Makefiles to 9.5.0 +- [#233] Update Baseimage to 21.0.5-1 + +### Security +- [#235] Update spring-boot-starter-parent to 3.3.7 to prevent CVE-2024-56337 + ## [v1.7.5-1] - 2024-11-27 ### Changed - [#231] Update spring-boot-starter-parent to 3.3.5 to prevent CVE-2024-52316 diff --git a/Dockerfile b/Dockerfile index 3070403e..67f2c19f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,9 @@ RUN set -x \ -FROM registry.cloudogu.com/official/java:21.0.4-3 +FROM registry.cloudogu.com/official/java:21.0.5-1 LABEL NAME="official/smeagol" \ - VERSION="1.7.5-1" \ + VERSION="1.7.6-1" \ maintainer="hello@cloudogu.com" ENV SERVICE_TAGS=webapp \ diff --git a/Makefile b/Makefile index 7f1c1480..feb38e8d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -MAKEFILES_VERSION=9.2.1 +MAKEFILES_VERSION=9.5.0 .DEFAULT_GOAL:=dogu-release diff --git a/build/make/build.mk b/build/make/build.mk index 857c11d4..d3581de3 100644 --- a/build/make/build.mk +++ b/build/make/build.mk @@ -3,7 +3,7 @@ ADDITIONAL_LDFLAGS?=-extldflags -static LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)" GOIMAGE?=golang -GOTAG?=1.22 +GOTAG?=1.23 GOOS?=linux GOARCH?=amd64 PRE_COMPILE?= diff --git a/build/make/k8s-dogu.tpl b/build/make/k8s-dogu.tpl index 296da650..91e2bb2f 100644 --- a/build/make/k8s-dogu.tpl +++ b/build/make/k8s-dogu.tpl @@ -1,4 +1,4 @@ -apiVersion: k8s.cloudogu.com/v1 +apiVersion: k8s.cloudogu.com/v2 kind: Dogu metadata: name: NAME diff --git a/build/make/prerelease.mk b/build/make/prerelease.mk new file mode 100644 index 00000000..c2cc39cd --- /dev/null +++ b/build/make/prerelease.mk @@ -0,0 +1,6 @@ +# used to create switch the dogu to a prerelease namespace +# e.g. official/usermgmt -> prerelease_official/usermgmt + +.PHONY: prerelease_namespace +prerelease_namespace: + build/make/stagex.sh prerelease_namespace \ No newline at end of file diff --git a/build/make/prerelease.sh b/build/make/prerelease.sh new file mode 100644 index 00000000..d976d956 --- /dev/null +++ b/build/make/prerelease.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +prerelease_namespace() { + + # Update version in dogu.json + if [ -f "dogu.json" ]; then + echo "Updating name in dogu.json..." + ORIG_NAME="$(jq -r ".Name" ./dogu.json)" + PRERELEASE_NAME="prerelease_${ORIG_NAME}" + jq ".Name = \"${PRERELEASE_NAME}\"" dogu.json >dogu2.json && mv dogu2.json dogu.json + jq ".Image = \"registry.cloudogu.com/${PRERELEASE_NAME}\"" dogu.json >dogu2.json && mv dogu2.json dogu.json + fi + + # Update version in Dockerfile + if [ -f "Dockerfile" ]; then + echo "Updating version in Dockerfile..." + ORIG_NAME="$(grep -oP "^[ ]*NAME=\"([^\"]*)" Dockerfile | awk -F "\"" '{print $2}')" + PRERELEASE_NAME="prerelease_$( echo -e "$ORIG_NAME" | sed 's/\//\\\//g' )" + sed -i "s/\(^[ ]*NAME=\"\)\([^\"]*\)\(.*$\)/\1${PRERELEASE_NAME}\3/" Dockerfile + fi + +} + + +TYPE="${1}" + +echo ${TYPE} +if [[ "${TYPE}" == "prerelease_namespace" ]];then + prerelease_namespace +fi \ No newline at end of file diff --git a/build/make/release.sh b/build/make/release.sh index ae9a7228..6d6388e4 100755 --- a/build/make/release.sh +++ b/build/make/release.sh @@ -56,6 +56,7 @@ fi update_versions "${NEW_RELEASE_VERSION}" update_changelog "${NEW_RELEASE_VERSION}" "${FIXED_CVE_LIST}" +update_releasenotes "${NEW_RELEASE_VERSION}" show_diff if [[ -n "${DRY_RUN}" ]]; then diff --git a/build/make/release_functions.sh b/build/make/release_functions.sh index 499c2489..f3e1636f 100755 --- a/build/make/release_functions.sh +++ b/build/make/release_functions.sh @@ -207,6 +207,50 @@ update_changelog() { git commit -m "Update changelog" } +update_releasenotes() { + local NEW_RELEASE_VERSION="${1}" + + # ReleaseNotes update + local CURRENT_DATE + CURRENT_DATE=$(date --rfc-3339=date) + local NEW_RELEASENOTE_TITLE="## [v${NEW_RELEASE_VERSION}] - ${CURRENT_DATE}" + rm -rf ".rn_changed" + find . -name "*release_notes*.md" -print0 | while read -d $'\0' file + do + # Check if "Unreleased" tag exists + while ! grep --silent "## \[Unreleased\]" "${file}"; do + echo "" + echo -e "\e[31mYour ${file} does not contain a \"## [Unreleased]\" line!\e[0m" + echo "Please add one to make it comply to https://keepachangelog.com/en/1.0.0/" + wait_for_ok "Please insert a \"## [Unreleased]\" line into ${file} now." + done + + # Add new title line to changelog + sed -i "s|## \[Unreleased\]|## \[Unreleased\]\n\n${NEW_RELEASENOTE_TITLE}|g" "${file}" + echo "Processed ${file}" + echo true > ".rn_changed" + done + + if test -f ".rn_changed" ; then + # Wait for user to validate changelog changes + wait_for_ok "Please make sure your release notes looks as desired." + + find . -name "*release_notes*.md" -print0 | while read -d $'\0' file + do + # Check if new version tag still exists + while ! grep --silent "$(echo $NEW_RELEASENOTE_TITLE | sed -e 's/[]\/$*.^[]/\\&/g')" "${file}"; do + echo "" + echo -e "\e[31mYour ${file} does not contain \"${NEW_RELEASENOTE_TITLE}\"!\e[0m" + wait_for_ok "Please update your ${file} now." + done + git add "${file}" + done + + git commit -m "Update ReleaseNotes" + fi + rm -rf ".rn_changed" +} + # addFixedCVEListFromReRelease is used in dogu cve releases. The method adds the fixed CVEs under the ### Fixed header # in the unreleased section. addFixedCVEListFromReRelease() { diff --git a/build/make/self-update.mk b/build/make/self-update.mk index 175f8a65..33a6a727 100644 --- a/build/make/self-update.mk +++ b/build/make/self-update.mk @@ -19,4 +19,9 @@ remove-old-files: .PHONY: copy-new-files copy-new-files: - @cp -r $(TMP_DIR)/makefiles-$(MAKEFILES_VERSION)/build/make $(BUILD_DIR) \ No newline at end of file + @cp -r $(TMP_DIR)/makefiles-$(MAKEFILES_VERSION)/build/make $(BUILD_DIR) + +.PHONY: update-build-libs +update-build-libs: + @echo "Check for newer Build-Lib versions" + build/make/self-update.sh buildlibs \ No newline at end of file diff --git a/build/make/self-update.sh b/build/make/self-update.sh new file mode 100755 index 00000000..72df125c --- /dev/null +++ b/build/make/self-update.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +TYPE="${1}" + +update_build_libs() { + echo "Get newest version of ces-build-lib and dogu-build-lib" + update_jenkinsfile + echo "Newest Versions set. Please check your Jenkinsfile" +} + +get_highest_version() { + local target="${1}" + local gitCesBuildLib + # getting tags from ces-build.libs OR dogu-build-libs + gitCesBuildLib="$(git ls-remote --tags --refs https://github.com/cloudogu/${target}-build-lib)" + local highest + # Flagfile for getting results out of while-loop + rm -rf .versions + while IFS= read -r line; do + local version + version="$(awk -F'/tags/' '{ for(i=1;i<=NF;i++) print $i }' <<< $line | tail -n 1 | sed 's/[^0-9\.]*//g')" + if [[ $version == *"."* ]] ; then + echo $version >> ".versions" + fi + done <<< "$gitCesBuildLib" + highest=$(sort .versions | tail -n 1) + rm -rf .versions + echo "${highest}" +} + +# Patch Jenkinsfile +update_jenkinsfile() { + sed -i "s/ces-build-lib@[[:digit:]].[[:digit:]].[[:digit:]]/ces-build-lib@$(get_highest_version ces)/g" Jenkinsfile + sed -i "s/dugu-build-lib@[[:digit:]].[[:digit:]].[[:digit:]]/dogu-build-lib@$(get_highest_version dogu)/g" Jenkinsfile +} + +# switch for script entrypoint +if [[ "${TYPE}" == "buildlibs" ]];then + update_build_libs +else + echo "Unknown target ${TYPE}" +fi + + + diff --git a/build/make/static-analysis.mk b/build/make/static-analysis.mk index 0ed0de33..00c406f2 100644 --- a/build/make/static-analysis.mk +++ b/build/make/static-analysis.mk @@ -2,12 +2,12 @@ STATIC_ANALYSIS_DIR=$(TARGET_DIR)/static-analysis GOIMAGE?=golang -GOTAG?=1.22 +GOTAG?=1.23 CUSTOM_GO_MOUNT?=-v /tmp:/tmp REVIEW_DOG=$(TMP_DIR)/bin/reviewdog LINT=$(TMP_DIR)/bin/golangci-lint -LINT_VERSION?=v1.58.2 +LINT_VERSION?=v1.61.0 # ignore tests and mocks LINTFLAGS=--tests=false --exclude-files="^.*_mock.go$$" --exclude-files="^.*/mock.*.go$$" --timeout 10m --issues-exit-code 0 ADDITIONAL_LINTER=-E bodyclose -E containedctx -E contextcheck -E decorder -E dupl -E errname -E forcetypeassert -E funlen -E unparam diff --git a/docs/gui/release_notes_de.md b/docs/gui/release_notes_de.md index b3fee6d4..abeed86a 100644 --- a/docs/gui/release_notes_de.md +++ b/docs/gui/release_notes_de.md @@ -4,7 +4,12 @@ Im Folgenden finden Sie die Release Notes für Smeagol. Technische Details zu einem Release finden Sie im zugehörigen [Changelog](https://docs.cloudogu.com/de/docs/dogus/smeagol/CHANGELOG/). -## Unreleased +## [Unreleased] + +## [v1.7.6-1] - 2025-01-10 + +**Das Release behebt eine kritische Sicherheitslücke ([CVE-2024-56337](https://github.com/advisories/GHSA-27hp-xhwr-wr2m)). Ein Update ist daher empfohlen.** + Wir haben nur technische Änderungen vorgenommen. Näheres finden Sie in den Changelogs. ## 1.7.5-1 diff --git a/docs/gui/release_notes_en.md b/docs/gui/release_notes_en.md index 3a43bc11..84d1e870 100644 --- a/docs/gui/release_notes_en.md +++ b/docs/gui/release_notes_en.md @@ -4,7 +4,11 @@ Below you will find the release notes for Smeagol. Technical details on a release can be found in the corresponding [Changelog](https://docs.cloudogu.com/en/docs/dogus/smeagol/CHANGELOG/). -## Unreleased +## [Unreleased] + +## [v1.7.6-1] - 2025-01-10 +**The release fixes a critical security vulnerability ([CVE-2024-56337](https://github.com/advisories/GHSA-27hp-xhwr-wr2m)). An update is therefore recommended.** + We have only made technical changes. You can find more details in the changelogs. ## 1.7.5-1 diff --git a/dogu.json b/dogu.json index abe4f927..72fd0dc9 100644 --- a/dogu.json +++ b/dogu.json @@ -1,6 +1,6 @@ { "Name": "official/smeagol", - "Version": "1.7.5-1", + "Version": "1.7.6-1", "DisplayName": "Smeagol", "Description": "Store your technical documentation with in your git repositories", "Category": "Development Apps", diff --git a/package.json b/package.json index 434fa8a5..59f0efbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smeagol", - "version": "1.7.5-1", + "version": "1.7.6-1", "private": true, "license": "AGPL-3.0-only", "dependencies": { diff --git a/pom.xml b/pom.xml index 6eeebc5c..2f7f8c34 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,13 @@ org.springframework.boot spring-boot-starter-parent - 3.3.5 + 3.3.7 com.cloudogu.wiki smeagol - 1.7.5-1 + 1.7.6-1 smeagol war @@ -39,7 +39,7 @@ org.springframework spring-web - 6.1.15 + 6.1.16