From 6975d4883b070deb1c71010341d673bd7b03d2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 14 Mar 2023 10:36:47 +0100 Subject: [PATCH 01/13] vendor: update to libgit2 v1.6.1 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 036fe1afb..8a871d13b 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 036fe1afba37d9b20509671d3048c6088f018134 +Subproject commit 8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 From de0457661529327ebcfe406ff6bebd1567112441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 14 Mar 2023 10:37:20 +0100 Subject: [PATCH 02/13] vendor: update to libgit2 v1.6.2 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 8a871d13b..25ec37379 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 +Subproject commit 25ec37379ed07b10c4ecc6143cf6018cabc8f857 From 04bd9e5e797392cd6e5baeefdbcf50b60e527e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 14 Mar 2023 10:38:15 +0100 Subject: [PATCH 03/13] Bump version to 1.6.2 --- lib/rugged/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rugged/version.rb b/lib/rugged/version.rb index 56da7e4c3..b34e9db67 100644 --- a/lib/rugged/version.rb +++ b/lib/rugged/version.rb @@ -4,5 +4,5 @@ # For full terms see the included LICENSE file. module Rugged - Version = VERSION = '1.5.0' + Version = VERSION = '1.6.2' end From 4d84b562d9fa01aa8c877cba95dfc069d6fd211d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 17 Mar 2023 09:44:42 +0100 Subject: [PATCH 04/13] ext: correct pc filename --- ext/rugged/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/rugged/extconf.rb b/ext/rugged/extconf.rb index 76e71edeb..7dbd2b3b9 100644 --- a/ext/rugged/extconf.rb +++ b/ext/rugged/extconf.rb @@ -116,7 +116,7 @@ def self.run_cmake(timeout, args) $LDFLAGS << " " + "-L#{Dir.pwd}/deps/winhttp" $LIBS << " -lwinhttp -lcrypt32 -lrpcrt4 -lole32 -lz -lssh2" else - pcfile = File.join(LIBGIT2_DIR, "build", "git2.pc") + pcfile = File.join(LIBGIT2_DIR, "build", "libgit2.pc") $LDFLAGS << " " + `pkg-config --libs --static #{pcfile}`.strip end end From cbe12c9a471de45119a69ef5800a3bb495c7f1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 17 Mar 2023 10:22:13 +0100 Subject: [PATCH 05/13] ci: Use ubuntu-22.04 ubuntu-18.04 is not supported by the ruby-setup version that gives us the newer ruby so let's get a newer version as ubuntu-20.04 fails for other rasons and this we can make work. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c625e830..99bb82e59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: fail-fast: false matrix: ruby: [ '2.6', '2.7', '3.0', '3.1', '3.2' ] - os: [ ubuntu-18.04 ] + os: [ ubuntu-22.04 ] runs-on: ${{ matrix.os }} name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }} From c24d94417ce7ab2d071cf5bb339ed003e7a93656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 17 Mar 2023 11:15:44 +0100 Subject: [PATCH 06/13] ci: tell sshd that we want ssh-rsa still --- script/travisbuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/travisbuild b/script/travisbuild index a82bb8314..7a02d1aff 100755 --- a/script/travisbuild +++ b/script/travisbuild @@ -15,7 +15,10 @@ HostKey ${SSHD_DIR}/id_rsa PidFile ${SSHD_DIR}/pid AuthorizedKeysFile ${HOME}/.ssh/authorized_keys LogLevel DEBUG +# For now let's accept ssh-rsa so the rest of the setup works RSAAuthentication yes +HostKeyAlgorithms ssh-rsa +PubkeyAcceptedAlgorithms ssh-rsa PasswordAuthentication yes PubkeyAuthentication yes ChallengeResponseAuthentication no From a52b9830f0d83e30ff8f0481a2baacd95ce0d04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 27 Mar 2023 12:36:25 +0200 Subject: [PATCH 07/13] vendor: bump libgit2 to v1.6.3 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 25ec37379..c058aa87d 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 25ec37379ed07b10c4ecc6143cf6018cabc8f857 +Subproject commit c058aa87dce4c67a3b86b3349beebd64b7bedcd3 From 4cab089873bf1fa179329cf9d9a269bb56c918d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 27 Mar 2023 12:36:53 +0200 Subject: [PATCH 08/13] Bump version to 1.6.3 --- lib/rugged/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rugged/version.rb b/lib/rugged/version.rb index b34e9db67..a3fdf9834 100644 --- a/lib/rugged/version.rb +++ b/lib/rugged/version.rb @@ -4,5 +4,5 @@ # For full terms see the included LICENSE file. module Rugged - Version = VERSION = '1.6.2' + Version = VERSION = '1.6.3' end From 9b6a6931bf1c26e7a26b9e454bc079102cdab9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 31 Aug 2023 16:43:34 +0200 Subject: [PATCH 09/13] ci: allow disabling SSH tests --- script/travisbuild | 72 ++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/script/travisbuild b/script/travisbuild index 7a02d1aff..dcdc64d41 100755 --- a/script/travisbuild +++ b/script/travisbuild @@ -2,12 +2,14 @@ set -ex -echo "Starting ssh daemon..." -TMPDIR=${TMPDIR:-/tmp} -HOME=`mktemp -d ${TMPDIR}/home.XXXXXXXX` -SSHD_DIR=`mktemp -d ${TMPDIR}/sshd.XXXXXXXX` +if [ -z "$SKIP_SSH_TESTS" ]; then -cat >"${SSHD_DIR}/sshd_config" <<-EOF + echo "Starting ssh daemon..." + TMPDIR=${TMPDIR:-/tmp} + HOME=`mktemp -d ${TMPDIR}/home.XXXXXXXX` + SSHD_DIR=`mktemp -d ${TMPDIR}/sshd.XXXXXXXX` + + cat >"${SSHD_DIR}/sshd_config" <<-EOF Port 2222 ListenAddress 0.0.0.0 Protocol 2 @@ -26,29 +28,30 @@ StrictModes no # Required here as sshd will simply close connection otherwise UsePAM no EOF -ssh-keygen -t rsa -f "${SSHD_DIR}/id_rsa" -N "" -q -/usr/sbin/sshd -f "${SSHD_DIR}/sshd_config" -E "${SSHD_DIR}/log" + ssh-keygen -t rsa -f "${SSHD_DIR}/id_rsa" -N "" -q + /usr/sbin/sshd -f "${SSHD_DIR}/sshd_config" -E "${SSHD_DIR}/log" -# Set up keys -mkdir "${HOME}/.ssh" -ssh-keygen -t rsa -f "${HOME}/.ssh/id_rsa" -N "" -q -cat "${HOME}/.ssh/id_rsa.pub" >>"${HOME}/.ssh/authorized_keys" -while read algorithm key comment; do - echo "[localhost]:2222 $algorithm $key" >>"${HOME}/.ssh/known_hosts" -done <"${SSHD_DIR}/id_rsa.pub" + # Set up keys + mkdir "${HOME}/.ssh" + ssh-keygen -t rsa -f "${HOME}/.ssh/id_rsa" -N "" -q + cat "${HOME}/.ssh/id_rsa.pub" >>"${HOME}/.ssh/authorized_keys" + while read algorithm key comment; do + echo "[localhost]:2222 $algorithm $key" >>"${HOME}/.ssh/known_hosts" + done <"${SSHD_DIR}/id_rsa.pub" -# Append the github.com keys for the tests that don't override checks. Some -# older libssh2 versions don't like it unless we have ssh-rsa in here. This also -# tests that the automatic selection off of known_hosts is working. -ssh-keyscan -t ssh-rsa github.com >>"${HOME}/.ssh/known_hosts" + # Append the github.com keys for the tests that don't override checks. Some + # older libssh2 versions don't like it unless we have ssh-rsa in here. This also + # tests that the automatic selection off of known_hosts is working. + ssh-keyscan -t ssh-rsa github.com >>"${HOME}/.ssh/known_hosts" -# Get the fingerprint for localhost and remove the colons so we can -# parse it as a hex number. Older versions have a different output -# format. -if [[ $(ssh -V 2>&1) == OpenSSH_6* ]]; then - SSH_FINGERPRINT=$(ssh-keygen -F '[localhost]:2222' -f "${HOME}/.ssh/known_hosts" -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':') -else - SSH_FINGERPRINT=$(ssh-keygen -E md5 -F '[localhost]:2222' -f "${HOME}/.ssh/known_hosts" -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :) + # Get the fingerprint for localhost and remove the colons so we can + # parse it as a hex number. Older versions have a different output + # format. + if [[ $(ssh -V 2>&1) == OpenSSH_6* ]]; then + SSH_FINGERPRINT=$(ssh-keygen -F '[localhost]:2222' -f "${HOME}/.ssh/known_hosts" -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':') + else + SSH_FINGERPRINT=$(ssh-keygen -E md5 -F '[localhost]:2222' -f "${HOME}/.ssh/known_hosts" -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :) + fi fi # Create a test repo which we can use for the online tests @@ -65,17 +68,18 @@ git daemon --listen=localhost --port=9419 --export-all --base-path=$HOME/_temp_r # On Actions we start with 777 which means sshd won't let us in chmod 750 $HOME +export GITTEST_REMOTE_REPO_PATH="$HOME/_temp/test.git" export GITTEST_REMOTE_GIT_RO_URL="git://localhost:9419/testrepo.git" export GITTEST_REMOTE_GIT_URL="git://localhost/test.git" -export GITTEST_REMOTE_SSH_URL="ssh://localhost:2222/$HOME/_temp/test.git" -export GITTEST_REMOTE_SSH_USER=$USER -export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa" -export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub" -export GITTEST_REMOTE_SSH_PASSPHRASE="" -export GITTEST_REMOTE_REPO_PATH="$HOME/_temp/test.git" +if [ -z "$SKIP_SSH_TESTS" ]; then + export GITTEST_REMOTE_SSH_URL="ssh://localhost:2222/$HOME/_temp/test.git" + export GITTEST_REMOTE_SSH_USER=$USER + export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa" + export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub" + export GITTEST_REMOTE_SSH_PASSPHRASE="" -echo 'PasswordAuthentication yes' | sudo tee -a /etc/sshd_config -eval $(ssh-agent) -ssh-add $GITTEST_REMOTE_SSH_KEY + eval $(ssh-agent) + ssh-add $GITTEST_REMOTE_SSH_KEY +fi bundle exec rake -- --with-ssh || exit $? From c34778cd665d486a0ebe62d642c4bf9b871f5f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 31 Aug 2023 16:48:43 +0200 Subject: [PATCH 10/13] ci: skip SSH tests on macOS It looks like the tests don't pass with the current libssh2 on macOS and we don't know what the source is. The library doesn't do these tests so we shouldn't until that is working. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99bb82e59..4eefd1eed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: runs-on: ${{ matrix.os }} name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }} + env: + SKIP_SSH_TESTS: true steps: - uses: actions/checkout@master - name: update submodule From 205f57658cb1d284f45c71a83bb868996b49bbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 31 Aug 2023 17:23:04 +0200 Subject: [PATCH 11/13] test: correct which set of creds we're checking for OnelineSshPushTest --- test/online/push_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/online/push_test.rb b/test/online/push_test.rb index e516f6e54..cbfbc2f94 100644 --- a/test/online/push_test.rb +++ b/test/online/push_test.rb @@ -29,7 +29,7 @@ def test_push_branches class OnlineSshPushTest < Rugged::OnlineTestCase def setup - skip unless Rugged.features.include?(:ssh) && git_creds? + skip unless Rugged.features.include?(:ssh) && ssh_creds? @repo = FixtureRepo.from_libgit2("push_src") @remote = @repo.remotes.create("test", ENV['GITTEST_REMOTE_SSH_URL']) From c59229013145364c8669126a2cc475bfa45ab249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 7 Feb 2024 11:10:28 +0100 Subject: [PATCH 12/13] vendor: update libgit2 to 1.6.5 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index c058aa87d..155578578 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit c058aa87dce4c67a3b86b3349beebd64b7bedcd3 +Subproject commit 155578578b78efc6bae7383a708d470eb206e36a From 8ccf97d74d71973a4ca00d4b0c3bc9fb05d30543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 7 Feb 2024 11:11:06 +0100 Subject: [PATCH 13/13] Bump version to 1.6.5 --- lib/rugged/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rugged/version.rb b/lib/rugged/version.rb index a3fdf9834..bb2266656 100644 --- a/lib/rugged/version.rb +++ b/lib/rugged/version.rb @@ -4,5 +4,5 @@ # For full terms see the included LICENSE file. module Rugged - Version = VERSION = '1.6.3' + Version = VERSION = '1.6.5' end