From 553389aa5035eb85cd7eb6e0a7c1146ee3beb781 Mon Sep 17 00:00:00 2001 From: No0ne Date: Fri, 18 Oct 2024 16:33:55 +0200 Subject: [PATCH] Allow terminus to work in an IPv6-only environment with DNS64/NAT64 --- docs/examples/PantheonAliases.php | 2 +- src/Commands/Remote/SSHBaseCommand.php | 2 +- templates/aliases/fragment.aliases.drushrc.php.twig | 2 +- templates/aliases/fragment.site.yml.twig | 2 +- tests/Functional/AliasesCommandTest.php | 6 +++--- tests/features/aliases.feature | 2 +- .../drushrcEmitter/standardAliasFixtureWithoutDbUrl.out | 6 +++--- .../standardWithoutDbUrl/sites/pantheon/agency.site.yml | 2 +- .../standardWithoutDbUrl/sites/pantheon/demo.site.yml | 2 +- .../sites/pantheon/personalsite.site.yml | 2 +- tests/unit_tests/Commands/AliasesCommandTest.php | 4 ++-- tests/unit_tests/Helpers/TemplateTest.php | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/examples/PantheonAliases.php b/docs/examples/PantheonAliases.php index 94f05d1d6..2f6128c69 100644 --- a/docs/examples/PantheonAliases.php +++ b/docs/examples/PantheonAliases.php @@ -78,7 +78,7 @@ private function constructAlias($environment) 'db-allows-remote' => true, 'remote-host' => $remote_host, 'remote-user' => $remote_user, - 'ssh-options' => '-p 2222 -o \"AddressFamily inet\"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'code/sites/default/files', '%drush-script' => 'drush', diff --git a/src/Commands/Remote/SSHBaseCommand.php b/src/Commands/Remote/SSHBaseCommand.php index b3659a604..693162b6e 100755 --- a/src/Commands/Remote/SSHBaseCommand.php +++ b/src/Commands/Remote/SSHBaseCommand.php @@ -373,7 +373,7 @@ private function getConnectionString() $command = $this->getConfig()->get('ssh_command'); return vsprintf( - '%s -T %s@%s -p %s -o "StrictHostKeyChecking=no" -o "AddressFamily inet"', + '%s -T %s@%s -p %s -o "StrictHostKeyChecking=no"', [$command, $sftp['username'], $this->lookupHostViaAlternateNameserver($sftp['host']), $sftp['port']] ); } diff --git a/templates/aliases/fragment.aliases.drushrc.php.twig b/templates/aliases/fragment.aliases.drushrc.php.twig index 8bda0117d..31a8779e2 100644 --- a/templates/aliases/fragment.aliases.drushrc.php.twig +++ b/templates/aliases/fragment.aliases.drushrc.php.twig @@ -2,7 +2,7 @@ 'uri' => '{{env_label}}-{{site_name}}.pantheonsite.io', 'remote-host' => 'appserver.{{env_label}}.{{site_id}}.drush.in', 'remote-user' => '{{env_label}}.{{site_id}}', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), diff --git a/templates/aliases/fragment.site.yml.twig b/templates/aliases/fragment.site.yml.twig index 2cc9ff9cf..15b74bc32 100644 --- a/templates/aliases/fragment.site.yml.twig +++ b/templates/aliases/fragment.site.yml.twig @@ -5,6 +5,6 @@ uri: {{env_label}}-{{site_name}}.pantheonsite.io user: {{env_label}}.{{site_id}} ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false diff --git a/tests/Functional/AliasesCommandTest.php b/tests/Functional/AliasesCommandTest.php index 8f651eacf..b6085f94a 100644 --- a/tests/Functional/AliasesCommandTest.php +++ b/tests/Functional/AliasesCommandTest.php @@ -62,8 +62,8 @@ public function testGetAliases() sprintf('"remote-user" value should match "${env-name}.%s"', $this->getSiteId()) ); $this->assertTrue( - false !== strpos($alias_printed, '-p 2222 -o "AddressFamily inet"'), - '"ssh-options" value should match "-p 2222 -o "AddressFamily inet"' + false !== strpos($alias_printed, '-p 2222'), + '"ssh-options" value should match "-p 2222' ); $this->assertTrue( false !== strpos($alias_printed, '\'path-aliases\'') @@ -107,7 +107,7 @@ public function testGetAliases() uri: {$site_alias['uri']} user: {$site_alias['remote-user']} ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false EOF; $this->assertEquals($expected_drush_9_site_alias, $drush_9_site_alias_in_file); diff --git a/tests/features/aliases.feature b/tests/features/aliases.feature index 59673ee12..1801ec901 100644 --- a/tests/features/aliases.feature +++ b/tests/features/aliases.feature @@ -31,7 +31,7 @@ Feature: Gathering sites' aliases 'uri' => '${env-name}-a-far-off-site-with-no-org.pantheonsite.io', 'remote-host' => 'appserver.${env-name}.8a5311d2-162a-4a88-8561-ebf8706568cb.drush.in', 'remote-user' => '${env-name}.8a5311d2-162a-4a88-8561-ebf8706568cb', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), diff --git a/tests/fixtures/aliases/drushrcEmitter/standardAliasFixtureWithoutDbUrl.out b/tests/fixtures/aliases/drushrcEmitter/standardAliasFixtureWithoutDbUrl.out index 36f6dd568..c2980e057 100644 --- a/tests/fixtures/aliases/drushrcEmitter/standardAliasFixtureWithoutDbUrl.out +++ b/tests/fixtures/aliases/drushrcEmitter/standardAliasFixtureWithoutDbUrl.out @@ -15,7 +15,7 @@ 'uri' => '${env-name}-personalsite.pantheonsite.io', 'remote-host' => 'appserver.${env-name}.33333333-3333-3333-3333-333333333333.drush.in', 'remote-user' => '${env-name}.33333333-3333-3333-3333-333333333333', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), @@ -25,7 +25,7 @@ 'uri' => '${env-name}-demo.pantheonsite.io', 'remote-host' => 'appserver.${env-name}.44444444-4444-4444-4444-444444444444.drush.in', 'remote-user' => '${env-name}.44444444-4444-4444-4444-444444444444', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), @@ -35,7 +35,7 @@ 'uri' => '${env-name}-agency.pantheonsite.io', 'remote-host' => 'appserver.${env-name}.55555555-5555-5555-5555-555555555555.drush.in', 'remote-user' => '${env-name}.55555555-5555-5555-5555-555555555555', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), diff --git a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/agency.site.yml b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/agency.site.yml index 65106e070..e86589195 100644 --- a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/agency.site.yml +++ b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/agency.site.yml @@ -5,5 +5,5 @@ uri: ${env-name}-agency.pantheonsite.io user: ${env-name}.55555555-5555-5555-5555-555555555555 ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false diff --git a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/demo.site.yml b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/demo.site.yml index a878bf3e0..90a1f2c62 100644 --- a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/demo.site.yml +++ b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/demo.site.yml @@ -5,5 +5,5 @@ uri: ${env-name}-demo.pantheonsite.io user: ${env-name}.44444444-4444-4444-4444-444444444444 ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false diff --git a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/personalsite.site.yml b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/personalsite.site.yml index 8653a3bc4..e1bdc4921 100644 --- a/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/personalsite.site.yml +++ b/tests/fixtures/aliases/sitesYmlEmitter/standardWithoutDbUrl/sites/pantheon/personalsite.site.yml @@ -5,5 +5,5 @@ uri: ${env-name}-personalsite.pantheonsite.io user: ${env-name}.33333333-3333-3333-3333-333333333333 ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false diff --git a/tests/unit_tests/Commands/AliasesCommandTest.php b/tests/unit_tests/Commands/AliasesCommandTest.php index 7134f81b0..0c1b8b7d5 100644 --- a/tests/unit_tests/Commands/AliasesCommandTest.php +++ b/tests/unit_tests/Commands/AliasesCommandTest.php @@ -153,7 +153,7 @@ public function testAliases() uri: \${env-name}-site1.pantheonsite.io user: \${env-name}.abc ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false __EOT__; $this->assertEquals($expected, trim($drush_9_aliases)); @@ -232,7 +232,7 @@ protected function expectedDrush8AliasOutput() 'uri' => '\${env-name}-site1.pantheonsite.io', 'remote-host' => 'appserver.\${env-name}.abc.drush.in', 'remote-user' => '\${env-name}.abc', - 'ssh-options' => '-p 2222 -o "AddressFamily inet"', + 'ssh-options' => '-p 2222', 'path-aliases' => array( '%files' => 'files', ), diff --git a/tests/unit_tests/Helpers/TemplateTest.php b/tests/unit_tests/Helpers/TemplateTest.php index 4705e0e99..de4004232 100644 --- a/tests/unit_tests/Helpers/TemplateTest.php +++ b/tests/unit_tests/Helpers/TemplateTest.php @@ -32,7 +32,7 @@ public function processTestValues() uri: MULTIDEV-MYSITE.pantheonsite.io user: MULTIDEV.00000000-0000-0000-0000-000000000000 ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false EOT; @@ -44,7 +44,7 @@ public function processTestValues() uri: MULTIDEV-MYSITE.pantheonsite.io user: MULTIDEV.00000000-0000-0000-0000-000000000000 ssh: - options: '-p 2222 -o "AddressFamily inet"' + options: '-p 2222' tty: false EOT;