From 6f47a5fde37b68790fd9c6c8dbc2dab07be108be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Mon, 27 Apr 2015 01:36:51 +0200 Subject: [PATCH 1/2] Fetch composer binary from HTTPS-only --- lib/symfony2/symfony.rb | 4 ++-- spec/capifony_symfony2_symfony_spec.rb | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/symfony2/symfony.rb b/lib/symfony2/symfony.rb index fd90854..de803a6 100644 --- a/lib/symfony2/symfony.rb +++ b/lib/symfony2/symfony.rb @@ -147,12 +147,12 @@ # Because we always install to temp location we assume that we download composer every time. logger.debug "Downloading composer to #{$temp_destination}" capifony_pretty_print "--> Downloading Composer to temp location" - run_locally "cd #{$temp_destination} && curl -s http://getcomposer.org/installer | #{php_bin}#{install_options}" + run_locally "cd #{$temp_destination} && curl -sS http://getcomposer.org/installer | #{php_bin}#{install_options}" else if !remote_file_exists?("#{latest_release}/composer.phar") capifony_pretty_print "--> Downloading Composer" - run "#{try_sudo} sh -c 'cd #{latest_release} && curl -s http://getcomposer.org/installer | #{php_bin}#{install_options}'" + run "#{try_sudo} sh -c 'cd #{latest_release} && curl -sS http://getcomposer.org/installer | #{php_bin}#{install_options}'" else capifony_pretty_print "--> Updating Composer" diff --git a/spec/capifony_symfony2_symfony_spec.rb b/spec/capifony_symfony2_symfony_spec.rb index d505a55..9de4bea 100644 --- a/spec/capifony_symfony2_symfony_spec.rb +++ b/spec/capifony_symfony2_symfony_spec.rb @@ -170,7 +170,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -190,7 +190,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -211,7 +211,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -225,7 +225,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update 1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -238,7 +238,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -249,7 +249,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -269,7 +269,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927/vendor; fi;') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -280,7 +280,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -298,7 +298,7 @@ @configuration.find_and_execute_task('symfony:composer:dump_autoload') end - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar dump-autoload --optimize\'') } end @@ -308,7 +308,7 @@ @configuration.find_and_execute_task('symfony:composer:dump_autoload') end - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && my_composer dump-autoload --optimize\'') } end From b0d8bfa1b908a602f07bfc89322906d74eb91920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Mon, 27 Apr 2015 01:47:33 +0200 Subject: [PATCH 2/2] Add https instead http --- lib/symfony2/symfony.rb | 4 ++-- spec/capifony_symfony2_symfony_spec.rb | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/symfony2/symfony.rb b/lib/symfony2/symfony.rb index de803a6..b9e86c8 100644 --- a/lib/symfony2/symfony.rb +++ b/lib/symfony2/symfony.rb @@ -147,12 +147,12 @@ # Because we always install to temp location we assume that we download composer every time. logger.debug "Downloading composer to #{$temp_destination}" capifony_pretty_print "--> Downloading Composer to temp location" - run_locally "cd #{$temp_destination} && curl -sS http://getcomposer.org/installer | #{php_bin}#{install_options}" + run_locally "cd #{$temp_destination} && curl -sS https://getcomposer.org/installer | #{php_bin}#{install_options}" else if !remote_file_exists?("#{latest_release}/composer.phar") capifony_pretty_print "--> Downloading Composer" - run "#{try_sudo} sh -c 'cd #{latest_release} && curl -sS http://getcomposer.org/installer | #{php_bin}#{install_options}'" + run "#{try_sudo} sh -c 'cd #{latest_release} && curl -sS https://getcomposer.org/installer | #{php_bin}#{install_options}'" else capifony_pretty_print "--> Updating Composer" diff --git a/spec/capifony_symfony2_symfony_spec.rb b/spec/capifony_symfony2_symfony_spec.rb index 9de4bea..26b3b04 100644 --- a/spec/capifony_symfony2_symfony_spec.rb +++ b/spec/capifony_symfony2_symfony_spec.rb @@ -170,7 +170,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -190,7 +190,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -211,7 +211,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -225,7 +225,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update 1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -238,7 +238,7 @@ it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -249,7 +249,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -269,7 +269,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927/vendor; fi;') } - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -280,7 +280,7 @@ end it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -298,7 +298,7 @@ @configuration.find_and_execute_task('symfony:composer:dump_autoload') end - it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar dump-autoload --optimize\'') } end @@ -308,7 +308,7 @@ @configuration.find_and_execute_task('symfony:composer:dump_autoload') end - it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS http://getcomposer.org/installer | php\'') } + it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && my_composer dump-autoload --optimize\'') } end