Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
files: build/libs/resize.war
secrets: inherit

docker_publish:
permissions:
contents: read
needs:
- release
uses: jeffersonlab/container-workflows/.github/workflows/docker-publish.yaml@v2
with:
semvertag: ${{ needs.release.outputs.semvertag }}
secrets: inherit
# COMMENTED OUT BECAUSE OF ISSUE #4
#docker_publish:
# permissions:
# contents: read
# needs:
# - release
# uses: jeffersonlab/container-workflows/.github/workflows/docker-publish.yaml@v2
# with:
# semvertag: ${{ needs.release.outputs.semvertag }}
# secrets: inherit

acctest_deploy:
permissions:
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILD_IMAGE=gradle:9-jdk21
ARG RUN_IMAGE=quay.io/wildfly/wildfly:26.1.3.Final-jdk17
ARG RUN_IMAGE=jeffersonlab/wildfly:2.2.0

################## Stage 0
FROM ${BUILD_IMAGE} AS builder
Expand All @@ -24,7 +24,6 @@ RUN if [ -z "${CUSTOM_CRT_URL}" ] ; then echo "No custom cert needed"; else \
curl -sS -o /etc/pki/ca-trust/source/anchors/customcert.crt $CUSTOM_CRT_URL \
&& update-ca-trust \
&& keytool -import -alias custom -file /etc/pki/ca-trust/source/anchors/customcert.crt -cacerts -storepass changeit -noprompt \
; fi \
&& yum install -y ImageMagick
; fi
USER jboss
ENV MOGRIFY='/usr/bin/mogrify'
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# resize [![CI](https://github.com/JeffersonLab/resize/actions/workflows/ci.yaml/badge.svg)](https://github.com/JeffersonLab/resize/actions/workflows/ci.yaml) [![Docker](https://img.shields.io/docker/v/jeffersonlab/resize?sort=semver&label=DockerHub)](https://hub.docker.com/r/jeffersonlab/resize)
A [Java EE 8](https://en.wikipedia.org/wiki/Jakarta_EE) web application for resizing images via a wrapper to [ImageMagick](https://imagemagick.org/), developed for use by [Presenter](https://github.com/JeffersonLab/presenter).
A [Jakarta EE 10](https://en.wikipedia.org/wiki/Jakarta_EE) web application for resizing images via a wrapper to [ImageMagick](https://imagemagick.org/), developed for use by [Presenter](https://github.com/JeffersonLab/presenter).

![Screenshot](https://github.com/JeffersonLab/resize/raw/main/Screenshot.png?raw=true "Screenshot")

Expand Down Expand Up @@ -31,7 +31,7 @@ http://localhost:8080/resize
This application requires a Java 17+ JVM and standard library to run, plus a Java EE 8+ application server (developed with Wildfly).

1. Install ImageMagick
2. Download [Wildfly 26.1.3](https://www.wildfly.org/downloads/)
2. Download [Wildfly 37.0.1](https://www.wildfly.org/downloads/)
3. [Configure](https://github.com/JeffersonLab/resize#configure) Wildfly and start it
4. Download [resize.war](https://github.com/JeffersonLab/resize/releases) and deploy it to Wildfly
5. Navigate your web browser to [localhost:8080/resize](http://localhost:8080/resize)
Expand Down Expand Up @@ -60,10 +60,10 @@ gradlew build
- The [Create release](https://github.com/JeffersonLab/java-workflows/blob/main/.github/workflows/gh-release.yaml) GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details. A war file artifact is attached to the release.

## Deploy
At JLab this app is found internally at [wildfly6.acc.jlab.org/resize](https://wildfly6.acc.jlab.org/resize) and at [wildflytest6.acc.jlab.org/resize](https://wildflytest6.acc.jlab.org/resize). The `ace.jlab.org` and `acctest.acc.jlab.org` proxy servers do not proxy this internal only service. A [deploy script](https://github.com/JeffersonLab/wildfly/blob/main/scripts/deploy.sh) is provided to automate wget and deploy. Example:
At JLab this app is found internally at [wildfly5.acc.jlab.org/resize](https://wildfly6.acc.jlab.org/resize) and at [wildflytest5.acc.jlab.org/resize](https://wildflytest6.acc.jlab.org/resize). The `ace.jlab.org` and `acctest.acc.jlab.org` proxy servers do not proxy this internal only service. A [deploy script](https://github.com/JeffersonLab/wildfly/blob/main/scripts/deploy.sh) is provided to automate wget and deploy. Example:

```
/root/setup/deploy.sh resize v1.2.3
/opt/wildfly/cd/deploy.sh resize v1.2.3
```

**JLab Internal Docs**: [InstallGuideWildflyRHEL9](https://accwiki.acc.jlab.org/do/view/SysAdmin/InstallGuideWildflyRHEL9)
**JLab Internal Docs**: [RHEL9 Wildfly](https://acgdocs.acc.jlab.org/en/ace/builds/rhel9-wildfly)
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ repositories {
mavenCentral()
}
dependencies {
providedCompile 'javax:javaee-api:8.0.1',
'javax.servlet:jstl:1.2'
// Wildfly 37.0.1.Final provides:
providedCompile 'jakarta.platform:jakarta.jakartaee-api:10.0.0',
'org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1'
}
tasks.named('jar') {
enabled = false
}
war {
archiveFileName = 'resize.war'
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/jlab/resize/ConverterController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package org.jlab.resize;

import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.MultipartConfig;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Part;
import java.awt.Dimension;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
Expand All @@ -16,14 +24,6 @@
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import org.jlab.resize.util.IOUtil;

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app version="6.0"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd">
<context-param>
<param-name>appName</param-name>
<param-value>image-magic</param-value>
Expand Down