| | |
| | | */ |
| | | package com.gitblit.transport.ssh.commands; |
| | | |
| | | import com.gitblit.IStoredSettings; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.net.MalformedURLException; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import com.gitblit.IStoredSettings; |
| | | import com.gitblit.Keys; |
| | | import com.gitblit.manager.IGitblit; |
| | | import com.gitblit.utils.StringUtils; |
| | |
| | | protected String getRepositoryUrl(String repository) { |
| | | String username = getContext().getClient().getUsername(); |
| | | IStoredSettings settings = getContext().getGitblit().getSettings(); |
| | | String displayHostname = settings.getString(Keys.git.sshDisplayHost, ""); |
| | | String displayHostname = settings.getString(Keys.git.sshAdvertisedHost, ""); |
| | | if(displayHostname.isEmpty()) { |
| | | displayHostname = getHostname(); |
| | | } |
| | | int port = settings.getInteger(Keys.git.sshPort, 0); |
| | | int displayPort = settings.getInteger(Keys.git.sshDisplayPort, port); |
| | | int displayPort = settings.getInteger(Keys.git.sshAdvertisedPort, port); |
| | | if (displayPort == 22) { |
| | | // standard port |
| | | return MessageFormat.format("{0}@{1}/{2}.git", username, displayHostname, repository); |