From 894516c646edef58fd5ee0fd964a201d687a6f02 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Wed, 15 Feb 2017 13:57:22 +0000 Subject: [PATCH] Check the sources with sha256 from phpmyadmin.net --- scripts/install | 11 ++++++----- scripts/upgrade | 11 ++++++----- {conf => sources}/upstream_version | 0 3 files changed, 12 insertions(+), 10 deletions(-) rename {conf => sources}/upstream_version (100%) diff --git a/scripts/install b/scripts/install index ae48ed6..e52e0f6 100644 --- a/scripts/install +++ b/scripts/install @@ -38,11 +38,12 @@ ynh_app_setting_set $app path $path ynh_app_setting_set $app admin $admin # Copy files to the right place -version=$(cat ../conf/upstream_version) -sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O ../phpMyAdmin.tar.gz -#sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo cp -r ../phpMyAdmin-$version-all-languages/* $final_path +version=$(cat ../sources/upstream_version) +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O phpMyAdmin-$version-all-languages.tar.gz +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz.sha256 -O phpMyAdmin-$version-all-languages.tar.gz.sha256 +sudo sha256sum -c phpMyAdmin-$version-all-languages.tar.gz.sha256 --status || (echo "Corrupt source" >&2 && false) +sudo tar xzf phpMyAdmin-$version-all-languages.tar.gz -C ../sources/ > /dev/null 2>&1 +sudo cp -r ../sources/phpMyAdmin-$version-all-languages/* $final_path # Create db #GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app. diff --git a/scripts/upgrade b/scripts/upgrade index f45be58..a5d8183 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,11 +18,12 @@ db_user=$(ynh_app_setting_get $app db_user) CHECK_PATH # Vérifie et corrige la syntaxe du path. # Copy files to the right place -version=$(cat ../conf/upstream_version) -sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O ../phpMyAdmin.tar.gz -#sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo cp -r ../phpMyAdmin-$version-all-languages/* $final_path +version=$(cat ../sources/upstream_version) +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O phpMyAdmin-$version-all-languages.tar.gz +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz.sha256 -O phpMyAdmin-$version-all-languages.tar.gz.sha256 +sudo sha256sum -c phpMyAdmin-$version-all-languages.tar.gz.sha256 --status || (echo "Corrupt source" >&2 && false) +sudo tar xzf phpMyAdmin-$version-all-languages.tar.gz -C ../sources/ > /dev/null 2>&1 +sudo cp -r ../sources/phpMyAdmin-$version-all-languages/* $final_path # Update tables sudo sed -i "s@phpmyadmin@$db_user@g" $final_path/sql/upgrade_column_info_4_3_0+.sql diff --git a/conf/upstream_version b/sources/upstream_version similarity index 100% rename from conf/upstream_version rename to sources/upstream_version