Plugin Manager can not download _site plugins from github

Sounds like github changes a bit download url for master zip file.

From `https://github.com/username/reponame/zipball/master` to `https://codeload.github.com/username/reponame/zip/master`.

We need to update plugin manager to reflect that change.

In the meantime, we invite users having this issue to use:

```sh
bin/plugin -install reponame -url https://codeload.github.com/username/reponame/zip/master
```

For example:

```sh
bin/plugin -install paramedic -url https://codeload.github.com/karmi/elasticsearch-paramedic/zip/master
```

Closes #3551
This commit is contained in:
David Pilato 2013-08-21 16:06:30 +02:00
parent 25d28f8afa
commit 8668479b92
1 changed files with 6 additions and 7 deletions

View File

@ -28,6 +28,10 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
import org.elasticsearch.node.internal.InternalSettingsPerparer; import org.elasticsearch.node.internal.InternalSettingsPerparer;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -36,11 +40,6 @@ import java.util.Enumeration;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS;
/** /**
@ -179,7 +178,7 @@ public class PluginManager {
} }
if (!downloaded) { if (!downloaded) {
// try it as a site plugin tagged // try it as a site plugin tagged
pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/v" + version); pluginUrl = new URL("https://codeload.github.com/" + userName + "/" + repoName + "/zip/v" + version);
System.out.println("Trying " + pluginUrl.toExternalForm() + "... (assuming site plugin)"); System.out.println("Trying " + pluginUrl.toExternalForm() + "... (assuming site plugin)");
try { try {
downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out)); downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));
@ -193,7 +192,7 @@ public class PluginManager {
} }
} else { } else {
// assume site plugin, download master.... // assume site plugin, download master....
URL pluginUrl = new URL("https://github.com/" + userName + "/" + repoName + "/zipball/master"); URL pluginUrl = new URL("https://codeload.github.com/" + userName + "/" + repoName + "/zip/master");
System.out.println("Trying " + pluginUrl.toExternalForm() + "... (assuming site plugin)"); System.out.println("Trying " + pluginUrl.toExternalForm() + "... (assuming site plugin)");
try { try {
downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out)); downloadHelper.download(pluginUrl, pluginFile, new HttpDownloadHelper.VerboseProgress(System.out));