Skip to content

Commit

Permalink
Merge pull request #2180 from gschueler/feature/jetty-upgrade
Browse files Browse the repository at this point in the history
Feature/jetty upgrade
  • Loading branch information
gschueler committed Nov 17, 2016
2 parents 51256c5 + e13ef6c commit 2a86a48
Show file tree
Hide file tree
Showing 28 changed files with 122 additions and 79 deletions.
2 changes: 1 addition & 1 deletion packaging/debroot/etc/rundeck/jaas-loginmodule.conf
@@ -1,5 +1,5 @@
RDpropertyfilelogin {
org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="/etc/rundeck/realm.properties";
};
2 changes: 1 addition & 1 deletion packaging/root/etc/rundeck/jaas-loginmodule.conf
@@ -1,5 +1,5 @@
RDpropertyfilelogin {
org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="/etc/rundeck/realm.properties";
};
12 changes: 10 additions & 2 deletions packaging/rundeck.spec
Expand Up @@ -15,6 +15,8 @@ RunDeck, is no ordinary wooden deck. You can build a bon fire on this deck.
Rundeck provides a single console for dispatching commands across many resources.

%changelog
* Wed Nov 16 2016 Greg Schueler <greg@simplifyops.com> 2.7.0-0
- Upgraded jetty jar dependencies
* Tue Jan 20 2015 Greg Schueler <greg@simplifyops.com> 2.5-0
- Fix cli jar file versions, fix changelog date
* Sat Apr 19 2014 Diomidis Spinellis <dds@aueb.gr> 2.0-4
Expand Down Expand Up @@ -77,12 +79,18 @@ fi

# Server Bootstrap
%dir /var/lib/rundeck/bootstrap
/var/lib/rundeck/bootstrap/jetty-all-7.6.0.v20120127.jar
/var/lib/rundeck/bootstrap/javax.servlet-3.0.0.v201112011016.jar
/var/lib/rundeck/bootstrap/jetty-all-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-security-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-server-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-util-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-io-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-http-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/jetty-jaas-9.0.7.v20131107.jar
/var/lib/rundeck/bootstrap/log4j-1.2.16.jar
/var/lib/rundeck/bootstrap/jna-3.2.2.jar
/var/lib/rundeck/bootstrap/libpam4j-1.5.jar
/var/lib/rundeck/bootstrap/rundeck-jetty-server-%{_vname}.jar
/var/lib/rundeck/bootstrap/servlet-api-2.5.jar
/var/lib/rundeck/bootstrap/not-yet-commons-ssl-0.3.11.jar

