~jan0sch/smederee
Showing details for patch 1b5030b96f71a17ec0380d2e796b760da7fa4169.
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala --- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala 2025-02-02 09:56:39.821404984 +0000 +++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala 2025-02-02 09:56:39.821404984 +0000 @@ -39,6 +39,7 @@ abstract class DarcsSshCommand extends Command with ServerSessionAware { private val log = LoggerFactory.getLogger(classOf[DarcsSshCommand]) + protected var session: ServerSession = null protected var stdin: InputStream = null protected var stdout: OutputStream = null protected var stderr: OutputStream = null @@ -49,7 +50,7 @@ override def setExitCallback(callback: ExitCallback): Unit = this.callback = callback override def setInputStream(inputStream: InputStream): Unit = this.stdin = inputStream override def setOutputStream(outputStream: OutputStream): Unit = this.stdout = outputStream - override def setSession(session: ServerSession): Unit = () + override def setSession(session: ServerSession): Unit = this.session = session } diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshServer.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshServer.scala --- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshServer.scala 2025-02-02 09:56:39.821404984 +0000 +++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/SshServer.scala 2025-02-02 09:56:39.821404984 +0000 @@ -144,11 +144,9 @@ server.setFileSystemFactory( new VirtualFileSystemFactory(darcsConfiguration.repositoriesDirectory.toPath) ) - // FIXME Use SCP/SFTP as long as darcs support is missing (see https://github.com/apache/mina-sshd/blob/master/docs/sftp.md) + // Add our custom command factory which must provide darcs and scp functionality. val sftpSubsystem = new SftpSubsystemFactory.Builder().build() server.setSubsystemFactories(Collections.singletonList(sftpSubsystem)) - // val scpCommand = new ScpCommandFactory.Builder().build() - // server.setCommandFactory(scpCommand) val darcsCommand = new DarcsSshCommandFactory(darcsConfiguration) server.setCommandFactory(darcsCommand) server