[java-idp-plugin-jetty] branch main updated: JJETTY-29 - runjetty.sh support for externally set environment

Scott Cantor cantor.2 at osu.edu
Wed Nov 12 16:56:37 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-idp-plugin-jetty.

View the commit online:
https://git.shibboleth.net/view/?p=java-idp-plugin-jetty.git;a=commit;h=625eb445b10230d9e3fbdd5e79e24f85d2b6c548

The following commit(s) were added to refs/heads/main by this push:
     new 625eb44  JJETTY-29 - runjetty.sh support for externally set environment
625eb44 is described below

commit 625eb445b10230d9e3fbdd5e79e24f85d2b6c548
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Nov 12 11:52:06 2025 -0500

    JJETTY-29 - runjetty.sh support for externally set environment
    
    https://shibboleth.atlassian.net/browse/JJETTY-29
    
    Removed extra IdPModules in favor of one
    Default to 127.0.0.1 8080 and 8443
    Adjust runjetty.sh to backstop JETTY_HOME/BASE
    Add --exec and & flags to startup command for systemd
    Add environment override stub for runjetty.sh
---
 .../idp/module/jetty/JettyIdPModule.java           |  34 ----
 .../shibboleth/idp/module/jetty/JettySPModule.java |  34 ----
 .../services/net.shibboleth.idp.module.IdPModule   |   2 -
 .../net/shibboleth/idp/module/jetty/jetty.service  |   6 +-
 .../net/shibboleth/idp/module/jetty/jettyenv.sh    |   7 +
 .../shibboleth/idp/module/jetty/module.properties  | 194 +++++++++------------
 .../net/shibboleth/idp/module/jetty/runjetty.sh    |  14 +-
 7 files changed, 105 insertions(+), 186 deletions(-)

diff --git a/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettyIdPModule.java b/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettyIdPModule.java
deleted file mode 100644
index c1cd1b4..0000000
--- a/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettyIdPModule.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.shibboleth.idp.module.jetty;
-
-import java.io.IOException;
-
-import net.shibboleth.idp.Version;
-import net.shibboleth.idp.module.impl.PluginIdPModule;
-import net.shibboleth.profile.module.ModuleException;
-
-/**
- * Module to create start.d/idp.ini
- */
-public class JettyIdPModule extends PluginIdPModule {
-
-    /**
-     * Constructor.
-     */
-    public JettyIdPModule() throws IOException, ModuleException {
-        super(Version.getVersion(), JettyIdPModule.class);
-    }
-
-}
diff --git a/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettySPModule.java b/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettySPModule.java
deleted file mode 100644
index 878d0c8..0000000
--- a/jetty-impl/src/main/java/net/shibboleth/idp/module/jetty/JettySPModule.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.shibboleth.idp.module.jetty;
-
-import java.io.IOException;
-
-import net.shibboleth.idp.Version;
-import net.shibboleth.idp.module.impl.PluginIdPModule;
-import net.shibboleth.profile.module.ModuleException;
-
-/**
- * Module to create start.d/sp.ini
- */
-public class JettySPModule extends PluginIdPModule {
-
-    /**
-     * Constructor.
-     */
-    public JettySPModule() throws IOException, ModuleException {
-        super(Version.getVersion(), JettySPModule.class);
-    }
-
-}
diff --git a/jetty-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/jetty-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
index 2a2a37e..317b6dc 100644
--- a/jetty-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
+++ b/jetty-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
@@ -1,3 +1 @@
 net.shibboleth.idp.module.jetty.JettyModule
-net.shibboleth.idp.module.jetty.JettyIdPModule
-net.shibboleth.idp.module.jetty.JettySPModule
diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jetty.service b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jetty.service
index 33be77a..e912458 100644
--- a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jetty.service
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jetty.service
@@ -18,11 +18,9 @@ Restart=no
 TimeoutSec=45
 KillMode=process
 
-# TODO: Not sure what these paths should be.
+WorkingDirectory=/opt/jetty-base
 
-WorkingDirectory=/opt/jetty
-
-ExecStart=/opt/jetty/jetty-start.sh
+ExecStart=/opt/jetty/runjetty.sh
 
 ExecStop=/bin/kill ${MAINPID}
 
diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jettyenv.sh b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jettyenv.sh
new file mode 100644
index 0000000..2f0713b
--- /dev/null
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/jettyenv.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+# This is a sourced stub for injecting your own environment variables into the runjetty script,
+# principally JETTY_BASE and JETTY_HOME if you want to manage them yourself.
+
+#JETTY_HOME=
+#JETTY_BASE=
diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/module.properties b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/module.properties
index e688fde..c9989f4 100644
--- a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/module.properties
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/module.properties
@@ -1,126 +1,104 @@
 # Properties defining this module.
 
 # Class to Module ID mappings
