]> source.dussan.org Git - gitblit.git/commitdiff
allow configuring of internal URLs offered 274/head 56/256/1
authorJoel Johnson <joel.johnson@issinc.com>
Fri, 12 Jun 2015 23:46:31 +0000 (17:46 -0600)
committerJoel Johnson <joel.johnson@issinc.com>
Fri, 12 Jun 2015 23:46:31 +0000 (17:46 -0600)
src/main/distrib/data/defaults.properties
src/main/java/com/gitblit/manager/ServicesManager.java

index c17506894554026f6dc18cf544e5730cb88ae83f..ae519a10659a4fe9d2c2bd1a5adad9784021c320 100644 (file)
@@ -1168,6 +1168,24 @@ web.forwardSlashCharacter = /
 # SINCE 0.5.0
 web.otherUrls = 
 
+# Should HTTP/HTTPS URLs be displayed if the git servlet is enabled?
+# default: true
+#
+# SINCE 1.7.0
+web.showHttpServletUrls = true
+
+# Should git URLs be displayed if the git daemon is enabled?
+# default: true
+#
+# SINCE 1.7.0
+web.showGitDaemonUrls = true
+
+# Should SSH URLs be displayed if the SSH daemon is enabled?
+# default: true
+#
+# SINCE 1.7.0
+web.showSshDaemonUrls = true
+
 # Should app-specific clone links be displayed for SourceTree, SparkleShare, etc?
 #
 # SINCE 1.3.0
index 69e5e408ba58be2afc263b8bba53a94fa38cd1c0..5a957a177a9da4f1b46704f56a1d9d15321d9fd7 100644 (file)
@@ -162,7 +162,8 @@ public class ServicesManager implements IServicesManager {
                List<RepositoryUrl> list = new ArrayList<RepositoryUrl>();
 
                // http/https url
-               if (settings.getBoolean(Keys.git.enableGitServlet, true)) {
+               if (settings.getBoolean(Keys.git.enableGitServlet, true) &&
+                       settings.getBoolean(Keys.web.showHttpServletUrls, true)) {
                        AccessPermission permission = user.getRepositoryPermission(repository).permission;
                        if (permission.exceeds(AccessPermission.NONE)) {
                                Transport transport = Transport.fromString(request.getScheme());
@@ -177,7 +178,8 @@ public class ServicesManager implements IServicesManager {
 
                // ssh daemon url
                String sshDaemonUrl = getSshDaemonUrl(request, user, repository);
-               if (!StringUtils.isEmpty(sshDaemonUrl)) {
+               if (!StringUtils.isEmpty(sshDaemonUrl) &&
+                       settings.getBoolean(Keys.web.showSshDaemonUrls, true)) {
                        AccessPermission permission = user.getRepositoryPermission(repository).permission;
                        if (permission.exceeds(AccessPermission.NONE)) {
                                if (permission.atLeast(AccessPermission.PUSH) && !acceptsPush(Transport.SSH)) {
@@ -192,7 +194,8 @@ public class ServicesManager implements IServicesManager {
 
                // git daemon url
                String gitDaemonUrl = getGitDaemonUrl(request, user, repository);
-               if (!StringUtils.isEmpty(gitDaemonUrl)) {
+               if (!StringUtils.isEmpty(gitDaemonUrl) &&
+                               settings.getBoolean(Keys.web.showGitDaemonUrls, true)) {
                        AccessPermission permission = getGitDaemonAccessPermission(user, repository);
                        if (permission.exceeds(AccessPermission.NONE)) {
                                if (permission.atLeast(AccessPermission.PUSH) && !acceptsPush(Transport.GIT)) {