20 Commits

Author SHA1 Message Date
David Pursehouse
6558e4d048 Format lib/mina/BUILD with buildifier
Change-Id: I2b18780cf7ebcd5f0bb962935c0e811f0fb19eea
2017-03-30 17:31:27 +09:00
Paladox none
f2d4fac3f3 Add support for elliptic curve/ed25519 SSH keys
Adds a dependency on net.ip2.crypto.eddsa, which is released under
the CC0 1.0 Universal license [1].

[1] https://github.com/str4d/ed25519-java/blob/master/LICENSE.txt

Feature: Issue 4507
Change-Id: Icab3a3e367b69c14132f0cc9478a84ebb9df834c
2017-03-28 15:26:29 +00:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
David Ostrovsky
fa18907d7f Bazel: Reformat build files
Reformat the Bazel build files with the buildifier tool [1].

The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.

[1] https://github.com/bazelbuild/buildifier

Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
2016-12-07 11:33:07 +00:00
Yuxuan 'fishy' Wang
75b98f77d9 bazel: add license to appropriate lib/ targets
This is to prepare for implementing genlicenses rule in bazel.

Change-Id: I60d79d5b53f9dd05c9f9ebfe6e6f658604c5a037
2016-09-26 16:42:38 +08:00
David Pursehouse
2b2c3dd55a Merge branch 'stable-2.12'
* stable-2.12:
  Set uploader for inline edit
  Update 2.12.4 release notes
  SshDaemon: Set up the session timeout to make sshd.idleTimeout work
  Attach sources for sshd-core and mina-core

Change-Id: I651e8901f96646660790a7ef6a14275f6d94343c
2016-08-04 11:18:01 +09:00
David Pursehouse
7f1a1b66fc Attach sources for sshd-core and mina-core
Having sources helps with debugging.

Change-Id: If57ded4f72cd4864b8834ed04e6758f603fd05d9
2016-08-03 18:06:10 +09:00
David Ostrovsky
b81b4f75ae Implement Bazel build
To run the tests:

  bazel test //...

To build the Gerrit plugin API, run:

  bazel build gerrit-plugin-api:plugin-api_deploy.jar

To build the Gerrit extension API, run:

  bazel build gerrit-extension-api:extension-api_deploy.jar

TODOs:

Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io

Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
2016-06-14 21:12:02 +02:00
David Ostrovsky
c0a9d010d4 Bump SSHD version to 1.2.0
This version fixed some regressions from 1.0 release, most notably,
mina backend is fixed again: [1], [2]. It was reported, though,
that this backend is suffering from connection leaks: [3], [4].

Due to [5]  we can now remove GerritServerSession, because we can
register listener for the CloseFuture directly on ServerSession.

Update to minor API changes: [6]. Particularly, Command#destroy()
throws now Exception, that gets propagated into runtime exception.

[1] https://issues.apache.org/jira/browse/SSHD-626
[2] https://issues.apache.org/jira/browse/SSHD-639
[3] https://issues.apache.org/jira/browse/SSHD-595
[4] https://issues.apache.org/jira/browse/DIRMINA-1021
[5] https://issues.apache.org/jira/browse/SSHD-652
[6] 97b73947d5

Change-Id: Ic0e0819b5ddd1bf96cd82f3a142bf1b3375a564a
2016-04-05 19:46:08 +02:00
David Ostrovsky
e8a521447d Update sshd-core to 1.0.0 and mina to 2.10
This version includes several bug fixes and improvements.  See
the release note [1] for details.

Many packages have been renamed, and some classes removed.

FileKeyPairProvider was removed from the SSHD library, so we need to
borrow it from the previous release. We preserve the license, that is
the same as Gerrit Code Review, the header and the indentation.

Compilation warnings are fixed, mostly by adding missing @Override
annotations.

[1] https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12323302&styleName=Html&projectId=12310849

Change-Id: If047c3a279fc9c98a59ac3102b0db3f5f2fdae48
2016-01-19 09:35:51 +00:00
David Ostrovsky
e2921b62f6 Revert "Downgrade SSHD to 0.9.0-4-g5967cfd"
All versions of SSHD since release 0.10 were suffering from exhaustion
of thread pool. Number of valuable features had to be reverted to
downgrade the SSHD version to 0.9. This blocking bug [1] was fixed [2]
and released in 0.14.0.