-net.shibboleth.idp.module.jetty.JettyModule = jetty.module
-net.shibboleth.idp.module.jetty.JettyIdPModule = jetty.idp.module
-net.shibboleth.idp.module.jetty.JettySPModule = jetty.sp.module
+net.shibboleth.idp.module.jetty.JettyModule = jetty.Core
 
 # Module Owner
-jetty.module.plugin = net.shibboleth.idp.plugin.jetty
+jetty.Core.plugin = net.shibboleth.idp.plugin.jetty
 
-jetty.module.name = Jetty Base Module
-jetty.module.desc = Base configuration for Jetty
+jetty.Core.name = Jetty Core Module
+jetty.Core.desc = Jetty configurations for use with Shibboleth along with supporting scripts and tools.
 
-jetty.module.1.src = /net/shibboleth/idp/module/jetty/jetty-base-12/etc/jetty-requestlog.xml
-jetty.module.1.dest = jetty-base-12/etc/jetty-requestlog.xml
+jetty.Core.1.src = /net/shibboleth/idp/module/jetty/jetty-base-12/etc/jetty-requestlog.xml
+jetty.Core.1.dest = jetty-base-12/etc/jetty-requestlog.xml
 
-jetty.module.2.src = /net/shibboleth/idp/module/jetty/jetty-base-12/modules/idp.mod
-jetty.module.2.dest = jetty-base-12/modules/idp.mod
+jetty.Core.2.src = /net/shibboleth/idp/module/jetty/jetty-base-12/modules/shibboleth.mod
+jetty.Core.2.dest = jetty-base-12/modules/shibboleth.mod
+jetty.Core.2.replace = true
 
-jetty.module.3.src = /net/shibboleth/idp/module/jetty/jetty-base-12/modules/sp.mod
-jetty.module.3.dest = jetty-base-12/modules/sp.mod
+jetty.Core.3.src = /net/shibboleth/idp/module/jetty/jetty-base-12/resources/logback.xml
+jetty.Core.3.dest = jetty-base-12/resources/logback.xml
 
-jetty.module.4.src = /net/shibboleth/idp/module/jetty/jetty-base-12/resources/logback.xml
-jetty.module.4.dest = jetty-base-12/resources/logback.xml
+jetty.Core.4.src = /net/shibboleth/idp/module/jetty/jetty-base-12/webapps/idp.xml
+jetty.Core.4.dest = jetty-base-12/webapps/idp.xml
 
-jetty.module.5.src = /net/shibboleth/idp/module/jetty/jetty-base-12/webapps/idp.xml
-jetty.module.5.dest = jetty-base-12/webapps/idp.xml
+jetty.Core.5.src = /net/shibboleth/idp/module/jetty/jetty-base-12/webapps/static.xml
+jetty.Core.5.dest = jetty-base-12/webapps/static.xml
 
-jetty.module.6.src = /net/shibboleth/idp/module/jetty/jetty-base-12/webapps/static.xml
-jetty.module.6.dest = jetty-base-12/webapps/static.xml
+jetty.Core.6.src = /net/shibboleth/idp/module/jetty/jetty-base-12/static/index.html
+jetty.Core.6.dest = static/index.html
 
-jetty.module.7.src = /net/shibboleth/idp/module/jetty/jetty-base-12/static/index.html
-jetty.module.7.dest = static/index.html
+jetty.Core.7.src = /net/shibboleth/idp/module/jetty/jetty-cli.jar
+jetty.Core.7.dest = bin/net.shibboleth.idp.jetty-base/jetty-cli.jar
+jetty.Core.7.replace = true
 
-jetty.module.8.src = /net/shibboleth/idp/module/jetty/jetty-cli.jar
-jetty.module.8.dest = bin/net.shibboleth.idp.jetty-base/jetty-cli.jar
-jetty.module.8.replace = true
-
-jetty.module.9.src = /net/shibboleth/idp/module/jetty/jetty-base-12/start.d/shibboleth.ini
-jetty.module.9.dest = jetty-base-12/start.d/shibboleth.ini
+jetty.Core.8.src = /net/shibboleth/idp/module/jetty/jetty-base-12/start.d/shibboleth.ini
+jetty.Core.8.dest = jetty-base-12/start.d/shibboleth.ini
 
 #
 # Command lines (bat and sh)
 #
