David Ostrovsky
2014-03-11 5eafd9b6f046a03eca0576ae14673be674b9ce01
src/main/java/com/gitblit/transport/ssh/SshDaemon.java
@@ -44,6 +44,7 @@
import com.gitblit.transport.ssh.commands.CreateRepository;
import com.gitblit.transport.ssh.commands.DispatchCommand;
import com.gitblit.transport.ssh.commands.Receive;
import com.gitblit.transport.ssh.commands.SetAccountCommand;
import com.gitblit.transport.ssh.commands.Upload;
import com.gitblit.transport.ssh.commands.VersionCommand;
import com.gitblit.utils.IdGenerator;
@@ -116,12 +117,14 @@
         addr = new InetSocketAddress(bindInterface, port);
      }
      SshKeyAuthenticator publickeyAuthenticator = new SshKeyAuthenticator(
            keyManager, gitblit);
      sshd = SshServer.setUpDefaultServer();
      sshd.setPort(addr.getPort());
      sshd.setHost(addr.getHostName());
      sshd.setKeyPairProvider(new PEMGeneratorHostKeyProvider(new File(
            gitblit.getBaseFolder(), HOST_KEY_STORE).getPath()));
      sshd.setPublickeyAuthenticator(new SshKeyAuthenticator(keyManager, gitblit));
      sshd.setPublickeyAuthenticator(publickeyAuthenticator);
      sshd.setPasswordAuthenticator(new SshPasswordAuthenticator(gitblit));
      sshd.setSessionFactory(new SshSessionFactory(idGenerator));
      sshd.setFileSystemFactory(new DisabledFilesystemFactory());
@@ -130,6 +133,7 @@
      DispatchCommand gitblitCmd = new DispatchCommand();
      gitblitCmd.registerCommand(CreateRepository.class);
      gitblitCmd.registerCommand(VersionCommand.class);
      gitblitCmd.registerCommand(SetAccountCommand.class);
      DispatchCommand gitCmd = new DispatchCommand();
      gitCmd.registerCommand(Upload.class);
@@ -142,6 +146,7 @@
      root.setRepositoryResolver(new RepositoryResolver<SshSession>(gitblit));
      root.setUploadPackFactory(new GitblitUploadPackFactory<SshSession>(gitblit));
      root.setReceivePackFactory(new GitblitReceivePackFactory<SshSession>(gitblit));
      root.setAuthenticator(publickeyAuthenticator);
      SshCommandFactory commandFactory = new SshCommandFactory(
            new WorkQueue(idGenerator),