From 95d5246227966229f8f9c6300f1d2db1e31b2df6 Mon Sep 17 00:00:00 2001 From: armab Date: Mon, 14 Dec 2020 19:07:22 +0000 Subject: [PATCH 1/3] Installing 3rd party python3.6 via PPA based on user's agreement --- scripts/st2bootstrap-deb.sh | 28 ++++++++++++++++++++++++++++ scripts/st2bootstrap-deb.template.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index 04c96af4..b4a75b16 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -112,6 +112,34 @@ setup_args() { exit 1 fi fi + + # Python 3.6 package is not available in Ubuntu Xenial + # Installer can add it via 3rd party PPA based on user agreement + if [[ "$SUBTYPE" = 'xenial' ]]; then + sudo apt-get update > /dev/null 2>/dev/null + # check if python3.6 is available + if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then + echo "" + echo "WARNING!" + echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it." + echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." + echo "" + echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." + echo "By continue you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "" + read -p "Press [y] to continue or [n] to cancel adding it: " choice + case "$choice" in + y|Y ) + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 + echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list + ;; + * ) + echo "python3.6 PPA installation aborted" + exit 1 + ;; + esac + fi + fi } diff --git a/scripts/st2bootstrap-deb.template.sh b/scripts/st2bootstrap-deb.template.sh index 038b74af..0633a96d 100644 --- a/scripts/st2bootstrap-deb.template.sh +++ b/scripts/st2bootstrap-deb.template.sh @@ -104,6 +104,34 @@ setup_args() { exit 1 fi fi + + # Python 3.6 package is not available in Ubuntu Xenial + # Installer can add it via 3rd party PPA based on user agreement + if [[ "$SUBTYPE" = 'xenial' ]]; then + sudo apt-get update > /dev/null 2>/dev/null + # check if python3.6 is available + if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then + echo "" + echo "WARNING!" + echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it." + echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." + echo "" + echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." + echo "By continue you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "" + read -p "Press [y] to continue or [n] to cancel adding it: " choice + case "$choice" in + y|Y ) + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 + echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list + ;; + * ) + echo "python3.6 PPA installation aborted" + exit 1 + ;; + esac + fi + fi } From d5a143ef206413e1c960ce6a53db9b72341554a6 Mon Sep 17 00:00:00 2001 From: armab Date: Mon, 14 Dec 2020 19:49:01 +0000 Subject: [PATCH 2/3] Fix insecure py3.6 PPA wording --- scripts/st2bootstrap-deb.sh | 2 +- scripts/st2bootstrap-deb.template.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index b4a75b16..57079ab0 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -125,7 +125,7 @@ setup_args() { echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." echo "" echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." - echo "By continue you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository." echo "" read -p "Press [y] to continue or [n] to cancel adding it: " choice case "$choice" in diff --git a/scripts/st2bootstrap-deb.template.sh b/scripts/st2bootstrap-deb.template.sh index 0633a96d..12ef22af 100644 --- a/scripts/st2bootstrap-deb.template.sh +++ b/scripts/st2bootstrap-deb.template.sh @@ -117,7 +117,7 @@ setup_args() { echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." echo "" echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." - echo "By continue you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository." echo "" read -p "Press [y] to continue or [n] to cancel adding it: " choice case "$choice" in From aaeea508253b5c41314f932635928988ecb25d86 Mon Sep 17 00:00:00 2001 From: armab Date: Mon, 14 Dec 2020 20:34:16 +0000 Subject: [PATCH 3/3] Improve U16 py3 PPA warning message --- scripts/st2bootstrap-deb.sh | 8 ++++---- scripts/st2bootstrap-deb.template.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index 57079ab0..c667bed8 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -121,11 +121,11 @@ setup_args() { if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then echo "" echo "WARNING!" - echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it." - echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." + echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories." + echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions." echo "" - echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." - echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." + echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04." echo "" read -p "Press [y] to continue or [n] to cancel adding it: " choice case "$choice" in diff --git a/scripts/st2bootstrap-deb.template.sh b/scripts/st2bootstrap-deb.template.sh index 12ef22af..d592d542 100644 --- a/scripts/st2bootstrap-deb.template.sh +++ b/scripts/st2bootstrap-deb.template.sh @@ -113,11 +113,11 @@ setup_args() { if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then echo "" echo "WARNING!" - echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it." - echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS." + echo "The python3.6 package is a required dependency for the StackStorm st2 package but that is not installable from any of the default Ubuntu 16.04 repositories." + echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS. Support for Ubuntu 16.04 will be removed with future StackStorm versions." echo "" - echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." - echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository." + echo "Alternatively we'll try to add python3.6 from the 3rd party 'deadsnakes' repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa." + echo "By continuing you are aware of the support and security risks associated with using unofficial 3rd party PPA repository, and you understand that StackStorm does NOT provide ANY support for python3.6 packages on Ubuntu 16.04." echo "" read -p "Press [y] to continue or [n] to cancel adding it: " choice case "$choice" in