]> source.dussan.org Git - gitblit.git/commitdiff
Improve isServingRepositories check
authorJames Moger <james.moger@gitblit.com>
Wed, 19 Mar 2014 13:04:50 +0000 (09:04 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Apr 2014 22:58:09 +0000 (18:58 -0400)
src/main/java/com/gitblit/GitBlit.java
src/main/java/com/gitblit/manager/RuntimeManager.java
src/main/java/com/gitblit/manager/ServicesManager.java
src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java

index fa681ac1f9d03d2913e31cbdbd5e17e992fd466c..59408a68a119700fcbe73ee9dece899634b104e0 100644 (file)
@@ -107,6 +107,11 @@ public class GitBlit extends GitblitManager {
                return this;
        }
 
+       @Override
+       public boolean isServingRepositories() {
+               return servicesManager.isServingRepositories();
+       }
+
        protected Object [] getModules() {
                return new Object [] { new GitBlitModule()};
        }
index 45d1ea1248b53e5d8ea26ca7f29715ba7ac0e0dc..9805701b1c428eb96c0a3f79e9f1598c61ecd160 100644 (file)
@@ -116,7 +116,9 @@ public class RuntimeManager implements IRuntimeManager {
         */
        @Override
        public boolean isServingRepositories() {
-               return settings.getBoolean(Keys.git.enableGitServlet, true) || (settings.getInteger(Keys.git.daemonPort, 0) > 0);
+               return settings.getBoolean(Keys.git.enableGitServlet, true)
+                               || (settings.getInteger(Keys.git.daemonPort, 0) > 0)
+                               || (settings.getInteger(Keys.git.sshPort, 0) > 0);
        }
 
        /**
index 93121cfb271b4eeb0fee9737958fd653d5081387..e0fc8bbdb2834868b03be7e4ab51124c256b911e 100644 (file)
@@ -102,6 +102,12 @@ public class ServicesManager implements IManager {
                return this;
        }
 
+       public boolean isServingRepositories() {
+               return settings.getBoolean(Keys.git.enableGitServlet, true)
+                               || (gitDaemon != null && gitDaemon.isRunning())
+                               || (sshDaemon != null && sshDaemon.isRunning());
+       }
+
        protected void configureFederation() {
                boolean validPassphrase = true;
                String passphrase = settings.getString(Keys.federation.passphrase, "");
index bcd84b669b7011944e44f27ce04b01108b0c2ef9..0f31b31ed572140916718646988148795391a134 100644 (file)
@@ -165,7 +165,7 @@ public class RepositoryUrlPanel extends BasePanel {
                if (repository.isMirror) {\r
                        urlPanel.add(WicketUtils.newImage("accessRestrictionIcon", "mirror_16x16.png",\r
                                        getString("gb.isMirror")));\r
-               } else if (app().runtime().isServingRepositories()) {\r
+               } else if (app().gitblit().isServingRepositories()) {\r
                        switch (repository.accessRestriction) {\r
                        case NONE:\r
                                urlPanel.add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));\r