Update to the new version of SSHD and revert the downgrade.

This reverts commit bde8e9ac6f26a85c1a757ac0fa298f8b0c3c5783.

[1] https://issues.apache.org/jira/browse/SSHD-348
[2] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commitdiff;h=964e76890cf56da4491199860d0ea8276fbd26a6
Change-Id: Ib5faf1df0cb6bde2e2cd554c9311cc5e55095b04
2015-04-06 12:26:07 +09:00
Hugo Arès
414a09d283 Update sha1 for sshd-core 0.9.0-4-g5967cfd
Build was failing with the following error message:
expected 8f4b6f7ebc54655dc7d25a77665cf51f2b1288b2
received 449ec11c4417b295dbf1661585a50c6ec7d9a452

Change-Id: I77f442694eb403aff50de00ec826724fdb570e70
2014-12-05 16:12:55 +00:00
Saša Živkov
bde8e9ac6f Downgrade SSHD to 0.9.0-4-g5967cfd
Since there is no official 0.9.1 release of the SSHD yet, the
0.9.0-4-g5967cfd version was built from the 0.9.x branch and uploaded to
the Google cloud storage.

This change reverts the following Gerrit commits:

3d9c70c SSHD: Update to 0.13.0
52e4e0c Bump SSHD Mina version to 2.0.8
3921163 Don't use deprecated PGPPublicKeyRingCollection constructor
13452f4 Bump Bouncycastle version to 1.51
5f7d5a7 Update EncryptedContactStore to not use deprecated/removed methods
f69698c Update SSHD to 0.11.1-atlassian-1
67c38c8 Added global request handlers to SshDaemon
c31e17f Update sshd to 0.11.0
b9c66ea Bump SSHD version to 0.10.1 and enable nio2 backend

The reason for the downgrade (copied from the change 60161):

SSHD release 0.9 is known to be free from exhausting thread pool problem
[1]. Unfortunately 0.9 release suffers from sporadic handshake failures
[2].  The fix cannot be cleanly cherry-picked to 0.9 release. The back
port of this fix [3] is tracked under its own issue [4], was uploaded as
PR for SSHD Mina's GH repository [5] and merged recently [6].

Moreover, 0.9 suffers from "Authenticated with partial success" issue
[7]
that was fixed by [8], [9]; this patch must be applied as well.

This reverts commit dc7318b8eeda15732d4d2865fc5a7a0a68b3be15.

[1] https://issues.apache.org/jira/browse/SSHD-348
[2] https://issues.apache.org/jira/browse/SSHD-330
[3] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=2aed686bdb21681a421033c6ee5997e5cd8a9a83
[4] https://issues.apache.org/jira/browse/SSHD-356
[5] https://github.com/apache/mina-sshd/pull/7
[6] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=cc7162acf7ca89561ca57a9c68de735f17bf168b
[7] https://issues.apache.org/jira/browse/SSHD-254
[8] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=28a8ae258b08c6b41ab64ac25f2331168dc0415a
[9] https://gerrit-review.googlesource.com/51516

Change-Id: I889fb02c2cb1aa5df2cf8dcabace086f5094a914
2014-12-04 13:51:59 +01:00
David Ostrovsky
3d9c70c14e SSHD: Update to 0.13.0
Long standing exhausting thread pool SSHD bug was apparently fixed
upstream [1].

All Gerrit releases since 2.8.5 are known to suffer from this problem
with the consequence that Gerrit must be restarted overnight.

[1] https://issues.apache.org/jira/browse/SSHD-348

Change-Id: Ic52277050aa0cd19b19531ee997d312fd7273ebc
2014-11-06 22:37:15 +09:00
David Ostrovsky
52e4e0c82c Bump SSHD Mina version to 2.0.8
SSHD version 0.13.0 uses this Mina version.

