James Moger
2015-06-15 886d7abd2b5b42f3e7184b19cc588e36bf69f84b
Merged #256 "allow configuring of internal URLs offered"
2 files modified
27 ■■■■ changed files
src/main/distrib/data/defaults.properties 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/ServicesManager.java 9 ●●●●● patch | view | raw | blame | history
src/main/distrib/data/defaults.properties
@@ -1168,6 +1168,24 @@
# 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
src/main/java/com/gitblit/manager/ServicesManager.java
@@ -162,7 +162,8 @@
        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 @@
        // 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 @@
        // 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)) {