-jetty.module.10.src = /net/shibboleth/idp/module/jetty/runjetty.bat
-jetty.module.10.dest = bin/runjetty.bat
-jetty.module.10.nonwindows = false
-jetty.module.10.windows = true
-jetty.module.10.replace = true
-
-jetty.module.11.src = /net/shibboleth/idp/module/jetty/runjetty.sh
-jetty.module.11.dest = bin/runjetty.sh
-jetty.module.11.nonwindows = true
-jetty.module.11.windows = false
-jetty.module.11.exec = true
-
-jetty.module.12.src = /net/shibboleth/idp/module/jetty/config-jetty.bat
-jetty.module.12.dest = bin/config-jetty.bat
-jetty.module.12.nonwindows = false
-jetty.module.12.windows = true
-jetty.module.12.replace = true
-
-jetty.module.13.src = /net/shibboleth/idp/module/jetty/downloadjetty.bat
-jetty.module.13.dest = bin/downloadjetty.bat
-jetty.module.13.nonwindows = false
-jetty.module.13.windows = true
-jetty.module.13.replace = true
-
-jetty.module.14.src = /net/shibboleth/idp/module/jetty/downloadjetty.sh
-jetty.module.14.dest = bin/downloadjetty.sh
-jetty.module.14.nonwindows = true
-jetty.module.14.windows = false
-jetty.module.14.exec = true
-jetty.module.14.replace = true
-
-jetty.module.15.src = /net/shibboleth/idp/module/jetty/downloadprocrun.bat
-jetty.module.15.dest = bin/downloadprocrun.bat
-jetty.module.15.nonwindows = false
-jetty.module.15.windows = true
-jetty.module.15.replace = true
-
-jetty.module.16.src = /net/shibboleth/idp/module/jetty/setprocrunversion.bat
-jetty.module.16.dest = bin/setprocrunversion.bat
-jetty.module.16.nonwindows = false
-jetty.module.16.windows = true
-jetty.module.16.replace = true
-
-jetty.module.17.src = /net/shibboleth/idp/module/jetty/setjettyversion.bat
-jetty.module.17.dest = bin/setjettyversion.bat
-jetty.module.17.nonwindows = false
-jetty.module.17.windows = true
-jetty.module.17.replace = true
-
-jetty.module.18.src = /net/shibboleth/idp/module/jetty/setjettybase.bat
-jetty.module.18.dest = bin/setjettybase.bat
-jetty.module.18.nonwindows = false
-jetty.module.18.windows = true
-jetty.module.18.replace = true
-
-jetty.module.19.src = /net/shibboleth/idp/module/jetty/jetty-base-download-keystore.gpg
-jetty.module.19.dest = credentials/jetty-base-download-keystore.gpg
-jetty.module.19.replace = false
-
-#
-# Specific IdP module
-#
-jetty.idp.module.plugin = net.shibboleth.idp.plugin.jetty
-jetty.idp.module.name = Jetty Base IdP Module
-jetty.idp.module.desc = Configures Jetty to run the IdP
-
-
-jetty.idp.module.1.src = /net/shibboleth/idp/module/jetty/jetty-base-12/start.d/idp.ini
-jetty.idp.module.1.dest = jetty-base-12/start.d/idp.ini
-jetty.idp.module.1.replace = false
-
-#
-# Specific SP module
-#
-jetty.sp.module.plugin = net.shibboleth.idp.plugin.jetty
-jetty.sp.module.name = Jetty Base SP Module
-jetty.sp.module.desc = Configures Jetty to run the SP Hub
-
-
-jetty.sp.module.1.src = /net/shibboleth/idp/module/jetty/jetty-base-12/start.d/sp.ini
-jetty.sp.module.1.dest = jetty-base-12/start.d/sp.ini
-jetty.sp.module.1.replace = false
+jetty.Core.9.src = /net/shibboleth/idp/module/jetty/runjetty.bat
+jetty.Core.9.dest = bin/runjetty.bat
+jetty.Core.9.nonwindows = false
+jetty.Core.9.windows = true
+jetty.Core.9.replace = true
+
+jetty.Core.10.src = /net/shibboleth/idp/module/jetty/runjetty.sh
+jetty.Core.10.dest = bin/runjetty.sh
+jetty.Core.10.nonwindows = true
+jetty.Core.10.windows = false
+jetty.Core.10.exec = true
+
+jetty.Core.11.src = /net/shibboleth/idp/module/jetty/jettyenv.sh
+jetty.Core.11.dest = bin/jettyenv.sh
+jetty.Core.11.nonwindows = true
+jetty.Core.11.windows = false
+jetty.Core.11.exec = true
+
+jetty.Core.12.src = /net/shibboleth/idp/module/jetty/config-jetty.bat
+jetty.Core.12.dest = bin/config-jetty.bat
+jetty.Core.12.nonwindows = false
+jetty.Core.12.windows = true
+jetty.Core.12.replace = true
+
+jetty.Core.13.src = /net/shibboleth/idp/module/jetty/downloadjetty.bat
+jetty.Core.13.dest = bin/downloadjetty.bat
+jetty.Core.13.nonwindows = false
+jetty.Core.13.windows = true
+jetty.Core.13.replace = true
+
+jetty.Core.14.src = /net/shibboleth/idp/module/jetty/downloadjetty.sh
+jetty.Core.14.dest = bin/downloadjetty.sh
+jetty.Core.14.nonwindows = true
+jetty.Core.14.windows = false
+jetty.Core.14.exec = true
+jetty.Core.14.replace = true
+
+jetty.Core.15.src = /net/shibboleth/idp/module/jetty/downloadprocrun.bat
+jetty.Core.15.dest = bin/downloadprocrun.bat
+jetty.Core.15.nonwindows = false
+jetty.Core.15.windows = true
+jetty.Core.15.replace = true
+
+jetty.Core.16.src = /net/shibboleth/idp/module/jetty/setprocrunversion.bat
+jetty.Core.16.dest = bin/setprocrunversion.bat
+jetty.Core.16.nonwindows = false
+jetty.Core.16.windows = true
+jetty.Core.16.replace = true
+
+jetty.Core.17.src = /net/shibboleth/idp/module/jetty/setjettyversion.bat
+jetty.Core.17.dest = bin/setjettyversion.bat
+jetty.Core.17.nonwindows = false
+jetty.Core.17.windows = true
+jetty.Core.17.replace = true
+
+jetty.Core.18.src = /net/shibboleth/idp/module/jetty/setjettybase.bat
+jetty.Core.18.dest = bin/setjettybase.bat
+jetty.Core.18.nonwindows = false
+jetty.Core.18.windows = true
+jetty.Core.18.replace = true
+
+jetty.Core.19.src = /net/shibboleth/idp/module/jetty/jetty-base-download-keystore.gpg
+jetty.Core.19.dest = credentials/jetty-base-download-keystore.gpg
+jetty.Core.19.replace = false
diff --git a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/runjetty.sh b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/runjetty.sh
index 0d0ac69..14c1e5b 100644
--- a/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/runjetty.sh
+++ b/jetty-impl/src/main/resources/net/shibboleth/idp/module/jetty/runjetty.sh
@@ -12,6 +12,11 @@ declare JETTY_TMP
 
 LOCATION=$(dirname $0)
 
