diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 69bcdeab..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build - -on: - push: - paths: - - .github/workflows/build.yml - - build.gradle - - settings.gradle - - src/** - - launcher/build.gradle - - launcher/src/** - workflow_dispatch: - -jobs: - build: - runs-on: antville - - steps: - - uses: actions/checkout@v4 - - - name: Compile with Gradle - run: ./gradlew :compileJava diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5acc94a2..c01702e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,12 +4,19 @@ on: workflow_dispatch jobs: deploy: - runs-on: antville + runs-on: ubuntu-latest environment: - name: antville.org - url: https://antville.org + name: weblogs.at + url: https://weblogs.at steps: + - name: Set up SSH agent + uses: antville/helma/.github/actions/ssh@helma-🐜 + with: + config: ${{ vars.SSH_CONFIG }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + known-hosts: ${{ vars.SSH_KNOWN_HOSTS }} + - name: Copy files to production server run: ssh staging-server deploy-helma diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac8a3d1a..59d8f365 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,59 +1,45 @@ name: Release on: - workflow_dispatch: push: - tags: '2*' + tags: + - 'v*' permissions: contents: write jobs: - release: - runs-on: antville + build: + runs-on: ubuntu-latest env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ github.token }} LC_TIME: en_US.UTF-8 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: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 - name: Build with Gradle run: ./gradlew assembleDist - name: Create release - uses: actions/forgejo-release@v2 - with: - direction: upload - url: https://code.host.antville.org - token: ${{ github.token }} - title: Helma ${{ github.ref_name }} - release-dir: build/distributions - 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 "Helma ${{ github.ref_name }}" \ - --notes "${{ steps.create_release_notes.outputs.release_notes }}" + --title "$(date +'%d %b %Y')" \ + --generate-notes - - name: Upload release assets to GitHub + - name: Upload assets run: | - gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \ - --repo "$GITHUB_REPOSITORY" \ + gh release upload "$GITHUB_REF_NAME" \ + build/distributions/helma-*.* \ --clobber diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml deleted file mode 100644 index e470128c..00000000 --- a/.github/workflows/renovate.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Run Renovate - -on: - schedule: - - cron: "13 * * * *" - workflow_dispatch: - -jobs: - renovate: - runs-on: antville - - steps: - - uses: actions/checkout@v4 - - - name: Run Renovate - # See - # debug | info | warn | error | fatal - run: LOG_LEVEL=info npx renovate - env: - # Renovate is using this token to retrieve release notes - GITHUB_COM_TOKEN: ${{ secrets.renovate_github_com_token }} - # Autodiscover is better suited for an extra repo running Renovate on all desired repos - #RENOVATE_AUTODISCOVER: 'true' - RENOVATE_CONFIG_FILE: renovate.json - RENOVATE_ENDPOINT: ${{ github.api_url }} - RENOVATE_GIT_AUTHOR: Renovate Bot - #RENOVATE_GIT_IGNORED_AUTHORS: - # - 29139614+renovate[bot]@users.noreply.github.com - RENOVATE_IGNORE_PR_AUTHOR: 'true' - RENOVATE_LOG_FILE: renovate-log.ndjson - RENOVATE_LOG_FILE_LEVEL: debug - RENOVATE_PLATFORM: gitea - RENOVATE_REPOSITORIES: ${{ github.repository }} - RENOVATE_REPOSITORY_CACHE: 'enabled' - # github.token is not working here, it lacks some permissions required by Renovate - RENOVATE_TOKEN: ${{ secrets.renovate_token }} - - - name: Save log file - # FIXME: v4 of this action causes an error on Forgejo (“You must configure a GitHub token”) - uses: actions/upload-artifact@v3 - if: always() - with: - name: renovate-log.ndjson - path: renovate-log.ndjson diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 17e693d4..eac49cc3 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -4,15 +4,31 @@ on: workflow_dispatch jobs: stage: - runs-on: antville + runs-on: ubuntu-latest environment: name: stage - url: ${{ vars.stage_url }} + url: https://antville-test.online steps: - uses: actions/checkout@v4 + - name: Set up SSH agent + uses: ./.github/actions/ssh + with: + config: ${{ vars.SSH_CONFIG }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + known-hosts: ${{ vars.SSH_KNOWN_HOSTS }} + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Build with Gradle run: ./gradlew installDist diff --git a/build.gradle b/build.gradle index 9bde766c..38eb392b 100644 --- a/build.gradle +++ b/build.gradle @@ -58,17 +58,17 @@ configurations { } dependencies { - implementation 'com.google.code.gson:gson:2.12.1' - implementation 'commons-codec:commons-codec:1.18.0' + implementation 'com.google.code.gson:gson:2.11.0' + implementation 'commons-codec:commons-codec:1.17.1' implementation 'commons-fileupload:commons-fileupload:1.5' - implementation 'commons-logging:commons-logging:1.3.5' + implementation 'commons-logging:commons-logging:1.3.4' implementation 'commons-net:commons-net:3.11.1' implementation 'com.sun.mail:javax.mail:1.6.2' implementation 'javax.servlet:javax.servlet-api:4.0.1' implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1' - implementation 'org.eclipse.jetty:jetty-servlet:9.4.57.v20241219' - implementation 'org.eclipse.jetty:jetty-xml:9.4.57.v20241219' - implementation 'org.mozilla:rhino-all:1.8.0' + implementation 'org.eclipse.jetty:jetty-servlet:9.4.56.v20240826' + implementation 'org.eclipse.jetty:jetty-xml:9.4.56.v20240826' + implementation 'org.mozilla:rhino:1.7.13' implementation 'org.sejda.imageio:webp-imageio:0.1.6' implementation 'xerces:xercesImpl:2.12.2' implementation 'xmlrpc:xmlrpc:2.0.1' @@ -172,7 +172,6 @@ tasks.register('processSource', Sync) { line -> line .replaceAll('__builddate__', new Date().format("d MMM yyyy")) .replaceAll('__commithash__', gitOutput.toString().trim()) - .replaceAll('__version__', version) } into "${project.buildDir}/src" } diff --git a/cliff.toml b/cliff.toml deleted file mode 100644 index 7832044a..00000000 --- a/cliff.toml +++ /dev/null @@ -1,52 +0,0 @@ -# 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" }, -] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e18bc253..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/dist/extras/deploy.sh b/src/dist/extras/deploy.sh deleted file mode 100644 index 6ebd6bf2..00000000 --- a/src/dist/extras/deploy.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/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 diff --git a/src/main/java/helma/main/Server.java b/src/main/java/helma/main/Server.java index 88d70db7..b747f11e 100644 --- a/src/main/java/helma/main/Server.java +++ b/src/main/java/helma/main/Server.java @@ -36,7 +36,7 @@ import helma.util.ResourceProperties; */ public class Server implements Runnable { // version string - public static final String version = "__version__"; + public static final String version = "🐜"; // build date public static final String buildDate = "__builddate__"; @@ -149,13 +149,17 @@ public class Server implements Runnable { * check if we are running on a Java 2 VM - otherwise exit with an error message */ public static void checkJavaVersion() { - String javaVersion = System.getProperty("java.version", "0"); - int majorVersion = Integer.parseInt(javaVersion.split("\\.")[0]); + String javaVersion = System.getProperty("java.version"); - if (majorVersion < 11) { - System.err.println("This version of Helma requires Java 11 or greater."); + if ((javaVersion == null) || javaVersion.startsWith("1.5") + || javaVersion.startsWith("1.4") + || javaVersion.startsWith("1.3") + || javaVersion.startsWith("1.2") + || javaVersion.startsWith("1.1") + || javaVersion.startsWith("1.0")) { + System.err.println("This version of Helma requires Java 1.6 or greater."); - if (majorVersion == 0) { // don't think this will ever happen, but you never know + if (javaVersion == null) { // don't think this will ever happen, but you never know System.err.println("Your Java Runtime did not provide a version number. Please update to a more recent version."); } else { System.err.println("Your Java Runtime is version " + javaVersion +