[java-idp-jetty-base] 12/18: IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
Rod Widdowson
rdw at steadingsoftware.com
Tue Oct 15 15:14:59 UTC 2024
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch dev/IDP-2297
in repository java-idp-jetty-base.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-jetty-base.git;a=commit;h=44e765e3a616b32d0ee06baba513e58dd45a4281
commit 44e765e3a616b32d0ee06baba513e58dd45a4281
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Sep 25 14:33:26 2024 +0100
IDP-2297 Explore extending the Plugin and Module Infrastructure to allow Jetty installation
https://shibboleth.atlassian.net/browse/IDP-2297
Checkpoint work on the script to set up the system serice for jetty
---
.../idp/plugin/jettybase/module/config-jetty.bat | 65 ++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
new file mode 100644
index 0000000..5bee6a2
--- /dev/null
+++ b/jetty-base-impl/src/main/resources/net/shibboleth/idp/plugin/jettybase/module/config-jetty.bat
@@ -0,0 +1,65 @@
+rem @echo off
+setlocal
+
+REM We need a JVM
+if not defined JAVA_HOME (
+ echo Error: JAVA_HOME is not defined.
+ exit /b
+)
+
+if not exist "%JAVA_HOME%\bin\server\jvm.dll" (
+ echo Error: %JAVA_HOME%\bin\server\jvm.dll not found
+ exit /b
+)
+
+set IDP_HOME_WINDOWS=%~dp0..
+set JETTY_BASE=%~dp0..\jetty-base
+set PRUNSRV=%IDP_HOME_WINDOWS%\shibd_idp\prunsrv.exe
+
+for /f "tokens=* USEBACKQ" %%F in (`type "%JETTY_BASE%\jetty.base.linux"`) do (
+ SET IDP_HOME_UNIX=%%F
+)
+
+if "%1" EQU "UNINSTALL" (
+ @echo on
+ %PRUNSRV% //DS//Shibd_idp
+ exit /b
+)
+
+if NOT "%1" EQU "INSTALL" (
+ echo "Usage : XXXX [INSTALL|UNINSTALL] [User]
+ exit /b
+)
+
+if NOT "%2" EQU "" (
+ USERNAME=%2
+ SET /P PASSWORD="Password for %USERNAME%: "
+ USERPASSDIRECTIVE="--ServiceUser=%USERNAME% --ServicePassword=%PASSWORD%
+)
+
+REM
+REM First up create and configure the procrun instance which will run jetty
+REM This is described in
+REM https://commons.apache.org/proper/commons-daemon/procrun.html
+REM And what is set comes from the jetty documentation
+REM
+SET PORTPASS=%random%-%random%-%random%-%random%
+SET JVMOPTIONS="++JvmOptions=-DIdpHome=%IDP_HOME_UNIX%" ++JvmOptions=-Djdk.tls.ephemeralDHKeySize=2048 ++JvmOptions=-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog "++JvmOptions=java.io.tmpdir=%JETTY_BASE%\tmp" --JvmMx=2048
+
+%PRUNSRV% //IS/Shibd_idp --Startup auto %USERPASSDIRECTIVE% "--LogPath=%IDP_HOME_WINDOWS%\logs" "--Classpath=%JETTY_BASE%\start.jar"
+%PRUNSRV% //ES/Shibd_idp %JVMOPTIONS%
+%PRUNSRV% //ES/Shibd_idp --StartMode=jvm --StartClass=org.eclipse.jetty.start.Main ++StartParams=STOP_PORT=8963 ++StartParams=STOP.KEY=%PORTPASS% "++StartParams=jetty.base=%JETTY_BASE" "++StartParams=jetty.logging.dir=%IDP_HOME_WINDOWS%\logs"
+%PRUNSRV% //ES/Shibd_idp --StopMode=jvm --StopClass=org.eclipse.jetty.start.Main ++StopParams---stop ++StopParams=STOP_PORT=8963 ++StopParams=STOP.KEY=%PORTPASS% "++StopParams=jetty.base=%JETTY_BASE" "++StopParams=jetty.logging.dir=%IDP_HOME_WINDOWS%\logs"
+
+REM
+REM With that done poke holes in the firewall using "netsh advfirewall"
+REM
+.
+REM
+REM And finally lock down the install
+REM
+call %~dp0\setacl.bat %USERNAME%
+
+exit /b
+
+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list