+# Source our deployer stub.
+if [ -e $LOCATION/jettyenv.sh ] ; then
+  source $LOCATION/jettyenv.sh
+fi
+
 if [ -z "$JAVACMD" ] ; then 
   if [ -n "$JAVA_HOME"  ] ; then
     JAVACMD=$JAVA_HOME/bin/java
@@ -28,12 +33,14 @@ fi
 
 IDP_HOME=$(realpath ${LOCATION}/..)
 
+JETTY_HOME=${JETTY_HOME:-$IDP_HOME/jetty-home}
 if [ ! -e "$JETTY_HOME/start.jar" ] ; then
   echo "Error: JETTY_HOME is not defined correctly."
   echo " $JETTY_HOME/start.jar not found"
   exit 1
 fi
 
+JETTY_BASE=${JETTY_BASE:-$IDP_HOME/jetty-base}
 if [ ! -d "$JETTY_BASE/start.d" ] ; then
   echo "Error: JETTY_BASE is not defined correctly."
   echo " $JETTY_BASE/start.d not found"
@@ -47,9 +54,8 @@ if [ ! -e "$JETTY_TMP" ] ; then
 fi
 
 
-JVM_ARGS="-Didp.home=$IDP_HOME -Djdk.tls.ephemeralDHKeySize=2048 -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog -Djava.io.tmpdir=$JETTY_TMP -XX:+UseG1GC"
-
-JETTY_ARGS="jetty.base=$JETTY_BASE jetty.logging.dir=$IDP_HOME/logs"
+JVM_ARGS="-Didp.home=$IDP_HOME -Djdk.tls.ephemeralDHKeySize=2048 -Djava.io.tmpdir=$JETTY_TMP -XX:+UseG1GC"
 
-$JAVACMD  $JAVA_OPTS '-jar' $JETTY_HOME/start.jar  $JVM_ARGS  $JETTY_ARGS  "$@"
+JETTY_ARGS="jetty.base=$JETTY_BASE jetty.logging.dir=$IDP_HOME/logs --exec"
 
+$JAVACMD $JAVA_OPTS '-jar' $JETTY_HOME/start.jar $JVM_ARGS $JETTY_ARGS "$@" &

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list