]> source.dussan.org Git - gitblit.git/commitdiff
Renamed ssh.Display(Host|Port) to ssh.Advertised(Host|Port) 59/259/2
authorJames Moger <james.moger@gitblit.com>
Mon, 15 Jun 2015 16:56:23 +0000 (12:56 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 15 Jun 2015 16:56:23 +0000 (12:56 -0400)
src/main/distrib/data/defaults.properties
src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
src/main/java/com/gitblit/transport/ssh/SshDaemon.java
src/main/java/com/gitblit/transport/ssh/WelcomeShell.java
src/main/java/com/gitblit/transport/ssh/commands/SshCommand.java

index 272eec0864fca967ddf021ce9f94fb0cbda07e2f..60c914ba7194b79b1ebb0dcf2c3255b8dba97296 100644 (file)
@@ -116,13 +116,13 @@ git.sshBindInterface =
 # This may be useful in complex forwarding setups.
 #
 # SINCE 1.7.0
-git.sshDisplayHost = 
+git.sshAdvertisedHost = 
 
 # Manually specify the port to use in advertised SSH repository urls.
 # This may be useful in complex forwarding setups.
 #
 # SINCE 1.7.0
-git.sshDisplayPort = 
+git.sshAdvertisedPort = 
 
 # Specify the SSH key manager to use for retrieving, storing, and removing
 # SSH keys.
index d2ddc2c8bf63d886a6a6350f5523ae301db28fc0..e989ece3bb6b8c037415d9b2db25ab098b3a042a 100644 (file)
@@ -19,8 +19,6 @@ import java.io.IOException;
 import java.net.URL;\r
 import java.text.MessageFormat;\r
 \r
-import com.google.inject.Inject;\r
-import com.google.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
 import javax.servlet.http.HttpServletRequest;\r
@@ -34,6 +32,8 @@ import com.gitblit.manager.IUserManager;
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
 import com.gitblit.utils.StringUtils;\r
+import com.google.inject.Inject;\r
+import com.google.inject.Singleton;\r
 \r
 /**\r
  * Handles requests for Sparkleshare Invites\r
@@ -89,7 +89,7 @@ public class SparkleShareInviteServlet extends HttpServlet {
                        response.getWriter().append("SSH is not active on this server!");\r
                        return;\r
                }\r
-               int sshDisplayPort = settings.getInteger(Keys.git.sshDisplayPort, sshPort);\r
+               int sshDisplayPort = settings.getInteger(Keys.git.sshAdvertisedPort, sshPort);\r
 \r
                // extract repo name from request\r
                String repoUrl = request.getPathInfo().substring(1);\r
@@ -114,7 +114,7 @@ public class SparkleShareInviteServlet extends HttpServlet {
                if (!StringUtils.isEmpty(url) && url.indexOf("localhost") == -1) {\r
                        host = new URL(url).getHost();\r
                }\r
-               String sshDisplayHost = settings.getString(Keys.git.sshDisplayHost, "");\r
+               String sshDisplayHost = settings.getString(Keys.git.sshAdvertisedHost, "");\r
                if(sshDisplayHost.isEmpty()) {\r
                        sshDisplayHost = host;\r
                }\r
index 4756d967407b2c299136a277ef9a4652726e9667..68a2e901fcd6c7ae302d00df41359838ab125549 100644 (file)
@@ -35,8 +35,8 @@ import org.apache.sshd.common.io.mina.MinaServiceFactoryFactory;
 import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory;
 import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
 import org.apache.sshd.common.util.SecurityUtils;
-import org.apache.sshd.server.auth.CachingPublicKeyAuthenticator;
 import org.apache.sshd.server.UserAuth;
+import org.apache.sshd.server.auth.CachingPublicKeyAuthenticator;
 import org.apache.sshd.server.auth.UserAuthKeyboardInteractive;
 import org.apache.sshd.server.auth.UserAuthPassword;
 import org.apache.sshd.server.auth.UserAuthPublicKey;
@@ -130,7 +130,7 @@ public class SshDaemon {
                } else {
                        addr = new InetSocketAddress(bindInterface, port);
                }
-               
+
                //Will do GSS ?
                GSSAuthenticator gssAuthenticator = null;
                if(settings.getBoolean(Keys.git.sshWithKrb5, false)) {
@@ -144,9 +144,9 @@ public class SshDaemon {
                                        "");
                        if(! servicePrincipalName.isEmpty()) {
                                gssAuthenticator.setServicePrincipalName(servicePrincipalName);
-                       }                       
+                       }
                }
-               
+
                //Sort the authenticators for sshd
                List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<>();
                String sshAuthenticatorsOrderString = settings.getString(Keys.git.sshAuthenticatorsOrder,
@@ -156,7 +156,7 @@ public class SshDaemon {
                        switch (authenticatorName) {
                        case "gssapi-with-mic":
                                if(gssAuthenticator != null) {
-                                       userAuthFactories.add(new UserAuthGSS.Factory());                                       
+                                       userAuthFactories.add(new UserAuthGSS.Factory());
                                }
                                break;
                        case "publickey":
@@ -172,7 +172,7 @@ public class SshDaemon {
                                log.error("Unknown ssh authenticator: '{}'", authenticatorName);
                        }
                }
-               
+
                // Create the SSH server
                sshd = SshServer.setUpDefaultServer();
                sshd.setPort(addr.getPort());
@@ -203,8 +203,8 @@ public class SshDaemon {
                IStoredSettings settings = gitblit.getSettings();
 
                int port = sshd.getPort();
-               int displayPort = settings.getInteger(Keys.git.sshDisplayPort, port);
-               String displayServername = settings.getString(Keys.git.sshDisplayHost, "");
+               int displayPort = settings.getInteger(Keys.git.sshAdvertisedPort, port);
+               String displayServername = settings.getString(Keys.git.sshAdvertisedHost, "");
                if(displayServername.isEmpty()) {
                        displayServername = servername;
                }
index 267082ac0a9ff1dc4fd450d7eef797b95dbcc289..ec6f72914c8601471ea1a1d63288c0680489c33d 100644 (file)
@@ -200,8 +200,8 @@ public class WelcomeShell implements Factory<Command> {
                }
 
                private String formatUrl(String hostname, int port, String username) {
-                       int displayPort = settings.getInteger(Keys.git.sshDisplayPort, port);
-                       String displayHostname = settings.getString(Keys.git.sshDisplayHost, "");
+                       int displayPort = settings.getInteger(Keys.git.sshAdvertisedPort, port);
+                       String displayHostname = settings.getString(Keys.git.sshAdvertisedHost, "");
                        if(displayHostname.isEmpty()) {
                                displayHostname = hostname;
                        }
index 06b0e8d8850d1032767100a028b416456abd5a4a..02764db66103721a680692e117624ba6d71df4a3 100644 (file)
@@ -16,7 +16,6 @@
  */
 package com.gitblit.transport.ssh.commands;
 
-import com.gitblit.IStoredSettings;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.MalformedURLException;
@@ -28,6 +27,7 @@ import org.eclipse.jgit.util.SystemReader;
 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;
@@ -75,12 +75,12 @@ public abstract class SshCommand extends BaseCommand {
        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);