]> source.dussan.org Git - gitblit.git/commitdiff
Allow user to disable checksum verification on plugin registry refresh
authorJames Moger <james.moger@gitblit.com>
Fri, 11 Apr 2014 17:41:14 +0000 (13:41 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 11 Apr 2014 17:48:14 +0000 (13:48 -0400)
src/main/java/com/gitblit/manager/GitblitManager.java
src/main/java/com/gitblit/manager/IPluginManager.java
src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java

index 191d7cf1c1e429dcbbf7c2727d15b28b8374b85c..5fca0c245288975bea2f68843cc13163b93631c6 100644 (file)
@@ -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
index 33763aa860f55545c703dcc48ceb6c276eed90f2..fd4247ed6a34ed6f646efa12e43ead321be0ba4d 100644 (file)
@@ -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.
index 99dd6d13ec08ad2deff67a9a8dc35d5aa1fdedf6..19cefe027b15af9600b29c10c2f2e861c0e04336 100644 (file)
@@ -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<PluginRegistration> getItems() throws UnloggedFailure {
                        IGitblit gitblit = getContext().getGitblit();
                        if (refresh) {
-                               gitblit.refreshRegistry();
+                               gitblit.refreshRegistry(!disableChecksum);
                        }
 
                        List<PluginRegistration> list;