diff options
-rw-r--r-- | .classpath | 18 | ||||
-rw-r--r-- | build.moxie | 2 | ||||
-rw-r--r-- | gitblit.iml | 54 | ||||
-rw-r--r-- | src/main/java/com/gitblit/GitBlitServer.java | 20 |
4 files changed, 47 insertions, 47 deletions
@@ -25,15 +25,15 @@ <classpathentry kind="lib" path="ext/javax.mail-1.5.6.jar" sourcepath="ext/src/javax.mail-1.5.6.jar" /> <classpathentry kind="lib" path="ext/activation-1.1.jar" sourcepath="ext/src/activation-1.1.jar" /> <classpathentry kind="lib" path="ext/javax.servlet-api-3.1.0.jar" sourcepath="ext/src/javax.servlet-api-3.1.0.jar" /> - <classpathentry kind="lib" path="ext/jetty-servlet-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-servlet-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-security-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-security-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-server-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-server-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-continuation-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-continuation-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-http-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-http-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-io-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-io-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-util-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-util-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-webapp-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-webapp-9.3.16.v20170120.jar" /> - <classpathentry kind="lib" path="ext/jetty-xml-9.3.16.v20170120.jar" sourcepath="ext/src/jetty-xml-9.3.16.v20170120.jar" /> + <classpathentry kind="lib" path="ext/jetty-servlet-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-servlet-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-security-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-security-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-server-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-server-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-continuation-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-continuation-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-http-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-http-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-io-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-io-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-util-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-util-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-webapp-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-webapp-9.4.49.v20220914.jar" /> + <classpathentry kind="lib" path="ext/jetty-xml-9.4.49.v20220914.jar" sourcepath="ext/src/jetty-xml-9.4.49.v20220914.jar" /> <classpathentry kind="lib" path="ext/wicket-1.4.22.jar" sourcepath="ext/src/wicket-1.4.22.jar" /> <classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.22.jar" sourcepath="ext/src/wicket-auth-roles-1.4.22.jar" /> <classpathentry kind="lib" path="ext/wicket-extensions-1.4.22.jar" sourcepath="ext/src/wicket-extensions-1.4.22.jar" /> diff --git a/build.moxie b/build.moxie index dd26d3f6..0631391d 100644 --- a/build.moxie +++ b/build.moxie @@ -105,7 +105,7 @@ repositories: central, eclipse-snapshots, eclipse, gitblit # Convenience properties for dependencies properties: { - jetty.version : 9.3.16.v20170120 + jetty.version : 9.4.49.v20220914 slf4j.version : 1.7.29 wicket.version : 1.4.22 lucene.version : 5.5.2 diff --git a/gitblit.iml b/gitblit.iml index 2f1bfb32..49b2dedd 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -222,101 +222,101 @@ </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-servlet-9.3.16.v20170120.jar"> + <library name="jetty-servlet-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-servlet-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-servlet-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-servlet-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-servlet-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-security-9.3.16.v20170120.jar"> + <library name="jetty-security-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-security-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-security-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-security-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-security-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-server-9.3.16.v20170120.jar"> + <library name="jetty-server-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-server-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-server-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-server-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-server-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-continuation-9.3.16.v20170120.jar"> + <library name="jetty-continuation-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-continuation-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-continuation-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-continuation-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-continuation-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-http-9.3.16.v20170120.jar"> + <library name="jetty-http-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-http-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-http-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-http-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-http-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-io-9.3.16.v20170120.jar"> + <library name="jetty-io-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-io-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-io-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-io-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-io-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-util-9.3.16.v20170120.jar"> + <library name="jetty-util-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-util-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-util-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-util-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-util-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-webapp-9.3.16.v20170120.jar"> + <library name="jetty-webapp-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-webapp-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-webapp-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-webapp-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-webapp-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> - <library name="jetty-xml-9.3.16.v20170120.jar"> + <library name="jetty-xml-9.4.49.v20220914.jar"> <CLASSES> - <root url="jar://$MODULE_DIR$/ext/jetty-xml-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/jetty-xml-9.4.49.v20220914.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> - <root url="jar://$MODULE_DIR$/ext/src/jetty-xml-9.3.16.v20170120.jar!/" /> + <root url="jar://$MODULE_DIR$/ext/src/jetty-xml-9.4.49.v20220914.jar!/" /> </SOURCES> </library> </orderEntry> diff --git a/src/main/java/com/gitblit/GitBlitServer.java b/src/main/java/com/gitblit/GitBlitServer.java index ae01e8e0..d91b3be0 100644 --- a/src/main/java/com/gitblit/GitBlitServer.java +++ b/src/main/java/com/gitblit/GitBlitServer.java @@ -44,7 +44,8 @@ import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; -import org.eclipse.jetty.server.session.HashSessionManager; +import org.eclipse.jetty.server.session.SessionHandler; +import org.eclipse.jetty.servlet.ListenerHolder; import org.eclipse.jetty.util.security.Constraint; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.WebAppContext; @@ -302,7 +303,6 @@ public class GitBlitServer { } ServerConnector connector = new ServerConnector(server, factory); - connector.setSoLingerTime(-1); connector.setIdleTimeout(settings.getLong(Keys.server.httpIdleTimeout, 30000L)); connector.setPort(params.securePort); String bindInterface = settings.getString(Keys.server.httpsBindInterface, null); @@ -339,7 +339,6 @@ public class GitBlitServer { httpConfig.setSendDateHeader(false); ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory(httpConfig)); - connector.setSoLingerTime(-1); connector.setIdleTimeout(settings.getLong(Keys.server.httpIdleTimeout, 30000L)); connector.setPort(params.port); String bindInterface = settings.getString(Keys.server.httpBindInterface, null); @@ -381,13 +380,13 @@ public class GitBlitServer { rootContext.setWar(location.toExternalForm()); rootContext.setTempDirectory(tempDir); + // Set cookies HttpOnly so they are not accessible to JavaScript engines - HashSessionManager sessionManager = new HashSessionManager(); - sessionManager.setHttpOnly(true); + SessionHandler sessionHandler = rootContext.getSessionHandler(); + sessionHandler.setHttpOnly(true); // Use secure cookies if only serving https - sessionManager.setSecureRequestOnly( (params.port <= 0 && params.securePort > 0) || - (params.port > 0 && params.securePort > 0 && settings.getBoolean(Keys.server.redirectToHttpsPort, true)) ); - rootContext.getSessionHandler().setSessionManager(sessionManager); + sessionHandler.setSecureRequestOnly( (params.port <= 0 && params.securePort > 0) || + (params.port > 0 && params.securePort > 0 && settings.getBoolean(Keys.server.redirectToHttpsPort, true)) ); // Ensure there is a defined User Service String realmUsers = params.userService; @@ -457,8 +456,9 @@ public class GitBlitServer { } // Setup the Gitblit context - GitblitContext gitblit = newGitblit(settings, baseFolder); - rootContext.addEventListener(gitblit); + ListenerHolder gitblitHolder = new ListenerHolder(GitblitContext.class); + gitblitHolder.setListener(newGitblit(settings, baseFolder)); + rootContext.getServletHandler().addListener(gitblitHolder); try { // start the shutdown monitor |