From 0d3e3ca5b85d7e81066030a5081ea3a9cbe76607 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 21 Jul 2011 14:48:15 -0400
Subject: [PATCH] Rollback to Jetty 7.4.3 for now.
---
src/com/gitblit/GitBlitServer.java | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/src/com/gitblit/GitBlitServer.java b/src/com/gitblit/GitBlitServer.java
index 61f681f..92305fc 100644
--- a/src/com/gitblit/GitBlitServer.java
+++ b/src/com/gitblit/GitBlitServer.java
@@ -151,6 +151,9 @@
params.port, bindInterface));
httpConnector.setHost(bindInterface);
}
+ if (params.port < 1024 && !isWindows()) {
+ logger.warn("Gitblit needs to run with ROOT permissions for ports < 1024!");
+ }
connectors.add(httpConnector);
}
@@ -171,6 +174,9 @@
params.securePort, bindInterface));
secureConnector.setHost(bindInterface);
}
+ if (params.securePort < 1024 && !isWindows()) {
+ logger.warn("Gitblit needs to run with ROOT permissions for ports < 1024!");
+ }
connectors.add(secureConnector);
} else {
logger.warn("Failed to find or load Keystore?");
@@ -255,7 +261,7 @@
*
* @param useNIO
* @param port
- * @return an http cnonector
+ * @return an http connector
*/
private static Connector createConnector(boolean useNIO, int port) {
Connector connector;
@@ -273,6 +279,9 @@
connector.setPort(port);
connector.setMaxIdleTime(30000);
+ if (port < 1024 && !isWindows()) {
+ logger.warn("Gitblit needs to run with ROOT permissions for ports < 1024!");
+ }
return connector;
}
@@ -306,6 +315,15 @@
connector.setMaxIdleTime(30000);
return connector;
}
+
+ /**
+ * Tests to see if the operating system is Windows.
+ *
+ * @return true if this is a windows machine
+ */
+ private static boolean isWindows() {
+ return System.getProperty("os.name").toLowerCase().indexOf("windows") > -1;
+ }
/**
* The ShutdownMonitorThread opens a socket on a specified port and waits
--
Gitblit v1.9.1