Change-Id: I7e27dce435764a19aa27b58ea619d063f640a8fb
2014-11-06 22:37:00 +09:00
David Ostrovsky
f69698ce9b Update SSHD to 0.11.1-atlassian-1
Use custom build of SSHD library from Atlassian's maven repository,
that fixes sporadic handshake failures [1].

[1] https://issues.apache.org/jira/browse/SSHD-330

Change-Id: I4258f515ac10e04c8c8f1850f060b9dbad6d876f
2014-07-01 10:20:33 +09:00
David Pursehouse
c31e17f005 Update sshd to 0.11.0
Fixes a few issues including a null pointer exception [1] that causes
ssh commands to hang.

It also adds server driven rekeying after 1G bytes of data transferred,
which is a useful security feature.

[1] https://issues.apache.org/jira/browse/SSHD-307

Change-Id: I441995eaf76e4fe53f7991f5aef00e062900791b
2014-04-23 10:39:42 +09:00
David Ostrovsky
b9c66ea380 Bump SSHD version to 0.10.1 and enable nio2 backend
46f8488a78742799a4f5f781279c8955460e7964 removed nio2 backend because of
a bug [1].  Given that the bug is fixed and released, enable it again.

Another problem was also fixed and released [2].

Upgrade to the official version 0.10.1 makes Gerrit's own custom patch of
SSHD and hosting it on Google bucket unnecessary.

[1] https://issues.apache.org/jira/browse/SSHD-252
[2] https://issues.apache.org/jira/browse/SSHD-255

Bug: Issue 2406
Change-Id: I6668f6194427f153e1982e14b3936d2f3132fa7d
2014-04-23 10:39:23 +09:00
Shawn Pearce
84646adb82 Merge branch 'stable-2.7' into stable-2.8
* stable-2.7:
  Bump SSHD version to 0.9.0.201311081

Conflicts:
	gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowConnections.java
	pom.xml

Change-Id: I29487ae1efb5bdf6f18fc76fe14790a530481c9f
2013-11-08 21:16:47 -08:00
Shawn Pearce
fd6bb9f6a5 Build with Buck
Implement a new build system using Buck[1], Facebook's
open source clone of Google's internal build system.

  Pros:
  - Concise build language
  - Test and build output is concise
  - Test failures and stack traces show on terminal
  - Reliable incrementals; clean is unnecessary
  - Extensible with simple blocks of Python
  - Fast
      buck: clean: 0.452s, full 1m21.083s [*], no-op:  7.145s,
      mvn:  clean: 4.596s, full 2m53.776s,     no-op: 59.108s,

      [*] full build includes downloading all dependencies,
          time can vary due to remote server performance.

  Cons:
  - No Windows support
  - No native Maven Central support (added by macros)
  - No native GWT, Prolog, or WAR support (added by macros)
  - Bootstrap of buck requires Ant

Getting started:

  git clone https://gerrit.googlesource.com/buck
  cd buck
  ant

  Mac OS X:
    PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH"

  Linux:
    PATH="`pwd`/bin:$PATH"

Importing into Eclipse:

  $ time buck build :eclipse
  0m48.949s

  Import existing project from `pwd`
  Import 'gerrit' (do not import other Maven based projects)
  Expand 'gerrit'
  Right click 'buck-out' > Properties
  Under Attributes check 'Derived'

  If the code doesn't currently compile but an updated classpath
  is needed, refresh the configs and obtain missing JARs:

  $ buck build :eclipse_project :download

Running JUnit tests:

  $ time buck test --all -e slow  # skip slow tests
  0m19.320s

  $ time buck test --all          # includes acceptance tests
  5m17.517s

Building WAR:

  $ buck build :gerrit
  $ java -jar buck-out/gen/gerrit.war

Building release:

  $ buck test --all && buck build :api :release
  $ java -jar buck-out/gen/release.war
  $ ls -lh buck-out/gen/{extension,plugin}-api.jar

Downloading dependencies:

  Dependencies are normally downloaded automatically, but Buck can
  inspect its graph and download missing dependencies so future
  compiles can run without the network:

  $ buck build :download

[1] http://facebook.github.io/buck/

Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655
2013-05-09 13:40:36 +00:00