From 8212600d409eb6eb275ba7be09760299ab84cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 21:42:33 +0100 Subject: [PATCH 01/14] Add deploy script usable with rsync and a restricted SSH key --- src/dist/extras/deploy.sh | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/dist/extras/deploy.sh diff --git a/src/dist/extras/deploy.sh b/src/dist/extras/deploy.sh new file mode 100644 index 00000000..6ebd6bf2 --- /dev/null +++ b/src/dist/extras/deploy.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Use this script as forced command of an authorized SSH key: +# command="/home/helma/extras/deploy.sh" ssh-ed25519 AAAAC3NzaC… + +# Define HELMA_HOST and ANTVILLE_HOST in this file +# shellcheck source=/dev/null +. "$HOME"/deploy.env + +case "$SSH_ORIGINAL_COMMAND" in + ping) + echo pong + ;; + + deploy-helma) + rsync ./ "$HELMA_HOST":./ \ + --archive --compress --delete --verbose \ + --filter '+ /bin' \ + --filter '+ /extras' \ + --filter '+ /launcher.jar' \ + --filter '- /lib/ext' \ + --filter '+ /lib' \ + --filter '+ /modules' \ + --filter '- /*' + printf 'Restarting Helma on HELMA_host… ' + ssh "$HELMA_HOST" sudo /bin/systemctl restart helma + ;; + + deploy-antville) + rsync ./apps/antville/ "$ANTVILLE_HOST":./apps/antville/ \ + --archive --compress --delete --verbose \ + --filter '+ /claustra' \ + --filter '+ /code' \ + --filter '+ /compat' \ + --filter '+ /i18n' \ + --filter '+ /lib' \ + --filter '- /*' + rsync ./apps/antville/static/helma/ "$ANTVILLE_HOST":./apps/antville/static/helma/ \ + --archive --compress --verbose \ + --filter '+ /fonts' \ + --filter '+ /formica.html' \ + --filter '+ /img' \ + --filter '+ /scripts' \ + --filter '+ /styles' \ + --filter '- /*' + printf 'Restarting Helma on ANTVILLE_host… ' + ssh "$ANTVILLE_HOST" sudo /bin/systemctl restart helma + ;; + + restart) + printf 'Restarting Helma… ' + sudo /bin/systemctl restart helma + printf '%s\n' 'done.' + ;; + + *) + # Allow any rsync command but restrict it to the installation directory + rrsync -wo /home/helma + ;; +esac From 3a8997ca5c1ca4633178e39233c66080483c8335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 21:58:08 +0100 Subject: [PATCH 02/14] Initial commit --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9bf8429b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build + +on: + push: + paths: + - build.gradle + - settings.gradle + - src/** + - launcher/build.gradle + - launcher/src/** + workflow_dispatch: + +jobs: + build: + runs-on: antville + + strategy: + matrix: + java: [11, 17, 21] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Compile with Gradle + run: ./gradlew :compileJava From 84333d05cd78ed8f849fccf2f33e9f260e322751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 22:04:48 +0100 Subject: [PATCH 03/14] Use fully qualified URL for setup-java action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bf8429b..18fde086 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v4 + uses: https://github.com/actions/setup-java@v4 with: distribution: temurin java-version: ${{ matrix.java }} From 2ff29317e57dce8688ea3d3546b623baa34d6446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 22:09:55 +0100 Subject: [PATCH 04/14] Gradle is installed on the runner --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18fde086..846e2d6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,8 +27,5 @@ jobs: distribution: temurin java-version: ${{ matrix.java }} - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v3 - - name: Compile with Gradle run: ./gradlew :compileJava From 6ebdd6aa31e9900af80567faee2b007114b68944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 22:12:30 +0100 Subject: [PATCH 05/14] Leave aside compiling for different Java versions for now --- .github/workflows/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 846e2d6f..47af9523 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,18 +14,8 @@ jobs: build: runs-on: antville - strategy: - matrix: - java: [11, 17, 21] - steps: - uses: actions/checkout@v4 - - name: Set up Java - uses: https://github.com/actions/setup-java@v4 - with: - distribution: temurin - java-version: ${{ matrix.java }} - - name: Compile with Gradle run: ./gradlew :compileJava From 808bc48ab948135234f301fb36daea04456f033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Fri, 28 Feb 2025 22:13:25 +0100 Subject: [PATCH 06/14] Run the build workflow when itself has changed --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47af9523..69bcdeab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: Build on: push: paths: + - .github/workflows/build.yml - build.gradle - settings.gradle - src/** From d9d3c9b863ac90b650a52e86d280f45e2e7b444e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 1 Mar 2025 01:02:27 +0100 Subject: [PATCH 07/14] Add release notes generated with git-cliff --- .github/workflows/release.yml | 23 ++++++++++++---- cliff.toml | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 cliff.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7aa7874..ac8a3d1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,16 +9,27 @@ permissions: contents: write jobs: - build: + release: runs-on: antville env: GH_TOKEN: ${{ secrets.GH_TOKEN }} LC_TIME: en_US.UTF-8 - TODAY: $(date +'%d %b %Y') steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create release notes + id: create_release_notes + run: | + release_notes=$(npx git-cliff@latest --latest) + # Write the release notes as a heredoc to the workflow output + # ⚠️ No white space around `<<` is crucial! + echo "release_notes<<.eot0x03" >> $GITHUB_OUTPUT + echo "$release_notes" >> $GITHUB_OUTPUT + echo ".eot0x03" >> $GITHUB_OUTPUT - name: Build with Gradle run: ./gradlew assembleDist @@ -29,17 +40,17 @@ jobs: direction: upload url: https://code.host.antville.org token: ${{ github.token }} - title: ${{ env.TODAY }} + title: Helma ${{ github.ref_name }} release-dir: build/distributions - release-notes-assistant: true + release-notes: ${{ steps.create_release_notes.outputs.release_notes }} verbose: true - name: Create release at GitHub run: | gh release create "$GITHUB_REF_NAME" \ --repo "$GITHUB_REPOSITORY" \ - --title "${{ env.TODAY }}" \ - --generate-notes + --title "Helma ${{ github.ref_name }}" \ + --notes "${{ steps.create_release_notes.outputs.release_notes }}" - name: Upload release assets to GitHub run: | diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 00000000..7832044a --- /dev/null +++ b/cliff.toml @@ -0,0 +1,52 @@ +# git-cliff ~ default configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +trim = true + +header = "## Changes" + +body = """ +{% for group, commits in commits | filter(attribute="merge_commit") | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + * [{{ commit.id | split(pat="") | slice(end=11) | join() }}]\ + (https://code.host.antville.org/antville/helma/commit/{{ commit.id }}) \ + {% if commit.breaking %}**Breaking:** {% endif %}\ + {{ commit.message | split(pat="\\n") | first | upper_first }}\ + {% endfor %} +{% endfor %} + +**Full Changelog:** [{{ previous.version }} → {{ version }}]\ +(https://code.host.antville.org/antville/helma/compare/\ +{{ previous.version | urlencode }}..{{ version | urlencode }})\n\n +""" + +footer = """ +Generated by [git-cliff](https://git-cliff.org/). +""" + +[git] +conventional_commits = false +filter_commits = false +filter_unconventional = false +protect_breaking_commits = false +sort_commits = "newest" +split_commits = false +topo_order = false + +commit_parsers = [ + { message = "^Apply \\d+ suggestion", skip = true }, + { message = "^Merge .*(branch|dependabot|dependency|renovate)", skip = true }, + { message = "^Lock file maintenance", skip = true }, + { message = "yarn\\.lock", skip = true }, + + { message = "^[Ff]ix", group = " 🐛 Bug Fixes" }, + { field = "author.name", pattern = "[Rr]enovate|[Dd]ependabot", group = " 📦 Dependency Updates" }, + { message = "^Merge pull request", group = " 🔀 Merges" }, + { message = ".*", group = " Uncategorized" }, +] From e3a77328375c82c597e3d89e624082fe073070e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 1 Mar 2025 19:21:42 +0100 Subject: [PATCH 08/14] Escape HTML elements in commit messages --- cliff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cliff.toml b/cliff.toml index 7832044a..755c4ca2 100644 --- a/cliff.toml +++ b/cliff.toml @@ -17,7 +17,7 @@ body = """ * [{{ commit.id | split(pat="") | slice(end=11) | join() }}]\ (https://code.host.antville.org/antville/helma/commit/{{ commit.id }}) \ {% if commit.breaking %}**Breaking:** {% endif %}\ - {{ commit.message | split(pat="\\n") | first | upper_first }}\ + {{ commit.message | split(pat="\\n") | first | upper_first | escape }}\ {% endfor %} {% endfor %} From 8adbd235698eb0115834cfd4b8b949b59da8f041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 1 Mar 2025 19:32:06 +0100 Subject: [PATCH 09/14] Bump year of copyright notice --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index df5926e7..65dfb884 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 1999-2008 Helma Project. All rights reserved. +Copyright (c) 1999-2025 Helma Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions From 38181e8e00ff646c97ce63b5ba166240847033a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sat, 1 Mar 2025 19:32:20 +0100 Subject: [PATCH 10/14] Update repo URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e93af8d1..f8155df0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## TL;DR - Make sure you have Java 11 or higher installed -- Download and unpack the [latest release](https://github.com/antville/helma/releases) +- Download and unpack the [latest release](https://code.host.antville.org/antville/helma/releases) - Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform - Direct your web browser to From e6c974120bef0438facf6feef66ccd8c8c90191d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Tue, 8 Apr 2025 11:48:37 +0200 Subject: [PATCH 11/14] Update .gitigore file for VSC settings --- .gitignore | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e9557b6a..552a74e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ -.gradle -.idea -.settings +.* + +.vscode/* +!.vscode +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json +!.vscode/tasks.json + build /apps @@ -15,8 +21,8 @@ build /static /*.properties +!/gradle.properties + /launcher.jar /passwd /start.* - -!/gradle.properties From 8caf790529de288e92a3e5e194557aa2886b9ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Tue, 8 Apr 2025 11:50:21 +0200 Subject: [PATCH 12/14] Remove custom configuration of Gradle sourceSets Using the sources in build creates a lot of confusion in VSC --- build.gradle | 9 --------- 1 file changed, 9 deletions(-) diff --git a/build.gradle b/build.gradle index 9bde766c..63d5400e 100644 --- a/build.gradle +++ b/build.gradle @@ -42,15 +42,6 @@ if (JavaVersion.current().isJava8Compatible()) { } } -sourceSets { - main { - java { - // Sources in `src` will be available here after processing - srcDirs = ["$buildDir/src/main/java"] - } - } -} - configurations { // Wrapping implementation because it does not allow access to its files // (i.e. cannot be resolved) From f786b40961fabc009eafa3a276c037563bdb104c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Tue, 8 Apr 2025 11:52:11 +0200 Subject: [PATCH 13/14] Rename the modules project to prevent VSC from renaming the main project to helma_ Does not work, unfortunately --- settings.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/settings.gradle b/settings.gradle index c6fe1184..5fd2dc60 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,3 +16,6 @@ project(':modules').projectDir = file('modules/helma') project(':jala').projectDir = file('modules/jala') project(':hopKit').projectDir = file('modules/jala/util/HopKit') project(':test').projectDir = file('modules/jala/util/Test') + +// Rename this project to prevent redundancy and renaming of main project (VSC does not care, though) +project(':modules').name = 'modules' From 96f2dce50fcc96764954bd291d093ea5daa0cbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Tue, 8 Apr 2025 12:05:54 +0200 Subject: [PATCH 14/14] Add launch configuration for debugging Helma --- .vscode/launch.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..b9116072 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Current File", + "request": "launch", + "mainClass": "${file}" + }, + { + "type": "java", + "name": "Debug", + "request": "launch", + "mainClass": "helma.main.Server", + "projectName": "helma_" + } + ] +}