From e902064590962412b45f3d6ffccaece401f7f5c1 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 11 Apr 2014 13:41:14 -0400 Subject: [PATCH] Allow user to disable checksum verification on plugin registry refresh --- src/main/java/com/gitblit/manager/GitblitManager.java | 4 ++-- src/main/java/com/gitblit/manager/IPluginManager.java | 4 +++- .../transport/ssh/commands/PluginDispatcher.java | 11 +++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gitblit/manager/GitblitManager.java b/src/main/java/com/gitblit/manager/GitblitManager.java index 191d7cf1..5fca0c24 100644 --- a/src/main/java/com/gitblit/manager/GitblitManager.java +++ b/src/main/java/com/gitblit/manager/GitblitManager.java @@ -1250,8 +1250,8 @@ public class GitblitManager implements IGitblit { } @Override - public boolean refreshRegistry() { - return pluginManager.refreshRegistry(); + public boolean refreshRegistry(boolean verifyChecksum) { + return pluginManager.refreshRegistry(verifyChecksum); } @Override diff --git a/src/main/java/com/gitblit/manager/IPluginManager.java b/src/main/java/com/gitblit/manager/IPluginManager.java index 33763aa8..fd4247ed 100644 --- a/src/main/java/com/gitblit/manager/IPluginManager.java +++ b/src/main/java/com/gitblit/manager/IPluginManager.java @@ -118,8 +118,10 @@ public interface IPluginManager extends IManager { /** * Refresh the plugin registry. + * + * @param verifyChecksum */ - boolean refreshRegistry(); + boolean refreshRegistry(boolean verifyChecksum); /** * Install the plugin from the specified url. diff --git a/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java b/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java index 99dd6d13..19cefe02 100644 --- a/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java +++ b/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java @@ -410,10 +410,14 @@ public class PluginDispatcher extends DispatchCommand { @CommandMetaData(name = "refresh", description = "Refresh the plugin registry data") public static class RefreshPlugins extends SshCommand { + + @Option(name = "--noverify", usage = "Disable checksum verification") + private boolean disableChecksum; + @Override public void run() throws Failure { IGitblit gitblit = getContext().getGitblit(); - gitblit.refreshRegistry(); + gitblit.refreshRegistry(!disableChecksum); } } @@ -426,11 +430,14 @@ public class PluginDispatcher extends DispatchCommand { @Option(name = "--updates", aliases = { "-u" }, usage = "show available updates") protected boolean updates; + @Option(name = "--noverify", usage = "Disable checksum verification") + private boolean disableChecksum; + @Override protected List getItems() throws UnloggedFailure { IGitblit gitblit = getContext().getGitblit(); if (refresh) { - gitblit.refreshRegistry(); + gitblit.refreshRegistry(!disableChecksum); } List list; -- 2.39.5