From c540e8d102920ce57f8a6d6b24e2752795c28df7 Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Fri, 25 Mar 2022 14:16:15 -0500 Subject: [PATCH 01/47] Add --build arguments to docker compose invocations --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a07fb0d62..24ed4da9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,24 +13,24 @@ jobs: uses: actions/checkout@v2 - name: Test in Linux JDK 11 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk11' - run: docker-compose -f docker/Linux-JDK11/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Linux-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux JDK 15 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk15' - run: docker-compose -f docker/Linux-JDK15/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Linux-JDK15/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux JDK 16 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk16' - run: docker-compose -f docker/Linux-JDK16/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Linux-JDK16/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux GraalVM if: matrix.os == 'ubuntu-latest' && matrix.java == 'graalvm' - run: docker-compose -f docker/Linux-GraalVM20/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Linux-GraalVM20/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Windows JDK 11 if: matrix.os == 'windows-latest' && matrix.java == 'jdk11' - run: docker-compose -f docker/Windows-JDK11/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Windows-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Windows JDK 15 if: matrix.os == 'windows-latest' && matrix.java == 'jdk15' - run: docker-compose -f docker/Windows-JDK15/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Windows-JDK15/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Windows JDK 16 if: matrix.os == 'windows-latest' && matrix.java == 'jdk16' - run: docker-compose -f docker/Windows-JDK16/docker-compose.yml up --exit-code-from cantaloupe + run: docker-compose -f docker/Windows-JDK16/docker-compose.yml up --build --exit-code-from cantaloupe # TODO: Windows+GraalVM From 9c5b1fa427c92246406dc44deae029befd7d91d4 Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Fri, 25 Mar 2022 15:54:23 -0500 Subject: [PATCH 02/47] Add an --add-opens argument to the surefire invocation to support JAI in Java 16+ --- pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c72227efa..366e2a4ea 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 9.4.34.v20201102 9.2.17.0 1.2.8 - 3.0.0-M3 + 3.0.0-M5 @@ -420,6 +420,8 @@ random false + + --add-opens java.desktop/sun.awt.image=ALL-UNNAMED @@ -555,6 +557,8 @@ random false + + --add-opens java.desktop/sun.awt.image=ALL-UNNAMED AzureStorage*Test FfmpegProcessorTest @@ -584,6 +588,8 @@ random false + + --add-opens java.desktop/sun.awt.image=ALL-UNNAMED Azure*Test From 39344099d10e31f93d6fd45d08713d8d5ddf2b89 Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Fri, 25 Mar 2022 17:20:10 -0500 Subject: [PATCH 03/47] Replace JDK 15 & 16 with 18 in CI and update Windows containers to Server Core 2022 --- .github/workflows/ci.yml | 20 +++---- docker/Linux-JDK15/Dockerfile | 57 ------------------- docker/Linux-JDK15/docker-compose.yml | 21 ------- .../{Linux-JDK16 => Linux-JDK18}/Dockerfile | 16 +++--- .../docker-compose.yml | 2 +- docker/Windows-JDK11/Dockerfile | 2 +- docker/Windows-JDK15/Dockerfile | 28 --------- docker/Windows-JDK15/Dockerfile-minio | 10 ---- docker/Windows-JDK15/docker-compose.yml | 19 ------- .../Dockerfile | 4 +- .../Dockerfile-minio | 2 +- .../docker-compose.yml | 4 +- 12 files changed, 22 insertions(+), 163 deletions(-) delete mode 100644 docker/Linux-JDK15/Dockerfile delete mode 100644 docker/Linux-JDK15/docker-compose.yml rename docker/{Linux-JDK16 => Linux-JDK18}/Dockerfile (76%) rename docker/{Linux-JDK16 => Linux-JDK18}/docker-compose.yml (89%) delete mode 100644 docker/Windows-JDK15/Dockerfile delete mode 100644 docker/Windows-JDK15/Dockerfile-minio delete mode 100644 docker/Windows-JDK15/docker-compose.yml rename docker/{Windows-JDK16 => Windows-JDK18}/Dockerfile (89%) rename docker/{Windows-JDK16 => Windows-JDK18}/Dockerfile-minio (81%) rename docker/{Windows-JDK16 => Windows-JDK18}/docker-compose.yml (77%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24ed4da9a..e9e6dfe5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - java: [jdk11, jdk15, graalvm] + java: [jdk11, jdk18, graalvm] fail-fast: false steps: - name: Check out the repository @@ -14,23 +14,17 @@ jobs: - name: Test in Linux JDK 11 if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk11' run: docker-compose -f docker/Linux-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe - - name: Test in Linux JDK 15 - if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk15' - run: docker-compose -f docker/Linux-JDK15/docker-compose.yml up --build --exit-code-from cantaloupe - - name: Test in Linux JDK 16 - if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk16' - run: docker-compose -f docker/Linux-JDK16/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Linux JDK 18 + if: matrix.os == 'ubuntu-latest' && matrix.java == 'jdk18' + run: docker-compose -f docker/Linux-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Linux GraalVM if: matrix.os == 'ubuntu-latest' && matrix.java == 'graalvm' run: docker-compose -f docker/Linux-GraalVM20/docker-compose.yml up --build --exit-code-from cantaloupe - name: Test in Windows JDK 11 if: matrix.os == 'windows-latest' && matrix.java == 'jdk11' run: docker-compose -f docker/Windows-JDK11/docker-compose.yml up --build --exit-code-from cantaloupe - - name: Test in Windows JDK 15 - if: matrix.os == 'windows-latest' && matrix.java == 'jdk15' - run: docker-compose -f docker/Windows-JDK15/docker-compose.yml up --build --exit-code-from cantaloupe - - name: Test in Windows JDK 16 - if: matrix.os == 'windows-latest' && matrix.java == 'jdk16' - run: docker-compose -f docker/Windows-JDK16/docker-compose.yml up --build --exit-code-from cantaloupe + - name: Test in Windows JDK 18 + if: matrix.os == 'windows-latest' && matrix.java == 'jdk18' + run: docker-compose -f docker/Windows-JDK18/docker-compose.yml up --build --exit-code-from cantaloupe # TODO: Windows+GraalVM diff --git a/docker/Linux-JDK15/Dockerfile b/docker/Linux-JDK15/Dockerfile deleted file mode 100644 index d8ffc2296..000000000 --- a/docker/Linux-JDK15/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM ubuntu:latest - -ENV JAVA_HOME=/opt/jdk -ENV PATH=$PATH:/opt/jdk/bin -ARG DEBIAN_FRONTEND=noninteractive - -# Install various dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - ffmpeg \ - maven \ - wget \ - libopenjp2-tools \ - liblcms2-dev \ - libpng-dev \ - libzstd-dev \ - libtiff-dev \ - libjpeg-dev \ - zlib1g-dev \ - libwebp-dev \ - libimage-exiftool-perl \ - && rm -rf /var/lib/apt/lists/* - -# Install TurboJpegProcessor dependencies -RUN mkdir -p /opt/libjpeg-turbo/lib -COPY docker/Linux-JDK11/image_files/libjpeg-turbo/lib64 /opt/libjpeg-turbo/lib - -# Install KakaduNativeProcessor dependencies -COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ - -# Install GrokProcessor dependencies -RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ - && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ - && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ - && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb - -# Install OpenJDK -RUN wget -q https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_linux_hotspot_15.0.1_9.tar.gz \ - && tar xfz OpenJDK15U-jdk_x64_linux_hotspot_15.0.1_9.tar.gz \ - && mv jdk-15.0.1+9 /opt/jdk - -# A non-root user is needed for some FilesystemSourceTest tests to work. -ARG user=cantaloupe -ARG home=/home/$user -RUN adduser --home $home $user -RUN chown -R $user $home -USER $user -WORKDIR $home - -# Install application dependencies -COPY ./pom.xml pom.xml -RUN mvn --quiet dependency:resolve - -# Copy the code -COPY --chown=cantaloupe docker/Linux-JDK11/image_files/test.properties test.properties -COPY --chown=cantaloupe ./src src - -ENTRYPOINT mvn --batch-mode test -Pfreedeps \ No newline at end of file diff --git a/docker/Linux-JDK15/docker-compose.yml b/docker/Linux-JDK15/docker-compose.yml deleted file mode 100644 index 4b4136275..000000000 --- a/docker/Linux-JDK15/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -# -# N.B.: docker-compose must be invoked from the project root directory: -# -# docker-compose -f path/to/docker-compose.yml up --exit-code-from cantaloupe -# -version: '3' -services: - cantaloupe: - build: - context: ../../ - dockerfile: $PWD/docker/Linux-JDK15/Dockerfile - minio: - image: minio/minio - environment: - MINIO_ACCESS_KEY: MinioUser - MINIO_SECRET_KEY: OpenSesame - hostname: minio - command: server /data - redis: - image: redis:alpine - hostname: redis \ No newline at end of file diff --git a/docker/Linux-JDK16/Dockerfile b/docker/Linux-JDK18/Dockerfile similarity index 76% rename from docker/Linux-JDK16/Dockerfile rename to docker/Linux-JDK18/Dockerfile index 34e828755..947f543e0 100644 --- a/docker/Linux-JDK16/Dockerfile +++ b/docker/Linux-JDK18/Dockerfile @@ -39,14 +39,14 @@ RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6. && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb \ # Install OpenJDK - && wget -q https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_x64_linux_hotspot_16.0.1_9.tar.gz \ - && tar xfz OpenJDK16U-jdk_x64_linux_hotspot_16.0.1_9.tar.gz \ - && mv jdk-16.0.1+9 /opt/jdk \ - # Install Maven (the one in apt is too old for JDK16 as of 2020-05-14) - && wget -q https://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz \ - && tar xfz apache-maven-3.8.1-bin.tar.gz \ - && mv apache-maven-3.8.1 /opt/maven \ - && rm apache-maven-3.8.1-bin.tar.gz + && wget -q https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz \ + && tar xfz openjdk-18_linux-x64_bin.tar.gz \ + && mv jdk-18 /opt/jdk \ + # Install a newer Maven than the one in apt + && wget -q https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz \ + && tar xfz apache-maven-3.8.5-bin.tar.gz \ + && mv apache-maven-3.8.5 /opt/maven \ + && rm apache-maven-3.8.5-bin.tar.gz # A non-root user is needed for some FilesystemSourceTest tests to work. ARG user=cantaloupe diff --git a/docker/Linux-JDK16/docker-compose.yml b/docker/Linux-JDK18/docker-compose.yml similarity index 89% rename from docker/Linux-JDK16/docker-compose.yml rename to docker/Linux-JDK18/docker-compose.yml index b6518c805..7b2572bc0 100644 --- a/docker/Linux-JDK16/docker-compose.yml +++ b/docker/Linux-JDK18/docker-compose.yml @@ -8,7 +8,7 @@ services: cantaloupe: build: context: ../../ - dockerfile: $PWD/docker/Linux-JDK16/Dockerfile + dockerfile: $PWD/docker/Linux-JDK18/Dockerfile minio: image: minio/minio environment: diff --git a/docker/Windows-JDK11/Dockerfile b/docker/Windows-JDK11/Dockerfile index 8d81bd6d1..ba1008de8 100644 --- a/docker/Windows-JDK11/Dockerfile +++ b/docker/Windows-JDK11/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 ENV chocolateyUseWindowsCompression false diff --git a/docker/Windows-JDK15/Dockerfile b/docker/Windows-JDK15/Dockerfile deleted file mode 100644 index 79307a09a..000000000 --- a/docker/Windows-JDK15/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 - -ENV chocolateyUseWindowsCompression false - -# Install the Chocolatey package manager, which makes it easier to install -# dependencies. -RUN powershell -Command \ - iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \ - choco feature disable --name showDownloadProgress - -# Install various dependencies -# TODO: openjpeg -RUN choco install -y adoptopenjdk15 maven ffmpeg - -# Install TurboJpegProcessor dependencies TODO: libjpeg-turbo -#RUN mkdir -p /opt/libjpeg-turbo/lib -#COPY docker/Windows10-JDK11/image_files/libjpeg-turbo/lib64 c:\windows\system32 - -# Install KakaduNativeProcessor dependencies -COPY dist/deps/Windows-x86-64/lib/* c:/Windows/System32/ - -# Install application dependencies -COPY pom.xml pom.xml -RUN mvn dependency:resolve - -# Copy the code -COPY docker/Windows-JDK11/image_files/test.properties test.properties -COPY src src \ No newline at end of file diff --git a/docker/Windows-JDK15/Dockerfile-minio b/docker/Windows-JDK15/Dockerfile-minio deleted file mode 100644 index babcdadfd..000000000 --- a/docker/Windows-JDK15/Dockerfile-minio +++ /dev/null @@ -1,10 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 - -ENV MINIO_ACCESS_KEY=MinioUser -ENV MINIO_SECRET_KEY=OpenSesame - -RUN curl.exe --output minio.exe --url https://dl.min.io/server/minio/release/windows-amd64/minio.exe - -RUN mkdir c:\data - -CMD minio.exe server --address=:9000 c:\data \ No newline at end of file diff --git a/docker/Windows-JDK15/docker-compose.yml b/docker/Windows-JDK15/docker-compose.yml deleted file mode 100644 index e2c44b801..000000000 --- a/docker/Windows-JDK15/docker-compose.yml +++ /dev/null @@ -1,19 +0,0 @@ -# -# N.B.: docker-compose must be invoked from the project root directory: -# -# docker-compose -f path/to/docker-compose.yml up --exit-code-from cantaloupe -# -version: '3' -services: - cantaloupe: - build: - context: ../../ - dockerfile: docker/Windows-JDK15/Dockerfile - minio: - build: - context: ../../ - dockerfile: docker/Windows-JDK15/Dockerfile-minio - environment: - MINIO_ACCESS_KEY: MinioUser - MINIO_SECRET_KEY: OpenSesame - hostname: minio \ No newline at end of file diff --git a/docker/Windows-JDK16/Dockerfile b/docker/Windows-JDK18/Dockerfile similarity index 89% rename from docker/Windows-JDK16/Dockerfile rename to docker/Windows-JDK18/Dockerfile index dc0c9673a..1f4bdd197 100644 --- a/docker/Windows-JDK16/Dockerfile +++ b/docker/Windows-JDK18/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 ENV chocolateyUseWindowsCompression false @@ -10,7 +10,7 @@ RUN powershell -Command \ # Install various dependencies # TODO: openjpeg -RUN choco install -y adoptopenjdk16 maven ffmpeg +RUN choco install -y adoptopenjdk18 maven ffmpeg # Install TurboJpegProcessor dependencies TODO: libjpeg-turbo #RUN mkdir -p /opt/libjpeg-turbo/lib diff --git a/docker/Windows-JDK16/Dockerfile-minio b/docker/Windows-JDK18/Dockerfile-minio similarity index 81% rename from docker/Windows-JDK16/Dockerfile-minio rename to docker/Windows-JDK18/Dockerfile-minio index b213b8746..115389668 100644 --- a/docker/Windows-JDK16/Dockerfile-minio +++ b/docker/Windows-JDK18/Dockerfile-minio @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 ENV MINIO_ACCESS_KEY=MinioUser ENV MINIO_SECRET_KEY=OpenSesame diff --git a/docker/Windows-JDK16/docker-compose.yml b/docker/Windows-JDK18/docker-compose.yml similarity index 77% rename from docker/Windows-JDK16/docker-compose.yml rename to docker/Windows-JDK18/docker-compose.yml index 1a505d28b..3c5812953 100644 --- a/docker/Windows-JDK16/docker-compose.yml +++ b/docker/Windows-JDK18/docker-compose.yml @@ -8,11 +8,11 @@ services: cantaloupe: build: context: ../../ - dockerfile: docker/Windows-JDK16/Dockerfile + dockerfile: docker/Windows-JDK18/Dockerfile minio: build: context: ../../ - dockerfile: docker/Windows-JDK16/Dockerfile-minio + dockerfile: docker/Windows-JDK18/Dockerfile-minio environment: MINIO_ACCESS_KEY: MinioUser MINIO_SECRET_KEY: OpenSesame From 3f856f4beec36c698a585cd870379b788d13585a Mon Sep 17 00:00:00 2001 From: Alex Dolski Date: Thu, 12 May 2022 15:52:14 -0500 Subject: [PATCH 04/47] handle() adds the OperationList to the RequestContext before calling OperationList.applyNonEndpointMutations() (fixes #589) --- CHANGES.md | 2 ++ .../library/cantaloupe/resource/ImageRequestHandler.java | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 49cf962e1..f73866d82 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ ## 5.0.6 * IIIF information endpoints always return JSON in HTTP 4xx responses. +* Fixed a bug whereby the values of the `operations` and `page_count` keys + in the delegate context were not set. * TurboJpegProcessor is able to generate non-JPEG derivative images, which fixes an HTTP 415 error that would occur when trying to do that. * Fixed a crop-offset bug that could occur when using PdfBoxProcessor to diff --git a/src/main/java/edu/illinois/library/cantaloupe/resource/ImageRequestHandler.java b/src/main/java/edu/illinois/library/cantaloupe/resource/ImageRequestHandler.java index 16d5142da..b5e6f38b2 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/resource/ImageRequestHandler.java +++ b/src/main/java/edu/illinois/library/cantaloupe/resource/ImageRequestHandler.java @@ -384,10 +384,12 @@ public void handle(OutputStream outputStream) throws Exception { try { fullSize = info.getSize(operationList.getPageIndex()); requestContext.setMetadata(info.getMetadata()); - operationList.applyNonEndpointMutations(info, delegateProxy); - operationList.freeze(); requestContext.setOperationList(operationList, fullSize); requestContext.setPageCount(info.getNumPages()); + // This must be done *after* the request context is fully + // populated, as some of the mutations may depend on it. + operationList.applyNonEndpointMutations(info, delegateProxy); + operationList.freeze(); } catch (IllegalArgumentException | IndexOutOfBoundsException e) { throw new IllegalClientArgumentException(e); } From 18a76cc408daf1c8b2da9f1a80e074d53624a029 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 9 Aug 2023 14:18:10 +0100 Subject: [PATCH 05/47] Updating libraries --- pom.xml | 60 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index 366e2a4ea..38340d9e1 100644 --- a/pom.xml +++ b/pom.xml @@ -70,25 +70,25 @@ net.logstash.logback logstash-logback-encoder - 6.1 + 7.4 com.github.ben-manes.caffeine caffeine - 2.5.6 + 3.1.6 com.google.protobuf protobuf-java - 3.5.1 + 4.0.0-rc-2 com.h2database h2 - 1.4.196 + 2.2.220 test @@ -101,19 +101,19 @@ com.microsoft.azure azure-storage - 5.2.0 + 8.6.6 com.squareup.okhttp3 okhttp - 3.13.1 + 5.0.0-alpha.11 com.zaxxer HikariCP - 2.7.2 + 5.0.1 @@ -126,7 +126,7 @@ commons-io commons-io - 2.4 + 2.13.0 edu.illinois.library @@ -137,63 +137,63 @@ io.lettuce lettuce-core - 6.0.1.RELEASE + 6.2.4.RELEASE javax.xml.bind jaxb-api - 2.3.0 + 2.4.0-b180830.0359 it.geosolutions.imageio-ext imageio-ext-tiff - 1.3.2 + 1.4.7 javax.servlet javax.servlet-api - 3.1.0 + 4.0.1 org.apache.commons commons-lang3 - 3.6 + 3.12.0 org.apache.pdfbox pdfbox - 2.0.23 + 2.0.29 org.apache.pdfbox jbig2-imageio - 3.0.3 + 3.0.4 org.junit.jupiter junit-jupiter-engine - 5.4.2 + 5.10.0-RC1 test org.openjdk.jmh jmh-core - 1.19 + 1.36 test org.openjdk.jmh jmh-generator-annprocess - 1.19 + 1.36 test org.apache.tika tika-core - 1.24.1 + 2.8.0 org.bouncycastle bcprov-jdk15on - 1.64 + 1.70 org.codehaus.janino janino - 2.7.8 + 3.1.10 @@ -330,45 +330,45 @@ org.apache.velocity velocity-engine-core - 2.0 + 2.3 org.seleniumhq.selenium htmlunit-driver - 2.21 + 4.10.0 test org.seleniumhq.selenium selenium-api - 2.53.0 + 4.10.0 test org.seleniumhq.selenium selenium-support - 2.53.0 + 4.10.0 test org.slf4j slf4j-api - 1.7.25 + 2.0.7 org.slf4j jcl-over-slf4j - 1.7.25 + 2.0.7 org.apache.maven.plugins maven-assembly-plugin - 3.1.1 + 3.6.0 maven-plugin From 1f98ccc5277eab32a5e46d9e48058a3304fc63bb Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 9 Aug 2023 14:18:29 +0100 Subject: [PATCH 06/47] Preparing for PDFBox v3 update --- .../illinois/library/cantaloupe/processor/PdfBoxProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/processor/PdfBoxProcessor.java b/src/main/java/edu/illinois/library/cantaloupe/processor/PdfBoxProcessor.java index 0197feab7..6de50010c 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/processor/PdfBoxProcessor.java +++ b/src/main/java/edu/illinois/library/cantaloupe/processor/PdfBoxProcessor.java @@ -142,7 +142,8 @@ public boolean isSeeking() { private void readDocument() throws IOException { if (doc == null) { final Stopwatch watch = new Stopwatch(); - + // For PDF Box v3 this would need to change to a loader: + // https://pdfbox.apache.org/3.0/migration.html#use-loader-to-get-a-pdf-document if (sourceFile != null) { doc = PDDocument.load(sourceFile.toFile(), getMemoryUsageSetting()); From f89fa00384479c7cde1509b131ecdad64e4e6e8b Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 9 Aug 2023 14:18:48 +0100 Subject: [PATCH 07/47] Updating tika to v2.8.0 See: https://archive.apache.org/dist/tika/2.0.0-BETA/CHANGES-2.0.0-BETA.txt --- .../java/edu/illinois/library/cantaloupe/image/MediaType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/image/MediaType.java b/src/main/java/edu/illinois/library/cantaloupe/image/MediaType.java index 1c4b0b367..d5370f3c0 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/image/MediaType.java +++ b/src/main/java/edu/illinois/library/cantaloupe/image/MediaType.java @@ -12,6 +12,7 @@ import org.apache.tika.detect.Detector; import org.apache.tika.io.TikaInputStream; import org.apache.tika.metadata.Metadata; +import org.apache.tika.metadata.TikaCoreProperties; import org.apache.tika.parser.AutoDetectParser; import java.io.IOException; @@ -99,7 +100,7 @@ public static List detectMediaTypes(Path path) AutoDetectParser parser = new AutoDetectParser(); Detector detector = parser.getDetector(); Metadata md = new Metadata(); - md.add(Metadata.RESOURCE_NAME_KEY, path.toString()); + md.add(TikaCoreProperties.RESOURCE_NAME_KEY, path.toString()); org.apache.tika.mime.MediaType mediaType = detector.detect(is, md); types.add(new MediaType(mediaType.toString())); } From 487dd59d5d73d9e6f3a3834b0a090c933a3726b4 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 9 Aug 2023 17:45:49 +0100 Subject: [PATCH 08/47] Rolling back to 1.3.2 which is latest release --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 38340d9e1..9654fd3c0 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,8 @@ it.geosolutions.imageio-ext imageio-ext-tiff - 1.4.7 + + 1.3.2 javax.servlet From a660719ffcaa6db816cf3951a427d8b2cce02113 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 10 Aug 2023 01:00:47 +0100 Subject: [PATCH 09/47] Rolling back seleniumhq --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 9654fd3c0..504c3a35f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ 9.2.17.0 1.2.8 3.0.0-M5 + 2.53.0 @@ -338,19 +339,19 @@ org.seleniumhq.selenium htmlunit-driver - 4.10.0 + ${seleniumhq.version} test org.seleniumhq.selenium selenium-api - 4.10.0 + ${seleniumhq.version} test org.seleniumhq.selenium selenium-support - 4.10.0 + ${seleniumhq.version} test From f2c65f773f6f441062775553969bfe835fed46b2 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 30 Aug 2023 13:53:04 +0100 Subject: [PATCH 10/47] Syncing versions of slf4j and logback --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 504c3a35f..8e3abf3c7 100644 --- a/pom.xml +++ b/pom.xml @@ -19,9 +19,10 @@ 2.11.0 9.4.34.v20201102 9.2.17.0 - 1.2.8 3.0.0-M5 2.53.0 + 1.2.12 + 1.7.36 @@ -358,13 +359,13 @@ org.slf4j slf4j-api - 2.0.7 + ${slf4j.version} org.slf4j jcl-over-slf4j - 2.0.7 + ${slf4j.version} From ee991b2629287988b9489b546344a83379acef43 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 30 Aug 2023 15:34:40 +0100 Subject: [PATCH 11/47] Updating maven version as 3.8.5 no longer exists at the URL --- docker/Linux-JDK18/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Linux-JDK18/Dockerfile b/docker/Linux-JDK18/Dockerfile index 947f543e0..c080846f0 100644 --- a/docker/Linux-JDK18/Dockerfile +++ b/docker/Linux-JDK18/Dockerfile @@ -43,10 +43,10 @@ RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6. && tar xfz openjdk-18_linux-x64_bin.tar.gz \ && mv jdk-18 /opt/jdk \ # Install a newer Maven than the one in apt - && wget -q https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz \ - && tar xfz apache-maven-3.8.5-bin.tar.gz \ - && mv apache-maven-3.8.5 /opt/maven \ - && rm apache-maven-3.8.5-bin.tar.gz + && wget -q https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \ + && tar xfz apache-maven-3.8.8-bin.tar.gz \ + && mv apache-maven-3.8.8 /opt/maven \ + && rm apache-maven-3.8.8-bin.tar.gz # A non-root user is needed for some FilesystemSourceTest tests to work. ARG user=cantaloupe From f438f83ae2c8a406509d75d9f38dbc2bddd2557a Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 30 Aug 2023 16:14:55 +0100 Subject: [PATCH 12/47] Trying upgrading windows version --- docker/Windows-JDK11/Dockerfile-minio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Windows-JDK11/Dockerfile-minio b/docker/Windows-JDK11/Dockerfile-minio index b213b8746..115389668 100644 --- a/docker/Windows-JDK11/Dockerfile-minio +++ b/docker/Windows-JDK11/Dockerfile-minio @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 ENV MINIO_ACCESS_KEY=MinioUser ENV MINIO_SECRET_KEY=OpenSesame From a5b3e5dcb3a3e3b9bda62ddbb3c8c76ac6079a6d Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 30 Aug 2023 16:36:02 +0100 Subject: [PATCH 13/47] Moving choco package --- docker/Windows-JDK18/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/Windows-JDK18/Dockerfile b/docker/Windows-JDK18/Dockerfile index 1f4bdd197..e3f570efc 100644 --- a/docker/Windows-JDK18/Dockerfile +++ b/docker/Windows-JDK18/Dockerfile @@ -10,8 +10,9 @@ RUN powershell -Command \ # Install various dependencies # TODO: openjpeg -RUN choco install -y adoptopenjdk18 maven ffmpeg - +RUN choco install -y maven ffmpeg +RUN choco install -y openjdk --version=18.0.2 + # Install TurboJpegProcessor dependencies TODO: libjpeg-turbo #RUN mkdir -p /opt/libjpeg-turbo/lib #COPY docker/Windows10-JDK11/image_files/libjpeg-turbo/lib64 c:\windows\system32 From 85a993a84d5841a151ff0b232841265723f3528a Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 5 Sep 2023 17:31:13 +0100 Subject: [PATCH 14/47] Moving creating prepared statement to after blob population --- .../library/cantaloupe/cache/JdbcCache.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java index 4a97cc2f5..feb25d817 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java +++ b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java @@ -56,7 +56,6 @@ private class ImageBlobOutputStream extends CompletableOutputStream { private final OutputStream blobOutputStream; private final OperationList ops; private final Connection connection; - private final PreparedStatement statement; /** * Constructor for writing derivative images. @@ -71,28 +70,28 @@ private class ImageBlobOutputStream extends CompletableOutputStream { connection.setAutoCommit(false); - final Configuration config = Configuration.getInstance(); - final String sql = String.format( - "INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", - config.getString(Key.JDBCCACHE_DERIVATIVE_IMAGE_TABLE), - DERIVATIVE_IMAGE_TABLE_OPERATIONS_COLUMN, - DERIVATIVE_IMAGE_TABLE_IMAGE_COLUMN, - DERIVATIVE_IMAGE_TABLE_LAST_ACCESSED_COLUMN); - LOGGER.debug(sql); - final Blob blob = connection.createBlob(); blobOutputStream = blob.setBinaryStream(1); - statement = connection.prepareStatement(sql); - statement.setString(1, ops.toString()); - statement.setBlob(2, blob); - statement.setTimestamp(3, now()); } @Override public void close() throws IOException { LOGGER.debug("Closing stream for {}", ops); + PreparedStatement statement = null; try { if (isCompletelyWritten()) { + final Configuration config = Configuration.getInstance(); + final String sql = String.format( + "INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", + config.getString(Key.JDBCCACHE_DERIVATIVE_IMAGE_TABLE), + DERIVATIVE_IMAGE_TABLE_OPERATIONS_COLUMN, + DERIVATIVE_IMAGE_TABLE_IMAGE_COLUMN, + DERIVATIVE_IMAGE_TABLE_LAST_ACCESSED_COLUMN); + LOGGER.debug(sql); + statement = connection.prepareStatement(sql); + statement.setString(1, ops.toString()); + statement.setBlob(2, blob); + statement.setTimestamp(3, now()); statement.executeUpdate(); connection.commit(); } else { @@ -102,7 +101,9 @@ public void close() throws IOException { throw new IOException(e.getMessage(), e); } finally { try { - statement.close(); + if (statement != null) { + statement.close(); + } } catch (SQLException e) { LOGGER.error(e.getMessage(), e); } @@ -390,6 +391,7 @@ public InputStream newDerivativeImageInputStream(OperationList opList) try { return new ImageBlobOutputStream(getConnection(), ops); } catch (SQLException e) { + LOGGER.error("Throwing Except: {}", e); throw new IOException(e.getMessage(), e); } } From 8ab3d43960db33bf0122b5b352dfd5ae913ed07f Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 6 Sep 2023 11:45:23 +0100 Subject: [PATCH 15/47] Fixing a missing blob exception --- .../edu/illinois/library/cantaloupe/cache/JdbcCache.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java index feb25d817..41ff213c2 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java +++ b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java @@ -56,6 +56,7 @@ private class ImageBlobOutputStream extends CompletableOutputStream { private final OutputStream blobOutputStream; private final OperationList ops; private final Connection connection; + private final Blob blob; /** * Constructor for writing derivative images. @@ -70,7 +71,7 @@ private class ImageBlobOutputStream extends CompletableOutputStream { connection.setAutoCommit(false); - final Blob blob = connection.createBlob(); + blob = connection.createBlob(); blobOutputStream = blob.setBinaryStream(1); } @@ -80,6 +81,7 @@ public void close() throws IOException { PreparedStatement statement = null; try { if (isCompletelyWritten()) { + blobOutputStream.close(); final Configuration config = Configuration.getInstance(); final String sql = String.format( "INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", @@ -362,7 +364,7 @@ public InputStream newDerivativeImageInputStream(OperationList opList) DERIVATIVE_IMAGE_TABLE_LAST_ACCESSED_COLUMN); try (Connection conn = getConnection(); - PreparedStatement statement = conn.prepareStatement(sql)) { + PreparedStatement statement = conn.prepareStatement(sql)) { statement.setString(1, opList.toString()); statement.setTimestamp(2, earliestValidDate()); From 6ce84ca803e91736c2d4323f87dff5c0ef79bee5 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 6 Sep 2023 11:46:20 +0100 Subject: [PATCH 16/47] Rolling back HikariCP to last version to support Java 8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e3abf3c7..fdc498f6b 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ com.zaxxer HikariCP - 5.0.1 + 4.0.3 From c8440ff80eb952563b75d914b2f7b997e4ea2c4f Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 3 Oct 2023 15:28:57 +0100 Subject: [PATCH 17/47] Adding a baseURI to make the rdf:about have a value --- .../cantaloupe/processor/codec/tiff/TIFFMetadataTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/edu/illinois/library/cantaloupe/processor/codec/tiff/TIFFMetadataTest.java b/src/test/java/edu/illinois/library/cantaloupe/processor/codec/tiff/TIFFMetadataTest.java index 7104e06be..132cf7bc9 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/processor/codec/tiff/TIFFMetadataTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/processor/codec/tiff/TIFFMetadataTest.java @@ -4,6 +4,8 @@ import edu.illinois.library.cantaloupe.test.TestUtil; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFFormat; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -80,7 +82,7 @@ void testGetXMP() throws IOException { try (ImageInputStream is = ImageIO.createImageInputStream(srcFile.toFile())) { final String rdf = newInstance(is).getXMP().orElseThrow(); final Model model = ModelFactory.createDefaultModel(); - model.read(new StringReader(rdf), null, "RDF/XML"); + model.read(new StringReader(rdf), "file://" + srcFile.getParent().toAbsolutePath(), "RDF/XML"); } } From e5340cd2054c7fcedab29d58420916b35acdc75c Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 3 Oct 2023 15:29:32 +0100 Subject: [PATCH 18/47] Adding an rdf:about value if not present --- .../library/cantaloupe/processor/codec/jpeg/Util.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java b/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java index 5a09e5bc0..b4df22630 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java +++ b/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java @@ -120,8 +120,13 @@ private static String mergeXMPModels(String standardXMP, private static Model readModel(String rdfXML) { Model model = ModelFactory.createDefaultModel(); + String base = null; + if (rdfXML.indexOf("rdf:about=''") != -1 || rdfXML.indexOf("rdf:about=\"\"") != -1) { + // Verison 4.8+ of jena requires a rdf:about link to not be empty + base = "http://example.com"; + } try (StringReader reader = new StringReader(rdfXML)) { - model.read(reader, null, "RDF/XML"); + model.read(reader, base, "RDF/XML"); } return model; } From 1833104032a6a256938ddb17388e49d526f25f77 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 3 Oct 2023 15:30:02 +0100 Subject: [PATCH 19/47] Updating to latest Jena version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fdc498f6b..9b8b228ed 100644 --- a/pom.xml +++ b/pom.xml @@ -205,12 +205,12 @@ org.apache.jena jena-core - 4.8.0 + 4.9.0 org.apache.jena jena-arq - 4.8.0 + 4.9.0 From 0e6aa0552bbf3988e5138d56fbe964de298f4adc Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 3 Oct 2023 16:21:59 +0100 Subject: [PATCH 20/47] Checking for empty rdf:about and using base URI --- .../library/cantaloupe/image/Metadata.java | 21 +++++++++++++++++-- .../cantaloupe/processor/codec/jpeg/Util.java | 14 +++++++++---- .../cantaloupe/image/MetadataTest.java | 2 ++ .../processor/codec/png/PNGMetadataTest.java | 5 +++-- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java b/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java index c4e2d413a..fe10ea32c 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java +++ b/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java @@ -216,10 +216,27 @@ private void loadXMP() { RIOT.init(); xmpModel = ModelFactory.createDefaultModel(); + String base = null; + if (xmp.get().indexOf("rdf:about=''") != -1 || xmp.get().indexOf("rdf:about=\"\"") != -1) { + // Version 4.8+ of jena requires a rdf:about link to not be empty + base = "http://example.com"; + } try (StringReader reader = new StringReader(xmp.get())) { - xmpModel.read(reader, null, "RDF/XML"); - } catch (RiotException | NullPointerException e) { + xmpModel.read(reader, base, "RDF/XML"); + } catch (RiotException e) { + if (e.getMessage().indexOf("Base URI is null, but there are relative URIs to resolve") != -1) { + // Version 4.8+ of jena requires a rdf:about link to not be empty + try (StringReader reader = new StringReader(xmp.get())) { + xmpModel.read(reader, "http://example.com", "RDF/XML"); + } catch (RiotException exception) { + LOGGER.info("loadXMP(): {}", exception.getMessage()); + } + } else { + LOGGER.info("loadXMP(): {}", e.getMessage()); + throw e; + } + } catch (NullPointerException e) { // The XMP string may be invalid RDF/XML, or there may be a bug // in Jena (that would be the NPE). Not much we can do. LOGGER.info("loadXMP(): {}", e.getMessage()); diff --git a/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java b/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java index b4df22630..b4b0de716 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java +++ b/src/main/java/edu/illinois/library/cantaloupe/processor/codec/jpeg/Util.java @@ -7,6 +7,7 @@ import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.riot.RiotException; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -121,12 +122,17 @@ private static String mergeXMPModels(String standardXMP, private static Model readModel(String rdfXML) { Model model = ModelFactory.createDefaultModel(); String base = null; - if (rdfXML.indexOf("rdf:about=''") != -1 || rdfXML.indexOf("rdf:about=\"\"") != -1) { - // Verison 4.8+ of jena requires a rdf:about link to not be empty - base = "http://example.com"; - } try (StringReader reader = new StringReader(rdfXML)) { model.read(reader, base, "RDF/XML"); + } catch (RiotException exception) { + if (exception.getMessage().indexOf("Base URI is null, but there are relative URIs to resolve") != -1) { + // Version 4.8+ of jena requires a rdf:about link to not be empty + try (StringReader reader = new StringReader(rdfXML)) { + model.read(reader, "http://example.com", "RDF/XML"); + } + } else { + throw exception; + } } return model; } diff --git a/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java b/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java index 654ed56f7..1b5183ac4 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java @@ -11,6 +11,8 @@ import edu.illinois.library.cantaloupe.test.BaseTest; import edu.illinois.library.cantaloupe.test.TestUtil; import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFFormat; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/edu/illinois/library/cantaloupe/processor/codec/png/PNGMetadataTest.java b/src/test/java/edu/illinois/library/cantaloupe/processor/codec/png/PNGMetadataTest.java index cf709ab1a..31ddace80 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/processor/codec/png/PNGMetadataTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/processor/codec/png/PNGMetadataTest.java @@ -45,9 +45,10 @@ void testGetNativeMetadata() throws IOException { @Test void testGetXMP() throws IOException { - final String rdf = getInstance("png-xmp.png").getXMP().orElseThrow(); + final String fixtureName = "png-xmp.png"; + final String rdf = getInstance(fixtureName).getXMP().orElseThrow(); final Model model = ModelFactory.createDefaultModel(); - model.read(new StringReader(rdf), null, "RDF/XML"); + model.read(new StringReader(rdf), "file://" + TestUtil.getImage(fixtureName).getParent().toAbsolutePath(), "RDF/XML"); } } From 9fdabbaf4cb36ff6ed783ffee221d98b94fc54ff Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 3 Oct 2023 16:35:50 +0100 Subject: [PATCH 21/47] Unpinning htmlunit version form selenium --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b8b228ed..4198d7e03 100644 --- a/pom.xml +++ b/pom.xml @@ -340,7 +340,7 @@ org.seleniumhq.selenium htmlunit-driver - ${seleniumhq.version} + 2.21 test From a03e63c9168d5f93ab42828f46bd550f44e57d5a Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 4 Oct 2023 11:29:29 +0100 Subject: [PATCH 22/47] Handling different exception but same outcome --- .../java/edu/illinois/library/cantaloupe/image/Metadata.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java b/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java index fe10ea32c..2d04a64e6 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java +++ b/src/main/java/edu/illinois/library/cantaloupe/image/Metadata.java @@ -146,6 +146,9 @@ public Orientation getOrientation() { } catch (IllegalArgumentException e) { LOGGER.info("readOrientation(): {}", e.getMessage()); orientation = Orientation.ROTATE_0; + } catch (RiotException e) { + LOGGER.info("readOrientation(): {}", e.getMessage()); + orientation = Orientation.ROTATE_0; } } return orientation; From 962dbff42d2b2e7ebf7d2fd9a62c4a2e24da9ee2 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 4 Oct 2023 11:29:54 +0100 Subject: [PATCH 23/47] Adding RDF namespace --- .../edu/illinois/library/cantaloupe/image/MetadataTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java b/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java index 1b5183ac4..92c69b590 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/image/MetadataTest.java @@ -403,7 +403,7 @@ void testToMap() { expectedMap.put("iptc", List.of(new DataSet( edu.illinois.library.cantaloupe.image.iptc.Tag.CITY, "Urbana".getBytes()).toMap())); - expectedMap.put("xmp_string", ""); + expectedMap.put("xmp_string", ""); expectedMap.put("native", Map.of("key1", "value1", "key2", "value2")); // assemble the Metadata @@ -422,7 +422,7 @@ void testToMap() { "Urbana".getBytes())); instance.setIPTC(iptc); // XMP - instance.setXMP(""); + instance.setXMP(""); // native instance.setNativeMetadata(Map.of("key1", "value1", "key2", "value2")); From cb8997cb0b94b01d43fdfa3f7cbe1e8db7dd2dd6 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 4 Oct 2023 11:32:04 +0100 Subject: [PATCH 24/47] Adding RDF namespace to test --- .../edu/illinois/library/cantaloupe/operation/EncodeTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/edu/illinois/library/cantaloupe/operation/EncodeTest.java b/src/test/java/edu/illinois/library/cantaloupe/operation/EncodeTest.java index ee8f5b614..0fc0b9aac 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/operation/EncodeTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/operation/EncodeTest.java @@ -137,7 +137,7 @@ void testToMap() { instance.setBackgroundColor(Color.BLUE); instance.setMaxComponentSize(10); Metadata metadata = new Metadata(); - metadata.setXMP(""); + metadata.setXMP(""); instance.setMetadata(metadata); Dimension size = new Dimension(500, 500); @@ -150,7 +150,7 @@ void testToMap() { assertTrue((boolean) map.get("interlace")); assertEquals(50, map.get("quality")); assertEquals(10, map.get("max_sample_size")); - assertEquals("", + assertEquals("", ((Map) map.get("metadata")).get("xmp_string")); } From d96c36be229afb3bccb70b414c7871aca642e29c Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 4 Oct 2023 11:55:47 +0100 Subject: [PATCH 25/47] Updating Jackson --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4198d7e03..f1e4ff9c4 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ UTF-8 UTF-8 2.15.28 - 2.11.0 + 2.15.2 9.4.34.v20201102 9.2.17.0 3.0.0-M5 @@ -571,6 +571,7 @@ RedisCacheTest TurboJpegProcessorTest TurboJPEG*Test + *S3* From 72aaecc5637482eccaf3637584123d11c286c1eb Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 4 Oct 2023 12:52:34 +0100 Subject: [PATCH 26/47] Updating jetty --- pom.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index f1e4ff9c4..79ec8477c 100644 --- a/pom.xml +++ b/pom.xml @@ -17,8 +17,8 @@ UTF-8 2.15.28 2.15.2 - 9.4.34.v20201102 - 9.2.17.0 + 9.4.52.v20230823 + 9.4.3.0 3.0.0-M5 2.53.0 1.2.12 @@ -139,7 +139,7 @@ io.lettuce lettuce-core - 6.2.4.RELEASE + 6.2.6.RELEASE @@ -221,8 +221,8 @@ org.bouncycastle - bcprov-jdk15on - 1.70 + bcprov-jdk18on + 1.76 @@ -502,7 +502,7 @@ maven-assembly-plugin - 3.1.1 + 3.6.0 package @@ -571,7 +571,6 @@ RedisCacheTest TurboJpegProcessorTest TurboJPEG*Test - *S3* From 3b6b762e6e693891a2d5adbcb31ddbab36d29094 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 5 Dec 2023 15:33:49 +0000 Subject: [PATCH 27/47] Moving to CGI.escape for Ruby 3 --- src/test/resources/delegates.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/resources/delegates.rb b/src/test/resources/delegates.rb index 5f233c06e..cf25f5c36 100644 --- a/src/test/resources/delegates.rb +++ b/src/test/resources/delegates.rb @@ -2,6 +2,7 @@ require 'java' require 'uri' +require 'cgi' class CustomDelegate @@ -166,11 +167,11 @@ def httpsource_resource_info(options = {}) elsif context['client_ip'] == '1.2.3.4' if context['request_headers']['X-Forwarded-Proto'] == 'https' return { - 'uri' => 'https://other-example.org/bleh/' + URI.escape(identifier) + 'uri' => 'https://other-example.org/bleh/' + CGI.escape(identifier) } else return { - 'uri' => 'http://other-example.org/bleh/' + URI.escape(identifier) + 'uri' => 'http://other-example.org/bleh/' + CGI.escape(identifier) } end end @@ -178,21 +179,21 @@ def httpsource_resource_info(options = {}) case identifier when 'http-jpg-rgb-64x56x8-baseline.jpg' return { - 'uri' => 'http://example.org/bla/' + URI.escape(identifier), + 'uri' => 'http://example.org/bla/' + CGI.escape(identifier), 'headers' => { 'X-Custom' => 'yes' } } when 'https-jpg-rgb-64x56x8-baseline.jpg' return { - 'uri' => 'https://example.org/bla/' + URI.escape(identifier), + 'uri' => 'https://example.org/bla/' + CGI.escape(identifier), 'headers' => { 'X-Custom' => 'yes' } } when 'http-jpg-rgb-64x56x8-plane.jpg' return { - 'uri' => 'http://example.org/bla/' + URI.escape(identifier), + 'uri' => 'http://example.org/bla/' + CGI.escape(identifier), 'username' => 'username', 'secret' => 'secret', 'headers' => { @@ -201,7 +202,7 @@ def httpsource_resource_info(options = {}) } when 'https-jpg-rgb-64x56x8-plane.jpg' return { - 'uri' => 'https://example.org/bla/' + URI.escape(identifier), + 'uri' => 'https://example.org/bla/' + CGI.escape(identifier), 'username' => 'username', 'secret' => 'secret', 'headers' => { From 49947d514faf0c9946f740e2c587bd52e48bae7b Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 5 Dec 2023 16:27:08 +0000 Subject: [PATCH 28/47] Trying the debian version of grok --- docker/Linux-JDK11/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/Linux-JDK11/Dockerfile b/docker/Linux-JDK11/Dockerfile index fb3eab9d5..c491f5a5e 100644 --- a/docker/Linux-JDK11/Dockerfile +++ b/docker/Linux-JDK11/Dockerfile @@ -18,6 +18,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ zlib1g-dev \ libwebp-dev \ libimage-exiftool-perl \ + libgrokj2k1 \ + grokj2k-tools && rm -rf /var/lib/apt/lists/* # Install TurboJpegProcessor dependencies @@ -28,10 +30,10 @@ COPY docker/Linux-JDK11/image_files/libjpeg-turbo/lib64 /opt/libjpeg-turbo/lib COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ # Install GrokProcessor dependencies -RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ - && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ - && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ - && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb +#RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ +# && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ +# && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ +# && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb # A non-root user is needed for some FilesystemSourceTest tests to work. ARG user=cantaloupe From 385c243c1f51114ce3cd26c6583ec88652e3c934 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 5 Dec 2023 16:28:22 +0000 Subject: [PATCH 29/47] Fixing typo --- docker/Linux-JDK11/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Linux-JDK11/Dockerfile b/docker/Linux-JDK11/Dockerfile index c491f5a5e..6070879f1 100644 --- a/docker/Linux-JDK11/Dockerfile +++ b/docker/Linux-JDK11/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libwebp-dev \ libimage-exiftool-perl \ libgrokj2k1 \ - grokj2k-tools + grokj2k-tools \ && rm -rf /var/lib/apt/lists/* # Install TurboJpegProcessor dependencies From 63c6d6a010ba468146b3cba7b59182477a786d6e Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 5 Dec 2023 16:36:52 +0000 Subject: [PATCH 30/47] Updating Ubuntu to version with grok --- docker/Linux-JDK11/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Linux-JDK11/Dockerfile b/docker/Linux-JDK11/Dockerfile index 6070879f1..52cc01447 100644 --- a/docker/Linux-JDK11/Dockerfile +++ b/docker/Linux-JDK11/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:lunar ARG DEBIAN_FRONTEND=noninteractive From 9556c9ae188e5d892cf2d2404afb7c7d05d0159c Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 6 Dec 2023 23:59:34 +0000 Subject: [PATCH 31/47] Moving to ubuntu lunar so we can get Grok via apt-get --- docker/Linux-JDK11/Dockerfile | 3 ++- docker/Linux-JDK18/Dockerfile | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docker/Linux-JDK11/Dockerfile b/docker/Linux-JDK11/Dockerfile index 52cc01447..3129f9a73 100644 --- a/docker/Linux-JDK11/Dockerfile +++ b/docker/Linux-JDK11/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libimage-exiftool-perl \ libgrokj2k1 \ grokj2k-tools \ + adduser \ && rm -rf /var/lib/apt/lists/* # Install TurboJpegProcessor dependencies @@ -39,7 +40,7 @@ COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ ARG user=cantaloupe ARG home=/home/$user RUN adduser --home $home $user -RUN chown -R $user $home +RUN chown -R $user $home USER $user WORKDIR $home diff --git a/docker/Linux-JDK18/Dockerfile b/docker/Linux-JDK18/Dockerfile index c080846f0..ac131292b 100644 --- a/docker/Linux-JDK18/Dockerfile +++ b/docker/Linux-JDK18/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:lunar ENV JAVA_HOME=/opt/jdk ENV PATH=$PATH:/opt/jdk/bin:/opt/maven/bin @@ -23,6 +23,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ zlib1g-dev \ libwebp-dev \ libimage-exiftool-perl \ + libgrokj2k1 \ + grokj2k-tools \ + adduser \ && rm -rf /var/lib/apt/lists/* # Install TurboJpegProcessor dependencies @@ -34,12 +37,12 @@ COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ # Install various other dependencies that aren't in apt # Install GrokProcessor dependencies -RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ - && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ - && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ - && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb \ +#RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ +# && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ +# && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ +# && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb \ # Install OpenJDK - && wget -q https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz \ +RUN wget -q https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz \ && tar xfz openjdk-18_linux-x64_bin.tar.gz \ && mv jdk-18 /opt/jdk \ # Install a newer Maven than the one in apt From 0527dff419ed2c922bde13236cc25e73c75b8524 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 7 Dec 2023 00:22:32 +0000 Subject: [PATCH 32/47] Updating grok install --- docker/Linux-GraalVM20/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docker/Linux-GraalVM20/Dockerfile b/docker/Linux-GraalVM20/Dockerfile index 847a3795f..55b7c044c 100644 --- a/docker/Linux-GraalVM20/Dockerfile +++ b/docker/Linux-GraalVM20/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:lunar ENV JAVA_HOME=/opt/graalvm-ce-java11-20.3.0 ENV GRAALVM_HOME=/opt/graalvm-ce-java11-20.3.0 @@ -20,6 +20,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ zlib1g-dev \ libwebp-dev \ libimage-exiftool-perl \ + libgrokj2k1 \ + grokj2k-tools \ + adduser \ && rm -rf /var/lib/apt/lists/* # Install TurboJpegProcessor dependencies @@ -30,10 +33,10 @@ COPY docker/Linux-JDK11/image_files/libjpeg-turbo/lib64 /opt/libjpeg-turbo/lib COPY dist/deps/Linux-x86-64/lib/* /usr/lib/ # Install GrokProcessor dependencies -RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ - && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ - && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ - && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb +#RUN wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/libgrokj2k1_7.6.5-1_amd64.deb \ +# && wget -q https://github.com/GrokImageCompression/grok/releases/download/v7.6.5/grokj2k-tools_7.6.5-1_amd64.deb \ +# && dpkg -i --ignore-depends=libjpeg62-turbo ./grokj2k-tools_7.6.5-1_amd64.deb +# && dpkg -i ./libgrokj2k1_7.6.5-1_amd64.deb \ # Install GraalVM RUN wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.0/graalvm-ce-java11-linux-amd64-20.3.0.tar.gz \ From 283d85e7f950352839c0727b865d650ed4eb03ef Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 12:47:30 +0000 Subject: [PATCH 33/47] Adding changes to v 5.0.6 --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f73866d82..5496b8600 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,8 @@ fixes an HTTP 415 error that would occur when trying to do that. * Fixed a crop-offset bug that could occur when using PdfBoxProcessor to generate JPEGs with libjpeg-turbo active. +* Updating libraries to fix security issues. Full details in [#634](https://github.com/cantaloupe-project/cantaloupe/issues/634) +* Update of Jena to 4.8 requires RDF to have a populated rdf:about field. May impact some XMP header processing. ## 5.0.5 From 9149ee999a333cd606274b23185c33c07417ce86 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 12:59:56 +0000 Subject: [PATCH 34/47] Adding basic CREDITS.md --- CREDITS.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 CREDITS.md diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 000000000..e0849d234 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,9 @@ +# Credits + +The success of this project is down to the great work done by the developers at the University of Illinois and particularly Alex Dolski who has been the main developer on the project. In 2023 the IIIF consortium offered to help release a security patch as so many IIIF community members are using this great software. + +- Cantaloupe 5.0.6 + * [Glen Robson](https://github.com/glenrobson/) with support from the [IIIF Consortium](https://iiif.io/community/consortium/) + +- Cantaloupe v1 - v6 + * [Alex Dolski](https://github.com/adolski), University of Illinois \ No newline at end of file From 31c4aaa5de4201182a5ca29a4943bc03c43c65f6 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 14:43:52 +0000 Subject: [PATCH 35/47] Updating logback version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 79ec8477c..7b61c98bd 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 9.4.3.0 3.0.0-M5 2.53.0 - 1.2.12 + 1.2.13 1.7.36 From 985b9ae212cc2b7560eb3d710cce2ceb2358ac2d Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 15:01:51 +0000 Subject: [PATCH 36/47] Updating libraries for security --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7b61c98bd..9fdf896a3 100644 --- a/pom.xml +++ b/pom.xml @@ -17,10 +17,10 @@ UTF-8 2.15.28 2.15.2 - 9.4.52.v20230823 + 9.4.53.v20231009 9.4.3.0 3.0.0-M5 - 2.53.0 + 2.53.1 1.2.13 1.7.36 @@ -109,7 +109,7 @@ com.squareup.okhttp3 okhttp - 5.0.0-alpha.11 + 5.0.0-alpha.12 @@ -205,12 +205,12 @@ org.apache.jena jena-core - 4.9.0 + 4.10.0 org.apache.jena jena-arq - 4.9.0 + 4.10.0 From 1874a81da2b5f27ca0aed028a807fe4931913770 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 15:40:57 +0000 Subject: [PATCH 37/47] Updating mvn verify plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9fdf896a3..e84df2045 100644 --- a/pom.xml +++ b/pom.xml @@ -533,7 +533,7 @@ org.owasp dependency-check-maven - 5.2.4 + 9.0.9 From cdb1ce9c66e167bb9be6114f0fd0b814d46ac7ff Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 16:18:50 +0000 Subject: [PATCH 38/47] Updating libraries identified by mvn verify --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e84df2045..28be79d27 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 11 UTF-8 UTF-8 - 2.15.28 + 2.23.8 2.15.2 9.4.53.v20231009 9.4.3.0 @@ -139,7 +139,7 @@ io.lettuce lettuce-core - 6.2.6.RELEASE + 6.2.7.RELEASE From f8840945a6bf16541f28b617dda69a12d9422364 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 16:39:59 +0000 Subject: [PATCH 39/47] Updating spot bugs --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28be79d27..b9fb00f6e 100644 --- a/pom.xml +++ b/pom.xml @@ -432,13 +432,13 @@ com.github.spotbugs spotbugs-maven-plugin - 4.1.3 + 4.8.3.0 com.github.spotbugs spotbugs - 4.1.4 + 4.8.3 From 0e9ad45c1f9f2868882a770df3221b76d4c7b7f9 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 16:53:14 +0000 Subject: [PATCH 40/47] Rolling back s3 version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9fb00f6e..11a1ad7ec 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 11 UTF-8 UTF-8 - 2.23.8 + 2.15.28 2.15.2 9.4.53.v20231009 9.4.3.0 From 026b69bcd9bec10ca5d77ef3c1010e9a71dd7972 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 18:28:38 +0000 Subject: [PATCH 41/47] Adding wait before testing if purged --- .../illinois/library/cantaloupe/cache/AbstractCacheTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java b/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java index 600391e3b..3dcbf0d9c 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java @@ -307,6 +307,9 @@ void testPurge() throws Exception { // purge everything instance.purge(); + // Allow time for purge + Thread.sleep(ASYNC_WAIT); + // assert that the info has been purged assertFalse(instance.getInfo(identifier).isPresent()); From bf2ee95625662cb38b7d360fd2e83f4b7a158de2 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 18:47:45 +0000 Subject: [PATCH 42/47] Speeding up test --- .../illinois/library/cantaloupe/cache/AbstractCacheTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java b/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java index 3dcbf0d9c..a8d2ad570 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/cache/AbstractCacheTest.java @@ -307,8 +307,8 @@ void testPurge() throws Exception { // purge everything instance.purge(); - // Allow time for purge - Thread.sleep(ASYNC_WAIT); + // Allow time for purge but not as long as upload + Thread.sleep(ASYNC_WAIT / 2); // assert that the info has been purged assertFalse(instance.getInfo(identifier).isPresent()); From ae6f431c271ed38d7fae084877e0f22d2499a1bf Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 19:05:34 +0000 Subject: [PATCH 43/47] Adding a pause after purge --- .../edu/illinois/library/cantaloupe/cache/S3CacheTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/edu/illinois/library/cantaloupe/cache/S3CacheTest.java b/src/test/java/edu/illinois/library/cantaloupe/cache/S3CacheTest.java index f2019fe06..d900a64b3 100644 --- a/src/test/java/edu/illinois/library/cantaloupe/cache/S3CacheTest.java +++ b/src/test/java/edu/illinois/library/cantaloupe/cache/S3CacheTest.java @@ -317,6 +317,9 @@ void testPurgeWithKeyPrefix() throws Exception { // purge everything instance.purge(); + // Allow some time for the purge to succeed + Thread.sleep(ASYNC_WAIT / 2); + // assert that the info has been purged assertFalse(instance.getInfo(identifier).isPresent()); From f95a1a34f1e25ea4d15bae6dca5fbb798ebf1988 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 24 Jan 2024 19:05:51 +0000 Subject: [PATCH 44/47] Trying a newer version of AWS --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11a1ad7ec..28b9dc726 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 11 UTF-8 UTF-8 - 2.15.28 + 2.21.4 2.15.2 9.4.53.v20231009 9.4.3.0 From 747942f6b00c68cc6011a7ee01642ace8665b9fc Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 8 May 2024 13:34:01 +0100 Subject: [PATCH 45/47] Updating Jetty --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94f60f209..fb8027428 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,8 @@ 2.21.4 2.15.2 - 9.4.53.v20231009 + + 11.0.5 9.4.3.0 3.0.0-M5 2.53.1 From 9e38b56204371271b7a595ec5e7100d617e0a942 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 8 May 2024 13:46:51 +0100 Subject: [PATCH 46/47] Resolving merge with added blob issue. --- .../edu/illinois/library/cantaloupe/cache/JdbcCache.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java index ee09c2997..8784f560d 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java +++ b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java @@ -56,7 +56,7 @@ private class ImageBlobOutputStream extends CompletableOutputStream { private final OutputStream blobOutputStream; private final OperationList ops; private final Connection connection; - private final Blob blob; + private final PreparedStatement statement; /** * Constructor for writing derivative images. @@ -82,6 +82,10 @@ private class ImageBlobOutputStream extends CompletableOutputStream { final Blob blob = connection.createBlob(); blobOutputStream = blob.setBinaryStream(1); + statement = connection.prepareStatement(sql); + statement.setString(1, ops.toString()); + statement.setBlob(2, blob); + statement.setTimestamp(3, now()); } @Override From 1a1c8785b69dfe2577c92a06c8e628490b26ce74 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Wed, 8 May 2024 15:43:08 +0100 Subject: [PATCH 47/47] Going with develop fix --- .../library/cantaloupe/cache/JdbcCache.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java index 8784f560d..58ce6caca 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java +++ b/src/main/java/edu/illinois/library/cantaloupe/cache/JdbcCache.java @@ -91,22 +91,8 @@ private class ImageBlobOutputStream extends CompletableOutputStream { @Override public void close() throws IOException { LOGGER.debug("Closing stream for {}", ops); - PreparedStatement statement = null; try { if (isComplete()) { - blobOutputStream.close(); - final Configuration config = Configuration.getInstance(); - final String sql = String.format( - "INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", - config.getString(Key.JDBCCACHE_DERIVATIVE_IMAGE_TABLE), - DERIVATIVE_IMAGE_TABLE_OPERATIONS_COLUMN, - DERIVATIVE_IMAGE_TABLE_IMAGE_COLUMN, - DERIVATIVE_IMAGE_TABLE_LAST_ACCESSED_COLUMN); - LOGGER.debug(sql); - statement = connection.prepareStatement(sql); - statement.setString(1, ops.toString()); - statement.setBlob(2, blob); - statement.setTimestamp(3, now()); statement.executeUpdate(); connection.commit(); } else {