# CLI Lib Support
Expand Down
2 changes: 1 addition & 1 deletion run-api-tests.sh
Expand Up @@ -143,7 +143,7 @@ run_ci_test(){
echo "Rundeck process PID: $RDPID"
fi

wait_for $DIR/rundeck.out 'Started SelectChannelConnector@'
wait_for $DIR/rundeck.out 'Started ServerConnector@'

echo "Rundeck started."

Expand Down
2 changes: 1 addition & 1 deletion rundeck-launcher/build.gradle
Expand Up @@ -25,7 +25,7 @@ eclipse.project.name = "${project.getParent().eclipse.project.name}:launcher"

subprojects{
defaultTasks 'clean','assemble'
ext.jettyVersion='7.6.0.v20120127'
ext.jettyVersion='9.0.7.v20131107'
}

task createPom << {
Expand Down
4 changes: 2 additions & 2 deletions rundeck-launcher/launcher/build.gradle
Expand Up @@ -28,8 +28,8 @@ archivesBaseName = 'rundeck-launcher'
defaultTasks 'clean','launcherJar'
ext.launcherMainClass = mainClassName
ext.launcherStartClass = "com.dtolabs.rundeck.RunServer"
ext.launcherJettyLibs = "servlet-api-2.5-20081211.jar jetty-${jettyVersion}.jar jetty-util-${jettyVersion}.jar jetty-naming-${jettyVersion}.jar jetty-plus-${jettyVersion}.jar jna-3.2.2.jar libpam4j-1.5.jar not-yet-commons-ssl-0.3.11.jar"
ext.launcherJettyLibsUnexpanded = 'servlet-api-2.5-20081211.jar jetty-${jettyVersion}.jar jetty-util-${jettyVersion}.jar jetty-naming-${jettyVersion}.jar jetty-plus-${jettyVersion}.jar jna-3.2.2.jar libpam4j-1.5.jar not-yet-commons-ssl-0.3.11.jar'
ext.launcherJettyLibs = "javax.servlet-3.0.0.v201112011016.jar jetty-${jettyVersion}.jar jetty-security-${jettyVersion}.jar jetty-server-${jettyVersion}.jar jetty-util-${jettyVersion}.jar jetty-io-${jettyVersion}.jar jetty-http-${jettyVersion}.jar jetty-jaas-${jettyVersion}.jar jna-3.2.2.jar libpam4j-1.5.jar not-yet-commons-ssl-0.3.11.jar"
ext.launcherJettyLibsUnexpanded = 'javax.servlet-3.0.0.v201112011016.jar jetty-${jettyVersion}.jar jetty-security-${jettyVersion}.jar jetty-server-${jettyVersion}.jar jetty-util-${jettyVersion}.jar jetty-io-${jettyVersion}.jar jetty-http-${jettyVersion}.jar jetty-jaas-${jettyVersion}.jar jna-3.2.2.jar libpam4j-1.5.jar not-yet-commons-ssl-0.3.11.jar'
ext.launcherJettyLibPath = "pkgs/webapp/WEB-INF/lib"

ext.launcherContentsDir = new File("$projectDir/build/launcher-contents")
Expand Down
@@ -1,5 +1,5 @@
RDpropertyfilelogin {
org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="${realm.properties.location}";
};
8 changes: 5 additions & 3 deletions rundeck-launcher/rundeck-jetty-server/build.gradle
Expand Up @@ -29,14 +29,16 @@ dependencies {
compile(
[group: 'log4j', name: 'log4j', version: '1.2.16',ext:'jar'],
[group: 'commons-cli', name: 'commons-cli', version: '1.0',ext:'jar'],
[group: 'org.eclipse.jetty.aggregate', name: 'jetty-all', version: jettyVersion,ext:'jar'],
[group: 'org.eclipse.jetty.aggregate', name: 'jetty-all', version: jettyVersion],
[group: 'org.eclipse.jetty', name: 'jetty-jaas', version: jettyVersion],
[group: 'org.kohsuke', name:'libpam4j', version:'1.5', ext:'jar'],
// This is in httpcomponents 4+ but stuck on 3.x for now.
[group: 'ca.juliusdavies', name: 'not-yet-commons-ssl', version: '0.3.11', ext: 'jar'],
)
runtime(
[group: 'org.eclipse.jetty.aggregate', name: 'jetty-all', version: jettyVersion, ext: 'jar'],
[group: 'javax.servlet', name: 'servlet-api', version: '2.5', ext: 'jar'],
[group: 'org.eclipse.jetty.aggregate', name: 'jetty-all', version: jettyVersion],
[group: 'org.eclipse.jetty', name: 'jetty-jaas', version: jettyVersion],
// [group: 'org.eclipse.jetty.orbit', name: 'javax.servlet', version: '3.0.0.v201112011016'],
)
testCompile (
[group: 'junit', name: 'junit', version: '4.8.1',ext:'jar'],
Expand Down
Expand Up @@ -16,15 +16,14 @@

package com.dtolabs.rundeck;

import org.eclipse.jetty.plus.jaas.JAASLoginService;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.jaas.JAASLoginService;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.server.Handler;

import java.io.*;
import java.util.Properties;

Expand Down Expand Up @@ -146,24 +145,44 @@ private boolean isSSLEnabled() {
}

private void configureHTTPConnector(final Server server) {
final SelectChannelConnector connector = new SelectChannelConnector();
HttpConfiguration http_config = new HttpConfiguration();
http_config.setOutputBufferSize(32768);
if (Boolean.getBoolean(RUNDECK_JETTY_CONNECTOR_FORWARDED)) {
ForwardedRequestCustomizer forwarding = new ForwardedRequestCustomizer();
http_config.addCustomizer(forwarding);
}
final ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory(http_config));
connector.setPort(port);
connector.setHost(System.getProperty(SERVER_HTTP_HOST, null));
connector.setForwarded(Boolean.getBoolean(RUNDECK_JETTY_CONNECTOR_FORWARDED));
server.addConnector(connector);
}

private void configureSSLConnector(final Server server) {
//configure ssl
final SslSelectChannelConnector connector = new SslSelectChannelConnector();
connector.setPort(httpsPort);
connector.setMaxIdleTime(30000);
connector.setForwarded(Boolean.getBoolean(RUNDECK_JETTY_CONNECTOR_FORWARDED));
SslContextFactory cf = connector.getSslContextFactory();
HttpConfiguration http_config = new HttpConfiguration();
http_config.setSecureScheme("https");
http_config.setSecurePort(httpsPort);
http_config.setOutputBufferSize(32768);

ServerConnector http = new ServerConnector(
server,
new HttpConnectionFactory(http_config)
);
http.setPort(httpsPort);
http.setIdleTimeout(30000);

HttpConfiguration https_config = new HttpConfiguration(http_config);
SecureRequestCustomizer src = new SecureRequestCustomizer();

// src.setStsMaxAge(2000);
// src.setStsIncludeSubDomains(true);

https_config.addCustomizer(src);
SslContextFactory cf = new SslContextFactory();
cf.setKeyStorePath(keystore);
cf.setKeyStorePassword(keystorePassword);
cf.setKeyManagerPassword(keyPassword);
cf.setTrustStore(truststore);
cf.setTrustStorePath(truststore);
cf.setTrustStorePassword(truststorePassword);
cf.setExcludeProtocols(
System.getProperty(
Expand Down Expand Up @@ -192,8 +211,20 @@ private void configureSSLConnector(final Server server) {
if(includeCipherSuites!=null) {
cf.setIncludeCipherSuites(includeCipherSuites.split(","));
}
connector.setHost(System.getProperty(SERVER_HTTP_HOST, null));
server.addConnector(connector);
ServerConnector https = new ServerConnector(
server,
new SslConnectionFactory(cf, HttpVersion.HTTP_1_1.asString()),
new HttpConnectionFactory(https_config)
);
if (Boolean.getBoolean(RUNDECK_JETTY_CONNECTOR_FORWARDED)) {
ForwardedRequestCustomizer forwarding = new ForwardedRequestCustomizer();
https_config.addCustomizer(forwarding);
}
https.setPort(httpsPort);
https.setIdleTimeout(500000);
https.setHost(System.getProperty(SERVER_HTTP_HOST, null));

server.setConnectors(new Connector[]{http, https});
}

/**
Expand Down
Expand Up @@ -24,9 +24,9 @@
package com.dtolabs.rundeck.jetty.jaas;

import org.apache.log4j.Logger;
import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
import org.eclipse.jetty.plus.jaas.spi.AbstractLoginModule;
import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.callback.ObjectCallback;
import org.eclipse.jetty.jaas.spi.AbstractLoginModule;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.security.Credential;

Expand Down
Expand Up @@ -41,9 +41,9 @@
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.LoginException;

import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
import org.eclipse.jetty.plus.jaas.spi.AbstractLoginModule;
import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.callback.ObjectCallback;
import org.eclipse.jetty.jaas.spi.AbstractLoginModule;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.security.Credential;
Expand Down
Expand Up @@ -16,9 +16,9 @@

package org.rundeck.jaas.jetty;

import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
import org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule;
import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.callback.ObjectCallback;
import org.eclipse.jetty.jaas.spi.PropertyFileLoginModule;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.rundeck.jaas.AbstractSharedLoginModule;

import javax.security.auth.Subject;
Expand Down
Expand Up @@ -16,8 +16,8 @@

package org.rundeck.jaas.jetty;

import org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule;
import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.spi.PropertyFileLoginModule;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.rundeck.jaas.AbstractSharedLoginModule;

import javax.security.auth.Subject;
Expand Down
Expand Up @@ -16,9 +16,9 @@

package org.rundeck.jaas.jetty;

import org.eclipse.jetty.plus.jaas.JAASPrincipal;
import org.eclipse.jetty.plus.jaas.JAASRole;
import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
import org.eclipse.jetty.jaas.JAASPrincipal;
import org.eclipse.jetty.jaas.JAASRole;
import org.eclipse.jetty.jaas.callback.ObjectCallback;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
Expand Down
Expand Up @@ -22,8 +22,8 @@
import java.util.Hashtable;
import java.util.List;

import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.callback.ObjectCallback;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.junit.Assert;
import org.junit.Test;

Expand Down
Expand Up @@ -16,7 +16,7 @@

package com.dtolabs.rundeck.jetty.jaas;

import org.eclipse.jetty.plus.jaas.spi.UserInfo;
import org.eclipse.jetty.jaas.spi.UserInfo;
import org.junit.Test;

import javax.naming.NamingEnumeration;
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/authfilter/grails-app/conf/BuildConfig.groovy
Expand Up @@ -43,7 +43,7 @@ grails.project.dependency.resolution = {
}

plugins {
build(":jetty:2.0.3",
build(":jetty:3.0.0",
":release:2.2.1",
":rest-client-builder:1.0.3") {
export = false
Expand Down
6 changes: 3 additions & 3 deletions rundeckapp/grails-app/conf/BuildConfig.groovy
Expand Up @@ -59,7 +59,7 @@ if(System.properties['disable.grails.central']) {
grails.plugin.location.webrealms = 'webrealms'
grails.plugin.location.metricsweb = 'metricsweb'
grails.plugin.location.authfilter = 'authfilter'

grails.servlet.version = "3.0"
grails.project.dependency.resolution = {
inherits 'global' // inherit Grails' default dependencies
log 'warn' // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
Expand Down Expand Up @@ -102,7 +102,7 @@ grails.project.dependency.resolution = {
runtime ':profiler:0.5'
runtime ':miniprofiler:0.4.1'
provided ':codenarc:0.22'
build ':jetty:2.0.3'
build ':jetty:3.0.0'
}

dependencies {
Expand Down Expand Up @@ -133,7 +133,7 @@ grails.project.dependency.resolution = {
}
}
grails.war.resources = { stagingDir, args ->
delete(file: "${stagingDir}/WEB-INF/lib/jetty-all-7.6.0.v20120127.jar")
delete(file: "${stagingDir}/WEB-INF/lib/jetty-all-9.0.7.v20131107.jar")
delete(file: "${stagingDir}/WEB-INF/lib/rundeck-jetty-server-${rundeckVersion}.jar")
delete(file: "${stagingDir}/WEB-INF/lib/servlet-api-2.5.jar")
if(System.getProperty('rundeck.war.additional')!=null){
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/metricsweb/grails-app/conf/BuildConfig.groovy
Expand Up @@ -50,7 +50,7 @@ grails.project.dependency.resolution = {
}

plugins {
build(":jetty:2.0.3",
build(":jetty:3.0.0",
":release:2.2.1",
":rest-client-builder:1.0.3") {
export = false
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/web-app/WEB-INF/jaas.conf
@@ -1,5 +1,5 @@
rundecklogin {
org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule
required
debug="true"
file="web-app/WEB-INF/jaaslogin.properties";
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/webrealms/grails-app/conf/BuildConfig.groovy
Expand Up @@ -44,7 +44,7 @@ grails.project.dependency.resolution = {
}

plugins {
build(":jetty:2.0.3",
build(":jetty:3.0.0",
":release:2.2.1",
":rest-client-builder:1.0.3") {
export = false
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/webrealms/scripts/Events.groovy
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import org.eclipse.jetty.plus.jaas.JAASLoginService
import org.eclipse.jetty.jaas.JAASLoginService
import org.eclipse.jetty.server.Server;

eventConfigureJetty = { Server server ->
Expand Down
8 changes: 5 additions & 3 deletions test/docker/dockers/rundeck/scripts/start_rundeck.sh
Expand Up @@ -183,15 +183,17 @@ $HOME/server/sbin/rundeckd start
echo "started rundeck"

# Wait for server to start
SUCCESS_MSG="Started SelectChannelConnector@0.0.0.0:"
SUCCESS_MSG="Started ServerConnector@"
MAX_ATTEMPTS=30
SLEEP=10
echo "Waiting for $RUNDECK_NODE to start. This will take about 2 minutes... "
declare -i count=0
while (( count <= MAX_ATTEMPTS ))
do
if ! grep "${SUCCESS_MSG}" "$LOGFILE"
then echo "Still working. hang on..."; # output a progress character.
if ! [ -f "$LOGFILE" ]
then echo "Waiting. hang on..."; # output a progress character.
elif ! grep "${SUCCESS_MSG}" "$LOGFILE" ; then
echo "Still working. hang on..."; # output a progress character.
else break; # found successful startup message.
fi
(( count += 1 )) ; # increment attempts counter.
Expand Down
2 changes: 2 additions & 0 deletions test/docker/test.sh
Expand Up @@ -33,6 +33,8 @@ docker-compose -f $DOCKER_COMPOSE_SPEC exec -T --user rundeck rundeck1 bash scri
EC=$?
echo "run_tests.sh finished with: $EC"

docker-compose -f $DOCKER_COMPOSE_SPEC logs

# Stop and clean all
docker-compose -f $DOCKER_COMPOSE_SPEC down --volumes --remove-orphans

Expand Down
4 changes: 2 additions & 2 deletions test/vagrant/centos-yum-vbox-ci/bootstrap.sh
Expand Up @@ -77,7 +77,7 @@ then
let count=0
while true
do
if ! grep "Started SelectChannelConnector@" /var/log/rundeck/service.log
if ! grep "Started ServerConnector@" /var/log/rundeck/service.log
then printf >&2 ".";# progress output.
else break; # successful message.
fi
Expand All @@ -92,7 +92,7 @@ else
let count=0
while true
do
if ! grep "Started SelectChannelConnector@" /var/log/rundeck/service.log
if ! grep "Started ServerConnector@" /var/log/rundeck/service.log
then printf >&2 ".";# progress output.
else break; # successful message.
fi
Expand Down

0 comments on commit 2a86a48

Please sign in to comment.