diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-19 09:04:50 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-10 18:58:09 -0400 |
commit | 8b87994373f018fe8a7b092831ad6f6bdca1ad6e (patch) | |
tree | a95dbda849e77ac4c6d2bebe3e0eb6f0d0776214 | |
parent | 13331ae61c7f08b4a202a531e005915147467bd8 (diff) | |
download | gitblit-8b87994373f018fe8a7b092831ad6f6bdca1ad6e.tar.gz gitblit-8b87994373f018fe8a7b092831ad6f6bdca1ad6e.zip |
Improve isServingRepositories check
4 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index fa681ac1..59408a68 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -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()}; } diff --git a/src/main/java/com/gitblit/manager/RuntimeManager.java b/src/main/java/com/gitblit/manager/RuntimeManager.java index 45d1ea12..9805701b 100644 --- a/src/main/java/com/gitblit/manager/RuntimeManager.java +++ b/src/main/java/com/gitblit/manager/RuntimeManager.java @@ -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); } /** diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index 93121cfb..e0fc8bbd 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -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, ""); diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java index bcd84b66..0f31b31e 100644 --- a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java @@ -165,7 +165,7 @@ public class RepositoryUrlPanel extends BasePanel { if (repository.isMirror) {
urlPanel.add(WicketUtils.newImage("accessRestrictionIcon", "mirror_16x16.png",
getString("gb.isMirror")));
- } else if (app().runtime().isServingRepositories()) {
+ } else if (app().gitblit().isServingRepositories()) {
switch (repository.accessRestriction) {
case NONE:
urlPanel.add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|