Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5ca78f3
Update baseline to 2.282, fixes PCT (detached ssh plugin) (#215)
timja Mar 12, 2021
e5553ea
Bump plugin from 4.15 to 4.16 (#213)
dependabot[bot] Mar 12, 2021
3d24736
Bump plugin from 4.16 to 4.17 (#216)
dependabot[bot] Mar 12, 2021
57d42b9
[maven-release-plugin] prepare release ssh-slaves-1.31.6
kuisathaverat Mar 13, 2021
81e7bc4
[maven-release-plugin] prepare for next development iteration
kuisathaverat Mar 13, 2021
79ba029
test: add SSH connections test for several configurations (#206)
kuisathaverat Mar 19, 2021
c51daff
[JENKINS-65155] The "java is not in the path" warning is show even th…
kuisathaverat Apr 9, 2021
aabe3c1
Bump testcontainers from 1.15.1 to 1.15.2 (#219)
dependabot[bot] Apr 9, 2021
59a6953
[maven-release-plugin] prepare release ssh-slaves-1.31.7
kuisathaverat Apr 9, 2021
d028f37
[maven-release-plugin] prepare for next development iteration
kuisathaverat Apr 9, 2021
4fdae33
Bump testcontainers from 1.15.2 to 1.15.3 (#225)
dependabot[bot] May 1, 2021
5a77c8f
Bump bom-2.277.x from 26 to 28 (#224)
dependabot[bot] May 1, 2021
c3d1bbb
Bump plugin from 4.17 to 4.18 (#223)
dependabot[bot] May 1, 2021
332a6b2
improve error message for Java missing on agent (#222)
peterbecich May 1, 2021
0d620bd
Bump docker-fixtures from 1.10 to 1.11 (#221)
dependabot[bot] May 1, 2021
c9602cd
[JENKINS-65398] Terminology update (#226)
twasyl May 4, 2021
5648f3e
Bump bom-2.277.x from 28 to 29 (#227)
dependabot[bot] May 4, 2021
ebb3160
Bump bom-2.277.x from 29 to 807.v6d348e44c987 (#229)
dependabot[bot] May 15, 2021
b883c7e
Replace usages of `com.google.common.io.ByteStreams` with usages of `…
basil May 15, 2021
bba7096
chore: bump version to 1.32.0
kuisathaverat Jun 5, 2021
918d0f6
[maven-release-plugin] prepare release ssh-slaves-1.32.0
kuisathaverat Jun 5, 2021
38ad3f6
[maven-release-plugin] prepare for next development iteration
kuisathaverat Jun 5, 2021
22f2e08
Bump plugin from 4.18 to 4.19 (#231)
dependabot[bot] Jun 6, 2021
34d997c
Bump bom-2.277.x from 807.v6d348e44c987 to 887.vae9c8ac09ff7 (#235)
dependabot[bot] Jul 2, 2021
1efd677
[JENKINS-65929] Detection of docker is unreliable (#236)
kuisathaverat Jul 2, 2021
24c2d1e
Bump git-changelist-maven-extension from 1.0-beta-7 to 1.2 (#237)
dependabot[bot] Jul 11, 2021
eed7f2a
Bump plugin from 4.19 to 4.20 (#239)
dependabot[bot] Jul 24, 2021
8ab9baa
Bump sshd from 3.0.3 to 3.0.4 (#238)
dependabot[bot] Jul 24, 2021
506b868
update package name for CommandFactory for mina-sshd 2.5.1 (#247)
Aug 20, 2021
ba1d657
Bump plugin from 4.20 to 4.24 (#244)
dependabot[bot] Aug 22, 2021
d03bc5d
Bump bom-2.277.x from 887.vae9c8ac09ff7 to 924.vda78166e6655 (#246)
dependabot[bot] Aug 22, 2021
8c2bfbe
fix: use user and password intead of DSA key in the test (#248)
kuisathaverat Aug 23, 2021
6009893
Bump testcontainers from 1.15.3 to 1.16.0 (#240)
dependabot[bot] Aug 23, 2021
a48f960
chore: bump Jenkins core to 1.289.1 LTS version (#250)
kuisathaverat Aug 25, 2021
22f5f5f
Bump sshd from 3.0.4 to 3.1.0 (#242)
dependabot[bot] Aug 25, 2021
99113ff
[maven-release-plugin] prepare release ssh-slaves-1.33.0
kuisathaverat Aug 25, 2021
21b694b
[maven-release-plugin] prepare for next development iteration
kuisathaverat Aug 25, 2021
8708c63
Bump bom-2.277.x from 924.vda78166e6655 to 937.v51fde92016ed (#251)
dependabot[bot] Sep 1, 2021
4b3a02a
[JENKINS-42969] Use Computer.addAction() (#261)
offa Nov 6, 2021
d86f588
[JENKINS-66601] host key allows ed25519 & ecdsa (#256)
MarkEWaite Nov 6, 2021
b52701e
Updated Readme ## Notes linkname to 1.31 (#252)
thommelutten Nov 6, 2021
affacf5
Bump bom-2.277.x from 937.v51fde92016ed to 961.vf0c9f6f59827 (#258)
dependabot[bot] Nov 6, 2021
7b02af1
Bump plugin from 4.24 to 4.29 (#262)
dependabot[bot] Nov 6, 2021
3045a3c
Add missing nullability annotations and replace JSR 305 (#260)
offa Nov 6, 2021
1dff6b3
Bump plugin from 4.29 to 4.31 (#264)
dependabot[bot] Nov 9, 2021
22bdd5d
Bump testcontainers from 1.16.0 to 1.16.2 (#263)
dependabot[bot] Nov 15, 2021
e51f9bb
Bump git-changelist-maven-extension from 1.2 to 1.6
dependabot[bot] Feb 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ target
.settings
work
bin
.DS_Store
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
<version>1.6</version>
</extension>
</extensions>
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def buildConfiguration = [
[platform: 'linux', jdk: '11'],
]

buildPlugin(configurations: buildConfiguration)
buildPlugin(configurations: buildConfiguration, timeout: 90)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Provides a means to launch agents via SSH.
## Notes

This plugin is formerly known as "SSH Slaves Plugin".
It was renamed in [1.32.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users.
It was renamed in [1.31.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users.
6 changes: 3 additions & 3 deletions doc/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This means that **you have to install a JDK/JRE 8 on your agent** in order to ru

The agent should have **enough memory** to run the remoting process and the builds.

**The agent needs to be reachable from the master**,
**The agent needs to be reachable from the Jenkins controller**,
You have to be ensure that your Jenkins instance can connect through SSH port to your agent; you can check it from the command line.
You will have to supply an account that can log in on the target machine. No root privileges are required.

Expand Down Expand Up @@ -106,7 +106,7 @@ to see if an entry exists that matches the current connection. It is possible to
the Java property `-Dhudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy.known_hosts_file=PATH_TO_FILE`

This method does not make any updates to the Known Hosts file, instead using the file as a read-only source and expecting
someone with suitable access to the appropriate user account on the Jenkins master to update the file as required,
someone with suitable access to the appropriate user account on the Jenkins controller to update the file as required,
potentially using the ssh hostname command to initiate a connection and update the file appropriately.

#### Manually provided key Verification Strategy
Expand All @@ -116,7 +116,7 @@ potentially using the ssh hostname command to initiate a connection and update t
Checks the key provided by the remote host matches the key set by the user who configured this connection.

The SSH key expected for this connection. This key should be in the form `algorithm value`
where algorithm is one of ssh-rsa or ssh-dss, and value is the Base 64 encoded content of the key. The keys should be placed in /etc/ssh/<key_name>.pub
where `algorithm` is one of ssh-rsa, ssh-ed25519, or ecdsa-sha2-nistp256, and `value` is the base 64 encoded content of the key. The public keys for a Linux agent can be read from the agent file system at `/etc/ssh/<key_name>.pub`.

#### Manually trusted key Verification Strategy

Expand Down
9 changes: 5 additions & 4 deletions doc/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ and see [Logging_and_Troubleshooting](https://en.wikibooks.org/wiki/OpenSSH/Logg

### Threads stuck at CredentialsProvider.trackAll

If you detect an adnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this:
If you detect an abnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this:

```
at hudson.XmlFile.write(XmlFile.java:186)
Expand Down Expand Up @@ -140,7 +140,7 @@ java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection

### After upgrade to ssh-slaves 1.28+ Failed to connect using SSH key credentials from files

The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins master ~/.ssh", and "From a file on Jenkins master" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible.
The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins controller ~/.ssh", and "From a file on Jenkins controller" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible.

The issue is related to ssh-credentials and a deprecated type of credentials, the workaround it is to recreate the credential with the same ID using "Enter directly" for the key, probably if you only save again the credential it will be migrated.

Expand All @@ -166,7 +166,8 @@ ConversionException: Could not call com.cloudbees.jenkins.plugins.sshcredentials

### Selenium Grid agents failed to connect

On recent versions of Jenkins Core, [Agent - Master Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it seems causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Master Access Control" (as it's said in Jenkin documentation)
On Jenkins Core 2.89.3, [Agent - Controller Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it can causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Controller Access Control" (as it's said in Jenkins documentation)
you can see more details at [JENKINS-49118](https://issues.jenkins.io/browse/JENKINS-49118)
https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control

"On the other hand, if all your agents are trusted to the same degree as your master, then it is safe to leave this subsystem off"
Expand Down Expand Up @@ -194,7 +195,7 @@ Caused by: java.io.EOFException

### Corrupt agent workdir folder

If you experience a immmediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder.
If you experience an immediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder.

```
Apr 17, 2019 2:16:23 PM INFO hudson.remoting.SynchronousCommandTransport$ReaderThread run
Expand Down
58 changes: 33 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.15</version>
<version>4.31</version>
</parent>

<artifactId>ssh-slaves</artifactId>
Expand All @@ -25,11 +25,11 @@
</licenses>

<properties>
<revision>1.31.6</revision>
<revision>1.33.1</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.222.4</jenkins.version>
<jenkins.version>2.289.1</jenkins.version>
<java.level>8</java.level>
<configuration-as-code.version>1.46</configuration-as-code.version>
<hpi.compatibleSinceVersion>1.31.0</hpi.compatibleSinceVersion>
</properties>

<developers>
Expand Down Expand Up @@ -102,38 +102,45 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.204.x</artifactId>
<version>18</version>
<artifactId>bom-2.277.x</artifactId>
<version>961.vf0c9f6f59827</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>trilead-api</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.3.14</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>sshd</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.test</groupId>
<artifactId>docker-fixtures</artifactId>
<version>1.10</version>
<version>1.11</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -145,27 +152,28 @@
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.16.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<minimumJavaVersion>1.8</minimumJavaVersion>
<compatibleSinceVersion>1.31.0</compatibleSinceVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 6 additions & 6 deletions src/main/java/hudson/plugins/sshslaves/JavaProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package hudson.plugins.sshslaves;

import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.slaves.SlaveComputer;
Expand All @@ -32,13 +33,12 @@

import java.util.List;
import java.util.Collections;
import javax.annotation.Nonnull;

/**
* Guess where Java is.
*/
public abstract class JavaProvider implements ExtensionPoint {

private static final VersionNumber JAVA_LEVEL_8 = new VersionNumber("8");

/**
Expand Down Expand Up @@ -68,12 +68,12 @@ public static ExtensionList<JavaProvider> all() {

/**
* Gets minimal required Java version.
*
* @return Minimal Java version required on the master and agent side.
*
* @return Minimal Java version required on the controller and agent side.
* @since TODO
*
*
*/
@Nonnull
@NonNull
public static VersionNumber getMinJavaLevel() {
return JAVA_LEVEL_8;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import hudson.slaves.SlaveComputer;
import hudson.util.VersionNumber;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.WARNING;

/**
* class to check if the version of java installed on the agent is a supported one.
Expand Down Expand Up @@ -76,17 +75,12 @@ protected String resolveJava() throws InterruptedException, IOException {
try {
return checkJavaVersion(listener, javaCommand);
} catch (IOException e) {
if(!"java".equalsIgnoreCase(javaCommand)){
LOGGER.log(WARNING, "Java is not in the PATH nor configured with the javaPath setting,"
+ " Jenkins will try to guess where is Java,"
+ "this guess will be remove in the future.");
}
LOGGER.log(FINE, "Failed to check the Java version",e);
// try the next one
}
}
}
throw new IOException("Java not found on " + computer + ". Install a Java 8 version on the Agent.");
throw new IOException("Java not found on " + computer + ". Install Java 8 or Java 11 on the Agent.");
}

@NonNull
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/sshslaves/SSHConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel;
import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ItemGroup;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -167,7 +168,7 @@ public SSHConnector(int port, String credentialsId, String jvmOptions, String ja
}

@Override
public SSHLauncher launch(String host, TaskListener listener) {
public SSHLauncher launch(@NonNull String host, TaskListener listener) {
SSHLauncher sshLauncher = new SSHLauncher(host, port, credentialsId, jvmOptions, javaPath, prefixStartSlaveCmd,
suffixStartSlaveCmd, launchTimeoutSeconds, maxNumRetries, retryWaitTime, sshHostKeyVerificationStrategy);
sshLauncher.setWorkDir(workDir);
Expand Down Expand Up @@ -283,6 +284,7 @@ public Boolean getTcpNoDelay() {

@Extension
public static class DescriptorImpl extends ComputerConnectorDescriptor {
@NonNull
@Override
public String getDisplayName() {
return Messages.SSHLauncher_DescriptorDisplayName();
Expand Down
Loading