From 9a6714baac529cd8523d4662add889f3d8134f98 Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Fri, 10 Jan 2020 11:35:09 -0700 Subject: [PATCH 1/3] Update to Remoting 3.40. This Remoting version removes old, deprecated, unsupported protocols versions 1, 2, and 3. --- README.md | 4 ---- jenkins-agent | 9 ++------- jenkins-agent.ps1 | 10 ++-------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 28904972a..d2172e4f3 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,6 @@ Optional environment variables: ### Enabled JNLP protocols -By default, the [JNLP3-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp3-connect) is disabled due to the known stability and scalability issues. -You can enable this protocol at your own risk using the -`JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false` property (the protocol should be enabled on the master side as well). - In Jenkins versions starting from `2.27` there is a [JNLP4-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp4-connect) protocol. If you use Jenkins `2.32.x LTS`, it is recommended to enable the protocol on your instance. diff --git a/jenkins-agent b/jenkins-agent index 9b2d31af8..c4563417e 100644 --- a/jenkins-agent +++ b/jenkins-agent @@ -2,7 +2,7 @@ # The MIT License # -# Copyright (c) 2015-2019, CloudBees, Inc. +# Copyright (c) 2015-2020, CloudBees, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -68,11 +68,6 @@ else JENKINS_AGENT_NAME="$JENKINS_NAME" fi - if [ -z "$JNLP_PROTOCOL_OPTS" ]; then - echo "Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to alter the behavior" - JNLP_PROTOCOL_OPTS="-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=true" - fi - if [ -n "$JENKINS_PROTOCOLS" ]; then PROTOCOLS="-protocols $JENKINS_PROTOCOLS" fi @@ -113,5 +108,5 @@ else #TODO: Handle the case when the command-line and Environment variable contain different values. #It is fine it blows up for now since it should lead to an error anyway. - exec $JAVA_BIN $JAVA_OPTS $JNLP_PROTOCOL_OPTS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" + exec $JAVA_BIN $JAVA_OPTS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" fi diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index 05c883be1..ebe8a746c 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2019, Alex Earl +# Copyright (c) 2020, Alex Earl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -88,12 +88,6 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { } $Name = $Name.Trim() - $jnlpProtocolOpts = '' - if([System.String]::IsNullOrWhiteSpace($env:JNLP_PROTOCOL_OPTS)) { - Write-Warning "JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to alter the behavior" - $jnlpProtocolOpts="-D`"org.jenkinsci.remoting.engine.JnlpProtocol3.disabled=true`"" - } - # if java home is defined, use it $JAVA_BIN="java.exe" if(![System.String]::IsNullOrWhiteSpace($JavaHome)) { @@ -114,5 +108,5 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { #TODO: Handle the case when the command-line and Environment variable contain different values. #It is fine it blows up for now since it should lead to an error anyway. - Start-Process -FilePath $JAVA_BIN -Wait -NoNewWindow -ArgumentList $("$jnlpProtocolOpts -cp C:/ProgramData/Jenkins/agent.jar hudson.remoting.jnlp.Main -headless$Tunnel$Url$WorkDir$Secret $Name") + Start-Process -FilePath $JAVA_BIN -Wait -NoNewWindow -ArgumentList $("-cp C:/ProgramData/Jenkins/agent.jar hudson.remoting.jnlp.Main -headless$Tunnel$Url$WorkDir$Secret $Name") } From 735838dc5015481ef681914edd4d547e56de8021 Mon Sep 17 00:00:00 2001 From: Jeff Thompson Date: Fri, 10 Jan 2020 12:18:28 -0700 Subject: [PATCH 2/3] Improve README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2172e4f3..94b2ad78e 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,9 @@ Optional environment variables: ### Enabled JNLP protocols -In Jenkins versions starting from `2.27` there is a [JNLP4-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp4-connect) protocol. -If you use Jenkins `2.32.x LTS`, it is recommended to enable the protocol on your instance. +As of version 3.40-1 this image only supports the [JNLP4-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp4-connect) protocol. +Earlier, long-unsupported protocols have been removed. +As a result, Jenkins versions prior to 2.32 are no longer supported. ### Amazon ECS From f725c5c5ee286bc1483e28c2a78fb033259d3f74 Mon Sep 17 00:00:00 2001 From: Jeff Thompson <37345299+jeffret-b@users.noreply.github.com> Date: Fri, 10 Jan 2020 12:19:59 -0700 Subject: [PATCH 3/3] Fix copyright. Co-Authored-By: Mark Waite --- jenkins-agent.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index ebe8a746c..6457d1e8e 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2020, Alex Earl +# Copyright (c) 2019-2020, Alex Earl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal