Skip to content
Permalink
Browse files

allow configuring of internal URLs offered

  • Loading branch information...
Joel Johnson
Joel Johnson committed Jun 12, 2015
1 parent f3b7e29 commit c20191fc0931a19bec0df1ab2b56f287e5d8b7c7
@@ -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
@@ -162,7 +162,8 @@ protected String getRepositoryUrl(HttpServletRequest request, String username, R
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 @@ protected String getRepositoryUrl(HttpServletRequest request, String username, R

// 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 @@ protected String getRepositoryUrl(HttpServletRequest request, String username, R

// 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)) {

0 comments on commit c20191f

Please sign in to comment.
You can’t perform that action at this time.